org.tubo.resource.springimpl
Class SpringResourceManagerImpl

java.lang.Object
  extended by org.tubo.resource.baseimpl.BaseAbstractResourceManager
      extended by org.tubo.resource.springimpl.SpringResourceManagerImpl
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, ResourceManager

public class SpringResourceManagerImpl
extends BaseAbstractResourceManager
implements org.springframework.beans.factory.BeanFactoryAware

Created: Dec 1, 2005 6:02:44 AM Last Modification Date: $Date: 2006-12-15 18:39:11 -0300 (Fri, 15 Dec 2006) $

Version:
$Revision: 79 $
Author:
maldito_orco (maldito_orco@users.sourceforge.net)

Field Summary
static java.lang.String BEAN_COMPONENT_TEMPLATE
          Template file for beans based on components
static java.lang.String BEAN_CONSUMER_TEMPLATE
          Template file for beans based on consumers
static java.lang.String BEAN_DEFAULT_TEMPLATE
          Template file for beans based on flows
static java.lang.String BEAN_EXCEPTION_MANAGER_TEMPLATE
          Template file for beans based on exceptions
static java.lang.String BEAN_EXCEPTION_TEMPLATE
          Template file for beans based on exceptions
static java.lang.String BEAN_FLOW_TEMPLATE
          Template file for beans based on flows
static java.lang.String RCS_ID
           
static java.lang.String SPRING_CONTEXT_HEADFILE
          Header for every spring xml context file
static java.lang.String SPRING_EVENT_BEAN_ID
          Event bean ID
static java.lang.String SPRING_EXCEPTION_MANAGER_BEAN_ID
          ExceptionManager bean ID
static java.lang.String SPRING_FLOW_CONTEXT_BEAN_ID
          FlowContext bean ID
static java.lang.String SPRING_FLOW_EXECUTOR_BEAN_ID
          FlowExecutor bean ID
static java.lang.String SPRING_ITEM_BEAN_ID
          Item bean ID
static java.lang.String SPRING_KERNEL_BEAN_ID
          Kernel bean ID
static java.lang.String SPRING_RESOURCE_MANAGER_BEAN_ID
          ResourceManager bean ID
 
Constructor Summary
protected SpringResourceManagerImpl()
          Default constructor protected.
 
Method Summary
protected static java.lang.StringBuffer appendSpringDefaultConfiguration(java.lang.StringBuffer buffer, Configuration config)
           
protected static java.lang.StringBuffer appendSpringDefinition(java.lang.StringBuffer buffer, Definition def)
           
protected static java.lang.StringBuffer appendSpringDefinition(java.lang.StringBuffer buffer, Definition def, java.lang.String templateFile, java.util.Map props)
          Append a Spring configuration of ComponentDef instance.
protected static java.lang.StringBuffer appendSpringExceptionManagerDefinition(java.lang.StringBuffer buffer)
           
protected static java.lang.StringBuffer appendSpringFlowDefinition(java.lang.StringBuffer buffer, Configuration config)
           
protected static java.lang.String createSpringContext(Configuration config)
          Create a Spring Context (Spring configuration) based on Configuration object.
 org.springframework.beans.factory.BeanFactory getBeanFactory()
           
 ExceptionManager getExceptionManager()
          Get exception manager
 FlowExecutor getFlowExecutor()
          Get flow processor manager
 Kernel getKernel()
           Get kernel instance
 Manager getManager(java.lang.String id)
          get a bean manager from spring
 Event getNewEvent()
           Create a new Item instance
 FlowContext getNewFlowContext()
           Create a new FlowContext instance
 Item getNewItem()
           Create a new Item instance
static SpringResourceManagerImpl newInstance(Configuration config)
           
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 
Methods inherited from class org.tubo.resource.baseimpl.BaseAbstractResourceManager
getComponentManager, getConfiguration, getConsumerManager, getConsumerManagers, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

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

BEAN_EXCEPTION_MANAGER_TEMPLATE

public static final java.lang.String BEAN_EXCEPTION_MANAGER_TEMPLATE
Template file for beans based on exceptions

See Also:
Constant Field Values

BEAN_EXCEPTION_TEMPLATE

public static final java.lang.String BEAN_EXCEPTION_TEMPLATE
Template file for beans based on exceptions

See Also:
Constant Field Values

BEAN_CONSUMER_TEMPLATE

public static final java.lang.String BEAN_CONSUMER_TEMPLATE
Template file for beans based on consumers

See Also:
Constant Field Values

BEAN_COMPONENT_TEMPLATE

public static final java.lang.String BEAN_COMPONENT_TEMPLATE
Template file for beans based on components

See Also:
Constant Field Values

BEAN_DEFAULT_TEMPLATE

public static final java.lang.String BEAN_DEFAULT_TEMPLATE
Template file for beans based on flows

See Also:
Constant Field Values

BEAN_FLOW_TEMPLATE

public static final java.lang.String BEAN_FLOW_TEMPLATE
Template file for beans based on flows

See Also:
Constant Field Values

SPRING_CONTEXT_HEADFILE

public static final java.lang.String SPRING_CONTEXT_HEADFILE
Header for every spring xml context file

See Also:
Constant Field Values

SPRING_KERNEL_BEAN_ID

public static final java.lang.String SPRING_KERNEL_BEAN_ID
Kernel bean ID

See Also:
Constant Field Values

SPRING_RESOURCE_MANAGER_BEAN_ID

public static final java.lang.String SPRING_RESOURCE_MANAGER_BEAN_ID
ResourceManager bean ID

See Also:
Constant Field Values

SPRING_ITEM_BEAN_ID

public static final java.lang.String SPRING_ITEM_BEAN_ID
Item bean ID

See Also:
Constant Field Values

SPRING_EVENT_BEAN_ID

public static final java.lang.String SPRING_EVENT_BEAN_ID
Event bean ID

See Also:
Constant Field Values

SPRING_FLOW_CONTEXT_BEAN_ID

public static final java.lang.String SPRING_FLOW_CONTEXT_BEAN_ID
FlowContext bean ID

See Also:
Constant Field Values

SPRING_EXCEPTION_MANAGER_BEAN_ID

public static final java.lang.String SPRING_EXCEPTION_MANAGER_BEAN_ID
ExceptionManager bean ID

See Also:
Constant Field Values

SPRING_FLOW_EXECUTOR_BEAN_ID

public static final java.lang.String SPRING_FLOW_EXECUTOR_BEAN_ID
FlowExecutor bean ID

See Also:
Constant Field Values
Constructor Detail

SpringResourceManagerImpl

protected SpringResourceManagerImpl()
                             throws TuboException
Default constructor protected. Used by test cases. Don't change. USED ONLY BY TEST CASES!

Throws:
TuboResourceException
TuboException
Method Detail

getBeanFactory

public org.springframework.beans.factory.BeanFactory getBeanFactory()

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware

getKernel

public Kernel getKernel()
                 throws TuboException

Get kernel instance

Specified by:
getKernel in interface ResourceManager
Returns:
kernel instance
Throws:
TuboException

getNewItem

public Item getNewItem()
                throws TuboException

Create a new Item instance

Specified by:
getNewItem in interface ResourceManager
Returns:
new Item instance
Throws:
TuboException

getNewEvent

public Event getNewEvent()
                  throws TuboException

Create a new Item instance

Specified by:
getNewEvent in interface ResourceManager
Returns:
new Item instance
Throws:
TuboException

getNewFlowContext

public FlowContext getNewFlowContext()
                              throws TuboException

Create a new FlowContext instance

Specified by:
getNewFlowContext in interface ResourceManager
Returns:
new FlowContext instance
Throws:
TuboException

getExceptionManager

public ExceptionManager getExceptionManager()
                                     throws TuboException
Description copied from interface: ResourceManager
Get exception manager

Specified by:
getExceptionManager in interface ResourceManager
Returns:
Exception manager
Throws:
TuboException

getFlowExecutor

public FlowExecutor getFlowExecutor()
                             throws TuboException
Description copied from interface: ResourceManager
Get flow processor manager

Specified by:
getFlowExecutor in interface ResourceManager
Returns:
Exception manager
Throws:
TuboException

getManager

public Manager getManager(java.lang.String id)
                   throws TuboException
get a bean manager from spring

Specified by:
getManager in interface ResourceManager
Parameters:
id -
Returns:
Throws:
TuboException

newInstance

public static SpringResourceManagerImpl newInstance(Configuration config)

createSpringContext

protected static java.lang.String createSpringContext(Configuration config)
                                               throws TuboResourceException
Create a Spring Context (Spring configuration) based on Configuration object.

Parameters:
config - Configuration
Returns:
A String with Spring representation of Configuration object.
Throws:
TuboResourceException

appendSpringDefaultConfiguration

protected static java.lang.StringBuffer appendSpringDefaultConfiguration(java.lang.StringBuffer buffer,
                                                                         Configuration config)
                                                                  throws TuboResourceException
Throws:
TuboResourceException

appendSpringFlowDefinition

protected static java.lang.StringBuffer appendSpringFlowDefinition(java.lang.StringBuffer buffer,
                                                                   Configuration config)
                                                            throws TuboResourceException
Throws:
TuboResourceException

appendSpringExceptionManagerDefinition

protected static java.lang.StringBuffer appendSpringExceptionManagerDefinition(java.lang.StringBuffer buffer)
                                                                        throws TuboResourceException
Throws:
TuboResourceException

appendSpringDefinition

protected static java.lang.StringBuffer appendSpringDefinition(java.lang.StringBuffer buffer,
                                                               Definition def)
                                                        throws TuboResourceException
Throws:
TuboResourceException

appendSpringDefinition

protected static java.lang.StringBuffer appendSpringDefinition(java.lang.StringBuffer buffer,
                                                               Definition def,
                                                               java.lang.String templateFile,
                                                               java.util.Map props)
                                                        throws TuboResourceException
Append a Spring configuration of ComponentDef instance.

Parameters:
buffer - Spring configuration
def - A ComponentDef instance
Returns:
The same StringBuffer but with a new component (bean) definition append to end;
Throws:
TuboResourceException


Copyright © 2004-2007 Tubo. All Rights Reserved.