|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServiceBlock
This is the primary Service Block interface designed to give some limited visibility into
the general Service Block functions. This simplified interface provides all the methods
necessary to work with the services, particularly if you are using Action Documents for
your runtime management model. For access to the service block's deeper API, use the
ServiceBlockAdmin API which will let you programmatically manage your block if you need
more fine-grained controls or want to do something custom.
In this case, we are passing the current class loader as the block's parent loader and null.
Passing the current loader is standard procedure for instantiating a Service Block because
we want our entry points to be visible locally and from inside the block. Additionally, passing
the 'null' means we are not adding anything new to the class path (also SOP).
ServiceBlock serviceBlock = new ServiceBlockImpl(thisLoader, null);
Method Summary | |
---|---|
Class |
getContractClass(String contractClassName)
This method will return a reference to the Class object that has been loaded from within the service block context. |
ServiceFinder |
getServiceFinder()
Once you have a Service Block, you can acquire a Service Finder which will help acquire proper references to Entry Points (from outside the SB) and services from inside the SB (if you are writing a service). |
ManagedService |
getStaticService(Class contractClass)
Takes a contract class object and returns the associated service object. |
ManagedService |
getStaticService(String className)
Takes a fully-qualified string name of the contract class and returns the associated service object. |
boolean |
isRegisteredContract(String contractClassName)
Simple query to see if a contract is registered or not. |
Method Detail |
---|
boolean isRegisteredContract(String contractClassName)
contractClassName
- This is the class object for the Service Contract interface.
ServiceFinder getServiceFinder()
Class getContractClass(String contractClassName) throws ClassNotFoundException
contractClassName
- This is the fqclass name of the Class object to acquire.
ClassNotFoundException
- Thrown if the given class doesn't map to anything in the Service Block.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 className) throws UnavailableServiceException, UnknownServiceException, ClassNotFoundException
className
- 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 |