org.apache.agila.services
Class AbstractInstanceService

java.lang.Object
  extended by org.apache.agila.services.AbstractInstanceService
All Implemented Interfaces:
InstanceService
Direct Known Subclasses:
InstanceServiceImpl, InstanceServiceImpl

public abstract class AbstractInstanceService
extends java.lang.Object
implements InstanceService

Version:
$Id: AbstractInstanceService.java 232597 2005-08-14 11:33:39Z clim $
Author:
Geir Magnusson Jr.

Constructor Summary
AbstractInstanceService()
           
 
Method Summary
 void deRegisterListener(InstanceLifecycleListener listener)
           
 Instance getInstanceByID(InstanceID id)
           
 InstanceInfo getInstanceInfoByID(InstanceID id)
           
 java.util.List getInstanceInfos()
          TODO - scrap this.
 InstanceServiceInfo getInstanceServiceInfo()
           
protected abstract  Instance internalCreate(BusinessProcessID processID, java.util.Map params)
          Method to create a new instance.
protected abstract  Instance internalGetByID(InstanceID id)
          returns an instance by ID from the persistence store
protected abstract  java.util.List internalGetInstanceInfos()
          returns all instances from the persistence store
protected abstract  InstanceServiceInfo internalInstanceServiceInfo()
           
protected abstract  void internalSave(Instance instance)
          Method to save an instance (update/persiste).
 InstanceID newInstance(BusinessProcessID processID, java.util.Map params)
          Returns a new instance for a given processID
 void registerListener(InstanceLifecycleListener listener)
           
 void save(Instance instance)
           
 void setBusinessProcessService(BusinessProcessService bps)
           
 void setLogService(LogService logger)
           
 void setQueueService(QueueService qs)
           
 void setTokenService(TokenService ts)
           
 void start(InstanceID id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.agila.services.InstanceService
resume, stop, suspend
 

Constructor Detail

AbstractInstanceService

public AbstractInstanceService()
Method Detail

setTokenService

public void setTokenService(TokenService ts)

setBusinessProcessService

public void setBusinessProcessService(BusinessProcessService bps)

setQueueService

public void setQueueService(QueueService qs)

setLogService

public void setLogService(LogService logger)

newInstance

public InstanceID newInstance(BusinessProcessID processID,
                              java.util.Map params)
Description copied from interface: InstanceService
Returns a new instance for a given processID

Specified by:
newInstance in interface InstanceService
Returns:

start

public void start(InstanceID id)
Specified by:
start in interface InstanceService

save

public void save(Instance instance)
Specified by:
save in interface InstanceService

getInstanceByID

public Instance getInstanceByID(InstanceID id)
Specified by:
getInstanceByID in interface InstanceService

getInstanceInfoByID

public InstanceInfo getInstanceInfoByID(InstanceID id)
Specified by:
getInstanceInfoByID in interface InstanceService

getInstanceInfos

public java.util.List getInstanceInfos()
TODO - scrap this. Imagine 1,000,000 instances....

Specified by:
getInstanceInfos in interface InstanceService
Returns:

getInstanceServiceInfo

public InstanceServiceInfo getInstanceServiceInfo()
Specified by:
getInstanceServiceInfo in interface InstanceService

registerListener

public void registerListener(InstanceLifecycleListener listener)
Specified by:
registerListener in interface InstanceService

deRegisterListener

public void deRegisterListener(InstanceLifecycleListener listener)
Specified by:
deRegisterListener in interface InstanceService

internalCreate

protected abstract Instance internalCreate(BusinessProcessID processID,
                                           java.util.Map params)
Method to create a new instance. Implementations can just override to use a different kind of persistent store

Parameters:
processID -
params -
Returns:
new instances

internalSave

protected abstract void internalSave(Instance instance)
Method to save an instance (update/persiste). Implementations can just override.

Parameters:
instance -

internalGetByID

protected abstract Instance internalGetByID(InstanceID id)
returns an instance by ID from the persistence store

Parameters:
id -
Returns:
Instance if found, or null

internalGetInstanceInfos

protected abstract java.util.List internalGetInstanceInfos()
returns all instances from the persistence store

Returns:
List with 0 or more instances

internalInstanceServiceInfo

protected abstract InstanceServiceInfo internalInstanceServiceInfo()


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