ClusterListenerGBean clusterListenerGBean = clusterListenerChain; while(clusterListenerGBean != null){ cluster.addClusterListener((ClusterListener)clusterListenerGBean.getInternalObject()); clusterListenerGBean = clusterListenerGBean.getNextValve(); ValveGBean valveGBean = tomcatValveChain; while(valveGBean != null){ cluster.addValve((Valve)valveGBean.getInternalObject()); valveGBean = valveGBean.getNextValve(); cluster.setClusterDeployer((ClusterDeployer)deployer.getInternalObject()); cluster.setChannel((Channel)channel.getInternalObject()); cluster.registerManager((ClusterManager)manager.getInternalObject());
/** * Notifies the cluster that a single sign on session * has been terminated due to a user logout, deregister * the specified single sign on identifier, and invalidate * any associated sessions on the local node. * * @param ssoId Single sign on identifier to deregister */ @Override protected void deregister(String ssoId) { if (cluster != null && cluster.getMembers().length > 0) { messageNumber++; SingleSignOnMessage msg = new SingleSignOnMessage(cluster.getLocalMember(), ssoId, null); msg.setAction(SingleSignOnMessage.LOGOUT_SESSION); cluster.send(msg); if (containerLog.isDebugEnabled()) { containerLog.debug("SingleSignOnMessage Send with action " + msg.getAction()); } } deregisterLocal(ssoId); }
Channel channel = cluster.getChannel(); if (channel != null) { storeElement(aWriter, indent, channel); ClusterDeployer deployer = cluster.getClusterDeployer(); if (deployer != null) { storeElement(aWriter, indent, deployer); Valve valves[] = cluster.getValves(); storeElementArray(aWriter, indent, valves);
/** * Send messages to other backup member (domain or all) * @param msg Session message */ protected void send(SessionMessage msg) { if(cluster != null) { cluster.send(msg); } }
if (started) return; Container hcontainer = getCluster().getContainer(); if(!(hcontainer instanceof Host)) { log.error(sm.getString("farmWarDeployer.hostOnly")); count = 0; getCluster().addClusterListener(this);
Map<String,ClusterManager> managers = cluster.getManagers() ; if (ctxname == null) { for (Map.Entry<String, ClusterManager> entry : SessionMessage.EVT_ALL_SESSION_NOCONTEXTMANAGER, null, "NO-CONTEXT-MANAGER","NO-CONTEXT-MANAGER-" + ctxname); cluster.send(replymsg, msg.getAddress());
if (cluster != null && cluster.getMembers().length > 0) { long beforeSendTime = System.currentTimeMillis(); Member mbr = findSessionMasterMember(); receiverQueue = true ; cluster.send(msg, mbr); if (log.isInfoEnabled()) log.info(sm.getString("deltaManager.waitForSessionState",getName(), mbr, Integer.valueOf(getStateTransferTimeout())));
protected void sendChangeSessionId(String newSessionID, String orgSessionID) { if (cluster.getMembers().length > 0) { try { // serialize sessionID byte[] data = serializeSessionId(newSessionID); // notify change sessionID SessionMessage msg = new SessionMessageImpl(getName(), SessionMessage.EVT_CHANGE_SESSION_ID, data, orgSessionID, orgSessionID + "-" + System.currentTimeMillis()); msg.setTimestamp(System.currentTimeMillis()); counterSend_EVT_CHANGE_SESSION_ID++; send(msg); } catch (IOException e) { log.error(sm.getString("deltaManager.unableSerializeSessionID", newSessionID), e); } } }
if(cluster.getManager(clusterManager.getName()) == null) { return ; if(cluster.hasMembers()) { sendReplicationMessage(request, totalstart, isCrossContext, clusterManager); } else {
/** * Add this Mover as Cluster Listener ( receiver) * * @throws LifecycleException */ public void start() throws LifecycleException { if (started) return; getCluster().addClusterListener(this); started = true; if (log.isInfoEnabled()) log.info(sm.getString("jvmRoute.clusterListener.started")); }
cluster.registerManager(this); LazyReplicatedMap<String,Session> map = new LazyReplicatedMap<>( this, cluster.getChannel(), rpcTimeout, getMapName(), getClassLoaders(), terminateOnStartFailure); map.setChannelSendOptions(mapSendOptions);
catalinaCluster.setChannel(getChannel().getChannel(cl)); catalinaCluster.addValve(valve); catalinaCluster.addClusterListener(clusterListener);
if (log.isInfoEnabled()) log.info(sm.getString("farmWarDeployer.removeStart", contextName)); Member localMember = getCluster().getLocalMember(); UndeployMessage msg = new UndeployMessage(localMember, System .currentTimeMillis(), "Undeploy:" + contextName + ":" if (log.isDebugEnabled()) log.debug(sm.getString("farmWarDeployer.removeTxMsg", contextName)); cluster.send(msg);
/** * Start this component and implement the requirements * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected synchronized void startInternal() throws LifecycleException { super.startInternal(); try { CatalinaCluster catclust = (CatalinaCluster)this.getCluster(); if ( catclust != null ) { ReplicatedMap<String,Object> map = new ReplicatedMap<>( this, catclust.getChannel(),DEFAULT_REPL_TIMEOUT, getName(),getClassLoaders()); map.setChannelSendOptions(mapSendOptions); ((ReplApplContext)this.context).setAttributeMap(map); } } catch ( Exception x ) { log.error(sm.getString("replicatedContext.startUnable", getName()),x); throw new LifecycleException(sm.getString("replicatedContext.startFailed", getName()),x); } }
public String getMapName() { String name = cluster.getManagerName(getName(),this)+"-"+"map"; if ( log.isDebugEnabled() ) log.debug("Backup manager, Setting map name to:"+name); return name; }
private File getAbsolutePath(String path) { File dir = new File(path); if (!dir.isAbsolute()) { dir = new File(getCluster().getContainer().getCatalinaBase(), dir.getPath()); } try { dir = dir.getCanonicalFile(); } catch (IOException e) {// ignore } return dir; } }
(manager instanceof ClusterManager && getCluster() != null && getCluster().getManager(((ClusterManager)manager).getName()) != null) || (manager instanceof PersistentManager))) {
@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); }
this, cluster.getChannel(), rpcTimeout, cluster.getClusterName() + "-SSO-cache", cls, terminateOnStartFailure); cache.setChannelSendOptions(mapSendOptions);
if (log.isInfoEnabled()) { String type = "unknown" ; if( cluster.getContainer() instanceof Host){ type = "Host" ; } else if( cluster.getContainer() instanceof Engine){ type = "Engine" ; getName(), type, cluster.getClusterName()));