001// Copyright 2004, 2005 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.hivemind;
016
017import java.util.List;
018
019import org.apache.commons.logging.Log;
020import org.apache.hivemind.internal.Module;
021
022/**
023 * A wrapper for the parameters needed by {@link org.apache.hivemind.ServiceImplementationFactory}.
024 * 
025 * @author Howard M. Lewis Ship
026 * @since 1.1
027 */
028public interface ServiceImplementationFactoryParameters
029{
030    /**
031     * The fully qualified id of the service.
032     */
033
034    public String getServiceId();
035
036    /**
037     * The interface defined for the service.
038     */
039    public Class getServiceInterface();
040
041    /**
042     * The log used for any output related to the service (or the construction of the service).
043     */
044
045    public Log getLog();
046
047    /**
048     * An {@link ErrorLog} instance used for reporting recoverable errors related to the service (or
049     * the construction of the service).
050     */
051
052    public ErrorLog getErrorLog();
053
054    /**
055     * The module containing the service constructor. Primarily used to locate other services (or
056     * configurations) using simple (non-qualified) ids.
057     */
058    public Module getInvokingModule();
059
060    /**
061     * The parameters passed to the factory to guide the construction of the service. In most cases,
062     * there will only be a single element in the list.
063     */
064    public List getParameters();
065    
066    /**
067     * Returns the first parameter passed to the factory (since most factories
068     * take exactly one parameter, this is the most common usage).  If no parameters exist,
069     * returns null.
070     */
071    public Object getFirstParameter();
072
073}