com.sdm.quasar.client.core.server.impl
Class ServerProxy

java.lang.Object
  extended bycom.sdm.quasar.client.core.server.impl.ServerProxy
All Implemented Interfaces:
ServerAccessService, Service

public class ServerProxy
extends java.lang.Object
implements ServerAccessService

An implementation of ServerAccessService, that delegates the concrete implementation of server access to so-called ServerProxyPlugins. The plugins are called in the registered order; at least the last registered plugin should make the server-communication work and should not call the subsequent plugin (in opposide to all others).

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
ServerProxy(ServerProxyPlugin[] serverProxyPlugins)
          Creates a new ServerProxy.
 
Method Summary
 java.lang.Object getService(java.lang.Class service)
          Returns the service implementation registered with the service manager.
 BooleanState getServiceCallingBooleanState()
          Returns a BooleanState, that is true as long as a service - previously returned by getService(Class) - is beeing called.
 boolean hasService(java.lang.Class service)
          Tests, whether a service is registered with the service manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerProxy

public ServerProxy(ServerProxyPlugin[] serverProxyPlugins)
Creates a new ServerProxy.

Method Detail

getService

public java.lang.Object getService(java.lang.Class service)
Description copied from interface: ServerAccessService
Returns the service implementation registered with the service manager.

Specified by:
getService in interface ServerAccessService
Parameters:
service - the interface that defines the service
Returns:
the implementation for the service interface.
See Also:
ServerAccessService.getService(java.lang.Class)

hasService

public boolean hasService(java.lang.Class service)
Description copied from interface: ServerAccessService
Tests, whether a service is registered with the service manager.

Specified by:
hasService in interface ServerAccessService
Parameters:
service - the interface that defines the service
Returns:
true, iff an implementation is registered for the given service.
See Also:
ServerAccessService.hasService(java.lang.Class)

getServiceCallingBooleanState

public BooleanState getServiceCallingBooleanState()
Description copied from interface: ServerAccessService
Returns a BooleanState, that is true as long as a service - previously returned by ServerAccessService.getService(Class) - is beeing called.

Specified by:
getServiceCallingBooleanState in interface ServerAccessService
Returns:
a BooleanState, that is true, while any server-side-service is called.
See Also:
ServerAccessService.getServiceCallingBooleanState()