org.tubo.resource.consumer
Class BaseConsumerImpl

java.lang.Object
  extended by org.tubo.resource.baseimpl.BaseResourceImpl
      extended by org.tubo.resource.consumer.BaseConsumerImpl
All Implemented Interfaces:
Consumer, Resource
Direct Known Subclasses:
ServerSocketConsumer

public class BaseConsumerImpl
extends BaseResourceImpl
implements Consumer

Created: Jun 21, 2005 6:59:48 AM Last Modification Date: $Date: 2006-12-15 18:44:02 -0300 (Fri, 15 Dec 2006) $

Version:
$Revision: 81 $
Author:
jvlio (jvlio@users.sourceforge.net)

Field Summary
static java.lang.String RCS_ID
           
 
Constructor Summary
BaseConsumerImpl()
          Default empty constructor
 
Method Summary
protected  Event createEvent()
          Create a new Item instance using ResourceManager
protected  FlowContext createFlowContext()
          Create a new FlowContext instance using ResourceManager
protected  Item createItem()
          Create a new Item instance using ResourceManager
protected  FlowContext dispatchOriginFlowEvent(Event event, Item item)
           
protected  FlowContext doConsumerLifeCycle(java.lang.String eventAction, java.lang.Object consumedRawData)
          This method is a template method with the life cycle of the consumption process.
protected  void initializeEvent(Event event)
          LifeCycle Hook used by subclasses to do a custom Event setup
protected  void initializeItem(Item item)
          LifeCycle Hook used by subclasses to make a custom Event setup
protected  void postOriginFlowEvent(FlowContext flowContext)
          LifeCycle Hook used by subclasses to execute post event actions
protected  void preOriginFlowEvent(FlowContext flowContext)
          LifeCycle Hook used by subclasses to execute pre event actions
 void setListener(ConsumerListener listener)
           
 
Methods inherited from class org.tubo.resource.baseimpl.BaseResourceImpl
getId, getProperties, getProperty, getResourceManager, setId, setProperties, setProperty, setResourceManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tubo.resource.consumer.Consumer
getId
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values
Constructor Detail

BaseConsumerImpl

public BaseConsumerImpl()
Default empty constructor

Method Detail

setListener

public void setListener(ConsumerListener listener)
Specified by:
setListener in interface Consumer

doConsumerLifeCycle

protected FlowContext doConsumerLifeCycle(java.lang.String eventAction,
                                          java.lang.Object consumedRawData)
This method is a template method with the life cycle of the consumption process.

Parameters:
eventAction -
consumedRawData -
Returns:
FlowContext used on this life cycle

createEvent

protected Event createEvent()
Create a new Item instance using ResourceManager

Returns:
a Item instance

initializeEvent

protected void initializeEvent(Event event)
LifeCycle Hook used by subclasses to do a custom Event setup

Parameters:
event - Event to be configured

createItem

protected Item createItem()
Create a new Item instance using ResourceManager

Returns:
a Item instance

initializeItem

protected void initializeItem(Item item)
LifeCycle Hook used by subclasses to make a custom Event setup

Parameters:
item - Item to be configured

dispatchOriginFlowEvent

protected FlowContext dispatchOriginFlowEvent(Event event,
                                              Item item)

createFlowContext

protected FlowContext createFlowContext()
Create a new FlowContext instance using ResourceManager

Returns:
a Item instance

preOriginFlowEvent

protected void preOriginFlowEvent(FlowContext flowContext)
LifeCycle Hook used by subclasses to execute pre event actions

Parameters:
flowContext - FlowContext to be used on this event

postOriginFlowEvent

protected void postOriginFlowEvent(FlowContext flowContext)
LifeCycle Hook used by subclasses to execute post event actions

Parameters:
flowContext - FlowContext used on this event


Copyright © 2004-2007 Tubo. All Rights Reserved.