    001    package 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
    024    import org.apache.turbine.modules.Assembler;
    025    import org.apache.turbine.modules.Loader;
    026    import org.apache.turbine.services.Service;
    027    import org.apache.turbine.services.assemblerbroker.util.AssemblerFactory;
    028    import 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 743071 2009-02-10 19:37:33Z tv $
    037     */
    038    public interface AssemblerBrokerService
    039            extends Service
    040    {
    041        /** Name of the Service */
    042        String SERVICE_NAME = "AssemblerBrokerService";
    043
    044        /**
    045         * Register an AssemblerFactory class for a given type
    046         *
    047         * @param type Type of the Factory
    048         * @param factory The factory object
    049         */
    050        void registerFactory(String type, AssemblerFactory factory);
    051
    052        /**
    053         * Attempts to load an Assembler of a type with a given name
    054         *
    055         * @param type The Type of the Assembler
    056         * @param name The Name of the Assembler
    057         * @return An Assembler object for the requested name and type
    058         *
    059         * @throws TurbineException Something went wrong while looking for the Assembler
    060         */
    061        Assembler getAssembler(String type, String name) throws TurbineException;
    062
    063        /**
    064         * Get a Loader for the given assembler type
    065         *
    066         * @param type The Type of the Assembler
    067         * @return A Loader instance for the requested type
    068         */
    069        Loader getLoader(String type);
    070    }