public ClassLoader[] getClassLoaders() { return getClassLoaders(container); }
protected void clone(ClusterManagerBase copy) { copy.setName("Clone-from-" + getName()); copy.setCluster(getCluster()); copy.setMaxActiveSessions(getMaxActiveSessions()); copy.setMaxInactiveInterval(getMaxInactiveInterval()); copy.setSessionIdLength(getSessionIdLength()); copy.setProcessExpiresFrequency(getProcessExpiresFrequency()); copy.setNotifyListenersOnReplication(isNotifyListenersOnReplication()); copy.setSessionAttributeFilter(getSessionAttributeFilter()); copy.setSecureRandomClass(getSecureRandomClass()); copy.setSecureRandomProvider(getSecureRandomProvider()); copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm()); }
/** * Open Stream and use correct ClassLoader (Container) Switch * ThreadClassLoader * * @param data * @return The object input stream * @throws IOException */ @Override public ReplicationStream getReplicationStream(byte[] data) throws IOException { return getReplicationStream(data,0,data.length); }
public ClassLoader[] getClassLoaders() { return getClassLoaders(getContext()); }
protected void clone(ClusterManagerBase copy) { copy.setName("Clone-from-" + getName()); copy.setMaxActiveSessions(getMaxActiveSessions()); copy.setProcessExpiresFrequency(getProcessExpiresFrequency()); copy.setNotifyListenersOnReplication(isNotifyListenersOnReplication()); copy.setSessionAttributeNameFilter(getSessionAttributeNameFilter()); copy.setSessionAttributeValueClassNameFilter(getSessionAttributeValueClassNameFilter()); copy.setWarnOnSessionAttributeFilterFailure(getWarnOnSessionAttributeFilterFailure()); copy.setSecureRandomClass(getSecureRandomClass()); copy.setSecureRandomProvider(getSecureRandomProvider()); copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm()); if (getSessionIdGenerator() != null) { try { SessionIdGenerator copyIdGenerator = sessionIdGeneratorClass.getConstructor().newInstance(); copyIdGenerator.setSessionIdLength(getSessionIdGenerator().getSessionIdLength()); copyIdGenerator.setJvmRoute(getSessionIdGenerator().getJvmRoute()); copy.setSessionIdGenerator(copyIdGenerator); } catch (ReflectiveOperationException e) { // Ignore } } copy.setRecordAllActions(isRecordAllActions()); }
@Override protected void startInternal() throws LifecycleException { super.startInternal(); if (getCluster() == null) { Cluster cluster = getContext().getCluster(); if (cluster instanceof CatalinaCluster) { setCluster((CatalinaCluster)cluster); } } if (cluster != null) cluster.registerManager(this); }
protected void changeSessionId(Session session, String newId, boolean notify) { String orgSessionID = session.getId(); super.changeSessionId(session, newId); if (notify) sendChangeSessionId(session.getId(), orgSessionID); }
/** * create new session with check maxActiveSessions and send session creation * to other cluster nodes. * * @param distribute * @return The session */ public Session createSession(String sessionId, boolean distribute) { DeltaSession session = (DeltaSession) super.createSession(sessionId) ; if (distribute) { sendCreateSession(session.getId(), session); } if (log.isDebugEnabled()) log.debug(sm.getString("deltaManager.createSession.newSession", session.getId(), Integer.valueOf(sessions.size()))); return (session); }
/** * Register cross context session at replication valve thread local * @param session cross context session */ protected void registerSessionAtReplicationValve(DeltaSession session) { if(replicationValve == null) { CatalinaCluster cluster = getCluster() ; if(cluster != null) { Valve[] valves = cluster.getValves(); if(valves != null && valves.length > 0) { for(int i=0; replicationValve == null && i < valves.length ; i++ ){ if(valves[i] instanceof ReplicationValve) replicationValve = (ReplicationValve)valves[i] ; }//for if(replicationValve == null && log.isDebugEnabled()) { log.debug("no ReplicationValve found for CrossContext Support"); }//endif }//end if }//endif }//end if if(replicationValve != null) { replicationValve.registerReplicationSession(session); } }
public ClassLoader[] getClassLoaders() { return getClassLoaders(getContext()); }
protected void changeSessionId(Session session, boolean notify) { String orgSessionID = session.getId(); super.changeSessionId(session); if (notify) sendChangeSessionId(session.getId(), orgSessionID); }
/** * create new session with check maxActiveSessions and send session creation * to other cluster nodes. * * @param distribute * @return The session */ public Session createSession(String sessionId, boolean distribute) { DeltaSession session = (DeltaSession) super.createSession(sessionId) ; if (distribute) { sendCreateSession(session.getId(), session); } if (log.isDebugEnabled()) log.debug(sm.getString("deltaManager.createSession.newSession", session.getId(), Integer.valueOf(sessions.size()))); return (session); }
protected void clone(ClusterManagerBase copy) { copy.setName("Clone-from-" + getName()); copy.setCluster(getCluster()); copy.setMaxActiveSessions(getMaxActiveSessions()); copy.setMaxInactiveInterval(getMaxInactiveInterval()); copy.setSessionIdLength(getSessionIdLength()); copy.setProcessExpiresFrequency(getProcessExpiresFrequency()); copy.setNotifyListenersOnReplication(isNotifyListenersOnReplication()); copy.setSessionAttributeFilter(getSessionAttributeFilter()); copy.setSecureRandomClass(getSecureRandomClass()); copy.setSecureRandomProvider(getSecureRandomProvider()); copy.setSecureRandomAlgorithm(getSecureRandomAlgorithm()); }
public ClassLoader[] getClassLoaders() { if (manager instanceof ClusterManagerBase) { return ((ClusterManagerBase)manager).getClassLoaders(); } else if (manager instanceof ManagerBase) { ManagerBase mb = (ManagerBase)manager; return ClusterManagerBase.getClassLoaders(mb.getContext()); } return null; }
protected void changeSessionId(Session session, String newId, boolean notify) { String orgSessionID = session.getId(); super.changeSessionId(session, newId); if (notify) sendChangeSessionId(session.getId(), orgSessionID); }
/** * Open Stream and use correct ClassLoader (Container) Switch * ThreadClassLoader * * @param data * @return The object input stream * @throws IOException */ @Override public ReplicationStream getReplicationStream(byte[] data) throws IOException { return getReplicationStream(data,0,data.length); }
/** * Create new session with check maxActiveSessions and send session creation * to other cluster nodes. * * @param sessionId The session id that should be used for the session * @param distribute <code>true</code> to replicate the new session * @return The session */ public Session createSession(String sessionId, boolean distribute) { DeltaSession session = (DeltaSession) super.createSession(sessionId) ; if (distribute) { sendCreateSession(session.getId(), session); } if (log.isDebugEnabled()) log.debug(sm.getString("deltaManager.createSession.newSession", session.getId(), Integer.valueOf(sessions.size()))); return session; }
@Override public ReplicationStream getReplicationStream(byte[] data, int offset, int length) throws IOException { ByteArrayInputStream fis = new ByteArrayInputStream(data, offset, length); return new ReplicationStream(fis, getClassLoaders()); }
protected void changeSessionId(Session session, boolean notify) { String orgSessionID = session.getId(); super.changeSessionId(session); if (notify) sendChangeSessionId(session.getId(), orgSessionID); }
@Override public ReplicationStream getReplicationStream(byte[] data) throws IOException { return getReplicationStream(data,0,data.length); }