org.codehaus.activemq.transport.tcp
Class TcpTransportServerChannel

java.lang.Object
  extended byorg.codehaus.activemq.transport.TransportServerChannelSupport
      extended byorg.codehaus.activemq.transport.tcp.TcpTransportServerChannel
All Implemented Interfaces:
Runnable, Service, TransportServerChannel
Direct Known Subclasses:
JxtaTransportServerChannel

public class TcpTransportServerChannel
extends TransportServerChannelSupport
implements Runnable

Binds to a well known port and listens for Sockets ...

Version:
$Revision: 1.23 $

Field Summary
protected static int DEFAULT_BACKLOG
           
 
Constructor Summary
TcpTransportServerChannel(WireFormat wireFormat, ServerSocket serverSocket)
           
TcpTransportServerChannel(WireFormat wireFormat, URI bindAddr)
          Default Constructor
 
Method Summary
protected  ServerSocket createServerSocket(URI bind)
          Factory method to create a new ServerSocket
 int getBacklog()
           
 int getMaxOutstandingMessages()
           
 boolean isUseAsyncSend()
           
 void run()
          pull Sockets from the ServerSocket
 void setBacklog(int backlog)
           
 void setMaxOutstandingMessages(int maxOutstandingMessages)
           
 void setUseAsyncSend(boolean useAsyncSend)
           
 void start()
          start listeneing for events
 void stop()
          close the ServerChannel
 String toString()
           
protected  void updatePhysicalUri(URI bindAddr)
          In cases where we construct ourselves with a zero port we need to regenerate the URI with the real physical port so that people can connect to us via discovery
 
Methods inherited from class org.codehaus.activemq.transport.TransportServerChannelSupport
addClient, getTransportChannelListener, getUrl, setTransportChannelListener, setUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BACKLOG

protected static final int DEFAULT_BACKLOG
See Also:
Constant Field Values
Constructor Detail

TcpTransportServerChannel

public TcpTransportServerChannel(WireFormat wireFormat,
                                 URI bindAddr)
                          throws JMSException
Default Constructor

Parameters:
bindAddr -
Throws:
JMSException

TcpTransportServerChannel

public TcpTransportServerChannel(WireFormat wireFormat,
                                 ServerSocket serverSocket)
                          throws JMSException
Method Detail

start

public void start()
           throws JMSException
Description copied from interface: TransportServerChannel
start listeneing for events

Specified by:
start in interface TransportServerChannel
Overrides:
start in class TransportServerChannelSupport
Throws:
JMSException

stop

public void stop()
          throws JMSException
Description copied from interface: TransportServerChannel
close the ServerChannel

Specified by:
stop in interface TransportServerChannel
Overrides:
stop in class TransportServerChannelSupport
Throws:
JMSException

toString

public String toString()
Returns:
pretty print of this

run

public void run()
pull Sockets from the ServerSocket

Specified by:
run in interface Runnable

isUseAsyncSend

public boolean isUseAsyncSend()

setUseAsyncSend

public void setUseAsyncSend(boolean useAsyncSend)

getMaxOutstandingMessages

public int getMaxOutstandingMessages()

setMaxOutstandingMessages

public void setMaxOutstandingMessages(int maxOutstandingMessages)

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int backlog)

updatePhysicalUri

protected void updatePhysicalUri(URI bindAddr)
                          throws URISyntaxException
In cases where we construct ourselves with a zero port we need to regenerate the URI with the real physical port so that people can connect to us via discovery

Throws:
URISyntaxException

createServerSocket

protected ServerSocket createServerSocket(URI bind)
                                   throws UnknownHostException,
                                          IOException
Factory method to create a new ServerSocket

Throws:
UnknownHostException
IOException


Copyright © 2004 Protique, Ltd.. All Rights Reserved.