com.ibm.workflow.portlet.sample
Class StarterPEAHandler

java.lang.Object
  |
  +--com.ibm.workflow.portlet.client.GenericCommandHandler
        |
        +--com.ibm.workflow.portlet.sample.StarterPEAHandler
All Implemented Interfaces:
CommandHandler

public class StarterPEAHandler
extends GenericCommandHandler

This CommandHandler automatically starts and stops the Program Execution Agent for the Web user.

This sample demonstrates how to use the onLogon and onLogoff hooks.

For details on how to run this sample, see the Samples section.


Constructor Summary
StarterPEAHandler()
           
 
Method Summary
 java.lang.String getHandlerInfo()
          Returns information about the handler, such as author, version, and copyright.
 void init(Config config)
          Initializes the handler and caches the Web user, if configured.
 void onLogoff(SessionContext context)
          Shuts down the Web user's PEA if called for the Web user ID.
 void onLogon(RequestContext context)
          Start the Web user's PEA called for the Web user ID and if enabled in PortalClient.properties.
 
Methods inherited from class com.ibm.workflow.portlet.client.GenericCommandHandler
destroy, execute, getConfig, getContext, getCredentials, getSessionContext, getTriggerTagFor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarterPEAHandler

public StarterPEAHandler()
Method Detail

getHandlerInfo

public java.lang.String getHandlerInfo()
Returns information about the handler, such as author, version, and copyright.
Overrides:
getHandlerInfo in class GenericCommandHandler
Returns:
a String containing handler information

init

public void init(Config config)
Initializes the handler and caches the Web user, if configured. This feature has to be enabled in PortalClient.properties by setting StarterUserID and StarterPEA.
Overrides:
init in class GenericCommandHandler
Parameters:
config - The servlet's configuration and initialization parameters

onLogon

public void onLogon(RequestContext context)
Start the Web user's PEA called for the Web user ID and if enabled in PortalClient.properties. If the PEA already is running, it will be receycled.
Overrides:
onLogon in class GenericCommandHandler
Parameters:
context - The RequestContext of the newly added session

onLogoff

public void onLogoff(SessionContext context)
Shuts down the Web user's PEA if called for the Web user ID. Note that this will only happen if you terminate your Web application properly. There is no way to explicitely log off the Web user.
Overrides:
onLogoff in class GenericCommandHandler
Parameters:
context - The SessionContext of the session to be removed


© Copyright IBM Corporation 2002, 2007. All Rights Reserved.