+
+ public static void closeInvalidSessions() {
+ Collection<ServiceReference<CmsSession>> srs;
+ try {
+ srs = bc.getServiceReferences(CmsSession.class, null);
+ for (ServiceReference<CmsSession> sr : srs) {
+ CmsSession cmsSession = bc.getService(sr);
+ if (!cmsSession.isValid()) {
+ ((CmsSessionImpl) cmsSession).close();
+ if (log.isDebugEnabled())
+ log.debug("Closed expired CMS session " + cmsSession);
+ }
+ }
+ } catch (InvalidSyntaxException e) {
+ throw new IllegalArgumentException("Cannot get CMS sessions", e);
+ }
+ }