com.sdm.quasar.client.core.server.impl.plugins
Class ImplementationServerProxyPlugin

java.lang.Object
  extended bycom.sdm.quasar.client.core.server.impl.plugins.ImplementationServerProxyPlugin
All Implemented Interfaces:
ServerProxyPlugin

public class ImplementationServerProxyPlugin
extends java.lang.Object
implements ServerProxyPlugin

A simple ServerProxyPlugin implementation that allows to register service implementations at this plugin. Processing the server service call simply means calling these registered implementations.

Version:
1.$Revision$
Author:
Thomas Wolf

Nested Class Summary
 
Nested classes inherited from class com.sdm.quasar.client.core.server.impl.ServerProxyPlugin
ServerProxyPlugin.ServerProxyPluginCallback
 
Constructor Summary
ImplementationServerProxyPlugin()
          Creates a new ImplementationServerProxyPlugin.
 
Method Summary
 boolean hasServerService(java.lang.Class service, ServerProxyPlugin.ServerProxyPluginCallback serverProxyPluginCallback)
          Tests, whether a service is registered with the service manager.
 java.lang.Object processServerServiceCall(java.lang.Class serverInterface, java.lang.reflect.Method method, java.lang.Object[] args, ServerProxyPlugin.ServerProxyPluginCallback serverProxyPluginCallback)
           
 void registerServiceImplementation(java.lang.Class serviceInterface, java.lang.Object serviceImplementation)
          Registers an implementation of a server service interface
 void unregisterServiceImplementation(java.lang.Class serviceInterface, java.lang.Object serviceImplementation)
          Unregisters a previously registered service implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplementationServerProxyPlugin

public ImplementationServerProxyPlugin()
Creates a new ImplementationServerProxyPlugin.

Method Detail

registerServiceImplementation

public void registerServiceImplementation(java.lang.Class serviceInterface,
                                          java.lang.Object serviceImplementation)
Registers an implementation of a server service interface

Parameters:
serviceInterface - the service interface to register an implementation for (not null)
serviceImplementation - the implementation of that service (not null, must implement serviceInterface)
Throws:
java.lang.IllegalArgumentException - if the service interface class describes not an interface or if the service implementation is not implementing the service interface

unregisterServiceImplementation

public void unregisterServiceImplementation(java.lang.Class serviceInterface,
                                            java.lang.Object serviceImplementation)
Unregisters a previously registered service implementation

Parameters:
serviceInterface - the service interface to register an implementation for (not null)
serviceImplementation - the implementation of that service (not null, must implement serviceInterface)

hasServerService

public boolean hasServerService(java.lang.Class service,
                                ServerProxyPlugin.ServerProxyPluginCallback serverProxyPluginCallback)
Description copied from interface: ServerProxyPlugin
Tests, whether a service is registered with the service manager.

Specified by:
hasServerService in interface ServerProxyPlugin
Parameters:
service - the interface that defines the service
Returns:
true, iff an implementation is registered for the given service.
See Also:
ServerProxyPlugin.hasServerService(java.lang.Class, com.sdm.quasar.client.core.server.impl.ServerProxyPlugin.ServerProxyPluginCallback)

processServerServiceCall

public java.lang.Object processServerServiceCall(java.lang.Class serverInterface,
                                                 java.lang.reflect.Method method,
                                                 java.lang.Object[] args,
                                                 ServerProxyPlugin.ServerProxyPluginCallback serverProxyPluginCallback)
                                          throws java.lang.Throwable
Specified by:
processServerServiceCall in interface ServerProxyPlugin
Parameters:
serverInterface -
method -
args -
serverProxyPluginCallback - a ServerProxyPlugin.ServerProxyPluginCallback to access the subsequent ServerProxyPlugins without knowing them
Returns:
Throws:
java.lang.Throwable
See Also:
ServerProxyPlugin.processServerServiceCall(java.lang.Class, java.lang.reflect.Method, java.lang.Object[], com.sdm.quasar.client.core.server.impl.ServerProxyPlugin.ServerProxyPluginCallback)