private void doImminentSessionTimeout(Context activeContext) { ManagerBase manager = (ManagerBase) activeContext.getManager(); Session[] sessions = manager.findSessions(); for (int i = 0; i < sessions.length; i++) { if (sessions[i]!=null && sessions[i].isValid()) { sessions[i].setMaxInactiveInterval(EXTRA_DELAY_SECS); // leave it to be expired by the manager } } try { Thread.sleep(REASONABLE_MSECS_TO_EXPIRY); } catch (InterruptedException ie) { // ignored } // paranoid verification that active sessions have now gone sessions = manager.findSessions(); assertTrue(sessions.length == 0); }
public ClassLoader[] getClassLoaders() { if ( manager instanceof BackupManager ) return ((BackupManager)manager).getClassLoaders(); else if ( manager instanceof ClusterManagerBase ) return ((ClusterManagerBase)manager).getClassLoaders(); else if ( manager instanceof StandardManager ) { StandardManager sm = (StandardManager)manager; return ClusterManagerBase.getClassLoaders(sm.getContainer()); } else if ( manager instanceof ManagerBase ) { ManagerBase mb = (ManagerBase)manager; return ClusterManagerBase.getClassLoaders(mb.getContainer()); }//end if return null; }
/** * get jvmroute from engine * * @param request current request * @return return jvmRoute from ManagerBase or null */ protected String getLocalJvmRoute(Request request) { Manager manager = getManager(request); if(manager instanceof ManagerBase) return ((ManagerBase) manager).getJvmRoute(); return null ; }
private void setRapidSessionTimeoutDetection() { ((ManagerBase) basicContext.getManager()) .setProcessExpiresFrequency(MANAGER_EXPIRE_SESSIONS_FAST); ((ManagerBase) nonloginContext.getManager()) .setProcessExpiresFrequency(MANAGER_EXPIRE_SESSIONS_FAST); }
public ClassLoader[] getClassLoaders() { if (manager instanceof BackupManager) return ((BackupManager) manager).getClassLoaders(); else if (manager instanceof ClusterManagerBase) return ((ClusterManagerBase) manager).getClassLoaders(); else if (manager instanceof StandardManager) { StandardManager sm = (StandardManager) manager; return ClusterManagerBase.getClassLoaders(sm.getContainer()); } else if (manager instanceof ManagerBase) { ManagerBase mb = (ManagerBase) manager; return ClusterManagerBase.getClassLoaders(mb.getContainer()); } // end if return null; }
/** * Reset manager statistics */ public synchronized void resetStatistics() { processingTime = 0; expiredSessions.set(0); synchronized (sessionCreationTiming) { sessionCreationTiming.clear(); while (sessionCreationTiming.size() < ManagerBase.TIMING_STATS_CACHE_SIZE) { sessionCreationTiming.add(null); } } synchronized (sessionExpirationTiming) { sessionExpirationTiming.clear(); while (sessionExpirationTiming.size() < ManagerBase.TIMING_STATS_CACHE_SIZE) { sessionExpirationTiming.add(null); } } rejectedSessions = 0; sessionReplaceCounter = 0; counterNoStateTransfered = 0; setMaxActive(getActiveSessions()); sessionCounter = getActiveSessions(); counterReceive_EVT_ALL_SESSION_DATA = 0; counterReceive_EVT_GET_ALL_SESSIONS = 0; counterReceive_EVT_SESSION_ACCESSED = 0; counterReceive_EVT_SESSION_CREATED = 0; counterReceive_EVT_SESSION_DELTA = 0; counterReceive_EVT_SESSION_EXPIRED = 0; counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE = 0; counterReceive_EVT_CHANGE_SESSION_ID = 0; counterSend_EVT_ALL_SESSION_DATA = 0; counterSend_EVT_GET_ALL_SESSIONS = 0; counterSend_EVT_SESSION_ACCESSED = 0; counterSend_EVT_SESSION_CREATED = 0; counterSend_EVT_SESSION_DELTA = 0; counterSend_EVT_SESSION_EXPIRED = 0; counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE = 0; counterSend_EVT_CHANGE_SESSION_ID = 0; }
@Override public void lifecycleEvent(LifecycleEvent event) { if (event.getType().equals(Lifecycle.START_EVENT)) { Context context = (Context) event.getLifecycle(); Manager manager = context.getManager(); if (manager instanceof ManagerBase) { ((ManagerBase) manager) .setSessionIdGenerator(new LazySessionIdGenerator()); } } }
/** * Reset manager statistics */ public synchronized void resetStatistics() { processingTime = 0 ; expiredSessions.set(0); synchronized (sessionCreationTiming) { sessionCreationTiming.clear(); while (sessionCreationTiming.size() < ManagerBase.TIMING_STATS_CACHE_SIZE) { sessionCreationTiming.add(null); } } synchronized (sessionExpirationTiming) { sessionExpirationTiming.clear(); while (sessionExpirationTiming.size() < ManagerBase.TIMING_STATS_CACHE_SIZE) { sessionExpirationTiming.add(null); } } rejectedSessions = 0 ; sessionReplaceCounter = 0 ; counterNoStateTransfered = 0 ; setMaxActive(getActiveSessions()); sessionCounter = getActiveSessions() ; counterReceive_EVT_ALL_SESSION_DATA = 0; counterReceive_EVT_GET_ALL_SESSIONS = 0; counterReceive_EVT_SESSION_ACCESSED = 0 ; counterReceive_EVT_SESSION_CREATED = 0 ; counterReceive_EVT_SESSION_DELTA = 0 ; counterReceive_EVT_SESSION_EXPIRED = 0 ; counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE = 0; counterReceive_EVT_CHANGE_SESSION_ID = 0; counterSend_EVT_ALL_SESSION_DATA = 0; counterSend_EVT_GET_ALL_SESSIONS = 0; counterSend_EVT_SESSION_ACCESSED = 0 ; counterSend_EVT_SESSION_CREATED = 0 ; counterSend_EVT_SESSION_DELTA = 0 ; counterSend_EVT_SESSION_EXPIRED = 0 ; counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE = 0; counterSend_EVT_CHANGE_SESSION_ID = 0; }
private void setRapidSessionTimeout() { ((ManagerBase) basicContext.getManager()) .setProcessExpiresFrequency(MANAGER_EXPIRE_SESSIONS_FAST); }
/** * get jvmroute from engine * * @param request * current request * @return return jvmRoute from ManagerBase or null */ protected String getLocalJvmRoute(Request request) { Manager manager = getManager(request); if (manager instanceof ManagerBase) return ((ManagerBase) manager).getJvmRoute(); return null; }