Java 类org.apache.catalina.tribes.group.ChannelInterceptorBase 实例源码

项目:class-guard    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final Member[] mbrs = members.toArray(new Member[members.size()]);
    final ChannelInterceptorBase base = this;
    Thread t = new Thread() {
        @Override
        public void run() {
            for (int i=0; i<mbrs.length; i++ ) {
                base.memberAdded(mbrs[i]);
            }
        }
    };
    t.start();
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
}
项目:apache-tomcat-7.0.57    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final Member[] mbrs = members.toArray(new Member[members.size()]);
    final ChannelInterceptorBase base = this;
    Thread t = new Thread() {
        @Override
        public void run() {
            for (int i=0; i<mbrs.length; i++ ) {
                base.memberAdded(mbrs[i]);
            }
        }
    };
    t.start();
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
}
项目:apache-tomcat-7.0.57    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final Member[] mbrs = members.toArray(new Member[members.size()]);
    final ChannelInterceptorBase base = this;
    Thread t = new Thread() {
        @Override
        public void run() {
            for (int i=0; i<mbrs.length; i++ ) {
                base.memberAdded(mbrs[i]);
            }
        }
    };
    t.start();
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
}
项目:WBSAirback    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final Member[] mbrs = members.toArray(new Member[members.size()]);
    final ChannelInterceptorBase base = this;
    Thread t = new Thread() {
        @Override
        public void run() {
            for (int i=0; i<mbrs.length; i++ ) {
                base.memberAdded(mbrs[i]);
            }
        }
    };
    t.start();
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));
}
项目:tomcat7    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final ChannelInterceptorBase base = this;
    for (final Member member : members) {
        Thread t = new Thread() {
            @Override
            public void run() {
                base.memberAdded(member);
                if (getfirstInterceptor().getMember(member) != null) {
                    sendLocalMember(new Member[]{member});
                }
            }
        };
        t.start();
    }
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));

    // check required interceptors
    TcpFailureDetector failureDetector = null;
    TcpPingInterceptor pingInterceptor = null;
    ChannelInterceptor prev = getPrevious();
    while (prev != null) {
        if (prev instanceof TcpFailureDetector ) failureDetector = (TcpFailureDetector) prev;
        if (prev instanceof TcpPingInterceptor) pingInterceptor = (TcpPingInterceptor) prev;
        prev = prev.getPrevious();
    }
    if (failureDetector == null) {
        log.warn("There is no TcpFailureDetector. Automatic detection of static members does"
                + " not work properly. By defining the StaticMembershipInterceptor under the"
                + " TcpFailureDetector, automatic detection of the static members will work.");
    }
    if (pingInterceptor == null) {
        log.warn("There is no TcpPingInterceptor. The health check of static member does"
                + " not work properly. By defining the TcpPingInterceptor, the health check of"
                + " static member will work.");
    }
}
项目:apache-tomcat-7.0.73-with-comment    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * @param svc int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ( (Channel.SND_RX_SEQ&svc)==Channel.SND_RX_SEQ ) super.start(Channel.SND_RX_SEQ); 
    if ( (Channel.SND_TX_SEQ&svc)==Channel.SND_TX_SEQ ) super.start(Channel.SND_TX_SEQ); 
    final ChannelInterceptorBase base = this;
    for (final Member member : members) {
        Thread t = new Thread() {
            @Override
            public void run() {
                base.memberAdded(member);
                if (getfirstInterceptor().getMember(member) != null) {
                    sendLocalMember(new Member[]{member});
                }
            }
        };
        t.start();
    }
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));

    // check required interceptors
    TcpFailureDetector failureDetector = null;
    TcpPingInterceptor pingInterceptor = null;
    ChannelInterceptor prev = getPrevious();
    while (prev != null) {
        if (prev instanceof TcpFailureDetector ) failureDetector = (TcpFailureDetector) prev;
        if (prev instanceof TcpPingInterceptor) pingInterceptor = (TcpPingInterceptor) prev;
        prev = prev.getPrevious();
    }
    if (failureDetector == null) {
        log.warn("There is no TcpFailureDetector. Automatic detection of static members does"
                + " not work properly. By defining the StaticMembershipInterceptor under the"
                + " TcpFailureDetector, automatic detection of the static members will work.");
    }
    if (pingInterceptor == null) {
        log.warn("There is no TcpPingInterceptor. The health check of static member does"
                + " not work properly. By defining the TcpPingInterceptor, the health check of"
                + " static member will work.");
    }
}
项目:lazycat    文件:StaticMembershipInterceptor.java   
/**
 * Send notifications upwards
 * 
 * @param svc
 *            int
 * @throws ChannelException
 */
@Override
public void start(int svc) throws ChannelException {
    if ((Channel.SND_RX_SEQ & svc) == Channel.SND_RX_SEQ)
        super.start(Channel.SND_RX_SEQ);
    if ((Channel.SND_TX_SEQ & svc) == Channel.SND_TX_SEQ)
        super.start(Channel.SND_TX_SEQ);
    final ChannelInterceptorBase base = this;
    for (final Member member : members) {
        Thread t = new Thread() {
            @Override
            public void run() {
                base.memberAdded(member);
                if (getfirstInterceptor().getMember(member) != null) {
                    sendLocalMember(new Member[] { member });
                }
            }
        };
        t.start();
    }
    super.start(svc & (~Channel.SND_RX_SEQ) & (~Channel.SND_TX_SEQ));

    // check required interceptors
    TcpFailureDetector failureDetector = null;
    TcpPingInterceptor pingInterceptor = null;
    ChannelInterceptor prev = getPrevious();
    while (prev != null) {
        if (prev instanceof TcpFailureDetector)
            failureDetector = (TcpFailureDetector) prev;
        if (prev instanceof TcpPingInterceptor)
            pingInterceptor = (TcpPingInterceptor) prev;
        prev = prev.getPrevious();
    }
    if (failureDetector == null) {
        log.warn("There is no TcpFailureDetector. Automatic detection of static members does"
                + " not work properly. By defining the StaticMembershipInterceptor under the"
                + " TcpFailureDetector, automatic detection of the static members will work.");
    }
    if (pingInterceptor == null) {
        log.warn("There is no TcpPingInterceptor. The health check of static member does"
                + " not work properly. By defining the TcpPingInterceptor, the health check of"
                + " static member will work.");
    }
}