org.cb.jset.server
Class JSetGameServer

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byorg.cb.jset.server.JSetGameServer
All Implemented Interfaces:
java.rmi.Remote, RemoteSetGameServer, java.io.Serializable

public class JSetGameServer
extends java.rmi.server.UnicastRemoteObject
implements RemoteSetGameServer

Provides accesses to RemoteSetGame implementations.

Version:
$Id: JSetGameServer.java 130 2004-04-15 05:18:07Z jerome $
Author:
jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
JSetGameServer()
          Creates a new instance of JSetGameServer.
 
Method Summary
 int createGame(java.lang.String name, int nbPlayers)
          Create a game with the specified number of players.
 RemoteSetGame getGame(int id)
          Returns the game identified by the specified id.
 RemoteSetGame[] getGames()
           
static void main(java.lang.String[] args)
          Starts a JSetGameServer.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSetGameServer

public JSetGameServer()
               throws java.rmi.RemoteException
Creates a new instance of JSetGameServer.

Throws:
java.rmi.RemoteException - if failed to export object
Method Detail

createGame

public int createGame(java.lang.String name,
                      int nbPlayers)
               throws java.rmi.RemoteException
Create a game with the specified number of players.

Specified by:
createGame in interface RemoteSetGameServer
Parameters:
name - the name of the game.
nbPlayers - the number of players.
Returns:
the new game id
Throws:
java.rmi.RemoteException - upon communication related exception on this remote call

getGame

public RemoteSetGame getGame(int id)
                      throws java.rmi.RemoteException
Returns the game identified by the specified id.

Specified by:
getGame in interface RemoteSetGameServer
Parameters:
id - the id of the game to return
Returns:
the game if found, or null if none found.
Throws:
java.rmi.RemoteException - upon communication related exception on this remote call

getGames

public RemoteSetGame[] getGames()
                         throws java.rmi.RemoteException
Specified by:
getGames in interface RemoteSetGameServer
Returns:
the different remote games known to this server.
Throws:
java.rmi.RemoteException - upon communication related exception on this remote call

main

public static void main(java.lang.String[] args)
Starts a JSetGameServer.

Parameters:
args - no specific argument expected


Copyright © 2004 CoffeeBreaks. All Rights Reserved.