snifos.communication
Interface CommModule

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
DummyCommModule, SocketCommModule

public interface CommModule
extends java.lang.Runnable

This interface describes communication module which can be used in SNIFOS application server.

Version:
$Id: CommModule.java,v 1.2 2004/05/08 21:55:25 mwerla Exp $

Method Summary
 void configure(java.util.Properties configuration, int commModuleId)
          Configures instance of CommModule with given parameters.
 void disconnectUser(UserId userId)
          Disconnects given user from a module.
 void sendMessage(UserId userId, org.dom4j.Document message)
          Called by server to send message to user.
 void setServer(Server server)
          Sets instance of server which will be used to pass messages to applications.
 void shutdown()
          Stops communication module.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

configure

public void configure(java.util.Properties configuration,
                      int commModuleId)
Configures instance of CommModule with given parameters.

Parameters:
configuration - Configuration which will be used.
commModuleId - Id of this instance of communication module inside the server - it is necessary to create valid user id.

setServer

public void setServer(Server server)
Sets instance of server which will be used to pass messages to applications.

Parameters:
server - Server instance.

sendMessage

public void sendMessage(UserId userId,
                        org.dom4j.Document message)
                 throws InvalidUserException
Called by server to send message to user.

Parameters:
userId - Id of user which should receive message.
message - Message to be sent.
Throws:
InvalidUserException - Thrown when user id is invalid for this communication module instance.

disconnectUser

public void disconnectUser(UserId userId)
Disconnects given user from a module.

Parameters:
userId - User id.

shutdown

public void shutdown()
Stops communication module.



Copyright © 2001-2004 MoMaT & MWe Team. All Rights Reserved.