01: // Copyright 2007 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.tapestry.ioc;
16:
17: import org.apache.tapestry.ioc.annotations.EagerLoad;
18: import org.apache.tapestry.ioc.annotations.Scope;
19: import org.apache.tapestry.ioc.def.ServiceDef;
20:
21: /**
22: * Allows additional options for a service to be specified, overriding hard coded defaults or
23: * defaults from annotations on the service.
24: *
25: * @see ServiceDef
26: */
27: public interface ServiceBindingOptions {
28: /**
29: * Allows a specific service id for the service to be provided, rather than the default (from
30: * the service interface). This is useful when multiple services implement the same interface,
31: * since service ids must be unique.
32: *
33: * @param id
34: * @return this binding options, for further configuration
35: */
36: ServiceBindingOptions withId(String id);
37:
38: /**
39: * Sets the scope of the service, overriding the {@link Scope} annotation on the service
40: * implementation class.
41: *
42: * @param scope
43: * @return this binding options, for further configuration
44: */
45: ServiceBindingOptions scope(String scope);
46:
47: /**
48: * Turns eager loading on for this service. This may also be accomplished using the
49: * {@link EagerLoad} annotation on the service implementation class.
50: *
51: * @return this binding options, for further configuration
52: */
53: ServiceBindingOptions eagerLoad();
54: }
|