Class IncrementEJBPea

java.lang.Object
  |
  +--IncrementEJBPea

public class IncrementEJBPea
extends java.lang.Object

MQSeries Workflow EJB invocation sample

This sample shows you how to invoke an EJB using the PEA and the Java High Performance Bridge

This way to invoke EJBs allows you to retrieve the Workflow containers metamodel but does not support transactions

The High Performance Bridge caches the static variables of this class this is a major advantage, but must be used with caution.


Field Summary
private static com.ibm.workflow.api.Agent agent
          MQWF embedded Agent
private  java.lang.String command
          Command to be executed in this invocation
private static com.ibm.workflow.api.ExecutionAgent exeAgent
          MQWF Execution Agent, needed for workflow container access
private static com.transarc.jmon.examples.Inc.IncHome incrementHome
          EJB home interface
private  java.lang.String instanceName
          Workflow process instance name
private static javax.naming.Context jndiContext
          JNDI naming context
 
Constructor Summary
IncrementEJBPea()
          Dummy constructor
 
Method Summary
private  int executeCommand()
          Dispatcher method that actually invokes the EJB methods
static void main(java.lang.String[] args)
          Main method, no parameter evaluation
private  void readContainer()
          Reads all needed variables from the input container and stores the values in the class variables
private  void writeContainer(int count)
          Writes the increment counter value to the output container
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

jndiContext

private static javax.naming.Context jndiContext
JNDI naming context

incrementHome

private static com.transarc.jmon.examples.Inc.IncHome incrementHome
EJB home interface

agent

private static com.ibm.workflow.api.Agent agent
MQWF embedded Agent

exeAgent

private static com.ibm.workflow.api.ExecutionAgent exeAgent
MQWF Execution Agent, needed for workflow container access

command

private java.lang.String command
Command to be executed in this invocation

instanceName

private java.lang.String instanceName
Workflow process instance name
Constructor Detail

IncrementEJBPea

public IncrementEJBPea()
Dummy constructor
Method Detail

executeCommand

private int executeCommand()
                    throws java.lang.Exception
Dispatcher method that actually invokes the EJB methods
Returns:
The value of the increment counter in the EJB
Throws:
java.lang.Exception - Any occurred exception will be rethrown unfiltered

main

public static void main(java.lang.String[] args)
Main method, no parameter evaluation

readContainer

private void readContainer()
                    throws com.ibm.workflow.api.FmcException
Reads all needed variables from the input container and stores the values in the class variables
Throws:
com.ibm.workflow.api.FmcException - Any occurred exception will be rethrown

writeContainer

private void writeContainer(int count)
                     throws com.ibm.workflow.api.FmcException
Writes the increment counter value to the output container
Parameters:
count - The value of the increment counter in the EJB
Throws:
com.ibm.workflow.api.FmcException - Any occurred exception will be rethrown