• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SimpleTcpCluster类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.catalina.ha.tcp.SimpleTcpCluster的典型用法代码示例。如果您正苦于以下问题:Java SimpleTcpCluster类的具体用法?Java SimpleTcpCluster怎么用?Java SimpleTcpCluster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SimpleTcpCluster类属于org.apache.catalina.ha.tcp包,在下文中一共展示了SimpleTcpCluster类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doTestInvalidate

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
private void doTestInvalidate(boolean useClustering) throws Exception {
    // Setup Tomcat instance
    Tomcat tomcat = getTomcatInstance();

    // No file system docBase required
    Context ctx = tomcat.addContext("", null);

    Tomcat.addServlet(ctx, "bug56578", new Bug56578Servlet());
    ctx.addServletMapping("/bug56578", "bug56578");

    if (useClustering) {
        tomcat.getEngine().setCluster(new SimpleTcpCluster());
        ctx.setDistributable(true);
        ctx.setManager(ctx.getCluster().createManager(""));
    }
    tomcat.start();

    ByteChunk res = getUrl("http://localhost:" + getPort() + "/bug56578");
    Assert.assertEquals("PASS", res.toString());
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:TestStandardSessionIntegration.java


示例2: doTestInvalidate

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
private void doTestInvalidate(boolean useClustering) throws Exception {
    // Setup Tomcat instance
    Tomcat tomcat = getTomcatInstance();

    // Must have a real docBase - just use temp
    Context ctx = tomcat.addContext("", System.getProperty("java.io.tmpdir"));

    Tomcat.addServlet(ctx, "bug56578", new Bug56578Servlet());
    ctx.addServletMapping("/bug56578", "bug56578");

    if (useClustering) {
        tomcat.getEngine().setCluster(new SimpleTcpCluster());
        ctx.setDistributable(true);
        ctx.setManager(ctx.getCluster().createManager(""));
    }
    tomcat.start();

    ByteChunk res = getUrl("http://localhost:" + getPort() + "/bug56578");
    Assert.assertEquals("PASS", res.toString());
}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:21,代码来源:TestStandardSession.java


示例3: SimpleTomEETcpCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
public SimpleTomEETcpCluster(final SimpleTcpCluster from) {
    clusterListeners.addAll(Arrays.asList(from.findClusterListeners()));

    setClusterName(from.getClusterName());
    setContainer(from.getContainer());
    setNotifyLifecycleListenerOnFailure(from.isNotifyLifecycleListenerOnFailure());

    setChannelSendOptions(from.getChannelSendOptions());
    setChannelStartOptions(from.getChannelStartOptions());
    setHeartbeatBackgroundEnabled(from.isHeartbeatBackgroundEnabled());
    setChannel(from.getChannel());
    getManagers().putAll(from.getManagers());
    setManagerTemplate(from.getManagerTemplate());
    setClusterDeployer(from.getClusterDeployer());

    for (final Valve valve : from.getValves()) {
        addValve(valve);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:20,代码来源:SimpleTomEETcpCluster.java


示例4: manageCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的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


示例5: registerDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
public static boolean registerDefaultCluster(SimpleTcpCluster cluster)  {
    try {
        initDefaultCluster();
        ObjectName clusterName = getDefaultClusterName(cluster);
        if (!getMBeanServer().isRegistered(clusterName)) {
            getMBeanServer().registerMBean(getManagedBean(cluster), clusterName);
        }
        return true;
    }catch ( Exception x ) {
        log.warn("Unable to register default cluster implementation with JMX",x);
        return false;
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:14,代码来源:ClusterJmxHelper.java


示例6: unregisterDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
public static boolean unregisterDefaultCluster(SimpleTcpCluster cluster) {
    try {
        ObjectName clusterName = getDefaultClusterName(cluster);
        if (getMBeanServer().isRegistered(clusterName)) {
            getMBeanServer().unregisterMBean(clusterName);
        }
        return true;
    }catch ( Exception x ) {
        log.warn("Unable to unregister default cluster implementation with JMX",x);
        return false;
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ClusterJmxHelper.java


示例7: getDefaultClusterName

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
private static ObjectName getDefaultClusterName(SimpleTcpCluster cluster) throws Exception {
    String domain = getMBeanServer().getDefaultDomain();
    String type = ":type=";
    String clusterType= type+"Cluster";
    if (cluster.getContainer() instanceof StandardHost) {
        domain = ((StandardHost) cluster.getContainer()).getDomain();
        clusterType += ",host=" + cluster.getContainer().getName();
    } else {
        if (cluster.getContainer() instanceof StandardEngine) {
            domain = ((StandardEngine) cluster.getContainer()).getDomain();
        }
    }
    ObjectName clusterName = new ObjectName(domain + clusterType);
    return clusterName;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:16,代码来源:ClusterJmxHelper.java


示例8: registerDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
public static boolean registerDefaultCluster(SimpleTcpCluster cluster) {
	try {
		initDefaultCluster();
		ObjectName clusterName = getDefaultClusterName(cluster);
		if (!getMBeanServer().isRegistered(clusterName)) {
			getMBeanServer().registerMBean(getManagedBean(cluster), clusterName);
		}
		return true;
	} catch (Exception x) {
		log.warn("Unable to register default cluster implementation with JMX", x);
		return false;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:14,代码来源:ClusterJmxHelper.java


示例9: unregisterDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
public static boolean unregisterDefaultCluster(SimpleTcpCluster cluster) {
	try {
		ObjectName clusterName = getDefaultClusterName(cluster);
		if (getMBeanServer().isRegistered(clusterName)) {
			getMBeanServer().unregisterMBean(clusterName);
		}
		return true;
	} catch (Exception x) {
		log.warn("Unable to unregister default cluster implementation with JMX", x);
		return false;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:13,代码来源:ClusterJmxHelper.java


示例10: getDefaultClusterName

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
private static ObjectName getDefaultClusterName(SimpleTcpCluster cluster) throws Exception {
	String domain = getMBeanServer().getDefaultDomain();
	String type = ":type=";
	String clusterType = type + "Cluster";
	if (cluster.getContainer() instanceof StandardHost) {
		domain = ((StandardHost) cluster.getContainer()).getDomain();
		clusterType += ",host=" + cluster.getContainer().getName();
	} else {
		if (cluster.getContainer() instanceof StandardEngine) {
			domain = ((StandardEngine) cluster.getContainer()).getDomain();
		}
	}
	ObjectName clusterName = new ObjectName(domain + clusterType);
	return clusterName;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:16,代码来源:ClusterJmxHelper.java


示例11: initDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:ClusterJmxHelper.java


示例12: initDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
protected static void initDefaultCluster() {
	initMetaData(SimpleTcpCluster.class);
	initMetaData(FarmWarDeployer.class); // not functional yet
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:5,代码来源:ClusterJmxHelper.java


示例13: initDefaultCluster

import org.apache.catalina.ha.tcp.SimpleTcpCluster; //导入依赖的package包/类
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(DeltaManager.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
    initMetaData(ClusterSingleSignOn.class); //not functional yet
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:7,代码来源:ClusterJmxHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RankedFeatureVector类代码示例发布时间:2022-05-22
下一篇:
Java MRProtoUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap