|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface ACR
Interface into a running Astro Runtime, from which AR services can be accessed.
Example of accessing an AR service by interface class,
Example of accessing an AR service by name,
Finder| Method Summary | |
|---|---|
Object |
getService(Class interfaceClass)
Retrieve an instance of an AR Service by class. |
Object |
getService(String componentName)
Retreive an instance of an AR service by name. |
| Method Detail |
|---|
Object getService(Class interfaceClass)
throws ACRException,
InvalidArgumentException,
NotFoundException
Example:
import org.astrogrid.acr.system.Configuration; import org.astrogrid.acr.builtin.ACR; import org.astrogrid.acr.Finder; Finder f = new Finder(); ACR ar = f.find(); Configuration c = (Configuration) ar.getService(Configuration.class)
interfaceClass - the interface class for a service. This must be one of the interface classes
in this api marked as 'AR Service'.
InvalidArgumentException - if the parameter class is not an interface
NotFoundException - if the parameter class is not an available service in the ACR
ACRException - if another error occurs while retrieving the service instance
Object getService(String componentName)
throws ACRException,
InvalidArgumentException,
NotFoundException
Note:
This method is a less-well-typed equvalent to ACR.getService(Class) - prefer use that method.
However, this method is handy when it isn't easy to get hold of
class objects - e.g. from in-java scripting languages, and via the xmlrpc interface.
Example:
import org.astrogrid.acr.system.Configuration;
import org.astrogrid.acr.builtin.ACR;
import org.astrogrid.acr.Finder;
Finder f = new Finder();
ACR ar = f.find();
Configuration c = (Configuration) ar.getService("system.configuration")
componentName - the name of the service - (as defined by the Service Name block in API documentation).
These are the same component names as used in the XMLRPC interface - all follow the form
moduleName.componentName
InvalidArgumentException - if the componentName does not follow the form moduleName.componentName
NotFoundException - if this componentName is not an available service in the ACR
ACRException - if another error occurs while retrieving the service instance
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||