org.benow.service
Class RemoteServices

java.lang.Object
  extended by org.benow.service.Services
      extended by org.benow.service.RemoteServices
All Implemented Interfaces:
org.benow.java.spec.Markup, Service

public class RemoteServices
extends Services


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
 
Constructor Summary
RemoteServices(ServiceConnectionMethod conn)
           
RemoteServices(java.net.URL receptionURL)
           
 
Method Summary
 ServiceSpecification getServiceSpecification(java.lang.Class<? extends Service> serviceInterface)
          Gets the service specification for the given class.
 java.util.List<ServiceSpecification> getServiceSpecifications()
           
 java.util.List<java.lang.Class<? extends Service>> listServiceClassesImplementing(java.lang.Class<?> serviceInterface)
           
 java.util.List<ServiceSpecification> listServices()
           
 void returnService(Service service)
           
 void subscribeToEvents(org.benow.java.notify.Listener listener)
          Subscribes to all events generated by the message bus.
 Service takeService(java.lang.Class<? extends Service> serviceInterface)
          Gets remote accessor implementing given interface.
 void unsubscribe()
          Unsubscribe from all events on remote end (regardless of listener).
 
Methods inherited from class org.benow.service.Services
doInit, getInstance, isService, returnAService, setInstance, takeAService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteServices

public RemoteServices(ServiceConnectionMethod conn)
               throws InvalidClassError
Throws:
InvalidClassError

RemoteServices

public RemoteServices(java.net.URL receptionURL)
               throws org.benow.repository.NoSuchObjectException,
                      java.lang.InstantiationException,
                      InvalidClassError
Throws:
org.benow.repository.NoSuchObjectException
java.lang.InstantiationException
InvalidClassError
Method Detail

getServiceSpecification

public ServiceSpecification getServiceSpecification(java.lang.Class<? extends Service> serviceInterface)
                                             throws org.benow.java.spec.SpecificationException
Description copied from class: Services
Gets the service specification for the given class. If is interface, specification returned directly, if is implementation, specification for the first service interface is returned.

Specified by:
getServiceSpecification in class Services
Throws:
org.benow.java.spec.SpecificationException

listServiceClassesImplementing

public java.util.List<java.lang.Class<? extends Service>> listServiceClassesImplementing(java.lang.Class<?> serviceInterface)
Specified by:
listServiceClassesImplementing in class Services
Returns:
list of services implementing given service interface

listServices

public java.util.List<ServiceSpecification> listServices()
Specified by:
listServices in class Services
Returns:
list of available services (interfaces)

returnService

public void returnService(Service service)
Specified by:
returnService in class Services

subscribeToEvents

public void subscribeToEvents(org.benow.java.notify.Listener listener)
                       throws java.io.IOException
Subscribes to all events generated by the message bus.

Parameters:
listener -
Throws:
java.io.IOException

unsubscribe

public void unsubscribe()
                 throws java.io.IOException
Unsubscribe from all events on remote end (regardless of listener).

Parameters:
listener -
Throws:
java.io.IOException

takeService

public Service takeService(java.lang.Class<? extends Service> serviceInterface)
                    throws InvalidClassError
Gets remote accessor implementing given interface. If unknown, creates an implementation for this interface (by creating source with methods that make requests via the conn), compiles the created code, and creates an instance (with the conn). Check the dyn dir for debugging (src/dynamic). Dynamic class dest (build/dynamic) does not have to be in the classpath... there is a special internal loader for the dynamics.

Specified by:
takeService in class Services
Throws:
InvalidClassError

getServiceSpecifications

public java.util.List<ServiceSpecification> getServiceSpecifications()
Specified by:
getServiceSpecifications in class Services