org.jppf.jca.work
Class JPPFJcaClient

java.lang.Object
  extended by org.jppf.client.AbstractJPPFClient
      extended by org.jppf.client.AbstractGenericClient
          extended by org.jppf.jca.work.JPPFJcaClient
All Implemented Interfaces:
EventListener, ClientConnectionStatusListener

public class JPPFJcaClient
extends 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.

Author:
Laurent Cohen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jppf.client.AbstractGenericClient
AbstractGenericClient.ConnectionInitializer
 
Field Summary
 
Fields inherited from class org.jppf.client.AbstractGenericClient
availableConnections, config, executor, loadBalancer, receiverThread
 
Fields inherited from class org.jppf.client.AbstractJPPFClient
allConnections, credentials, listeners, pools, totalTaskCount, uuid
 
Constructor Summary
JPPFJcaClient(String uuid, String configuration)
          Initialize this client with a specified application UUID.
 
Method Summary
 void close()
          Close this client and release all the resources it is using.
protected  AbstractJPPFClientConnection createConnection(String uuid, String name, JPPFConnectionInformation info)
          Create a new driver connection based on the specified parameters.
 JPPFSubmissionManager getSubmissionManager()
          Get the submission manager for thsi JPPF client.
protected  void initConfig(Object configuration)
          Initialize this client's configuration.
 void setSubmissionManager(JPPFSubmissionManager submissionManager)
          Set the submission manager for thsi JPPF client.
 void statusChanged(ClientConnectionStatusEvent event)
          Invoked when the status of a client connection has changed.
 List<JPPFTask> submit(JPPFJob job)
          Submit a JPPFJob for execution.
 
Methods inherited from class org.jppf.client.AbstractGenericClient
addRequestClassLoader, getAvailableConnections, getConfig, getExecutor, getLoadBalancer, getRequestClassLoader, handleAvailableConnection, handleAvailableConnection2, hasAvailableConnection, initPools, isLocalExecutionEnabled, newConnection, removeRequestClassLoader, setLocalExecutionEnabled
 
Methods inherited from class org.jppf.client.AbstractJPPFClient
addClientListener, connectionFailed, getAllConnectionNames, getAllConnections, getClientConnection, getClientConnection, getClientConnection, getClientConnection, getUuid, initCredentials, removeClientListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFJcaClient

public JPPFJcaClient(String uuid,
                     String configuration)
Initialize this client with a specified application UUID.

Parameters:
uuid - the unique identifier for this local client.
configuration - the object holding the JPPF configuration.
Method Detail

submit

public List<JPPFTask> submit(JPPFJob job)
                      throws Exception
Submit a JPPFJob for execution.

Specified by:
submit in class AbstractJPPFClient
Parameters:
job - the job to execute.
Returns:
the results of the tasks' execution, as a list of JPPFTask instances for a blocking job, or null if the job is non-blocking.
Throws:
Exception - if an error occurs while sending the job for execution.
See Also:
AbstractJPPFClient.submit(org.jppf.client.JPPFJob)

close

public void close()
Close this client and release all the resources it is using.

Overrides:
close in class AbstractGenericClient

statusChanged

public void statusChanged(ClientConnectionStatusEvent event)
Invoked when the status of a client connection has changed.

Specified by:
statusChanged in interface ClientConnectionStatusListener
Overrides:
statusChanged in class AbstractGenericClient
Parameters:
event - the event to notify of.
See Also:
ClientConnectionStatusListener.statusChanged(org.jppf.client.event.ClientConnectionStatusEvent)

getSubmissionManager

public JPPFSubmissionManager getSubmissionManager()
Get the submission manager for thsi JPPF client.

Returns:
a JPPFSubmissionManager instance.

setSubmissionManager

public void setSubmissionManager(JPPFSubmissionManager submissionManager)
Set the submission manager for thsi JPPF client.

Parameters:
submissionManager - a JPPFSubmissionManager instance.

createConnection

protected AbstractJPPFClientConnection createConnection(String uuid,
                                                        String name,
                                                        JPPFConnectionInformation info)
Create a new driver connection based on the specified parameters.

Specified by:
createConnection in class AbstractGenericClient
Parameters:
uuid - the uuid of the JPPF client.
name - the name of the connection.
info - the driver connection information.
Returns:
an instance of a subclass of AbstractJPPFClientConnection.

initConfig

protected void initConfig(Object configuration)
Initialize this client's configuration.

Specified by:
initConfig in class AbstractGenericClient
Parameters:
configuration - an object holding the JPPF configuration.


Copyright © 2005-2010 JPPF Team.