Java 类org.apache.catalina.ha.tcp.SimpleTcpCluster 实例源码

项目:tomcat7    文件:TestStandardSessionIntegration.java   
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());
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestStandardSessionIntegration.java   
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());
}
项目:apache-tomcat-7.0.57    文件:TestStandardSession.java   
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());
}
项目:apache-tomcat-7.0.57    文件:TestStandardSession.java   
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());
}
项目:tomee    文件:SimpleTomEETcpCluster.java   
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);
    }
}
项目:tomee    文件:TomcatWebAppBuilder.java   
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);
    }
}
项目:tomcat7    文件:ClusterJmxHelper.java   
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;
    }
}
项目:tomcat7    文件:ClusterJmxHelper.java   
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;
    }
}
项目:tomcat7    文件:ClusterJmxHelper.java   
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;
}
项目:apache-tomcat-7.0.73-with-comment    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:ClusterJmxHelper.java   
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;
}
项目:lazycat    文件:ClusterJmxHelper.java   
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;
    }
}
项目:lazycat    文件:ClusterJmxHelper.java   
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;
    }
}
项目:lazycat    文件:ClusterJmxHelper.java   
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;
}
项目:class-guard    文件:ClusterJmxHelper.java   
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;
    }
}
项目:class-guard    文件:ClusterJmxHelper.java   
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;
    }
}
项目:class-guard    文件:ClusterJmxHelper.java   
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;
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
    }
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
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;
}
项目:WBSAirback    文件:ClusterJmxHelper.java   
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;
    }
}
项目:WBSAirback    文件:ClusterJmxHelper.java   
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;
    }
}
项目:WBSAirback    文件:ClusterJmxHelper.java   
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;
}
项目:tomcat7    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
项目:apache-tomcat-7.0.73-with-comment    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
项目:lazycat    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); // not functional yet
}
项目:class-guard    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
项目:apache-tomcat-7.0.57    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
}
项目:WBSAirback    文件:ClusterJmxHelper.java   
protected static void initDefaultCluster() {
    initMetaData(SimpleTcpCluster.class);
    initMetaData(DeltaManager.class);
    initMetaData(FarmWarDeployer.class); //not functional yet
    initMetaData(ClusterSingleSignOn.class); //not functional yet
}