public abstract class AbstractClientConnectionHandler extends Object implements ClientConnectionHandler
| Modifier and Type | Field and Description |
|---|---|
protected String |
host
The name or IP address of the host the class server is running on.
|
protected List<ClientConnectionStatusListener> |
listeners
List of status listeners for this connection.
|
protected String |
name
The name given to this connection handler.
|
protected JPPFClientConnection |
owner
The client connection which owns this connection handler.
|
protected int |
port
The TCP port the class server is listening to.
|
protected SocketWrapper |
socketClient
The socket client uses to communicate over a socket connection.
|
protected SocketInitializer |
socketInitializer
Used to synchronize access to the underlying socket from multiple threads.
|
protected AtomicReference<JPPFClientConnectionStatus> |
status
Status of the connection.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractClientConnectionHandler(JPPFClientConnection owner,
String name)
Initialize this connection with the specified owner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClientConnectionStatusListener(ClientConnectionStatusListener listener)
Add a connection status listener to this connection's list of listeners.
|
void |
close()
Close and cleanup this connection handler.
|
protected abstract SocketInitializer |
createSocketInitializer()
Create a socket initializer for this connection handler.
|
protected void |
createSSLConnection()
Create the ssl connection over an established plain connection.
|
protected void |
fireStatusChanged(JPPFClientConnectionStatus oldStatus)
Notify all listeners that the status of this connection has changed.
|
SocketWrapper |
getSocketClient()
Get the socket client used to communicate over a socket connection.
|
JPPFClientConnectionStatus |
getStatus()
Get the status of this connection.
|
void |
removeClientConnectionStatusListener(ClientConnectionStatusListener listener)
Remove a connection status listener from this connection's list of listeners.
|
void |
setStatus(JPPFClientConnectionStatus newStatus)
Set the status of this connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initSocketClientprotected SocketWrapper socketClient
protected SocketInitializer socketInitializer
protected String host
protected int port
protected JPPFClientConnection owner
protected String name
protected final AtomicReference<JPPFClientConnectionStatus> status
protected final List<ClientConnectionStatusListener> listeners
protected AbstractClientConnectionHandler(JPPFClientConnection owner, String name)
owner - the client connection which owns this connection handler.name - the name given to this connection.public JPPFClientConnectionStatus getStatus()
JPPFClientConnectionStatus enumerated value.ClientConnectionStatusHandler.getStatus()public void setStatus(JPPFClientConnectionStatus newStatus)
newStatus - a JPPFClientConnectionStatus enumerated value.ClientConnectionStatusHandler.setStatus(org.jppf.client.JPPFClientConnectionStatus)public void addClientConnectionStatusListener(ClientConnectionStatusListener listener)
listener - the listener to add to the list.ClientConnectionStatusHandler.addClientConnectionStatusListener(org.jppf.client.event.ClientConnectionStatusListener)public void removeClientConnectionStatusListener(ClientConnectionStatusListener listener)
listener - the listener to remove from the list.ClientConnectionStatusHandler.removeClientConnectionStatusListener(org.jppf.client.event.ClientConnectionStatusListener)protected abstract SocketInitializer createSocketInitializer()
SocketInitializer instance.protected void fireStatusChanged(JPPFClientConnectionStatus oldStatus)
oldStatus - the connection status before the change.public SocketWrapper getSocketClient() throws Exception
getSocketClient in interface ClientConnectionHandlerSocketWrapper instance.Exception - if any error occurs.protected void createSSLConnection()
throws Exception
Exception - if any error occurs.public void close()
ClientConnectionHandlerclose in interface ClientConnectionHandlerCopyright © 2005-2012 JPPF Team.