예제 #1
0
 protected void checkDefaults() {
   if (clusterListeners.size() == 0) {
     addClusterListener(new ClusterSessionListener());
   }
   if (valves.size() == 0) {
     addValve(new JvmRouteBinderValve());
     addValve(new ReplicationValve());
   }
   if (clusterDeployer != null) clusterDeployer.setCluster(this);
   if (channel == null) channel = new GroupChannel();
   if (channel instanceof GroupChannel && !((GroupChannel) channel).getInterceptors().hasNext()) {
     channel.addInterceptor(new MessageDispatch15Interceptor());
     channel.addInterceptor(new TcpFailureDetector());
   }
 }
예제 #2
0
  /**
   * Stop Cluster and implement the requirements of {@link
   * org.apache.catalina.util.LifecycleBase#stopInternal()}.
   *
   * @exception LifecycleException if this component detects a fatal error that prevents this
   *     component from being used
   */
  @Override
  protected void stopInternal() throws LifecycleException {

    setState(LifecycleState.STOPPING);

    unregisterMember(channel.getLocalMember(false));
    if (clusterDeployer != null) clusterDeployer.stop();
    this.managers.clear();
    try {
      if (clusterDeployer != null) clusterDeployer.setCluster(null);
      channel.stop(channelStartOptions);
      channel.removeChannelListener(this);
      channel.removeMembershipListener(this);
      this.unregisterClusterValve();
    } catch (Exception x) {
      log.error(sm.getString("simpleTcpCluster.stopUnable"), x);
    }
  }