- Collection<ServiceReference<CmsSession>> srs;
- try {
- srs = bc.getServiceReferences(CmsSession.class, "(" + CmsSession.SESSION_UUID + "=" + nodeSessionId + ")");
- } catch (InvalidSyntaxException e) {
- throw new CmsException("Cannot retrieve CMS session #" + nodeSessionId, e);
- }
-
- if (srs.size() == 0) {
- // if (log.isTraceEnabled())
- // log.warn("No CMS web session found for http session " +
- // nodeSessionId);
- return false;
- } else if (srs.size() > 1)
- throw new CmsException(srs.size() + " CMS web sessions found for http session " + nodeSessionId);
-
- WebCmsSessionImpl cmsSession = (WebCmsSessionImpl) bc.getService(srs.iterator().next());
- cmsSession.cleanUp();
-// subject.getPrivateCredentials().removeAll(subject.getPrivateCredentials(CmsSessionId.class));
- if (log.isDebugEnabled())
- log.debug("Logged out CMS session " + cmsSession.getUuid());
+ CmsSessionImpl cmsSession = CmsContextImpl.getCmsContext().getCmsSessionByUuid(nodeSessionId);
+
+ // FIXME logout all views
+ // TODO check why it is sometimes null
+ if (cmsSession != null)
+ cmsSession.close();
+ // if (log.isDebugEnabled())
+ // log.debug("Logged out CMS session " + cmsSession.getUuid());