org.apache.hivemind.internal
Interface ServicePoint

All Superinterfaces:
ExtensionPoint, Locatable
All Known Subinterfaces:
ConstructableServicePoint
All Known Implementing Classes:
ServicePointImpl

public interface ServicePoint
extends ExtensionPoint

Sub-interface of ExtensionPoint that defines a service extension point. A service may have a single factory contribution, and any number of interceptor contributions.

Author:
Howard Lewis Ship

Method Summary
 void forceServiceInstantiation()
          Forces the service to be fully instantiated immediately, rather than lazily.
 java.lang.Class getDeclaredInterface()
          Returns the interface for the service as specified in the descriptor; starting with release 1.1 it is possible to define a service in terms of a class (as the interface).
 java.lang.Object getService(java.lang.Class interfaceClass)
          Obtains the full service implementation for this service extension point, an object that implements the service interface.
 java.lang.Class getServiceInterface()
          Returns the type of the service, the interface the service implements.
 java.lang.String getServiceInterfaceClassName()
          Returns the fully qualified class name of the service interface.
 ServicePointDefinition 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

getServiceInterface

java.lang.Class getServiceInterface()
Returns the type of the service, the interface the service implements. This may be a synthetic interface when the interface for the service point is, in fact, a class. It equals the class returned by getDeclaredInterface() if the declared interface is a real interface and not a class.


getDeclaredInterface

java.lang.Class getDeclaredInterface()
Returns the interface for the service as specified in the descriptor; starting with release 1.1 it is possible to define a service in terms of a class (as the interface). In that case the POJO class is returned here.

Since:
1.1

getServiceInterfaceClassName

java.lang.String getServiceInterfaceClassName()
Returns the fully qualified class name of the service interface. This is useful so that loading the actual service interface class can be deferred as late as possible. This is the value, as specified in the descriptor (except that simple names in the descriptor are prefixed with the module's package name). Starting in release 1.1, this may be the name of a ordinary class, not an interface.

Since:
1.1

getService

java.lang.Object getService(java.lang.Class interfaceClass)
Obtains the full service implementation for this service extension point, an object that implements the service interface. Because of the different service models, and because of the possibility of interceptors, the exact class and object returned can't be specified (and may vary at different times), but that is not relevant to client code, which is assured that it can invoke the service methods defined by the service interface.

Parameters:
interfaceClass - the class that the service will be cast to; a check is made that the service is assignable to the indicated interface. It does not have to, necessarily, match the service interface (it could be a super-interface, for example).
Returns:
the outermost interceptor for the service, or the core implementation if there are no interceptors.
Throws:
ApplicationRuntimeException - if there is any problem creating the service.

forceServiceInstantiation

void forceServiceInstantiation()
Forces the service to be fully instantiated immediately, rather than lazily.


getServicePointDefinition

ServicePointDefinition getServicePointDefinition()


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