1 package org.apache.turbine.services.assemblerbroker;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.turbine.modules.Assembler;
20 import org.apache.turbine.services.TurbineServices;
21 import org.apache.turbine.services.assemblerbroker.util.AssemblerFactory;
22 import org.apache.turbine.util.TurbineException;
23
24 /***
25 * An interface the Turbine Assembler service.
26 * See TurbineAssemblerBrokerService for more info.
27 *
28 * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
29 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
30 * @version $Id: TurbineAssemblerBroker.java 264148 2005-08-29 14:21:04Z henning $
31 */
32 public abstract class TurbineAssemblerBroker
33 {
34 /***
35 * Utility method for accessing the service
36 * implementation
37 *
38 * @return An AssemblerBroker implementation instance
39 */
40 public static AssemblerBrokerService getService()
41 {
42 return (AssemblerBrokerService) TurbineServices.getInstance()
43 .getService(AssemblerBrokerService.SERVICE_NAME);
44 }
45
46 /***
47 * Register a new Assembler factory with this service.
48 *
49 * @param type The type of Assembler Factory
50 * @param factory The actual Factory Object
51 */
52 public static void registerFactory(String type, AssemblerFactory factory)
53 {
54 getService().registerFactory(type, factory);
55 }
56
57 /***
58 * Return an Assembler for a given type and object name.
59 *
60 * @param type The Type of Assember we want
61 * @param name The name of the Assembler
62 *
63 * @return An Assembler Object.
64 *
65 * @throws TurbineException If a problem locating the Assember occured.
66 */
67 public static Assembler getAssembler(String type, String name)
68 throws TurbineException
69 {
70 return getService().getAssembler(type, name);
71 }
72 }