当前位置: 首页>>代码示例>>Java>>正文


Java Cluster类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:24,代码来源:TomcatWebAppBuilder.java

示例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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:ClusterManagerBase.java

示例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();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:ReplicationValve.java

示例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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:ContainerBase.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:ContainerBase.java

示例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();
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:20,代码来源:DistributedManager.java

示例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);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:ClusterManagerBase.java

示例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();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:ReplicationValve.java

示例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);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:16,代码来源:ContainerBase.java

示例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);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:43,代码来源:BackupManager.java

示例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;
}
 
开发者ID:pidster-dot-org,项目名称:embed-apache-tomcat,代码行数:9,代码来源:AbstractContainerBuilder.java

示例12: getCluster

import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public Cluster getCluster() { return null; }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:3,代码来源:FailedContext.java

示例13: setCluster

import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public void setCluster(Cluster cluster) { /* NO-OP */ }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:3,代码来源:FailedContext.java

示例14: getCluster

import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public Cluster getCluster() {
    return null;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:TesterContext.java

示例15: setCluster

import org.apache.catalina.Cluster; //导入依赖的package包/类
@Override
public void setCluster(Cluster cluster) {
    // NO-OP
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:TesterContext.java


注:本文中的org.apache.catalina.Cluster类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。