org.jppf.gigaspaces.test
Class GSClient

java.lang.Object
  extended by org.jppf.gigaspaces.test.GSClient

public class GSClient
extends Object

Client class used to invoke a JPPF job submission service deployed as a processing unit.

Author:
Laurent Cohen

Constructor Summary
GSClient()
          Default constructor.
 
Method Summary
 void afterPropertiesSet()
          Called after the Spring bean initialization.
static JPPFJob execute(String jobName, int nbTasks, long taskDuration)
          Initialize the Spring context, invoke the appropriate bean method, and return the results of the JPPF execution.
 JPPFService getJppfService()
          Get a proxy to the service deployed in a GS space.
 JPPFJob runJob(String jobName, int nbTasks, long taskDuration)
          Execute a job with the specified parameters, submitting it to the JPPF space.
 void setJppfService(JPPFService service)
          Set a proxy to the service deployed in a GS space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSClient

public GSClient()
Default constructor.

Method Detail

execute

public static JPPFJob execute(String jobName,
                              int nbTasks,
                              long taskDuration)
                       throws Exception
Initialize the Spring context, invoke the appropriate bean method, and return the results of the JPPF execution.

Parameters:
jobName - the name given to the JPPF job.
nbTasks - the number of tasks in the job.
taskDuration - the duration in milliseconds of each task in the job.
Returns:
the results as a JPPFJob instance.
Throws:
Exception - if any error occurs.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Called after the Spring bean initialization.

Throws:
Exception - if any error occurs.
See Also:
org.springframework.beans.factory.InitializingBean#afterPropertiesSet()

runJob

public JPPFJob runJob(String jobName,
                      int nbTasks,
                      long taskDuration)
               throws Exception
Execute a job with the specified parameters, submitting it to the JPPF space.

Parameters:
jobName - the name given to the JPPF job.
nbTasks - the number of tasks in the job.
taskDuration - the duration in milliseconds of each task in the job.
Returns:
the results as a JPPFJob instance.
Throws:
Exception - if any error occurs.

getJppfService

public JPPFService getJppfService()
Get a proxy to the service deployed in a GS space.

Returns:
a JPPFService instance.

setJppfService

public void setJppfService(JPPFService service)
Set a proxy to the service deployed in a GS space.

Parameters:
service - a JPPFService instance.


Copyright © 2005-2010 JPPF Team.