org.apache.agila.impl.memory
Class TokenServiceImpl

java.lang.Object
  extended by org.apache.agila.impl.memory.TokenServiceImpl
All Implemented Interfaces:
TokenService

public class TokenServiceImpl
extends java.lang.Object
implements TokenService

Version:
$Id: $
Author:
Geir Magnusson Jr.

Constructor Summary
TokenServiceImpl()
           
 
Method Summary
 java.util.List getActiveTokensForInstance(InstanceID instanceID)
          Returns all tokens active for a given execution instance of a business process
 java.util.List getParallelTokens(TokenID tokenID)
          Returns a set of tokens that are considered 'parallel' to a given tokenID Parallel tokens are any tokens that can trace their lineage to the first common ancestor N T1 T2 <- parallel tokens N N1 T1 T2 N2 | T3 T4 | N3 | T5 | N4 So N4 asking about T2 could get T1 or T3 and/or T4 or T5, depending on execution timing.
 Token getTokenByID(TokenID tokenID)
          Fetches a token from the token store
 Token newToken(InstanceID instanceID, NodeID nodeID, int state)
          token factory - creates a new token with valid token ID.
 Token[] nextToken(Connection[] connSet, Token parentToken)
          Returns a set of tokens, advanced along the connections given.
 boolean saveToken(Token t)
          Saves the state of a token after modification or update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenServiceImpl

public TokenServiceImpl()
Method Detail

getActiveTokensForInstance

public java.util.List getActiveTokensForInstance(InstanceID instanceID)
Description copied from interface: TokenService
Returns all tokens active for a given execution instance of a business process

Specified by:
getActiveTokensForInstance in interface TokenService
Returns:
list of Token instances for this instances

saveToken

public boolean saveToken(Token t)
Description copied from interface: TokenService
Saves the state of a token after modification or update

Specified by:
saveToken in interface TokenService
Returns:
true if successfully saved, false otherwise

newToken

public Token newToken(InstanceID instanceID,
                      NodeID nodeID,
                      int state)
Description copied from interface: TokenService
token factory - creates a new token with valid token ID. Implementation should persist the token before returning if a persisting implementation

Specified by:
newToken in interface TokenService
Returns:
new Token associated w/ an instance/node/state

nextToken

public Token[] nextToken(Connection[] connSet,
                         Token parentToken)
Returns a set of tokens, advanced along the connections given. The implementation is responsible for tracking 'fork trees', to provide for join resolution in 'getParallelTokens()'

Specified by:
nextToken in interface TokenService
Parameters:
connSet -
parentToken -
Returns:

getTokenByID

public Token getTokenByID(TokenID tokenID)
Description copied from interface: TokenService
Fetches a token from the token store

Specified by:
getTokenByID in interface TokenService
Returns:
toke matching the id, or null if not found

getParallelTokens

public java.util.List getParallelTokens(TokenID tokenID)
Description copied from interface: TokenService
Returns a set of tokens that are considered 'parallel' to a given tokenID Parallel tokens are any tokens that can trace their lineage to the first common ancestor N T1 T2 <- parallel tokens N N1 T1 T2 N2 | T3 T4 | N3 | T5 | N4 So N4 asking about T2 could get T1 or T3 and/or T4 or T5, depending on execution timing. N1 T1 T2 N2 N3 T3 T4 T5 T6 N4 N5 T7 T8 N6 So N6 asking about T7 could one or more of (T2, T5, T6, T8) depending on timing This is only important to nodes with more than one input - any 'join' functionality.

Specified by:
getParallelTokens in interface TokenService
Returns:
misry and pain


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.