    001package org.apache.turbine.services.assemblerbroker;
    002
    003
    004/*
    005 * Licensed to the Apache Software Foundation (ASF) under one
    006 * or more contributor license agreements.  See the NOTICE file
    007 * distributed with this work for additional information
    008 * regarding copyright ownership.  The ASF licenses this file
    009 * to you under the Apache License, Version 2.0 (the
    010 * "License"); you may not use this file except in compliance
    011 * with the License.  You may obtain a copy of the License at
    012 *
    013 *   http://www.apache.org/licenses/LICENSE-2.0
    014 *
    015 * Unless required by applicable law or agreed to in writing,
    016 * software distributed under the License is distributed on an
    017 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    018 * KIND, either express or implied.  See the License for the
    019 * specific language governing permissions and limitations
    020 * under the License.
    021 */
    022
    023
    024import org.apache.turbine.modules.Assembler;
    025import org.apache.turbine.modules.Loader;
    026import org.apache.turbine.services.Service;
    027import org.apache.turbine.services.assemblerbroker.util.AssemblerFactory;
    028import org.apache.turbine.util.TurbineException;
    029
    030/**
    031 * An interface the Turbine Assembler service.
    032 * See TurbineAssemblerBrokerService for more info.
    033 *
    034 * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
    035 * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    036 * @version $Id: AssemblerBrokerService.java 1199089 2011-11-08 03:14:28Z tv $
    037 */
    038public interface AssemblerBrokerService
    039        extends Service
    040{
    041    /** Name of the Service */
    042    String SERVICE_NAME = "AssemblerBrokerService";
    043
    044    /**
    045     * Register an AssemblerFactory class
    046     *
    047     * @param factory The factory object
    048     */
    049    <T extends Assembler> void registerFactory(AssemblerFactory<T> factory);
    050
    051    /**
    052     * Attempts to load an Assembler of a type with a given name
    053     *
    054     * @param type The Type of the Assembler
    055     * @param name The Name of the Assembler
    056     * @return An Assembler object for the requested name and type
    057     *
    058     * @throws TurbineException Something went wrong while looking for the Assembler
    059     */
    060    <T extends Assembler> T getAssembler(Class<T> type, String name) throws TurbineException;
    061
    062    /**
    063     * Get a Loader for the given assembler type
    064     *
    065     * @param type The Type of the Assembler
    066     * @return A Loader instance for the requested type
    067     */
    068    <T extends Assembler> Loader<T> getLoader(Class<T> type);
    069}