org.apache.turbine.services.assemblerbroker
Class TurbineAssemblerBrokerService

java.lang.Object
  extended by org.apache.turbine.services.BaseInitable
      extended by org.apache.turbine.services.BaseService
          extended by org.apache.turbine.services.TurbineBaseService
              extended by org.apache.turbine.services.assemblerbroker.TurbineAssemblerBrokerService
All Implemented Interfaces:
AssemblerBrokerService, Initable, Service

public class TurbineAssemblerBrokerService
extends TurbineBaseService
implements AssemblerBrokerService

TurbineAssemblerBrokerService allows assemblers (like screens, actions and layouts) to be loaded from one or more AssemblerFactory classes. AssemblerFactory classes are registered with this broker by adding them to the TurbineResources.properties file.

Version:
$Id: TurbineAssemblerBrokerService.java 534527 2007-05-02 16:10:59Z tv $
Author:
Leon Messerschmidt, Henning P. Schmiedehausen

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.turbine.services.assemblerbroker.AssemblerBrokerService
ACTION_TYPE, LAYOUT_TYPE, NAVIGATION_TYPE, PAGE_TYPE, SCHEDULEDJOB_TYPE, SCREEN_TYPE, SERVICE_NAME
 
Constructor Summary
TurbineAssemblerBrokerService()
           
 
Method Summary
 Assembler getAssembler(java.lang.String type, java.lang.String name)
          Attempt to retrieve an Assembler of a given type with a name.
 void init()
          Initializes the AssemblerBroker and loads the AssemblerFactory classes registered in TurbineResources.Properties.
 void registerFactory(java.lang.String type, AssemblerFactory factory)
          Register a new AssemblerFactory under a certain type
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker, shutdown
 

Constructor Detail

TurbineAssemblerBrokerService

public TurbineAssemblerBrokerService()
Method Detail

init

public void init()
          throws InitializationException
Initializes the AssemblerBroker and loads the AssemblerFactory classes registered in TurbineResources.Properties.

Specified by:
init in interface Initable
Overrides:
init in class TurbineBaseService
Throws:
InitializationException

registerFactory

public void registerFactory(java.lang.String type,
                            AssemblerFactory factory)
Register a new AssemblerFactory under a certain type

Specified by:
registerFactory in interface AssemblerBrokerService
Parameters:
type - type of Assembler
factory - factory to register

getAssembler

public Assembler getAssembler(java.lang.String type,
                              java.lang.String name)
                       throws TurbineException
Attempt to retrieve an Assembler of a given type with a name. Cycle through all the registered AssemblerFactory classes of type and return the first non-null assembly found. If an assembly was not found return null.

Specified by:
getAssembler in interface AssemblerBrokerService
Parameters:
type - type of Assembler
name - name of the requested Assembler
Returns:
an Assembler or null
Throws:
TurbineException


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.