return app.getRepository();
}
@Override
public synchronized SessionProvider getSessionProvider() {
final SessionProvider original = super.getSessionProvider();
return new SessionProvider() {
public Session getSession(HttpServletRequest request, Repository rep, String workspace)
throws LoginException, ServletException, RepositoryException {
final String key = Brix.NS_PREFIX + "jcr-session";
BrixSession s = (BrixSession) request.getAttribute(key);
if (s == null) {
s = EventUtil.wrapSession(original.getSession(request, rep, workspace));
for (Plugin p : getBrix().getPlugins()) {
if (p instanceof SessionAwarePlugin) {
((SessionAwarePlugin) p).onWebDavSession(s);
}
}
request.setAttribute(key, s);
}
return s;
}
public void releaseSession(Session session) {
original.releaseSession(EventUtil.unwrapSession(session));
}
};
}