com.bea.wlrt.adapter.defaultprovider
Class SocketAdapterImpl

java.lang.Object
  |
  +--com.bea.wlrt.ede.impl.AbstractEventSource
        |
        +--com.bea.wlrt.ede.impl.AbstractStage
              |
              +--com.bea.wlrt.ede.impl.AbstractAdapter
                    |
                    +--com.bea.wlrt.adapter.defaultprovider.SocketAdapterImpl

public abstract class SocketAdapterImpl
extends AbstractAdapter
implements SocketAdapter

Creates a server connection and waits for incoming client connections. Inherited classes must provide a listener to handle read/write for the connection.


Constructor Summary
protected SocketAdapterImpl(String id, String applicationId)
           
protected SocketAdapterImpl(String id, String applicationId, int port)
           
 
Method Summary
 void connectionCreated(Connection conn)
          This method is called each time a new client connection is established.
 void destroy()
           
 int getPort()
           
protected abstract  Connection.Listener getReadListener(Connection conn)
          Returns a listener which will handle reading and writing for this connection
protected  ServerConnection getServerConnection()
           
 void onEvent(List newEvents)
           
 void setPort(int port)
           
protected  void setupServerConnection(int port)
           
 
Methods inherited from class com.bea.wlrt.ede.impl.AbstractAdapter
getWorkManager, setSessionManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketAdapterImpl

protected SocketAdapterImpl(String id,
                            String applicationId)

SocketAdapterImpl

protected SocketAdapterImpl(String id,
                            String applicationId,
                            int port)
Method Detail

setupServerConnection

protected void setupServerConnection(int port)


onEvent

public void onEvent(List newEvents)
             throws RejectEventException

Overrides:
onEvent in class com.bea.wlrt.ede.impl.AbstractStage

getServerConnection

protected ServerConnection getServerConnection()


getPort

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


setPort

public void setPort(int port)
Specified by:
setPort in interface SocketAdapter


connectionCreated

public void connectionCreated(Connection conn)
This method is called each time a new client connection is established.


destroy

public void destroy()
             throws Exception

Overrides:
destroy in class com.bea.wlrt.ede.impl.AbstractStage

getReadListener

protected abstract Connection.Listener getReadListener(Connection conn)
Returns a listener which will handle reading and writing for this connection

Returns:
a connection listener