public abstract class AbstractGenericClient extends AbstractJPPFClient
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractGenericClient.RegisteredClassLoader
Helper class for managing registered class loaders.
|
| Modifier and Type | Field and Description |
|---|---|
protected ThreadPoolExecutor |
executor
The pool of threads used for submitting execution requests.
|
protected org.jppf.client.JPPFMulticastReceiverThread |
receiverThread
Performs server discovery.
|
protected boolean |
sslEnabled
Determines whether SSL communication is on or off.
|
protected static String |
VALUE_JPPF_DISCOVERY
Constant for JPPF automatic connection discovery
|
totalTaskCount, uuid| Constructor and Description |
|---|
AbstractGenericClient(String uuid,
Object configuration,
ClientListener... listeners)
Initialize this client with a specified application UUID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestClassLoader(String uuid,
ClassLoader cl)
Add a request uuid to class loader mapping to this submission manager.
|
boolean |
cancelJob(String jobId)
Cancel the job with the specified id.
|
void |
close()
Close this client and release all the resources it is using.
|
protected void |
connectionFailed(JPPFClientConnection c)
Invoked when the status of a connection has changed to
JPPFClientConnectionStatus.FAILED. |
protected abstract AbstractJPPFClientConnection |
createConnection(String uuid,
String name,
JPPFConnectionInformation info,
boolean ssl)
Create a new driver connection based on the specified parameters.
|
protected abstract SubmissionManager |
createSubmissionManager()
Create the submission manager for this JPPF client.
|
TypedProperties |
getConfig()
Get JPPF configuration properties.
|
ThreadPoolExecutor |
getExecutor()
Get the pool of threads used for submitting execution requests.
|
ClassLoader |
getRequestClassLoader(String uuid)
Get a class loader from its request uuid.
|
boolean |
hasAvailableConnection()
Determine whether there is a client connection available for execution.
|
protected abstract TypedProperties |
initConfig(Object configuration)
Initialize this client's configuration.
|
protected void |
initPools(TypedProperties config)
Read all client connection information from the configuration and initialize
the connection pools accordingly.
|
protected void |
initRemotePools(TypedProperties props)
Initialize remote connection pools according to configuration.
|
boolean |
isLocalExecutionEnabled()
Determine whether local execution is enabled on this client.
|
void |
newConnection(JPPFClientConnection c)
Invoked when a new connection is created.
|
protected void |
newConnection(String name,
JPPFConnectionInformation info,
int priority,
int poolSize,
boolean ssl)
Called when a new connection is read from the configuration (as opposed to discovered from the network).
|
AbstractGenericClient.RegisteredClassLoader |
registerClassLoader(ClassLoader cl,
String uuid)
Register class loader with this submission manager.
|
void |
removeRequestClassLoader(String uuid)
Add a request uuid to class loader mapping to this submission manager.
|
void |
setLocalExecutionEnabled(boolean localExecutionEnabled)
Specify whether local execution is enabled on this client.
|
protected void |
setSubmissionManager(SubmissionManager submissionManager)
Set the submission manager for this JPPF client.
|
void |
statusChanged(ClientConnectionStatusEvent event)
Invoked when the status of a client connection has changed.
|
protected void |
unregister(AbstractGenericClient.RegisteredClassLoader registeredClassLoader)
Unregisters class loader from this submission manager.
|
addClientConnection, addClientListener, fireConnectionFailed, fireNewConnection, getAllConnectionNames, getAllConnections, getAllConnectionsCount, getClientConnection, getClientConnection, getClientConnection, getClientConnection, getUuid, initCredentials, isClosed, removeClientConnection, removeClientListener, submitprotected static final String VALUE_JPPF_DISCOVERY
protected ThreadPoolExecutor executor
protected org.jppf.client.JPPFMulticastReceiverThread receiverThread
protected boolean sslEnabled
public AbstractGenericClient(String uuid, Object configuration, ClientListener... listeners)
uuid - the unique identifier for this local client.configuration - the object holding the JPPF configuration.listeners - the listeners to add to this JPPF client to receive notifications of new connections.public TypedProperties getConfig()
TypedProperties instance. With JPPF configuration.protected abstract TypedProperties initConfig(Object configuration)
configuration - an object holding the JPPF configuration.TypedProperties instance holding JPPF configuration. Never be null.protected void initPools(TypedProperties config)
AbstractJPPFClientinitPools in class AbstractJPPFClientconfig - The JPPF configuration properties.protected void initRemotePools(TypedProperties props)
props - The JPPF configuration properties.protected void newConnection(String name, JPPFConnectionInformation info, int priority, int poolSize, boolean ssl)
name - the name assigned to the connection.info - the information required for the connection to connect to the driver.priority - the priority assigned to the connection.poolSize - the size of the associated connection pool.ssl - determines whether this is an SSL connection.protected abstract AbstractJPPFClientConnection createConnection(String uuid, String name, JPPFConnectionInformation info, boolean ssl)
uuid - the uuid of the JPPF client.name - the name of the connection.info - the driver connection information.ssl - determines whether this is an SSL connection.AbstractJPPFClientConnection.public void newConnection(JPPFClientConnection c)
newConnection in class AbstractJPPFClientc - the connection that failed.AbstractJPPFClient.newConnection(org.jppf.client.JPPFClientConnection)protected void connectionFailed(JPPFClientConnection c)
JPPFClientConnectionStatus.FAILED.connectionFailed in class AbstractJPPFClientc - the connection that failed.public void close()
close in class AbstractJPPFClientpublic boolean isLocalExecutionEnabled()
true if local execution is enabled, false otherwise.public void setLocalExecutionEnabled(boolean localExecutionEnabled)
localExecutionEnabled - true to enable local execution, false otherwisepublic boolean hasAvailableConnection()
public void statusChanged(ClientConnectionStatusEvent event)
AbstractJPPFClientstatusChanged in interface ClientConnectionStatusListenerstatusChanged in class AbstractJPPFClientevent - the event to notify of.ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)public ThreadPoolExecutor getExecutor()
ThreadPoolExecutor instance.public void addRequestClassLoader(String uuid, ClassLoader cl)
uuid - the uuid of the request.cl - the class loader for the request.public void removeRequestClassLoader(String uuid)
uuid - the uuid of the request.public ClassLoader getRequestClassLoader(String uuid)
uuid - the uuid of the request.ClassLoader instance, or null if none exists for the key.protected void setSubmissionManager(SubmissionManager submissionManager)
submissionManager - a JPPFSubmissionManager instance.protected abstract SubmissionManager createSubmissionManager()
JPPFSubmissionManager 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 AbstractGenericClient.RegisteredClassLoader registerClassLoader(ClassLoader cl, String uuid)
cl - a ClassLoader instance.uuid - unique id assigned to classLoader. Added as temporary fix for problems hanging jobs.RegisteredClassLoader instance.protected void unregister(AbstractGenericClient.RegisteredClassLoader registeredClassLoader)
registeredClassLoader - a RegisteredClassLoader instance.Copyright © 2005-2012 JPPF Team.