|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.client.AbstractJPPFClient
public abstract class AbstractJPPFClient
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 List<JPPFClientConnection> |
allConnections
A list of all the connections initially created. |
protected JPPFSecurityContext |
credentials
Security credentials associated with the application. |
protected List<ClientListener> |
listeners
List of listeners to this JPPF client. |
protected TreeMap<Integer,org.jppf.client.ClientPool> |
pools
Contains all the connections pools in ascending priority order. |
protected int |
totalTaskCount
Total count of the tasks submitted by this client. |
protected String |
uuid
Unique universal identifier for this JPPF client. |
| Constructor Summary | |
|---|---|
protected |
AbstractJPPFClient()
Initialize this client with an automatically generated application UUID. |
protected |
AbstractJPPFClient(String uuid)
Initialize this client with a specified application UUID. |
| Method Summary | |
|---|---|
void |
addClientListener(ClientListener listener)
Add a listener to the list of listeners to this client. |
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. |
List<String> |
getAllConnectionNames()
Get the names of all the client connections handled by this JPPFClient. |
List<JPPFClientConnection> |
getAllConnections()
Get all the client connections handled by this JPPFClient. |
JPPFClientConnection |
getClientConnection()
Get an available connection with the highest possible priority. |
JPPFClientConnection |
getClientConnection(boolean oneAttempt)
Get an available connection with the highest possible priority. |
JPPFClientConnection |
getClientConnection(boolean oneAttempt,
boolean anyState)
Get an available connection with the highest possible priority. |
JPPFClientConnection |
getClientConnection(String name)
Get a connection given its name. |
String |
getUuid()
Get the unique universal identifier for this JPPF client. |
void |
initCredentials()
Initialize this client's security credentials. |
protected abstract void |
initPools()
Read all client connection information from the configuration and initialize the connection pools accordingly. |
void |
newConnection(JPPFClientConnection c)
Notify all listeners that a new connection was created. |
void |
removeClientListener(ClientListener listener)
Remove a listener from the list of listeners to this client. |
void |
statusChanged(ClientConnectionStatusEvent event)
Invoked when the status of a client connection has changed. |
abstract List<JPPFTask> |
submit(JPPFJob job)
Submit a JPPFJob for execution. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JPPFSecurityContext credentials
protected int totalTaskCount
protected TreeMap<Integer,org.jppf.client.ClientPool> pools
protected String uuid
protected List<JPPFClientConnection> allConnections
protected List<ClientListener> listeners
| Constructor Detail |
|---|
protected AbstractJPPFClient()
protected AbstractJPPFClient(String uuid)
uuid - the unique identifier for this local client.| Method Detail |
|---|
protected abstract void initPools()
public List<JPPFClientConnection> getAllConnections()
JPPFClientConnection instances.public List<String> getAllConnectionNames()
public JPPFClientConnection getClientConnection(String name)
name - the name of the connection to find.
JPPFClientConnection with the highest possible priority.public JPPFClientConnection getClientConnection()
JPPFClientConnection with the highest possible priority.public JPPFClientConnection getClientConnection(boolean oneAttempt)
oneAttempt - determines whether this method should wait until a connection
becomes available (ACTIVE status) or fail immeditately if no available connection is found.JPPFClientConnection with the highest possible priority.
public JPPFClientConnection getClientConnection(boolean oneAttempt,
boolean anyState)
oneAttempt - determines whether this method should wait until a connection
becomes available (ACTIVE status) or fail immeditately if no available connection is found.anyState - specifies whether this method should look for an active connection or not care about the connection state.
JPPFClientConnection with the highest possible priority.
public void initCredentials()
throws Exception
Exception - if an error is raised during initialization.
public abstract List<JPPFTask> submit(JPPFJob job)
throws Exception
job - the job to execute.
JPPFTask instances for a blocking job, or null if the job is non-blocking.
Exception - if an error occurs while sending the job for execution.public void statusChanged(ClientConnectionStatusEvent event)
statusChanged in interface ClientConnectionStatusListenerevent - the event to notify of.ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)protected void connectionFailed(JPPFClientConnection c)
JPPFClientConnectionStatus.FAILED.
c - the connection that failed.public void close()
public void addClientListener(ClientListener listener)
listener - the listener to add.public void removeClientListener(ClientListener listener)
listener - the listener to remove.public void newConnection(JPPFClientConnection c)
c - the connection that was created.public String getUuid()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||