aigames.soccer.communication
Class SocketCommModule

java.lang.Object
  extended byaigames.soccer.communication.SocketCommModule
All Implemented Interfaces:
CommModule, java.lang.Runnable

public class SocketCommModule
extends java.lang.Object
implements CommModule

The socket communication module class.

Version:
$Id: SocketCommModule.java,v 1.5 2004/05/08 21:55:26 mwerla Exp $

Constructor Summary
SocketCommModule()
          Default constructor.
 
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 run()
           
 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 setTest(boolean b)
          Setter for test property.
 void shutdown()
          Stops communication module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketCommModule

public SocketCommModule()
Default constructor.

Method Detail

configure

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

Specified by:
configure in interface CommModule
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.
See Also:
CommModule.configure(java.util.Properties, int)

setServer

public void setServer(Server server)
Description copied from interface: CommModule
Sets instance of server which will be used to pass messages to applications.

Specified by:
setServer in interface CommModule
Parameters:
server - Server instance.
See Also:
CommModule.setServer(snifos.server.Server)

sendMessage

public void sendMessage(UserId userId,
                        org.dom4j.Document message)
                 throws InvalidUserException
Description copied from interface: CommModule
Called by server to send message to user.

Specified by:
sendMessage in interface CommModule
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.
See Also:
CommModule.sendMessage(snifos.common.UserId, org.dom4j.Document)

disconnectUser

public void disconnectUser(UserId userId)
Description copied from interface: CommModule
Disconnects given user from a module.

Specified by:
disconnectUser in interface CommModule
Parameters:
userId - User id.
See Also:
CommModule.disconnectUser(snifos.common.UserId)

shutdown

public void shutdown()
Description copied from interface: CommModule
Stops communication module.

Specified by:
shutdown in interface CommModule
See Also:
CommModule.shutdown()

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

setTest

public void setTest(boolean b)
Setter for test property.

Parameters:
b -


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