KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > assemblerbroker > TurbineAssemblerBroker


1 package org.apache.turbine.services.assemblerbroker;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
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,v 1.4.2.2 2004/05/20 03:05:19 seade Exp $
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 JavaDoc 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 JavaDoc type, String JavaDoc name)
68         throws TurbineException
69     {
70         return getService().getAssembler(type, name);
71     }
72 }
73
Popular Tags