aigames.soccer.application
Class SoccerApp

java.lang.Object
  extended byaigames.soccer.application.SoccerApp
All Implemented Interfaces:
Application, java.lang.Runnable

public class SoccerApp
extends java.lang.Object
implements Application

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

Constructor Summary
SoccerApp()
           
 
Method Summary
 void configure(java.util.Properties configuration, boolean isUnique)
          Configures instance of Application with given parameters.
 void receiveMessage(UserId userId, org.dom4j.Document messageDoc)
          Called by server to pass message from user to this instance of application.
 void registerUser(UserId userId, org.dom4j.Document message)
          Registers user with given id.
 void run()
           
 void setServer(Server serverToSet)
          Sets instance of server which will be used to communicate with to users.
 void unregisterUser(UserId userId)
          Unregisters user with given id (for example after user disconnects).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoccerApp

public SoccerApp()
Method Detail

configure

public void configure(java.util.Properties configuration,
                      boolean isUnique)
               throws ConfigurationException
Description copied from interface: Application
Configures instance of Application with given parameters.

Specified by:
configure in interface Application
Parameters:
configuration - Configuration which will be used.
isUnique - True if application is uniqe.
Throws:
ConfigurationException - Thrown when configuration is malformed or cannot be used for some reason.
See Also:
Application.configure(Properties, boolean)

setServer

public void setServer(Server serverToSet)
Description copied from interface: Application
Sets instance of server which will be used to communicate with to users.

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

unregisterUser

public void unregisterUser(UserId userId)
                    throws InvalidUserException
Description copied from interface: Application
Unregisters user with given id (for example after user disconnects).

Specified by:
unregisterUser in interface Application
Parameters:
userId - Id of user.
Throws:
InvalidUserException - Thrown when problem with deregistering occurs.
See Also:
Application.unregisterUser(snifos.common.UserId)

receiveMessage

public void receiveMessage(UserId userId,
                           org.dom4j.Document messageDoc)
                    throws InvalidUserException
Description copied from interface: Application
Called by server to pass message from user to this instance of application. If message is invalid for some reason, application should send message to the user with proper information - throwing an exception is not advised.

Specified by:
receiveMessage in interface Application
Parameters:
userId - Id of user which sends message.
messageDoc - Received message.
Throws:
InvalidUserException - Thrown when user id is invalid.
See Also:
Application.receiveMessage(snifos.common.UserId, org.dom4j.Document)

run

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

registerUser

public void registerUser(UserId userId,
                         org.dom4j.Document message)
                  throws InvalidUserException
Description copied from interface: Application
Registers user with given id.

Specified by:
registerUser in interface Application
Parameters:
userId - Id of user to register.
message - First message sent by user (can contain some user specific informations)
Throws:
InvalidUserException - Thrown when user cannot be registered by given application instance
See Also:
Application.registerUser(UserId, Document)


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