Java 类org.apache.catalina.tribes.MembershipService 实例源码

项目:tomcat7    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:class-guard    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:WBSAirback    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:tomcat7    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual services to shutdown
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will shutdown all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0) return; //we have already stopped up all components
        if (svc == 0 ) return;//nothing to stop

        boolean valid = false;
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.stop();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }            
        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));
        setChannel(null);
    }catch ( Exception x ) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:tomcat7    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:tomcat7    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}
项目:tomcat7    文件:GroupChannel.java   
/**
 * Returns the membership service component
 * @return MembershipService
 */
@Override
public MembershipService getMembershipService() {
    return coordinator.getMembershipService();
}
项目:tomcat7    文件:GroupChannel.java   
/**
 * Sets the membership component
 * @param membershipService MembershipService
 */
@Override
public void setMembershipService(MembershipService membershipService) {
    coordinator.setMembershipService(membershipService);
}
项目:tomcat7    文件:McastService.java   
/**
 * Start broadcasting and listening to membership pings
 * @throws java.lang.Exception if a IO error occurs
 */
@Override
public void start() throws java.lang.Exception {
    start(MembershipService.MBR_RX);
    start(MembershipService.MBR_TX);
}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual services to shutdown
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will shutdown all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0) return; //we have already stopped up all components
        if (svc == 0 ) return;//nothing to stop

        boolean valid = false;
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.stop();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }            
        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));
        setChannel(null);
    }catch ( Exception x ) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}
项目:apache-tomcat-7.0.73-with-comment    文件:GroupChannel.java   
/**
 * Returns the membership service component
 * @return MembershipService
 */
@Override
public MembershipService getMembershipService() {
    return coordinator.getMembershipService();
}
项目:apache-tomcat-7.0.73-with-comment    文件:GroupChannel.java   
/**
 * Sets the membership component
 * @param membershipService MembershipService
 */
@Override
public void setMembershipService(MembershipService membershipService) {
    coordinator.setMembershipService(membershipService);
}
项目:apache-tomcat-7.0.73-with-comment    文件:McastService.java   
/**
 * Start broadcasting and listening to membership pings
 * @throws java.lang.Exception if a IO error occurs
 */
@Override
public void start() throws java.lang.Exception {
    start(MembershipService.MBR_RX);
    start(MembershipService.MBR_TX);
}
项目:lazycat    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver, ChannelSender sender, MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:lazycat    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual
 * services to shutdown The svc parameter can be the logical or value of any
 * constants
 * 
 * @param svc
 *            int value of <BR>
 *            DEFAULT - will shutdown all services <BR>
 *            MBR_RX_SEQ - starts the membership receiver <BR>
 *            MBR_TX_SEQ - starts the membership broadcaster <BR>
 *            SND_TX_SEQ - starts the replication transmitter<BR>
 *            SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException
 *             if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        // make sure we don't pass down any flags that are unrelated to the
        // bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0)
            return; // we have already stopped up all components
        if (svc == 0)
            return;// nothing to stop

        boolean valid = false;
        if (Channel.SND_RX_SEQ == (svc & Channel.SND_RX_SEQ)) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if (Channel.SND_TX_SEQ == (svc & Channel.SND_TX_SEQ)) {
            clusterSender.stop();
            valid = true;
        }

        if (Channel.MBR_RX_SEQ == (svc & Channel.MBR_RX_SEQ)) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if (Channel.MBR_TX_SEQ == (svc & Channel.MBR_TX_SEQ)) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }
        if (!valid) {
            throw new IllegalArgumentException(
                    "Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));
        setChannel(null);
    } catch (Exception x) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:lazycat    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:lazycat    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}
项目:class-guard    文件:ChannelCoordinator.java   
/**
 * Starts up the channel. This can be called multiple times for individual services to start
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will start all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStart(int svc) throws ChannelException {
    try {
        boolean valid = false;
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == Channel.DEFAULT) return; //we have already started up all components
        if (svc == 0 ) return;//nothing to start

        if (svc == (svc & startLevel)) throw new ChannelException("Channel already started for level:"+svc);

        //must start the receiver first so that we can coordinate the port it
        //listens to with the local membership settings
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.setMessageListener(this);
            clusterReceiver.start();
            //synchronize, big time FIXME
            membershipService.setLocalMemberProperties(getClusterReceiver().getHost(), 
                                                       getClusterReceiver().getPort(),
                                                       getClusterReceiver().getSecurePort(),
                                                       getClusterReceiver().getUdpPort());
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.start();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.setMembershipListener(this);
            if (membershipService instanceof McastService) {
                ((McastService)membershipService).setMessageListener(this);
            }
            membershipService.start(MembershipService.MBR_RX);
            valid = true;
        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            membershipService.start(MembershipService.MBR_TX);
            valid = true;
        }

        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }
        startLevel = (startLevel | svc);
    }catch ( ChannelException cx ) {
        throw cx;
    }catch ( Exception x ) {
        throw new ChannelException(x);
    }
}
项目:class-guard    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual services to shutdown
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will shutdown all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0) return; //we have already stopped up all components
        if (svc == 0 ) return;//nothing to stop

        boolean valid = false;
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.stop();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }            
        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));

    }catch ( Exception x ) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:class-guard    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:class-guard    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}
项目:class-guard    文件:GroupChannel.java   
/**
 * Returns the membership service component
 * @return MembershipService
 */
@Override
public MembershipService getMembershipService() {
    return coordinator.getMembershipService();
}
项目:class-guard    文件:GroupChannel.java   
/**
 * Sets the membership component
 * @param membershipService MembershipService
 */
@Override
public void setMembershipService(MembershipService membershipService) {
    coordinator.setMembershipService(membershipService);
}
项目:class-guard    文件:McastService.java   
/**
 * Start broadcasting and listening to membership pings
 * @throws java.lang.Exception if a IO error occurs
 */
@Override
public void start() throws java.lang.Exception {
    start(MembershipService.MBR_RX);
    start(MembershipService.MBR_TX);
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
/**
 * Starts up the channel. This can be called multiple times for individual services to start
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will start all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStart(int svc) throws ChannelException {
    try {
        boolean valid = false;
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == Channel.DEFAULT) return; //we have already started up all components
        if (svc == 0 ) return;//nothing to start

        if (svc == (svc & startLevel)) throw new ChannelException("Channel already started for level:"+svc);

        //must start the receiver first so that we can coordinate the port it
        //listens to with the local membership settings
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.setMessageListener(this);
            clusterReceiver.start();
            //synchronize, big time FIXME
            membershipService.setLocalMemberProperties(getClusterReceiver().getHost(), 
                                                       getClusterReceiver().getPort(),
                                                       getClusterReceiver().getSecurePort(),
                                                       getClusterReceiver().getUdpPort());
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.start();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.setMembershipListener(this);
            if (membershipService instanceof McastService) {
                ((McastService)membershipService).setMessageListener(this);
            }
            membershipService.start(MembershipService.MBR_RX);
            valid = true;
        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            membershipService.start(MembershipService.MBR_TX);
            valid = true;
        }

        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }
        startLevel = (startLevel | svc);
    }catch ( ChannelException cx ) {
        throw cx;
    }catch ( Exception x ) {
        throw new ChannelException(x);
    }
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual services to shutdown
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will shutdown all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0) return; //we have already stopped up all components
        if (svc == 0 ) return;//nothing to stop

        boolean valid = false;
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.stop();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }            
        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));

    }catch ( Exception x ) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}
项目:apache-tomcat-7.0.57    文件:GroupChannel.java   
/**
 * Returns the membership service component
 * @return MembershipService
 */
@Override
public MembershipService getMembershipService() {
    return coordinator.getMembershipService();
}
项目:apache-tomcat-7.0.57    文件:GroupChannel.java   
/**
 * Sets the membership component
 * @param membershipService MembershipService
 */
@Override
public void setMembershipService(MembershipService membershipService) {
    coordinator.setMembershipService(membershipService);
}
项目:apache-tomcat-7.0.57    文件:McastService.java   
/**
 * Start broadcasting and listening to membership pings
 * @throws java.lang.Exception if a IO error occurs
 */
@Override
public void start() throws java.lang.Exception {
    start(MembershipService.MBR_RX);
    start(MembershipService.MBR_TX);
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
/**
 * Starts up the channel. This can be called multiple times for individual services to start
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will start all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStart(int svc) throws ChannelException {
    try {
        boolean valid = false;
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == Channel.DEFAULT) return; //we have already started up all components
        if (svc == 0 ) return;//nothing to start

        if (svc == (svc & startLevel)) throw new ChannelException("Channel already started for level:"+svc);

        //must start the receiver first so that we can coordinate the port it
        //listens to with the local membership settings
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.setMessageListener(this);
            clusterReceiver.start();
            //synchronize, big time FIXME
            membershipService.setLocalMemberProperties(getClusterReceiver().getHost(), 
                                                       getClusterReceiver().getPort(),
                                                       getClusterReceiver().getSecurePort(),
                                                       getClusterReceiver().getUdpPort());
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.start();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.setMembershipListener(this);
            if (membershipService instanceof McastService) {
                ((McastService)membershipService).setMessageListener(this);
            }
            membershipService.start(MembershipService.MBR_RX);
            valid = true;
        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            membershipService.start(MembershipService.MBR_TX);
            valid = true;
        }

        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }
        startLevel = (startLevel | svc);
    }catch ( ChannelException cx ) {
        throw cx;
    }catch ( Exception x ) {
        throw new ChannelException(x);
    }
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
/**
 * Shuts down the channel. This can be called multiple times for individual services to shutdown
 * The svc parameter can be the logical or value of any constants
 * @param svc int value of <BR>
 * DEFAULT - will shutdown all services <BR>
 * MBR_RX_SEQ - starts the membership receiver <BR>
 * MBR_TX_SEQ - starts the membership broadcaster <BR>
 * SND_TX_SEQ - starts the replication transmitter<BR>
 * SND_RX_SEQ - starts the replication receiver<BR>
 * @throws ChannelException if a startup error occurs or the service is already started.
 */
protected synchronized void internalStop(int svc) throws ChannelException {
    try {
        //make sure we don't pass down any flags that are unrelated to the bottom layer
        svc = svc & Channel.DEFAULT;

        if (startLevel == 0) return; //we have already stopped up all components
        if (svc == 0 ) return;//nothing to stop

        boolean valid = false;
        if ( Channel.SND_RX_SEQ==(svc & Channel.SND_RX_SEQ) ) {
            clusterReceiver.stop();
            clusterReceiver.setMessageListener(null);
            valid = true;
        }
        if ( Channel.SND_TX_SEQ==(svc & Channel.SND_TX_SEQ) ) {
            clusterSender.stop();
            valid = true;
        }

        if ( Channel.MBR_RX_SEQ==(svc & Channel.MBR_RX_SEQ) ) {
            membershipService.stop(MembershipService.MBR_RX);
            membershipService.setMembershipListener(null);
            valid = true;

        }
        if ( Channel.MBR_TX_SEQ==(svc & Channel.MBR_TX_SEQ) ) {
            valid = true;
            membershipService.stop(MembershipService.MBR_TX);
        }            
        if ( !valid) {
            throw new IllegalArgumentException("Invalid start level, valid levels are:SND_RX_SEQ,SND_TX_SEQ,MBR_TX_SEQ,MBR_RX_SEQ");
        }

        startLevel = (startLevel & (~svc));

    }catch ( Exception x ) {
        throw new ChannelException(x);
    } finally {

    }

}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public MembershipService getMembershipService() {
    return membershipService;
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public void setMembershipService(MembershipService membershipService) {
    this.membershipService = membershipService;
    this.membershipService.setMembershipListener(this);
}