|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.benow.service.Services
org.benow.service.LocalServices
public class LocalServices
Loads and exposes discovered services. Service descriptions are saved to a file, which is used in the loading process. To save service descriptions, use the service manager as an application. See main[] for more information.
main(String[])| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.benow.java.spec.Markup |
|---|
org.benow.java.spec.Markup.ParamName, org.benow.java.spec.Markup.ReturnDescription |
| Field Summary | |
|---|---|
static org.benow.security.permission.Permission |
PERM_EDIT
|
| Constructor Summary | |
|---|---|
LocalServices(java.util.List<java.lang.Class<? extends Service>> serviceClasses)
|
|
| Method Summary | |
|---|---|
void |
addServiceImplementator(java.lang.Class<? extends Service> serviceInterface,
java.lang.Class<?> serviceClass)
|
void |
addServiceImplementator(java.lang.Class<? extends Service> serviceInterface,
java.lang.Class<?> serviceClass,
java.lang.String src)
|
protected void |
doInit()
Override to initialize, only ever called once |
java.lang.Class<? extends Service> |
getServiceInterfaceFromImplementation(java.lang.Class<?> serviceClass)
Gets the (first) service interace implemented by the given the given service class |
ServiceSpecification |
getServiceSpecification(java.lang.Class<? extends Service> forClass)
Gets the service specification for the given class. |
java.util.List<ServiceSpecification> |
getServiceSpecifications()
Gets all services the user has permission to access. |
static java.lang.Class<?> |
getStackClass(java.lang.ClassLoader loader,
int position)
|
static java.lang.Class<?> |
getStackClass(int position)
Gets the class in the given position in the stack trace. |
static java.lang.Object |
invoke(java.lang.Class<? extends Service> serviceClass,
java.lang.Object source)
|
static java.lang.Object |
invokeThisService(java.lang.Object params)
Called from within a (main) method of a service, this utility invokes the default method within the service class instance with the given object and returns the result. |
static boolean |
isPublished(java.lang.Class<?> serviceClass)
|
java.util.List<java.lang.Class<? extends Service>> |
listServiceClassesImplementing(java.lang.Class<?> serviceInterface)
|
java.util.List<ServiceSpecification> |
listServices()
|
static void |
main(java.lang.String[] args)
Creates a service descriptor over discovered services. |
boolean |
onEvent(java.lang.Object notifier,
org.benow.java.notify.event.Event event)
Events passed to message bus. |
void |
onShutDown()
|
void |
returnService(Service serviceInstance)
|
Service |
takeService(java.lang.Class<? extends Service> serviceClassOrInterface)
|
java.lang.String |
toString()
|
| Methods inherited from class org.benow.service.Services |
|---|
getInstance, isService, returnAService, setInstance, takeAService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.benow.security.permission.Permission PERM_EDIT
| Constructor Detail |
|---|
public LocalServices(java.util.List<java.lang.Class<? extends Service>> serviceClasses)
throws java.io.InvalidClassException,
org.benow.java.spec.SpecificationException
java.io.InvalidClassException
org.benow.java.spec.SpecificationException| Method Detail |
|---|
protected void doInit()
throws java.lang.Exception
Services
doInit in class Servicesjava.lang.Exception
public void onShutDown()
throws java.lang.Throwable
onShutDown in interface org.benow.java.shutdown.Deinitializedjava.lang.Throwable
public void addServiceImplementator(java.lang.Class<? extends Service> serviceInterface,
java.lang.Class<?> serviceClass)
throws org.benow.java.spec.SpecificationException,
java.io.InvalidClassException
org.benow.java.spec.SpecificationException
java.io.InvalidClassException
public void addServiceImplementator(java.lang.Class<? extends Service> serviceInterface,
java.lang.Class<?> serviceClass,
java.lang.String src)
throws org.benow.java.spec.SpecificationException,
java.io.InvalidClassException
org.benow.java.spec.SpecificationException
java.io.InvalidClassException
public ServiceSpecification getServiceSpecification(java.lang.Class<? extends Service> forClass)
throws org.benow.java.spec.SpecificationException
getServiceSpecification in class Servicesorg.benow.java.spec.SpecificationExceptionpublic Service takeService(java.lang.Class<? extends Service> serviceClassOrInterface)
takeService in class Servicespublic void returnService(Service serviceInstance)
returnService in class Servicespublic java.util.List<java.lang.Class<? extends Service>> listServiceClassesImplementing(java.lang.Class<?> serviceInterface)
listServiceClassesImplementing in class Servicespublic static void main(java.lang.String[] args)
args - public java.lang.String toString()
toString in class java.lang.Object
public static java.lang.Object invokeThisService(java.lang.Object params)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.Throwable
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.Throwable
public static java.lang.Object invoke(java.lang.Class<? extends Service> serviceClass,
java.lang.Object source)
throws org.benow.java.spec.SpecificationException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.lang.Throwable
org.benow.java.spec.SpecificationException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.Throwablepublic static java.lang.Class<?> getStackClass(int position)
position - the position of the class in the stace
public static java.lang.Class<?> getStackClass(java.lang.ClassLoader loader,
int position)
public static boolean isPublished(java.lang.Class<?> serviceClass)
public java.lang.Class<? extends Service> getServiceInterfaceFromImplementation(java.lang.Class<?> serviceClass)
serviceClass -
public boolean onEvent(java.lang.Object notifier,
org.benow.java.notify.event.Event event)
onEvent in interface org.benow.java.notify.Listenerpublic java.util.List<ServiceSpecification> getServiceSpecifications()
getServiceSpecifications in class Servicespublic java.util.List<ServiceSpecification> listServices()
listServices in class Services
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||