org.apache.catalina.cluster.tcp
Class ReplicationListener

java.lang.Object
  extended byorg.apache.catalina.cluster.tcp.ReplicationListener
All Implemented Interfaces:
ClusterReceiver, java.lang.Runnable

public class ReplicationListener
extends java.lang.Object
implements java.lang.Runnable, ClusterReceiver


Constructor Summary
ReplicationListener()
           
 
Method Summary
 java.lang.String getHost()
           
 java.lang.Object getInterestOpsMutex()
           
 boolean getIsSenderSynchronized()
           
 int getPort()
           
 java.lang.String getTcpListenAddress()
           
 int getTcpListenPort()
           
 long getTcpSelectorTimeout()
           
 int getTcpThreadCount()
           
 void listen()
           
protected  void readDataFromSocket(java.nio.channels.SelectionKey key)
          Sample data handler method for a channel with data ready to read.
protected  void registerChannel(java.nio.channels.Selector selector, java.nio.channels.SelectableChannel channel, int ops, java.lang.Object attach)
          Register the given channel with the given selector for the given operations of interest
 void run()
           
 void setCatalinaCluster(CatalinaCluster cluster)
           
 void setIsSenderSynchronized(boolean isSenderSynchronized)
           
 void setTcpListenAddress(java.lang.String tcpListenAddress)
           
 void setTcpListenPort(int tcpListenPort)
           
 void setTcpSelectorTimeout(long tcpSelectorTimeout)
           
 void setTcpThreadCount(int tcpThreadCount)
           
 void start()
           
 void stop()
           
 void stopListening()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationListener

public ReplicationListener()
Method Detail

start

public void start()
Specified by:
start in interface ClusterReceiver

stop

public void stop()
Specified by:
stop in interface ClusterReceiver

run

public void run()
Specified by:
run in interface java.lang.Runnable

listen

public void listen()
            throws java.lang.Exception
Throws:
java.lang.Exception

stopListening

public void stopListening()

setCatalinaCluster

public void setCatalinaCluster(CatalinaCluster cluster)
Specified by:
setCatalinaCluster in interface ClusterReceiver

registerChannel

protected void registerChannel(java.nio.channels.Selector selector,
                               java.nio.channels.SelectableChannel channel,
                               int ops,
                               java.lang.Object attach)
                        throws java.lang.Exception
Register the given channel with the given selector for the given operations of interest

Throws:
java.lang.Exception

readDataFromSocket

protected void readDataFromSocket(java.nio.channels.SelectionKey key)
                           throws java.lang.Exception
Sample data handler method for a channel with data ready to read.

Parameters:
key - A SelectionKey object associated with a channel determined by the selector to be ready for reading. If the channel returns an EOF condition, it is closed here, which automatically invalidates the associated key. The selector will then de-register the channel on the next select call.
Throws:
java.lang.Exception

getTcpListenAddress

public java.lang.String getTcpListenAddress()

setTcpListenAddress

public void setTcpListenAddress(java.lang.String tcpListenAddress)

getTcpListenPort

public int getTcpListenPort()

setTcpListenPort

public void setTcpListenPort(int tcpListenPort)

getTcpSelectorTimeout

public long getTcpSelectorTimeout()

setTcpSelectorTimeout

public void setTcpSelectorTimeout(long tcpSelectorTimeout)

getTcpThreadCount

public int getTcpThreadCount()

setTcpThreadCount

public void setTcpThreadCount(int tcpThreadCount)

getIsSenderSynchronized

public boolean getIsSenderSynchronized()

setIsSenderSynchronized

public void setIsSenderSynchronized(boolean isSenderSynchronized)
Specified by:
setIsSenderSynchronized in interface ClusterReceiver

getHost

public java.lang.String getHost()
Specified by:
getHost in interface ClusterReceiver

getPort

public int getPort()
Specified by:
getPort in interface ClusterReceiver

getInterestOpsMutex

public java.lang.Object getInterestOpsMutex()


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.