|
PooliT v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ascentphase.poolit.handlers.SocketHandler
Handler for Socket connections. This class must be subclassed and override the methods postCreate() and/or preDestroy() if work is to be done after a Socket is created or before it is closed, respectively. Examples might be authentication after establishing a connection, or issuing a logout command prior to disconnect.
| Constructor Summary | |
SocketHandler(java.net.InetAddress address,
int port)
|
|
SocketHandler(java.lang.String host,
int port)
|
|
| Method Summary | |
java.lang.Object |
create()
Called by a Pooler to create a new object. |
void |
destroy(java.lang.Object o)
Called by a Pooler to perform any cleanup and destroy the object for garbage collection. |
protected void |
postCreate(java.net.Socket s)
This method should be overridden by subclasses that need to perform connection setup prior to having the Socket used. |
protected void |
preDestroy(java.net.Socket s)
This method should be overridden by subclasses that need to perform connection cleanup after it is no longer used and to be garbage- collected. |
boolean |
verify(java.lang.Object o)
Called by a Pooler to verify that the object is in a consistent and useable state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SocketHandler(java.net.InetAddress address,
int port)
public SocketHandler(java.lang.String host,
int port)
throws java.net.UnknownHostException
| Method Detail |
public java.lang.Object create()
throws CreateException
PoolHandler
create in interface PoolHandlerCreateExceptionPoolHandler.create()public void destroy(java.lang.Object o)
PoolHandler
destroy in interface PoolHandlero - the object to be destroyedPoolHandler.destroy(java.lang.Object)public boolean verify(java.lang.Object o)
PoolHandler
verify in interface PoolHandlero - the object to be testedPoolHandler.verify(java.lang.Object)
protected void postCreate(java.net.Socket s)
throws CreateException
s - the Socket to setup
CreateExceptionprotected void preDestroy(java.net.Socket s)
s - the Socket to cleanup.
|
PooliT v2.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||