public interface ConstructableServicePoint extends ServicePoint
ServiceModel
s to access non-
information about a ServicePoint
, such as its instance
builder and interceptors.Modifier and Type | Method and Description |
---|---|
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.
|
java.util.List |
getOrderedInterceptorContributions()
Returns a list of
ServiceInterceptorContribution s,
ordered according to their dependencies. |
ServiceImplementationConstructor |
getServiceConstructor()
Returns the constructor that can create the core service implementation.
|
forceServiceInstantiation, getDeclaredInterface, getParametersCount, getParametersSchema, getService, getServiceInterface, getServiceInterfaceClassName
getErrorLog, getExtensionPointId, getLog, getModule, visibleToModule
getLocation
ServiceImplementationConstructor getServiceConstructor()
java.util.List getOrderedInterceptorContributions()
ServiceInterceptorContribution
s,
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
followingInterceptorIds
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.
void clearConstructorInformation()
void addRegistryShutdownListener(RegistryShutdownListener listener)
listener
- the listener to be added to the infrastructure's shutdown coordinator