Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2006 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.campaign.action
Class Action

    java.lang.Object
      com.bea.campaign.action.Action

All Implemented Interfaces
  Serializable

Direct Known Subclasses:
  AddAdToPlaceholderAction, AddUserDiscountAction, EndStateAction, MailAction

    public abstract class Action

extends Object
implements Serializable

Base class for a campaign/scenario action.

An Action defines the behavior that will result from a rule firing in a Scenario. Actions should have the following objects set on after `init()` is called, but before `run()` is called:

- `event`: the `Event` that triggered this action.
- `random number`: the random number used during scenario execution.
- `request`: the `Request` that triggered this action.
- `scenario`: the `Scenario` this action is executed for.
- `scenario container`: the `ScenarioContainer` the scenario is part of. This should be a `Campaign`.
- `service locator`: the `ServiceLocator` to use to find services.
- `session`: the `Session` that triggered this action.
- `timestamp`: the time the event was fired.
- `user`: the profile of the user who triggered this action.

See Also
  Serialized Form

Constructor Summary
`Action()`

Method Summary
`Event` | `getEvent()` Get the event that initially triggered this action.
`Number` | `getRandom()` Get the random that was used in the scenario rules.
`Request` | `getRequest()` Get the request this Action is executing in.
`Scenario` | `getScenario()` Get the scenario that created this Action.
`ScenarioContainer` | `getScenarioContainer()` Get the that this action was created under.
`String` | `getScenarioContainerName()` Get the name of the ScenarioContainer
`String` | `getScenarioId()` Get the id of the scenario that created this Action
`String` | `getScenarioName()` Get the name of the scenario that created this Action
`ServiceLocator` | `getServiceLocator()` Get the ServiceLocator given to this action
`Session` | `getSession()` Get the session this Action is executing in.
`Timestamp` | `getTimestamp()` Get the timestamp of the event that caused this action.
`ProfileWrapper` | `getUser()` Get the user this Action is executing for.
`String` | `getUserId()` Get the userId associated with the event that triggered this Action
`abstract void` | `init(Map params)` Initialize the action with an arbitrary set of parameters.
`Object` | `locateService(String name)` Use this Action's ServiceLocator to lookup a service
`abstract void` | `run()` Run the behavior defined in the implementation of this Action.
`void` | `setEvent(Event evt)` Set the event that initially triggered this action This will be called by the ScenarioService prior to running the Action.
`void` | `setRandom(Number n)` Set the random number that was used in the scenario rules.
`void` | `setRequest(Request aRequest)` Set the request this Action is executing in This will be called by the ScenarioService prior to running the Action.
`void` | `setScenario(Scenario s)` Set the scenario that created this Action This will be called by the ScenarioService prior to running the Action.
`void` | `setScenarioContainer(ScenarioContainer s)` Set the ScenarioContainer that this action was created under This will be called by the ScenarioService prior to running the Action.
`void` | `setServiceLocator(ServiceLocator s)` Set a ServiceLocator for this Action to use.
`void` | `setSession(Session aSession)` Set the session this Action is executing in This will be called by the ScenarioService prior to running the Action.
`void` | `setTimestamp(Timestamp s)` Set the timestamp of the event that caused this action This will be called by the ScenarioService prior to running the Action.
`void` | `setUser(ProfileWrapper aUser)` Set the user this Action is executing for This will be called by the ScenarioService prior to running the Action.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Action

    public Action()

Method Detail

### run

    public abstract void run()
                      throws ActionException

  Run the behavior defined in the implementation of this Action.

  Throws
    `ActionException` - will be thrown if an error occurs

### init

    public abstract void init(Map params)
                       throws IllegalArgumentException

  Initialize the action with an arbitrary set of parameters. It is up to the provider of the Action implementation to define what these parameters are, and to do any sort of necessary error checking on them.

  Parameters
    `params` - A map of name/value pairs
  Throws
    `IllegalArgumentException` - if any required params are missing

### setServiceLocator

    public void setServiceLocator(ServiceLocator s)

  Set a ServiceLocator for this Action to use. This will be called by the ScenarioService prior to running the Action.

  Parameters
    `s` - the ServiceLocator

### getServiceLocator

    public ServiceLocator getServiceLocator()

  Get the ServiceLocator given to this action

  Returns
    this Action's ServiceLocator

### locateService

    public Object locateService(String name)

  Use this Action's ServiceLocator to lookup a service

  Parameters
    `name` - the name of the service
  Returns
    the located service, or null if it could not be found

### setEvent

    public void setEvent(Event evt)

  Set the event that initially triggered this action This will be called by the ScenarioService prior to running the Action.

### getEvent

    public Event getEvent()

  Get the event that initially triggered this action.

### setUser

    public void setUser(ProfileWrapper aUser)

  Set the user this Action is executing for This will be called by the ScenarioService prior to running the Action.

### getUser

    public ProfileWrapper getUser()

  Get the user this Action is executing for.

### getUserId

    public String getUserId()

  Get the userId associated with the event that triggered this Action

### setRequest

    public void setRequest(Request aRequest)

  Set the request this Action is executing in This will be called by the ScenarioService prior to running the Action.

### getRequest

    public Request getRequest()

  Get the request this Action is executing in.

### setSession

    public void setSession(Session aSession)

  Set the session this Action is executing in This will be called by the ScenarioService prior to running the Action.

### getSession

    public Session getSession()

  Get the session this Action is executing in.

### setScenario

    public void setScenario(Scenario s)

  Set the scenario that created this Action This will be called by the ScenarioService prior to running the Action.

### getScenario

    public Scenario getScenario()

  Get the scenario that created this Action.

### getScenarioName

    public String getScenarioName()

  Get the name of the scenario that created this Action

### getScenarioId

    public String getScenarioId()

  Get the id of the scenario that created this Action

### setScenarioContainer

    public void setScenarioContainer(ScenarioContainer s)

  Set the ScenarioContainer that this action was created under This will be called by the ScenarioService prior to running the Action.

### getScenarioContainer

    public ScenarioContainer getScenarioContainer()

  Get the that this action was created under.

### getScenarioContainerName

    public String getScenarioContainerName()

  Get the name of the ScenarioContainer

### setTimestamp

    public void setTimestamp(Timestamp s)

  Set the timestamp of the event that caused this action This will be called by the ScenarioService prior to running the Action.

### getTimestamp

    public Timestamp getTimestamp()

  Get the timestamp of the event that caused this action.

### setRandom

    public void setRandom(Number n)

  Set the random number that was used in the scenario rules. This will be called by the ScenarioService prior to running the Action.

### getRandom

    public Number getRandom()

  Get the random that was used in the scenario rules.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 BEA Systems, Inc. All Rights Reserved