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 org.apache.hivemind.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.
 Occurances getParametersCount()
          Returns the number of parameter object expected; generally this is the default of exactly one (Occurances.REQUIRED).
 Schema getParametersSchema()
          Returns the Schema used to process any parameters passed to the service.
 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.
 org.apache.commons.logging.Log getServiceLog()
          Returns the Log instance for this service point.
 
Methods inherited from interface org.apache.hivemind.internal.ExtensionPoint
getExtensionPointId, getModule
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

getServiceInterface

public java.lang.Class getServiceInterface()
Returns the type of the service, the interface the service implements.


getService

public 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:
org.apache.tapestry.ApplicationRuntimeException - if there is any problem creating the service.

getParametersSchema

public Schema getParametersSchema()
Returns the Schema used to process any parameters passed to the service. Service implementation factories and service interceptor factories allow parameters.


getParametersCount

public Occurances getParametersCount()
Returns the number of parameter object expected; generally this is the default of exactly one (Occurances.REQUIRED).


forceServiceInstantiation

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


getServiceLog

public org.apache.commons.logging.Log getServiceLog()
Returns the Log instance for this service point.