org.jacorb.orb.iiop
Class IIOPListener.Acceptor

java.lang.Object
  extended by java.lang.Thread
      extended by org.jacorb.orb.etf.ListenerBase.Acceptor
          extended by org.jacorb.orb.iiop.IIOPListener.Acceptor
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
IIOPListener

public class IIOPListener.Acceptor
extends ListenerBase.Acceptor


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.net.ServerSocket serverSocket
           
protected  boolean terminated
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected IIOPListener.Acceptor(java.lang.String name)
           
 
Method Summary
protected  void beginAccept()
          template method that is invoked during the accept loop before an incoming connection is accepted.
protected  java.net.ServerSocket createServerSocket()
          Template method that creates the server socket.
protected  void deliverConnection(java.net.Socket socket)
           
protected  void doHandleExceptionInRunLoop(java.lang.Exception exception, boolean isTerminated)
           
protected  void doSetup(java.net.Socket socket)
           
protected  void endAccept()
          template method that is invoked during the accept loop after an incoming connection was processed.
 boolean getAcceptorSocketLoop()
          getAcceptorSocketLoop returns whether we have done a socket accept.
 IIOPAddress getLocalAddress()
           
 void init()
           
 void run()
           
protected  void setup(java.net.Socket socket)
          Template method that sets up the socket right after the connection has been established.
 void terminate()
          Terminates this Acceptor by closing the ServerSocket and interrupting the run loop.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serverSocket

protected java.net.ServerSocket serverSocket

terminated

protected boolean terminated
Constructor Detail

IIOPListener.Acceptor

protected IIOPListener.Acceptor(java.lang.String name)
Method Detail

init

public void init()
Specified by:
init in class ListenerBase.Acceptor

beginAccept

protected void beginAccept()
                    throws java.lang.InterruptedException
template method that is invoked during the accept loop before an incoming connection is accepted.

Throws:
java.lang.InterruptedException

endAccept

protected void endAccept()
template method that is invoked during the accept loop after an incoming connection was processed.


run

public final void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class ListenerBase.Acceptor

doHandleExceptionInRunLoop

protected void doHandleExceptionInRunLoop(java.lang.Exception exception,
                                          boolean isTerminated)

terminate

public void terminate()
Terminates this Acceptor by closing the ServerSocket and interrupting the run loop.

Specified by:
terminate in class ListenerBase.Acceptor

getLocalAddress

public IIOPAddress getLocalAddress()

createServerSocket

protected java.net.ServerSocket createServerSocket()
Template method that creates the server socket.


setup

protected final void setup(java.net.Socket socket)
                    throws java.io.IOException
Template method that sets up the socket right after the connection has been established. Subclass implementations may implement their own logic by overriding doSetup

Throws:
java.io.IOException

doSetup

protected void doSetup(java.net.Socket socket)

deliverConnection

protected void deliverConnection(java.net.Socket socket)

getAcceptorSocketLoop

public boolean getAcceptorSocketLoop()
getAcceptorSocketLoop returns whether we have done a socket accept. This is useful for the AcceptorExceptionListener so it can determine for instance if the SSLException has been thrown before any connections have been made or after x amount of connections - this allows differentiation between initial configuration failure and failure to connect to a single client.

Returns:
a boolean value