|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.codemonster.surinam.core.framework.ServiceFinderImpl
public class ServiceFinderImpl
| Constructor Summary | |
|---|---|
ServiceFinderImpl(ServiceBlock serviceBlock)
|
|
| 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 serviceContractClass)
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. |
void |
invalidateReferences()
This callback is for routing interceptors to know that they should flush any references to services they might be holding on to. |
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. |
void |
setServiceBlock(ServiceBlock serviceBlock)
standard setter |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceFinderImpl(ServiceBlock serviceBlock)
| Method Detail |
|---|
public Object getService(Class serviceContractClass,
ServiceInvocationRouter invocationRouter)
throws UnknownServiceException,
UnavailableServiceException,
ClassNotFoundException
getService in interface ServiceFinderserviceContractClass - 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.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
ClassNotFoundException - Thrown if there's a problem with the service name given.ServiceFinder.getServiceClass(java.lang.String)
public Object getService(Class serviceContractClass)
throws UnknownServiceException,
UnavailableServiceException,
ClassNotFoundException
getService in interface ServiceFinderserviceContractClass - 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.
UnknownServiceException - This will be thrown when the requested interface is unknown to the
system, usually because the service was never installed or registered.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
ClassNotFoundException - Thrown if there's a problem with the service name given.ServiceFinder.getServiceClass(java.lang.String)
public Object getService(String serviceContractClassName)
throws UnknownServiceException,
ClassNotFoundException,
UnavailableServiceException
getService in interface ServiceFinderserviceContractClassName - This is the name of the Service Contract Class.
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.
UnavailableServiceException - This is thrown if the service is known but a usable organization object
cannot be found.
public Object getService(String serviceContractClassName,
ServiceInvocationRouter invocationRouter)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
getService in interface ServiceFinderserviceContractClassName - 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.public boolean isRegisteredContract(String serviceContractClassName)
isRegisteredContract in interface ServiceFinderserviceContractClassName - The name of the Service Contract target.
public Class getServiceClass(String serviceContractClassName)
throws ClassNotFoundException
getServiceClass in interface ServiceFinderserviceContractClassName - 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).
public ManagedService getStaticService(Class serviceContractClass)
throws UnavailableServiceException,
UnknownServiceException
getStaticService in interface ServiceFinderserviceContractClass - 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.
public ManagedService getStaticService(String serviceContractClassName)
throws UnavailableServiceException,
UnknownServiceException,
ClassNotFoundException
getStaticService in interface ServiceFinderserviceContractClassName - 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.public void setServiceBlock(ServiceBlock serviceBlock)
serviceBlock - The service block instance for the Finder to use.public void invalidateReferences()
invalidateReferences in interface InterceptorLifecycle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||