|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.AbstractJPPFClientConnection
public abstract class AbstractJPPFClientConnection
This class provides an API to submit execution requests and administration
commands, and request server information data.
It has its own unique identifier, used by the nodes, to determine whether
classes from the submitting application should be dynamically reloaded or not
depending on whether the uuid has changed or not.
| Field Summary | |
|---|---|
protected String |
appUuid
Unique identifier for this JPPF client. |
protected int |
classServerPort
The TCP port the class server is listening to. |
protected AbstractGenericClient |
client
The JPPF client that owns this connection. |
protected String |
connectionUuid
Unique ID for this connection and its two channels. |
protected JPPFSecurityContext |
credentials
Security credentials associated with the application. |
protected ClassServerDelegate |
delegate
Enables loading local classes onto remote nodes. |
protected String |
host
The name or IP address of the host the JPPF driver is running on. |
protected boolean |
isShutdown
Determines whether this connection has been shut down; |
protected JPPFJob |
job
Holds the tasks, data provider and submission mode for the current execution. |
protected List<ClientConnectionStatusListener> |
listeners
List of status listeners for this connection. |
protected String |
name
Configuration name for this local client. |
protected int |
port
The TCP port the JPPF driver listening to for submitted tasks. |
protected int |
priority
Priority given to the driver this client is connected to. |
protected AtomicReference<JPPFClientConnectionStatus> |
status
Status of the connection. |
protected Object |
statusLock
Used to synchronize access to the status. |
protected TaskServerConnectionHandler |
taskServerConnection
Handler for the connection to the task server. |
protected int |
totalTaskCount
Total count of the tasks submitted by this client. |
| Constructor Summary | |
|---|---|
AbstractJPPFClientConnection()
|
|
| Method Summary | |
|---|---|
void |
addClientConnectionStatusListener(ClientConnectionStatusListener listener)
Add a connection status listener to this connection's list of listeners. |
abstract 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 classServerPort,
int priority)
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. |
AbstractGenericClient |
getClient()
Get the JPPF client that owns this connection. |
String |
getConnectionUuid()
Get the unique ID for this connection and its two channels. |
JPPFJob |
getCurrentJob()
Get the object that holds the tasks, data provider and submission mode for the current execution. |
LoadBalancer |
getLoadBalancer()
Get the load balancer that distributes the load between local and remote execution. |
String |
getName()
Get the name assigned tothis client connection. |
int |
getPriority()
Get the priority assigned to this connection. |
protected String |
getSerializationHelperClassName()
Get the name of the serialization helper implementation class name to use. |
JPPFClientConnectionStatus |
getStatus()
Get the status of this connection. |
TaskServerConnectionHandler |
getTaskServerConnection()
Get the handler for the connection to the task server. |
abstract void |
init()
Initialize this client connection. |
void |
initCredentials()
Initialize this client's security credentials. |
protected SerializationHelper |
makeHelper()
Instantiate a SerializationHelper using the current context class loader. |
protected SerializationHelper |
makeHelper(ClassLoader cl)
Instantiate a SerializationHelper using the current context class loader. |
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. |
Pair<List<JPPFTask>,Integer> |
receiveResults()
Receive results of tasks execution. |
Pair<List<JPPFTask>,Integer> |
receiveResults(ClassLoader cl)
Receive results of tasks execution. |
void |
removeClientConnectionStatusListener(ClientConnectionStatusListener listener)
Remove a connection status listener from this connection's list of listeners. |
void |
sendTasks(JPPFJob job)
Send tasks to the server for execution. |
void |
sendTasks(JPPFTaskBundle header,
JPPFJob job)
Send tasks to the server for execution. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jppf.client.JPPFClientConnection |
|---|
submit |
| Field Detail |
|---|
protected TaskServerConnectionHandler taskServerConnection
protected ClassServerDelegate delegate
protected String appUuid
protected final String connectionUuid
protected String host
protected int port
protected int classServerPort
protected JPPFSecurityContext credentials
protected int totalTaskCount
protected String name
protected int priority
protected AtomicReference<JPPFClientConnectionStatus> status
protected Object statusLock
protected List<ClientConnectionStatusListener> listeners
protected JPPFJob job
protected boolean isShutdown
protected AbstractGenericClient client
| Constructor Detail |
|---|
public AbstractJPPFClientConnection()
| Method Detail |
|---|
protected void configure(String uuid,
String name,
String host,
int driverPort,
int classServerPort,
int priority)
uuid - the unique identifier for this local client.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.classServerPort - the TCP port the class server is listening to.priority - the assigned to this client connection.public abstract void init()
init in interface JPPFClientConnectionJPPFClientConnection.init()
public void initCredentials()
throws Exception
Exception - if an error is raised during initialization.
public void sendTasks(JPPFJob job)
throws Exception
job - - the job to execute remotely.
Exception - if an error occurs while sending the request.
public void sendTasks(JPPFTaskBundle header,
JPPFJob job)
throws Exception
header - the task bundle to send to the driver.job - the job to execute remotely.
Exception - if an error occurs while sending the request.
public Pair<List<JPPFTask>,Integer> receiveResults()
throws Exception
Exception - if an error is raised while reading the results from the server.
public Pair<List<JPPFTask>,Integer> receiveResults(ClassLoader cl)
throws Exception
cl - the cintext classloader to use to deserialize the results.
Exception - if an error is raised while reading the results from the server.
protected SerializationHelper makeHelper()
throws Exception
SerializationHelper using the current context class loader.
SerializationHelper instance.
Exception - if the serialiozation helper could not be instantiated.
protected SerializationHelper makeHelper(ClassLoader cl)
throws Exception
SerializationHelper using the current context class loader.
cl - the class loader to usew to load the seriaization helper class.
SerializationHelper instance.
Exception - if the serialiozation helper could not be instantiated.protected String getSerializationHelperClassName()
SerializationHelper implementation.public int getPriority()
getPriority in interface JPPFClientConnectionJPPFClientConnection.getPriority()public void setPriority(int priority)
priority - a priority as an int value.public JPPFClientConnectionStatus getStatus()
getStatus in interface ClientConnectionStatusHandlerJPPFClientConnectionStatus enumerated value.ClientConnectionStatusHandler.getStatus()public void setStatus(JPPFClientConnectionStatus status)
setStatus in interface ClientConnectionStatusHandlerstatus - a JPPFClientConnectionStatus enumerated value.ClientConnectionStatusHandler.setStatus(org.jppf.client.JPPFClientConnectionStatus)public void addClientConnectionStatusListener(ClientConnectionStatusListener listener)
addClientConnectionStatusListener in interface ClientConnectionStatusHandlerlistener - the listener to add to the list.ClientConnectionStatusHandler.addClientConnectionStatusListener(org.jppf.client.event.ClientConnectionStatusListener)public void removeClientConnectionStatusListener(ClientConnectionStatusListener listener)
removeClientConnectionStatusListener in interface ClientConnectionStatusHandlerlistener - 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 abstract List<JPPFJob> close()
close in interface JPPFClientConnectionJPPFJob instances to resubmit.JPPFClientConnection.close()public String getName()
getName in interface JPPFClientConnectionJPPFClientConnection.getName()public String toString()
toString in class ObjectObject.toString()protected abstract SocketInitializer createSocketInitializer()
SocketInitializer.public JPPFJob getCurrentJob()
JPPFJob instance.public void setCurrentJob(JPPFJob currentExecution)
currentExecution - a ClientExecution instance.public TaskServerConnectionHandler getTaskServerConnection()
TaskServerConnectionHandler instance.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 conneciton.taskConnectionStatus - status of the task server connection.public LoadBalancer getLoadBalancer()
LoadBalancer instance.public AbstractGenericClient getClient()
AbstractGenericClient instance.public String getConnectionUuid()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||