01: // Copyright 2004, 2005 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.hivemind;
16:
17: import java.util.List;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.hivemind.internal.Module;
21:
22: /**
23: * A wrapper for the parameters needed by {@link org.apache.hivemind.ServiceImplementationFactory}.
24: *
25: * @author Howard M. Lewis Ship
26: * @since 1.1
27: */
28: public interface ServiceImplementationFactoryParameters {
29: /**
30: * The fully qualified id of the service.
31: */
32:
33: public String getServiceId();
34:
35: /**
36: * The interface defined for the service.
37: */
38: public Class getServiceInterface();
39:
40: /**
41: * The log used for any output related to the service (or the construction of the service).
42: */
43:
44: public Log getLog();
45:
46: /**
47: * An {@link ErrorLog} instance used for reporting recoverable errors related to the service (or
48: * the construction of the service).
49: */
50:
51: public ErrorLog getErrorLog();
52:
53: /**
54: * The module containing the service constructor. Primarily used to locate other services (or
55: * configurations) using simple (non-qualified) ids.
56: */
57: public Module getInvokingModule();
58:
59: /**
60: * The parameters passed to the factory to guide the construction of the service. In most cases,
61: * there will only be a single element in the list.
62: */
63: public List getParameters();
64:
65: /**
66: * Returns the first parameter passed to the factory (since most factories
67: * take exactly one parameter, this is the most common usage). If no parameters exist,
68: * returns null.
69: */
70: public Object getFirstParameter();
71:
72: }
|