org.apache.hivemind.impl
Interface ConstructableServicePoint

All Superinterfaces:
ExtensionPoint, Locatable, ServicePoint
All Known Implementing Classes:
ServicePointImpl

public interface ConstructableServicePoint
extends ServicePoint

"Private" interface used by a ServiceModels to access non- information about a ServicePoint, such as its instance builder and interceptors.

Author:
Howard Lewis Ship

Method Summary
 void addRegistryShutdownListener(RegistryShutdownListener listener)
          Adds a shutdown listener; HiveMind uses two coordinators; the first is the hivemind.ShutdownCoordinator service, which is the coordinator used for service implementations.
 void clearConstructorInformation()
          Invoked by the ServiceModel when constuction information (the builder and interceptors) is no longer needed.
 ImplementationDefinition getImplementationDefinition()
           
 java.util.List getOrderedInterceptorContributions()
          Returns a list of InterceptorConstructors, ordered according to their dependencies.
 ImplementationConstructor getServiceConstructor()
          Returns the constructor that can create the core service implementation.
 
Methods inherited from interface org.apache.hivemind.internal.ServicePoint
forceServiceInstantiation, getDeclaredInterface, getService, getServiceInterface, getServiceInterfaceClassName, getServicePointDefinition
 
Methods inherited from interface org.apache.hivemind.internal.ExtensionPoint
getErrorLog, getExtensionPointId, getLog, getModule, visibleToModule
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getServiceConstructor

ImplementationConstructor getServiceConstructor()
Returns the constructor that can create the core service implementation. Returns the service constructor, if defined, or the default service constructor. The default service constructor comes from the <service-point> itself; other modules can override this default using an <implementation> element.


getImplementationDefinition

ImplementationDefinition getImplementationDefinition()

getOrderedInterceptorContributions

java.util.List getOrderedInterceptorContributions()
Returns a list of InterceptorConstructors, ordered according to their dependencies. May return null or an empty list.

Note that the order is tricky! To keep any error messages while ordering the interceptors understandable, they are ordered according into runtime execution order. Example: If we want a logging interceptor to operate before a security-check interceptor, we'll write the following in the descriptor:

               <interceptor service-id="hivemind.LoggingInterceptor" before="*"/>
               <interceptor service-id="somepackage.SecurityInterceptor"/>
 
The before value for the first interceptor contribution will be assigned to the contribution's followingNames property, because all other interceptors (including the security interceptor) should have their behavior follow the logging interceptor.

To get this behavior, the logging interceptor will delegate to the security interceptor, and the security interceptor will delegate to the core service implementation.

The trick is that interceptors are applied in reverse order: we start with core service implementation, wrap it with the security interceptor, then wrap that with the logging interceptor ... but that's an issue that applies when building the interceptor stack around the core service implementation.


clearConstructorInformation

void clearConstructorInformation()
Invoked by the ServiceModel when constuction information (the builder and interceptors) is no longer needed.


addRegistryShutdownListener

void addRegistryShutdownListener(RegistryShutdownListener listener)
Adds a shutdown listener; HiveMind uses two coordinators; the first is the hivemind.ShutdownCoordinator service, which is the coordinator used for service implementations. The second coordinator is used by the HiveMind infrastructure directly; this method adds a listener to that coordinator. Why two? It's about order of operations during registry shutdown; the hivemind.ShutdownCoordinator service's listeners are all invoked first, the the internal coordinator, to shutdown proxies and the like. This allows services to communicate during shutdown.

Parameters:
listener - the listener to be added to the infrastructure's shutdown coordinator
Since:
1.1.1


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.