|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ServicePoint.java | - | - | - | - |
|
1 |
// Copyright 2004, 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// 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.internal;
|
|
16 |
|
|
17 |
import org.apache.hivemind.Occurances;
|
|
18 |
import org.apache.hivemind.schema.Schema;
|
|
19 |
|
|
20 |
/**
|
|
21 |
* Sub-interface of {@link org.apache.hivemind.internal.ExtensionPoint} that defines a service
|
|
22 |
* extension point. A service may have a single factory contribution, and any number of interceptor
|
|
23 |
* contributions.
|
|
24 |
*
|
|
25 |
* @author Howard Lewis Ship
|
|
26 |
*/
|
|
27 |
public interface ServicePoint extends ExtensionPoint |
|
28 |
{ |
|
29 |
/**
|
|
30 |
* Returns the type of the service, the interface the service implements. This may be a
|
|
31 |
* synthetic interface when the interface for the service point is, in fact, a class.
|
|
32 |
*/
|
|
33 |
public Class getServiceInterface();
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Returns the interface for the service as specified in the descriptor; starting with release
|
|
37 |
* 1.1 it is possible to define a service in terms of a class (as the interface) and a synthetic
|
|
38 |
* interface is generated where appropriate.
|
|
39 |
*
|
|
40 |
* @since 1.1
|
|
41 |
*/
|
|
42 |
|
|
43 |
public Class getDeclaredInterface();
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Returns the fully qualified class name of the service interface. This is useful so that
|
|
47 |
* loading the actual service interface class can be deferred as late as possible. This is the
|
|
48 |
* value, as specified in the descriptor (except that simple names in the descriptor are
|
|
49 |
* prefixed with the module's package name). Starting in release 1.1, this may be the name of a
|
|
50 |
* ordinary class, not an interface.
|
|
51 |
*
|
|
52 |
* @since 1.1
|
|
53 |
*/
|
|
54 |
|
|
55 |
public String getServiceInterfaceClassName();
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Obtains the full service implementation for this service extension point, an object that
|
|
59 |
* implements the service interface. Because of the different service models, and because of the
|
|
60 |
* possibility of interceptors, the exact class and object returned can't be specified (and may
|
|
61 |
* vary at different times), but that is not relevant to client code, which is assured that it
|
|
62 |
* can invoke the service methods defined by the service interface.
|
|
63 |
*
|
|
64 |
* @param interfaceClass
|
|
65 |
* the class that the service will be cast to; a check is made that the service is
|
|
66 |
* assignable to the indicated interface. It does not have to, necessarily, match the
|
|
67 |
* service interface (it could be a super-interface, for example).
|
|
68 |
* @return the outermost interceptor for the service, or the core implementation if there are no
|
|
69 |
* interceptors.
|
|
70 |
* @throws org.apache.tapestry.ApplicationRuntimeException
|
|
71 |
* if there is any problem creating the service.
|
|
72 |
*/
|
|
73 |
public Object getService(Class interfaceClass);
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Returns the {@link Schema}used to process any parameters passed to the service. Service
|
|
77 |
* implementation factories and service interceptor factories allow parameters.
|
|
78 |
*/
|
|
79 |
|
|
80 |
public Schema getParametersSchema();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Returns the number of parameter object expected; generally this is the default of exactly one (
|
|
84 |
* {@link Occurances#REQUIRED}).
|
|
85 |
*/
|
|
86 |
public Occurances getParametersCount();
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Forces the service to be fully instantiated immediately, rather than lazily.
|
|
90 |
*/
|
|
91 |
|
|
92 |
public void forceServiceInstantiation(); |
|
93 |
} |
|