View Javadoc

1   package org.apache.turbine.services.assemblerbroker;
2   
3   
4   /*
5    * Licensed to the Apache Software Foundation (ASF) under one
6    * or more contributor license agreements.  See the NOTICE file
7    * distributed with this work for additional information
8    * regarding copyright ownership.  The ASF licenses this file
9    * to you under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License.  You may obtain a copy of the License at
12   *
13   *   http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on an
17   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied.  See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
21   */
22  
23  
24  import org.apache.turbine.modules.Assembler;
25  import org.apache.turbine.modules.Loader;
26  import org.apache.turbine.services.Service;
27  import org.apache.turbine.services.assemblerbroker.util.AssemblerFactory;
28  import org.apache.turbine.util.TurbineException;
29  
30  /**
31   * An interface the Turbine Assembler service.
32   * See TurbineAssemblerBrokerService for more info.
33   *
34   * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
35   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
36   * @version $Id: AssemblerBrokerService.java 743071 2009-02-10 19:37:33Z tv $
37   */
38  public interface AssemblerBrokerService
39          extends Service
40  {
41      /** Name of the Service */
42      String SERVICE_NAME = "AssemblerBrokerService";
43  
44      /**
45       * Register an AssemblerFactory class for a given type
46       *
47       * @param type Type of the Factory
48       * @param factory The factory object
49       */
50      void registerFactory(String type, AssemblerFactory factory);
51  
52      /**
53       * Attempts to load an Assembler of a type with a given name
54       *
55       * @param type The Type of the Assembler
56       * @param name The Name of the Assembler
57       * @return An Assembler object for the requested name and type
58       *
59       * @throws TurbineException Something went wrong while looking for the Assembler
60       */
61      Assembler getAssembler(String type, String name) throws TurbineException;
62  
63      /**
64       * Get a Loader for the given assembler type
65       *
66       * @param type The Type of the Assembler
67       * @return A Loader instance for the requested type
68       */
69      Loader getLoader(String type);
70  }