本文整理汇总了Java中org.apache.catalina.Cluster类的典型用法代码示例。如果您正苦于以下问题:Java Cluster类的具体用法?Java Cluster怎么用?Java Cluster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Cluster类属于org.apache.catalina包,在下文中一共展示了Cluster类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: manageCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
private void manageCluster(final Cluster cluster) {
if (cluster == null || cluster instanceof SimpleTomEETcpCluster) {
return;
}
Cluster current = cluster;
if (cluster instanceof SimpleTcpCluster) {
final Container container = cluster.getContainer();
current = new SimpleTomEETcpCluster((SimpleTcpCluster) cluster);
container.setCluster(current);
}
if (current instanceof CatalinaCluster) {
final CatalinaCluster haCluster = (CatalinaCluster) current;
TomEEClusterListener listener = SystemInstance.get().getComponent(TomEEClusterListener.class);
if (listener == null) {
listener = new TomEEClusterListener();
SystemInstance.get().setComponent(TomEEClusterListener.class, listener);
}
haCluster.addClusterListener(listener); // better to be a singleton
clusters.add(haCluster);
}
}
示例2: startInternal
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
if (getCluster() == null) {
Cluster cluster = getContainer().getCluster();
if (cluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster)cluster);
}
}
if (cluster != null) cluster.registerManager(this);
}
示例3: startInternal
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* 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 {
if (cluster == null) {
Cluster containerCluster = getContainer().getCluster();
if (containerCluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster)containerCluster);
} else {
if (log.isWarnEnabled()) {
log.warn(sm.getString("ReplicationValve.nocluster"));
}
}
}
super.startInternal();
}
示例4: getCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* Return the Cluster with which this Container is associated. If there is
* no associated Cluster, return the Cluster associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
@Override
public Cluster getCluster() {
if (cluster != null)
return (cluster);
if (parent != null)
return (parent.getCluster());
return (null);
}
示例5: getCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* Return the Cluster with which this Container is associated. If there is
* no associated Cluster, return the Cluster associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
public Cluster getCluster() {
if (cluster != null)
return (cluster);
if (parent != null)
return (parent.getCluster());
return (null);
}
示例6: start
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* Start this manager
*
* @exception LifecycleException if an error occurs
*/
public void start() throws LifecycleException {
Container container = getContainer();
Cluster cluster = null;
if(container != null)
cluster = container.getCluster();
if(cluster != null) {
this.clusterSender = cluster.getClusterSender(getName());
this.clusterReceiver = cluster.getClusterReceiver(getName());
}
super.start();
}
示例7: startInternal
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
protected void startInternal() throws LifecycleException {
super.startInternal();
if (getCluster() == null) {
Cluster cluster = getContainer().getCluster();
if (cluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster) cluster);
}
}
if (cluster != null)
cluster.registerManager(this);
}
示例8: startInternal
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* 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 {
if (cluster == null) {
Cluster containerCluster = getContainer().getCluster();
if (containerCluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster) containerCluster);
} else {
if (log.isWarnEnabled()) {
log.warn(sm.getString("ReplicationValve.nocluster"));
}
}
}
super.startInternal();
}
示例9: getCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* Return the Cluster with which this Container is associated. If there is
* no associated Cluster, return the Cluster associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
@Override
public Cluster getCluster() {
if (cluster != null)
return (cluster);
if (parent != null)
return (parent.getCluster());
return (null);
}
示例10: startInternal
import org.apache.catalina.Cluster; //导入依赖的package包/类
/**
* Start this component and implement the requirements
* of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* Starts the cluster communication channel, this will connect with the
* other nodes in the cluster, and request the current session state to be
* transferred to this node.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
*/
@SuppressWarnings("unchecked")
@Override
protected synchronized void startInternal() throws LifecycleException {
super.startInternal();
try {
if (getCluster() == null) {
Cluster cluster = getContainer().getCluster();
if (cluster instanceof CatalinaCluster) {
setCluster((CatalinaCluster)cluster);
} else {
throw new LifecycleException(
sm.getString("backupManager.noCluster", getName()));
}
}
cluster.registerManager(this);
LazyReplicatedMap map = new LazyReplicatedMap(this,
cluster.getChannel(),
rpcTimeout,
getMapName(),
getClassLoaders(),
terminateOnStartFailure);
map.setChannelSendOptions(mapSendOptions);
this.sessions = map;
} catch ( Exception x ) {
log.error(sm.getString("backupManager.startUnable", getName()),x);
throw new LifecycleException(sm.getString("backupManager.startFailed", getName()),x);
}
setState(LifecycleState.STARTING);
}
示例11: setCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public final T setCluster(Cluster cluster) {
LOGGER.log(Level.FINE, "setCluster({0})", cluster.getClass().getName());
cluster.setContainer(getContainer());
container.setCluster(cluster);
return (T) this;
}
示例12: getCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public Cluster getCluster() { return null; }
示例13: setCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public void setCluster(Cluster cluster) { /* NO-OP */ }
示例14: getCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public Cluster getCluster() {
return null;
}
示例15: setCluster
import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public void setCluster(Cluster cluster) {
// NO-OP
}