Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop batch applications > Develop batch applications
Develop a simple compute-intensive application
We can write a simple compute-intensive application using a compute-intensive job controller, the command line, or the Apache ANT tool.
Procedure
- Create a compute-intensive job using a compute-intensive job controller.
- Create a compute-intensive job step.
- Create a Java class that implements the com.ibm.websphere.ci.CIWork interface.
- Implement business logic.
- Declare a compute-intensive job controller.
- Add a stateless session bean to your deployment descriptor and point to the implementation class that the product provides.
Do so by specifying com.ibm.ws.ci.CIControllerBean as the bean class. Do this specification only once per compute-intensive application.
- Use com.ibm.ws.ci.CIControllerHome for the remote home interface class and com.ibm.ws.ci.CIController for the remote interface class.
- Configure the EJB deployment descriptor.
- Configure a resource reference on the controller bean to the WorkManager wm/CIWorkManager default of the type commonj.work.WorkManager.
- Create compute-intensive jobs using the command line.
- Create a compute-intensive job step.
- Create a Java class that implements the com.ibm.websphere.ci.CIWork interface.
- Implement business logic.
- Open a command prompt and ensure that the directory where your Java executable program is located is included in your PATH variable so that you can run the Java command.
- Issue the following command.
java -jar pgcbatchpackager.jar -appname= <application name> -jarfile= <jarfile containing POJO step classes> -earfile= <name of the output ear file without .ear> [-utilityjars= <semicolon separated list of utility jars>] [-debug] [-gridjob]For example for batch jobs, issue
java –jar pgcbatchpackager.jar –appname=SimpleCI –jarfile=SimpleCIEJBs.jar -earfile=SimpleCI –gridjob=true
- Create compute-intensive jobs using ANT.
- Create the compute-intensive job step.
- Create a Java class that implements the com.ibm.websphere.ci.CIWork interface.
- Implement business logic.
- For a compute-intensive job, ensure that the pgcbatchpackager.jar is on the class path.
- Declare the task.
Use the following command to declare the task:
<taskdef name="pgcpackager" classname="com.ibm.ws.batch.packager.PGCPackager" classpath="${FEBaseDir}/grid.pgc.packager/build/lib/pgcbatchpackager.jar" />
- After compiling the Java files in the application, invoke the pgcpackager task.
<pgcpackager appname=" <appname>" earFile=" <location name of EAR file to generate>" jarfile="location of the POJO jar file" gridJob="true"/>
Results
You have developed a simple compute-intensive application using a compute-intensive job controller, the command line, or ANT.
What to do next
Install the compute-intensive application and configure WebSphere grid endpoints.
Compute-intensive programming model
xJCL elements
Configure WebSphere grid endpoints
Deploy batch applications