|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.AbstractJPPFClient
org.jppf.client.AbstractGenericClient
public abstract class AbstractGenericClient
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.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractGenericClient.ConnectionInitializer
Wrapper class for the initialization of a client connection. |
| Field Summary | |
|---|---|
protected Vector<JPPFClientConnection> |
availableConnections
Keeps a list of the valid connections not currently executring tasks. |
protected TypedProperties |
config
The JPPF configuration properties. |
protected ThreadPoolExecutor |
executor
The pool of threads used for submitting execution requests. |
protected LoadBalancer |
loadBalancer
The load balancer for local versus remote execution. |
protected org.jppf.client.JPPFMulticastReceiverThread |
receiverThread
Performs server discovery. |
| Fields inherited from class org.jppf.client.AbstractJPPFClient |
|---|
allConnections, credentials, listeners, pools, totalTaskCount, uuid |
| Constructor Summary | |
|---|---|
AbstractGenericClient(Object configuration)
Initialize this client with an automatically generated application UUID. |
|
AbstractGenericClient(String uuid,
Object configuration)
Initialize this client with a specified application UUID. |
|
| Method Summary | |
|---|---|
void |
addRequestClassLoader(String uuid,
ClassLoader cl)
Add a request uuid to class loader mapping to this submission manager. |
void |
close()
Close this client and release all the resources it is using. |
protected abstract AbstractJPPFClientConnection |
createConnection(String uuid,
String name,
JPPFConnectionInformation info)
Create a new driver connection based on the specified parameters. |
Vector<JPPFClientConnection> |
getAvailableConnections()
Get the list of available connections. |
TypedProperties |
getConfig()
Get the JPPF configuration properties. |
ThreadPoolExecutor |
getExecutor()
Get the pool of threads used for submitting execution requests. |
LoadBalancer |
getLoadBalancer()
Get the load balancer for local versus remote execution. |
ClassLoader |
getRequestClassLoader(String uuid)
Get a class loader from its request uuid. |
Pair<Boolean,Boolean> |
handleAvailableConnection()
Determine whether there is a client connection available for execution. |
boolean |
handleAvailableConnection2()
Determine whether there is a client connection available for execution. |
boolean |
hasAvailableConnection()
Determine whether there is a client connection available for execution. |
protected abstract void |
initConfig(Object configuration)
Initialize this client's configuration. |
protected void |
initPools()
Read all client connection information from the configuration and initialize the connection pools accordingly. |
boolean |
isLocalExecutionEnabled()
Determine whether local execution is enabled on this client. |
void |
newConnection(JPPFClientConnection c)
Invoked when a new connection is created. |
void |
removeRequestClassLoader(String uuid)
Add a request uuid to class loader mapping to this submission manager. |
void |
setLocalExecutionEnabled(boolean localExecutionEnabled)
Specifiy whether local execution is enabled on this client. |
void |
statusChanged(ClientConnectionStatusEvent event)
Invoked when the status of a client connection has changed. |
| Methods inherited from class org.jppf.client.AbstractJPPFClient |
|---|
addClientListener, connectionFailed, getAllConnectionNames, getAllConnections, getClientConnection, getClientConnection, getClientConnection, getClientConnection, getUuid, initCredentials, removeClientListener, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ThreadPoolExecutor executor
protected TypedProperties config
protected org.jppf.client.JPPFMulticastReceiverThread receiverThread
protected LoadBalancer loadBalancer
protected Vector<JPPFClientConnection> availableConnections
| Constructor Detail |
|---|
public AbstractGenericClient(Object configuration)
configuration - the object holding the JPPF configuration.
public AbstractGenericClient(String uuid,
Object configuration)
uuid - the unique identifier for this local client.configuration - the object holding the JPPF configuration.| Method Detail |
|---|
protected abstract void initConfig(Object configuration)
configuration - an object holding the JPPF configuration.protected void initPools()
initPools in class AbstractJPPFClient
protected abstract AbstractJPPFClientConnection createConnection(String uuid,
String name,
JPPFConnectionInformation info)
uuid - the uuid of the JPPF client.name - the name of the connection.info - the driver connection information.
AbstractJPPFClientConnection.public void newConnection(JPPFClientConnection c)
newConnection in class AbstractJPPFClientc - the connection that failed.AbstractJPPFClient.newConnection(org.jppf.client.JPPFClientConnection)public void close()
close in class AbstractJPPFClientpublic LoadBalancer getLoadBalancer()
LoadBalancer instance.public TypedProperties getConfig()
TypedProperties 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.public 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 Pair<Boolean,Boolean> handleAvailableConnection()
public boolean handleAvailableConnection2()
public void statusChanged(ClientConnectionStatusEvent event)
statusChanged in interface ClientConnectionStatusListenerstatusChanged in class AbstractJPPFClientevent - the event to notify of.ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)public Vector<JPPFClientConnection> getAvailableConnections()
public ThreadPoolExecutor getExecutor()
ThreadPoolExecutor instance.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||