org.gscg.common.interactionlayer
Interface GlobalInteractionLayerInterface

All Superinterfaces:
java.util.EventListener, nl.tudelft.simulation.event.EventListenerInterface, nl.tudelft.simulation.event.EventProducerInterface, java.rmi.Remote, nl.tudelft.simulation.event.remote.RemoteEventProducerInterface
All Known Subinterfaces:
RemoteInteractionLayerInterface, RemoteInteractionLayerInterface, SingleUserInteractionLayerInterface
All Known Implementing Classes:
DistributorSingleUserInteractionLayer, GameLeaderInteractionLayer, ManufacturerSingleUserInteractionLayer

public interface GlobalInteractionLayerInterface
extends nl.tudelft.simulation.event.EventListenerInterface, nl.tudelft.simulation.event.remote.RemoteEventProducerInterface

Defines the methods for all the interaction layers present in a distributed interactive simulation, i.e. the single user and game leader interaction layers..

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Since:
1.1.1
Version:
$Revision: 1.1 $ $Date: 2005/06/16 12:33:58 $
Author:
Stijn-Pieter van Houten

Field Summary
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Method Summary
 void addEventTypeSentByClient(nl.tudelft.simulation.event.EventType eventType)
          Method addEventTypeSentByClient.
 void addEventTypeToAnnounceList(nl.tudelft.simulation.event.EventType eventType, AnnounceInterface announceObject)
          Method addEventTypeToAnnounceList.
 void getCache(java.lang.Object object, nl.tudelft.simulation.event.EventType eventType, boolean announce)
          this method is used by a remote client to indicate that it is 'online' the server side object is then able to subscribe to client side events and to send cached data
 nl.tudelft.simulation.event.EventType[] getStatisticEventTypes()
           
 int getTotalNumberOfDays()
           
 boolean login(nl.tudelft.simulation.event.remote.RemoteEventListenerInterface client)
           
 
Methods inherited from interface nl.tudelft.simulation.event.EventListenerInterface
notify
 
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypes, removeListener
 

Method Detail

addEventTypeSentByClient

public void addEventTypeSentByClient(nl.tudelft.simulation.event.EventType eventType)
                              throws java.rmi.RemoteException
Method addEventTypeSentByClient. EventTypes added using this method are fired by a client. Object which are interested in these events subscribe them as listeners to these events. At the same time, when the interaction layer receives one of these events, the event is checked with a list of known events.

Parameters:
eventType - the event type to add
Throws:
java.rmi.RemoteException - thrown in case of a network error

addEventTypeToAnnounceList

public void addEventTypeToAnnounceList(nl.tudelft.simulation.event.EventType eventType,
                                       AnnounceInterface announceObject)
                                throws java.rmi.RemoteException
Method addEventTypeToAnnounceList. Adds an event type and the corresponding announce object to a hashmap.

Parameters:
eventType - the event type
announceObject - the object to announce
Throws:
java.rmi.RemoteException - thrown in case of a network error

getCache

public void getCache(java.lang.Object object,
                     nl.tudelft.simulation.event.EventType eventType,
                     boolean announce)
              throws java.rmi.RemoteException
this method is used by a remote client to indicate that it is 'online' the server side object is then able to subscribe to client side events and to send cached data

Parameters:
object - the remote event producer or the remote event listener, may be null
eventType - the event type given as an argument for the announce method, may not be null
announce - true if this method is called during initialization of a client user interface; false in case of announcing for a statistic
Throws:
java.rmi.RemoteException - thrown in case of a network error

getStatisticEventTypes

public nl.tudelft.simulation.event.EventType[] getStatisticEventTypes()
                                                               throws java.rmi.RemoteException
Returns:
Returns an array with event types for statistics
Throws:
java.rmi.RemoteException - thrown in case of network failure

getTotalNumberOfDays

public int getTotalNumberOfDays()
                         throws java.rmi.RemoteException
Returns:
Returns an integer representing the total number of days of the simulation. This integer is used for stastistics as a range.
Throws:
java.rmi.RemoteException - thrown in case of network failure

login

public boolean login(nl.tudelft.simulation.event.remote.RemoteEventListenerInterface client)
              throws java.rmi.RemoteException
Parameters:
client - The client to login
Returns:
Returns returns true if an interactionlayer is already logged in
Throws:
java.rmi.RemoteException - thrown in case of network failure


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.