public abstract class AbstractJPPFClientConnection extends BaseJPPFClientConnection
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed
Determines whether this connection has been shut down;
|
protected String |
displayName
The name displayed for this connection.
|
protected JMXDriverConnectionWrapper |
jmxConnection
Provides access to the management functions of the driver.
|
protected int |
jmxPort |
protected List<ClientConnectionStatusListener> |
listeners
List of status listeners for this connection.
|
protected ClientConnectionStatusListener[] |
listenersArray
Temporary listeners array to allow access to the listeners without synchronization.
|
protected int |
priority
Priority given to the driver this client is connected to.
|
protected TypedProperties |
props
Contains the configuration properties for this client connection.
|
protected boolean |
ssl
Determines whether the communication via the server is done via SSL.
|
client, connectionCount, connectionUuid, delegate, host, job, name, ndclCache, port, SERIALIZATION_HELPER_IMPL, serializationHelperClassName, status, taskServerConnection, uuid| Constructor and Description |
|---|
AbstractJPPFClientConnection() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClientConnectionStatusListener(ClientConnectionStatusListener listener)
Add a connection status listener to this connection's list of listeners.
|
boolean |
cancelJob(String jobId)
Cancel the job with the specified id.
|
List<JPPFJob> |
close()
Shutdown this client and retrieve all pending executions for resubmission.
|
protected void |
configure(String uuid,
String name,
String host,
int driverPort,
int priority,
boolean ssl)
Configure this client connection with the specified parameters.
|
protected abstract SocketInitializer |
createSocketInitializer()
Create a socket initializer.
|
void |
delegateStatusChanged(ClientConnectionStatusEvent event)
Invoked to notify of a status change event on a client connection.
|
protected void |
fireStatusChanged(JPPFClientConnectionStatus oldStatus)
Notify all listeners that the status of this connection has changed.
|
JPPFJob |
getCurrentJob()
Get the object that holds the tasks, data provider and submission mode for the current execution.
|
JMXDriverConnectionWrapper |
getJmxConnection()
Get the object that provides access to the management functions of the driver.
|
int |
getPriority()
Get the priority assigned to this connection.
|
JPPFClientConnectionStatus |
getStatus()
Get the status of this connection.
|
JPPFSystemInformation |
getSystemInfo()
Get the system information.
|
abstract void |
init()
Initialize this client connection.
|
void |
initializeJmxConnection()
Initialize the jmx connection using the specified jmx server id.
|
boolean |
isClosed()
Determine whether this connection has been shut down;
|
boolean |
isSSL()
Determines if this connection is over SSL.
|
protected void |
processStatusChanged(JPPFClientConnectionStatus delegateStatus,
JPPFClientConnectionStatus taskConnectionStatus)
Handle a status change from either the class server delegate or the task server connection
and determine whether it triggers a status change for the client connection.
|
void |
removeClientConnectionStatusListener(ClientConnectionStatusListener listener)
Remove a connection status listener from this connection's list of listeners.
|
JPPFTaskBundle |
sendHandshakeJob()
Send a handshake job to the server.
|
void |
setCurrentJob(JPPFJob currentExecution)
Set the object that holds the tasks, data provider and submission mode for the current execution.
|
void |
setPriority(int priority)
Set the priority assigned to this connection.
|
void |
setStatus(JPPFClientConnectionStatus status)
Set the status of this connection.
|
void |
taskServerConnectionStatusChanged(ClientConnectionStatusEvent event)
Invoked to notify of a status change event on a client connection.
|
String |
toString()
Get a string representation of this client connection.
|
getClient, getConnectionUuid, getDelegate, getHost, getName, getPort, getSerializationHelperClassName, getTaskServerConnection, getUuid, makeHelper, makeHelper, receiveBundleAndResults, receiveResults, receiveResults, sendTasks, setSerializationHelperClassName, toDebugStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsubmitprotected int priority
protected final List<ClientConnectionStatusListener> listeners
protected ClientConnectionStatusListener[] listenersArray
protected boolean closed
protected String displayName
protected boolean ssl
protected JMXDriverConnectionWrapper jmxConnection
protected int jmxPort
protected TypedProperties props
protected void configure(String uuid, String name, String host, int driverPort, int priority, boolean ssl)
uuid - the remote driver's UUID.name - configuration name for this local client.host - the name or IP address of the host the JPPF driver is running on.driverPort - the TCP port the JPPF driver listening to for submitted tasks.priority - the assigned to this client connection.ssl - determines whether the communication via the server is done via SSL.public abstract void init()
init in interface JPPFClientConnectioninit in class BaseJPPFClientConnectionJPPFClientConnection.init()public int getPriority()
JPPFClientConnection.getPriority()public void setPriority(int priority)
priority - a priority as an int value.public JPPFClientConnectionStatus getStatus()
JPPFClientConnectionStatus enumerated value.ClientConnectionStatusHandler.getStatus()public void setStatus(JPPFClientConnectionStatus status)
status - 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 void fireStatusChanged(JPPFClientConnectionStatus oldStatus)
oldStatus - the connection status before the change.public String toString()
toString in class ObjectObject.toString()protected abstract SocketInitializer createSocketInitializer()
createSocketInitializer in class BaseJPPFClientConnectionSocketInitializer.public JPPFJob getCurrentJob()
JPPFJob instance.public void setCurrentJob(JPPFJob currentExecution)
currentExecution - a ClientExecution instance.public boolean cancelJob(String jobId) throws Exception
jobId - the id of the job to cancel.true when cancel was successful false otherwise.Exception - if any error occurs.DriverJobManagementMBean.cancelJob(java.lang.String)public void delegateStatusChanged(ClientConnectionStatusEvent event)
event - the event to notify of.ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)public void taskServerConnectionStatusChanged(ClientConnectionStatusEvent event)
event - the event to notify of.ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)protected void processStatusChanged(JPPFClientConnectionStatus delegateStatus, JPPFClientConnectionStatus taskConnectionStatus)
delegateStatus - status of the class server delegate connection.taskConnectionStatus - status of the task server connection.public boolean isSSL()
JPPFClientConnectiontrue if this is an SSL connection, false otherwise.public JPPFSystemInformation getSystemInfo()
JPPFSystemInformation instance.public JPPFTaskBundle sendHandshakeJob() throws Exception
BaseJPPFClientConnectionsendHandshakeJob in class BaseJPPFClientConnectionException - if an error occurs while sending the request.public void initializeJmxConnection()
public JMXDriverConnectionWrapper getJmxConnection()
JMXConnectionWrapper instance.public List<JPPFJob> close()
close in interface JPPFClientConnectionclose in class BaseJPPFClientConnectionJPPFJob instances to resubmit; this list may be empty, but never null.JPPFClientConnection.close()public boolean isClosed()
true if this connection has been closed, false otherwise.Copyright © 2005-2012 JPPF Team.