org.apache.turbine.services.assemblerbroker
Class TurbineAssemblerBrokerService
java.lang.Object
org.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
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 1078552 2011-03-06 19:58:46Z tv $
- Author:
- Leon Messerschmidt, Henning P. Schmiedehausen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TurbineAssemblerBrokerService
public TurbineAssemblerBrokerService()
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(String type,
AssemblerFactory factory)
- Register a new AssemblerFactory under a certain type
- Specified by:
registerFactory
in interface AssemblerBrokerService
- Parameters:
type
- type of Assemblerfactory
- factory to register
getAssembler
public Assembler getAssembler(String type,
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 Assemblername
- name of the requested Assembler
- Returns:
- an Assembler or null
- Throws:
TurbineException
getLoader
public Loader getLoader(String type)
- Get a Loader for the given assembler type
- Specified by:
getLoader
in interface AssemblerBrokerService
- Parameters:
type
- The Type of the Assembler
- Returns:
- A Loader instance for the requested type
Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.