|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ServiceFinder
The serviceFinder interface is how clients find the service references that they can use at runtime. Service Implementations that also wish to consume other service API, should hold a reference to this object internally. Subclasses will also need to support lifecycle callbacks which will help interceptors maintain any held references. This happens automatically when working with Action Documents but if you are manipulating the Service Block programmatically, you will need to make the call to the block via its admin interface to invalidate the references. This will cause the block to trigger the call back to the Finder which keeps track of all the proxies it created and notifies them that they need to update their references as they may be invalid.
| Method Summary | |
|---|---|
Object |
getService(Class serviceContractClass)
This is the primary method, by which, a client will acquire a proxy reference that it can use to consume a registered service. |
Object |
getService(Class serviceContractClass,
ServiceInvocationRouter invocationRouter)
This is the primary method, by which, a client will acquire a proxy reference that it can use to consume a registered service. |
Object |
getService(String serviceContractClassName)
Recognizing the difficulties in making the distinction between identical class objects loaded in conflicting loader contexts, we simply asking for the service based on the fully-qualified string where the internal directory will resolve the FQN to the correct class instance. |
Object |
getService(String serviceContractClassName,
ServiceInvocationRouter invocationRouter)
Recognizing the difficulties in making the distinction between identical class objects loaded in conflicting loader contexts, we simply asking for the service based on the fully-qualified string where the internal directory will resolve the FQN to the correct class instance. |
Class |
getServiceClass(String serviceContractClassName)
Because fully-qualified class names also include loader information, Class objects from different loaders are not the same, in some circumstances, class loader problems can be the result of a polluted runtime environment, it is recommended that you acquire a class reference directly from the Finder itself since it will return the exact reference that the Service Block is using. |
ManagedService |
getStaticService(Class contractClass)
Takes a Contract Class object and returns the associated Service. |
ManagedService |
getStaticService(String serviceContractClassName)
Takes a fully-qualified string name of the Contract Class and returns the associated service object. |
boolean |
isRegisteredContract(String serviceContractClassName)
For situations where you wish to see if a given Service Contract is actually registered with the Service Block, we provide this simple query. |
| Methods inherited from interface com.codemonster.surinam.export.lifecycle.InterceptorLifecycle |
|---|
invalidateReferences |
| Method Detail |
|---|
boolean isRegisteredContract(String serviceContractClassName)
serviceContractClassName - The name of the Service Contract target.
Class getServiceClass(String serviceContractClassName)
throws ClassNotFoundException
serviceContractClassName - This is the String class name of the Contract, for which, we want an
implementation that we can use.
ClassNotFoundException - Thrown if there is a class loader problem (usually in the meta-data).
Object getService(Class serviceContractClass)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
serviceContractClass - This is the class object of the service contract(interface) that the client
wants to use. This interface will be mated with an object that can perform all service-management-related
activities.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
ClassNotFoundException - Thrown if there's a problem with the service name given.getServiceClass(java.lang.String)
Object getService(Class serviceContractClass,
ServiceInvocationRouter invocationRouter)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
serviceContractClass - This is the class object of the service contract(interface) that the client
wants to use. This interface will be mated with an object that can perform all
service-management-related activities.invocationRouter - This is an implementation of the InvocationHandler interface designed to
replace the standard Surinam InvocationRouter that the proxy uses.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
ClassNotFoundException - Thrown if there's a problem with the service name given.getServiceClass(java.lang.String)
Object getService(String serviceContractClassName)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
serviceContractClassName - This is the name of the Service Contract Class.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
ClassNotFoundException - Thrown if there's a problem with the service name given.
Object getService(String serviceContractClassName,
ServiceInvocationRouter invocationRouter)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
serviceContractClassName - This is the name of the Service Contract Class.invocationRouter - This is an implementation of the InvocationHandler interface designed to the
replace the standard Surinam InvocationRouter that the proxy uses.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
ClassNotFoundException - Thrown if there's a problem with the service name given.
ManagedService getStaticService(Class contractClass)
throws UnavailableServiceException,
UnknownServiceException
contractClass - The fully-qualified class name of the service contract.
UnavailableServiceException - This is thrown if the service reports that it is unavailable.
UnknownServiceException - Thrown if the service is unknown to the block.
ManagedService getStaticService(String serviceContractClassName)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
serviceContractClassName - fq name of the service contract.
UnavailableServiceException - Thrown if the service reports that it is unavailable.
UnknownServiceException - Thrown if the service is unknown to the block.
ClassNotFoundException - Thrown if the given class doesn't map to anything in the Service Block.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||