Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 // Copyright 2004, 2005 The Apache Software Foundation2 //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 at6 //7 // http://www.apache.org/licenses/LICENSE-2.08 //9 // Unless required by applicable law or agreed to in writing, software10 // 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 and13 // limitations under the License.14 15 package org.apache.hivemind.impl;16 17 importjava.util.List;18 19 importorg.apache.hivemind.definition.ImplementationConstructor;20 importorg.apache.hivemind.definition.ImplementationDefinition;21 importorg.apache.hivemind.events.RegistryShutdownListener;22 importorg.apache.hivemind.internal.ServicePoint;23 24 /**25 * "Private" interface used by a {@link org.apache.hivemind.internal.ServiceModel}s to access non-26 * information about a {@link org.apache.hivemind.internal.ServicePoint}, such as its instance27 * builder and interceptors.28 * 29 * @author Howard Lewis Ship30 */31 publicinterface ConstructableServicePoint extendsServicePoint32 {33 /**34 * Returns the constructor that can create the core service implementation. Returns the service35 * constructor, if defined, or the default service constructor. The default service constructor36 * comes from the &lt;service-point&gt; itself; other modules can override this default using an37 * &lt;implementation&gt; element.38 */39 ImplementationConstructor getServiceConstructor();40 41 ImplementationDefinition getImplementationDefinition();42 43 /**44 * Returns a list of {@link org.apache.hivemind.definition.InterceptorConstructor}s,45 * ordered according to their dependencies. May return null or an empty list.46 * <p>47 * Note that the order is tricky! To keep any error messages while ordering the interceptors48 * understandable, they are ordered according into runtime execution order. Example: If we want49 * a logging interceptor to operate before a security-check interceptor, we'll write the50 * following in the descriptor:51 * 52 * <pre>53 * &lt;interceptor service-id=&quot;hivemind.LoggingInterceptor&quot; before=&quot;*&quot;/&gt;54 * &lt;interceptor service-id=&quot;somepackage.SecurityInterceptor&quot;/&gt;55 * </pre>56 * 57 * The <code>before</code> value for the first interceptor contribution will be assigned to58 * the contribution's59 * {@link org.apache.hivemind.definition.InterceptorConstructor#getFollowingNames() followingNames}60 * property, because all other interceptors (including the security interceptor) should have61 * their behavior follow the logging interceptor.62 * <p>63 * To get this behavior, the logging interceptor will delegate to the security interceptor, and64 * the security interceptor will delegate to the core service implementation.65 * <p>66 * The trick is that interceptors are applied in reverse order: we start with core service67 * implementation, wrap it with the security interceptor, then wrap that with the logging68 * interceptor ... but that's an issue that applies when building the interceptor stack around69 * the core service implementation.70 */71 List getOrderedInterceptorContributions();72 73 /**74 * Invoked by the ServiceModel when constuction information (the builder and interceptors) is no75 * longer needed.76 */77 void clearConstructorInformation();78 79 /**80 * Adds a shutdown listener; HiveMind uses two coordinators; the first is the81 * hivemind.ShutdownCoordinator service, which is the coordinator used for service82 * implementations. The second coordinator is used by the HiveMind infrastructure directly; this83 * method adds a listener to that coordinator. Why two? It's about order of operations during84 * registry shutdown; the hivemind.ShutdownCoordinator service's listeners are all invoked85 * first, the the internal coordinator, to shutdown proxies and the like. This allows services86 * to communicate during shutdown.87 * 88 * @param listener89 * the listener to be added to the infrastructure's shutdown coordinator90 * @since 1.1.191 */92 93 void addRegistryShutdownListener(RegistryShutdownListener listener);94 }