org.micropsi.comp.common
Class ComponentServerFacade

java.lang.Object
  extended byorg.micropsi.comp.common.ComponentServerFacade

public class ComponentServerFacade
extends java.lang.Object

A components server facade. Use this from within the component to register your request handlers. Typically this will be done in the component's performInitialisation() method.


Constructor Summary
ComponentServerFacade(ConfigurationReaderIF config, java.lang.String prefix)
          Creates the facade.
 
Method Summary
 ComChannelServerIF getServer(java.lang.String servername)
          Return the channelserver "servername"
 void registerRequestHandler(java.lang.String servername, RequestHandlerIF handler)
          Register a new request handler with the channelserver "servername".
 void unregisterRequestHandler(java.lang.String servername, java.lang.String handlername)
          unregister a RequestHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentServerFacade

public ComponentServerFacade(ConfigurationReaderIF config,
                             java.lang.String prefix)
                      throws MicropsiConfigException,
                             MicropsiException
Creates the facade. Channelservers will be created according to the configuration.

Method Detail

registerRequestHandler

public void registerRequestHandler(java.lang.String servername,
                                   RequestHandlerIF handler)
                            throws MicropsiException
Register a new request handler with the channelserver "servername". You don't have to care about threads, but you have to know which channelservers are there. Every component will define this and use a corresponding configuration.

Throws:
MicropsiException

unregisterRequestHandler

public void unregisterRequestHandler(java.lang.String servername,
                                     java.lang.String handlername)
                              throws MicropsiException
unregister a RequestHandler. You probably won't need this unless you want to change the behaviour of your component very drastically during runtime.

Throws:
MicropsiException

getServer

public ComChannelServerIF getServer(java.lang.String servername)
                             throws MicropsiException
Return the channelserver "servername"

Throws:
MicropsiException

(c) by Micropsi Project: http://www.cognitive-agents.org

.