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

项目:tomcat7    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:tomcat7    文件:ChannelCoordinator.java   
public void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目: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);
}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
public void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目:lazycat    文件:ChannelCoordinator.java   
public void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if (clusterReceiver != null) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if (this.clusterReceiver != null)
            this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目:class-guard    文件: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 void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目: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 void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目: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 void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目:WBSAirback    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver,
                          ChannelSender sender,
                          MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:WBSAirback    文件:ChannelCoordinator.java   
public void setClusterReceiver(ChannelReceiver clusterReceiver) {
    if ( clusterReceiver != null ) {
        this.clusterReceiver = clusterReceiver;
        this.clusterReceiver.setMessageListener(this);
    } else {
        if  (this.clusterReceiver!=null ) this.clusterReceiver.setMessageListener(null);
        this.clusterReceiver = null;
    }
}
项目:tomcat7    文件:ChannelCoordinator.java   
public ChannelReceiver getClusterReceiver() {
    return clusterReceiver;
}
项目:tomcat7    文件:GroupChannel.java   
/**
 * Returns the channel receiver component
 * @return ChannelReceiver
 */
@Override
public ChannelReceiver getChannelReceiver() {
    return coordinator.getClusterReceiver();
}
项目:tomcat7    文件:GroupChannel.java   
/**
 * Sets the channel receiver component
 * @param clusterReceiver ChannelReceiver
 */
@Override
public void setChannelReceiver(ChannelReceiver clusterReceiver) {
    coordinator.setClusterReceiver(clusterReceiver);
}
项目:tomcat7    文件:NioReplicationTask.java   
@Override
public synchronized void run() {
    if ( buffer == null ) {
        int size = getRxBufSize();
        if (key.channel() instanceof DatagramChannel) {
            size = ChannelReceiver.MAX_UDP_SIZE;
        }
        if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) {
            buffer = ByteBuffer.allocateDirect(size);
        } else {
            buffer = ByteBuffer.allocate(size);
        }
    } else {
        buffer.clear();
    }
    if (key == null) {
        return; // just in case
    }
    if ( log.isTraceEnabled() )
        log.trace("Servicing key:"+key);

    try {
        ObjectReader reader = (ObjectReader)key.attachment();
        if ( reader == null ) {
            if ( log.isTraceEnabled() )
                log.trace("No object reader, cancelling:"+key);
            cancelKey(key);
        } else {
            if ( log.isTraceEnabled() )
                log.trace("Draining channel:"+key);

            drainChannel(key, reader);
        }
    } catch (Exception e) {
        //this is common, since the sockets on the other
        //end expire after a certain time.
        if ( e instanceof CancelledKeyException ) {
            //do nothing
        } else if ( e instanceof IOException ) {
            //dont spew out stack traces for IO exceptions unless debug is enabled.
            if (log.isDebugEnabled()) log.debug ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].", e);
            else log.warn ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].");
        } else if ( log.isErrorEnabled() ) {
            //this is a real error, log it.
            log.error("Exception caught in TcpReplicationThread.drainChannel.",e);
        }
        cancelKey(key);
    } finally {

    }
    key = null;
    // done, ready for more, return to pool
    getTaskPool().returnWorker (this);
}
项目:tomcat7    文件:TestMulticastPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:tomcat7    文件:TestUdpPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:apache-tomcat-7.0.73-with-comment    文件:ChannelCoordinator.java   
public ChannelReceiver getClusterReceiver() {
    return clusterReceiver;
}
项目:apache-tomcat-7.0.73-with-comment    文件:GroupChannel.java   
/**
 * Returns the channel receiver component
 * @return ChannelReceiver
 */
@Override
public ChannelReceiver getChannelReceiver() {
    return coordinator.getClusterReceiver();
}
项目:apache-tomcat-7.0.73-with-comment    文件:GroupChannel.java   
/**
 * Sets the channel receiver component
 * @param clusterReceiver ChannelReceiver
 */
@Override
public void setChannelReceiver(ChannelReceiver clusterReceiver) {
    coordinator.setClusterReceiver(clusterReceiver);
}
项目:apache-tomcat-7.0.73-with-comment    文件:NioReplicationTask.java   
@Override
public synchronized void run() {
    if ( buffer == null ) {
        int size = getRxBufSize();
        if (key.channel() instanceof DatagramChannel) {
            size = ChannelReceiver.MAX_UDP_SIZE;
        }
        if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) {
            buffer = ByteBuffer.allocateDirect(size);
        } else {
            buffer = ByteBuffer.allocate(size);
        }
    } else {
        buffer.clear();
    }
    if (key == null) {
        return; // just in case
    }
    if ( log.isTraceEnabled() )
        log.trace("Servicing key:"+key);

    try {
        ObjectReader reader = (ObjectReader)key.attachment();
        if ( reader == null ) {
            if ( log.isTraceEnabled() )
                log.trace("No object reader, cancelling:"+key);
            cancelKey(key);
        } else {
            if ( log.isTraceEnabled() )
                log.trace("Draining channel:"+key);

            drainChannel(key, reader);
        }
    } catch (Exception e) {
        //this is common, since the sockets on the other
        //end expire after a certain time.
        if ( e instanceof CancelledKeyException ) {
            //do nothing
        } else if ( e instanceof IOException ) {
            //dont spew out stack traces for IO exceptions unless debug is enabled.
            if (log.isDebugEnabled()) log.debug ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].", e);
            else log.warn ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].");
        } else if ( log.isErrorEnabled() ) {
            //this is a real error, log it.
            log.error("Exception caught in TcpReplicationThread.drainChannel.",e);
        }
        cancelKey(key);
    } finally {

    }
    key = null;
    // done, ready for more, return to pool
    getTaskPool().returnWorker (this);
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestMulticastPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:apache-tomcat-7.0.73-with-comment    文件:TestUdpPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:lazycat    文件:ChannelCoordinator.java   
public ChannelCoordinator(ChannelReceiver receiver, ChannelSender sender, MembershipService service) {
    this();
    this.setClusterReceiver(receiver);
    this.setClusterSender(sender);
    this.setMembershipService(service);
}
项目:lazycat    文件:ChannelCoordinator.java   
public ChannelReceiver getClusterReceiver() {
    return clusterReceiver;
}
项目:lazycat    文件:NioReplicationTask.java   
@Override
public synchronized void run() {
    if (buffer == null) {
        int size = getRxBufSize();
        if (key.channel() instanceof DatagramChannel) {
            size = ChannelReceiver.MAX_UDP_SIZE;
        }
        if ((getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) {
            buffer = ByteBuffer.allocateDirect(size);
        } else {
            buffer = ByteBuffer.allocate(size);
        }
    } else {
        buffer.clear();
    }
    if (key == null) {
        return; // just in case
    }
    if (log.isTraceEnabled())
        log.trace("Servicing key:" + key);

    try {
        ObjectReader reader = (ObjectReader) key.attachment();
        if (reader == null) {
            if (log.isTraceEnabled())
                log.trace("No object reader, cancelling:" + key);
            cancelKey(key);
        } else {
            if (log.isTraceEnabled())
                log.trace("Draining channel:" + key);

            drainChannel(key, reader);
        }
    } catch (Exception e) {
        // this is common, since the sockets on the other
        // end expire after a certain time.
        if (e instanceof CancelledKeyException) {
            // do nothing
        } else if (e instanceof IOException) {
            // dont spew out stack traces for IO exceptions unless debug is
            // enabled.
            if (log.isDebugEnabled())
                log.debug(
                        "IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["
                                + e.getMessage() + "].",
                        e);
            else
                log.warn(
                        "IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["
                                + e.getMessage() + "].");
        } else if (log.isErrorEnabled()) {
            // this is a real error, log it.
            log.error("Exception caught in TcpReplicationThread.drainChannel.", e);
        }
        cancelKey(key);
    } finally {

    }
    key = null;
    // done, ready for more, return to pool
    getTaskPool().returnWorker(this);
}
项目:class-guard    文件:ChannelCoordinator.java   
public ChannelReceiver getClusterReceiver() {
    return clusterReceiver;
}
项目:class-guard    文件:GroupChannel.java   
/**
 * Returns the channel receiver component
 * @return ChannelReceiver
 */
@Override
public ChannelReceiver getChannelReceiver() {
    return coordinator.getClusterReceiver();
}
项目:class-guard    文件:GroupChannel.java   
/**
 * Sets the channel receiver component
 * @param clusterReceiver ChannelReceiver
 */
@Override
public void setChannelReceiver(ChannelReceiver clusterReceiver) {
    coordinator.setClusterReceiver(clusterReceiver);
}
项目:class-guard    文件:NioReplicationTask.java   
@Override
public synchronized void run() {
    if ( buffer == null ) {
        int size = getRxBufSize();
        if (key.channel() instanceof DatagramChannel) {
            size = ChannelReceiver.MAX_UDP_SIZE;
        }
        if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) {
            buffer = ByteBuffer.allocateDirect(size);
        } else {
            buffer = ByteBuffer.allocate(size);
        }
    } else {
        buffer.clear();
    }
    if (key == null) {
        return; // just in case
    }
    if ( log.isTraceEnabled() )
        log.trace("Servicing key:"+key);

    try {
        ObjectReader reader = (ObjectReader)key.attachment();
        if ( reader == null ) {
            if ( log.isTraceEnabled() )
                log.trace("No object reader, cancelling:"+key);
            cancelKey(key);
        } else {
            if ( log.isTraceEnabled() )
                log.trace("Draining channel:"+key);

            drainChannel(key, reader);
        }
    } catch (Exception e) {
        //this is common, since the sockets on the other
        //end expire after a certain time.
        if ( e instanceof CancelledKeyException ) {
            //do nothing
        } else if ( e instanceof IOException ) {
            //dont spew out stack traces for IO exceptions unless debug is enabled.
            if (log.isDebugEnabled()) log.debug ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].", e);
            else log.warn ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].");
        } else if ( log.isErrorEnabled() ) {
            //this is a real error, log it.
            log.error("Exception caught in TcpReplicationThread.drainChannel.",e);
        }
        cancelKey(key);
    } finally {

    }
    key = null;
    // done, ready for more, return to pool
    getTaskPool().returnWorker (this);
}
项目:class-guard    文件:TestMulticastPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:class-guard    文件:TestUdpPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:apache-tomcat-7.0.57    文件:ChannelCoordinator.java   
public ChannelReceiver getClusterReceiver() {
    return clusterReceiver;
}
项目:apache-tomcat-7.0.57    文件:GroupChannel.java   
/**
 * Returns the channel receiver component
 * @return ChannelReceiver
 */
@Override
public ChannelReceiver getChannelReceiver() {
    return coordinator.getClusterReceiver();
}
项目:apache-tomcat-7.0.57    文件:GroupChannel.java   
/**
 * Sets the channel receiver component
 * @param clusterReceiver ChannelReceiver
 */
@Override
public void setChannelReceiver(ChannelReceiver clusterReceiver) {
    coordinator.setClusterReceiver(clusterReceiver);
}
项目:apache-tomcat-7.0.57    文件:NioReplicationTask.java   
@Override
public synchronized void run() {
    if ( buffer == null ) {
        int size = getRxBufSize();
        if (key.channel() instanceof DatagramChannel) {
            size = ChannelReceiver.MAX_UDP_SIZE;
        }
        if ( (getOptions() & OPTION_DIRECT_BUFFER) == OPTION_DIRECT_BUFFER) {
            buffer = ByteBuffer.allocateDirect(size);
        } else {
            buffer = ByteBuffer.allocate(size);
        }
    } else {
        buffer.clear();
    }
    if (key == null) {
        return; // just in case
    }
    if ( log.isTraceEnabled() )
        log.trace("Servicing key:"+key);

    try {
        ObjectReader reader = (ObjectReader)key.attachment();
        if ( reader == null ) {
            if ( log.isTraceEnabled() )
                log.trace("No object reader, cancelling:"+key);
            cancelKey(key);
        } else {
            if ( log.isTraceEnabled() )
                log.trace("Draining channel:"+key);

            drainChannel(key, reader);
        }
    } catch (Exception e) {
        //this is common, since the sockets on the other
        //end expire after a certain time.
        if ( e instanceof CancelledKeyException ) {
            //do nothing
        } else if ( e instanceof IOException ) {
            //dont spew out stack traces for IO exceptions unless debug is enabled.
            if (log.isDebugEnabled()) log.debug ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].", e);
            else log.warn ("IOException in replication worker, unable to drain channel. Probable cause: Keep alive socket closed["+e.getMessage()+"].");
        } else if ( log.isErrorEnabled() ) {
            //this is a real error, log it.
            log.error("Exception caught in TcpReplicationThread.drainChannel.",e);
        }
        cancelKey(key);
    } finally {

    }
    key = null;
    // done, ready for more, return to pool
    getTaskPool().returnWorker (this);
}
项目:apache-tomcat-7.0.57    文件:TestMulticastPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}
项目:apache-tomcat-7.0.57    文件:TestUdpPackages.java   
public static Data createRandomData() {
    return createRandomData(ChannelReceiver.MAX_UDP_SIZE);
}