X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fserver%2Fmvc%2Fjcr%2FOpenSessionInViewJcrInterceptor.java;fp=server%2Fruntime%2Forg.argeo.server.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fserver%2Fmvc%2Fjcr%2FOpenSessionInViewJcrInterceptor.java;h=0000000000000000000000000000000000000000;hb=ecfe5aad6ecb3e05eeee1f700950c352fc4bfcd1;hp=77d2663d00e85d32b1eb25012534703457387a50;hpb=b8a1cd70a7d61b91f66e3f65736c57679dd9de46;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.core/src/main/java/org/argeo/server/mvc/jcr/OpenSessionInViewJcrInterceptor.java b/server/runtime/org.argeo.server.core/src/main/java/org/argeo/server/mvc/jcr/OpenSessionInViewJcrInterceptor.java deleted file mode 100644 index 77d2663d0..000000000 --- a/server/runtime/org.argeo.server.core/src/main/java/org/argeo/server/mvc/jcr/OpenSessionInViewJcrInterceptor.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2007-2012 Mathieu Baudier - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.server.mvc.jcr; - -import javax.jcr.Session; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.ui.ModelMap; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.WebRequest; -import org.springframework.web.context.request.WebRequestInterceptor; - -/** @deprecated */ -public class OpenSessionInViewJcrInterceptor implements WebRequestInterceptor, - JcrMvcConstants { - private final static Log log = LogFactory - .getLog(OpenSessionInViewJcrInterceptor.class); - - private Session session; - - public void preHandle(WebRequest request) throws Exception { - if (log.isTraceEnabled()) - log.trace("preHandle: " + request); - // Authentication auth = SecurityContextHolder.getContext() - // .getAuthentication(); - // if (auth != null) - // log.debug("auth=" + auth + ", authenticated=" - // + auth.isAuthenticated() + ", name=" + auth.getName()); - // else - // log.debug("No auth"); - - // FIXME: find a safer way to initialize - // FIXME: not really needed to initialize here - // session.getRepository(); - request.setAttribute(REQUEST_ATTR_SESSION, session, - RequestAttributes.SCOPE_REQUEST); - } - - public void postHandle(WebRequest request, ModelMap model) throws Exception { - // if (log.isDebugEnabled()) - // log.debug("postHandle: " + request); - } - - public void afterCompletion(WebRequest request, Exception ex) - throws Exception { - if (log.isTraceEnabled()) - log.trace("afterCompletion: " + request); - // FIXME: only close session that were open - session.logout(); - } - - public void setSession(Session session) { - this.session = session; - } - -}