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 1199089 2011-11-08 03:14:28Z 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
46       *
47       * @param factory The factory object
48       */
49      <T extends Assembler> void registerFactory(AssemblerFactory<T> factory);
50  
51      /**
52       * Attempts to load an Assembler of a type with a given name
53       *
54       * @param type The Type of the Assembler
55       * @param name The Name of the Assembler
56       * @return An Assembler object for the requested name and type
57       *
58       * @throws TurbineException Something went wrong while looking for the Assembler
59       */
60      <T extends Assembler> T getAssembler(Class<T> type, String name) throws TurbineException;
61  
62      /**
63       * Get a Loader for the given assembler type
64       *
65       * @param type The Type of the Assembler
66       * @return A Loader instance for the requested type
67       */
68      <T extends Assembler> Loader<T> getLoader(Class<T> type);
69  }