|
|||||||||||||||||||
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 | |||||||||||||||
ConstructableServicePoint.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.impl;
|
|
16 |
|
|
17 |
import java.util.List;
|
|
18 |
|
|
19 |
import org.apache.hivemind.*;
|
|
20 |
import org.apache.hivemind.internal.ServicePoint;
|
|
21 |
import org.apache.hivemind.internal.ServiceImplementationConstructor;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* "Private" interface used by a {@link org.apache.hivemind.ServiceModel}to access non-public
|
|
25 |
* information about a {@link ConstructableServicePoint}, such as its instance builder and
|
|
26 |
* interceptors.
|
|
27 |
*
|
|
28 |
* @author Howard Lewis Ship
|
|
29 |
*/
|
|
30 |
public interface ConstructableServicePoint extends ServicePoint |
|
31 |
{ |
|
32 |
/**
|
|
33 |
* Returns the constructor that can create the core service implementation. Returns the service
|
|
34 |
* constructor, if defined, or the default service constructor. The default service constructor
|
|
35 |
* comes from the <service-point> itself; other modules can override this default using an
|
|
36 |
* <implementation> element.
|
|
37 |
*/
|
|
38 |
public ServiceImplementationConstructor getServiceConstructor();
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Returns a list of {@link org.apache.hivemind.ServiceInterceptorContribution}s, ordered
|
|
42 |
* according to their dependencies. May return null or an empty list.
|
|
43 |
* <p>
|
|
44 |
* Note that the order is tricky! To keep any error messages while ordering the interceptors
|
|
45 |
* understandable, they are ordered according into runtime execution order. Example: If we want
|
|
46 |
* a logging interceptor to operate before a security-check interceptor, we'll write the
|
|
47 |
* following in the descriptor:
|
|
48 |
*
|
|
49 |
* <pre>
|
|
50 |
*
|
|
51 |
*
|
|
52 |
* <interceptor service-id="hivemind.LoggingInterceptor" before="*"/>
|
|
53 |
* <interceptor service-id="somepackage.SecurityInterceptor"/>
|
|
54 |
*
|
|
55 |
*
|
|
56 |
* </pre>
|
|
57 |
*
|
|
58 |
* The <code>before</code> value for the first interceptor contribution will be assigned to
|
|
59 |
* the contribution's
|
|
60 |
* {@link org.apache.hivemind.ServiceInterceptorContribution#getFollowingInterceptorIds() followingInterceptorIds}
|
|
61 |
* property, because all other interceptors (including the security interceptor) should have
|
|
62 |
* their behavior follow the logging interceptor.
|
|
63 |
* <p>
|
|
64 |
* To get this behavior, the logging interceptor will delegate to the security interceptor, and
|
|
65 |
* the security interceptor will delegate to the core service implementation.
|
|
66 |
* <p>
|
|
67 |
* The trick is that interceptors are applied in reverse order: we start with core service
|
|
68 |
* implementation, wrap it with the security interceptor, then wrap that with the logging
|
|
69 |
* interceptor ... but that's an issue that applies when building the interceptor stack around
|
|
70 |
* the core service implementation.
|
|
71 |
*/
|
|
72 |
public List getOrderedInterceptorContributions();
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Invoked by the ServiceModel when constuction information (the builder and interceptors) is no
|
|
76 |
* longer needed.
|
|
77 |
*/
|
|
78 |
public void clearConstructorInformation(); |
|
79 |
|
|
80 |
/**
|
|
81 |
* Returns the {@link ShutdownCooordinator}, used by the service model to inform proxies that
|
|
82 |
* the service has shutdown.
|
|
83 |
*/
|
|
84 |
|
|
85 |
public ShutdownCoordinator getShutdownCoordinator();
|
|
86 |
} |
|