jtge.engine.handler
Class Subject

java.lang.Object
  extended byjtge.engine.handler.Subject
All Implemented Interfaces:
IConsumer

public class Subject
extends java.lang.Object
implements IConsumer

Provides a means to broadcast received commands to several consumers.

Version:
$Revision: 1.3 $ $Date: 2005/08/26 18:09:36 $
Author:
Mathieu Champlon

Constructor Summary
Subject()
          Create a subject.
 
Method Summary
 void handle(ICommand command)
          Handle a command.
 void register(IConsumer observer)
          Register an observer.
 void unregister(IConsumer observer)
          Unregister an observer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Subject

public Subject()
Create a subject.

Method Detail

register

public final void register(IConsumer observer)
Register an observer.

If the consumer was previously registered this method has no effect.

Parameters:
observer - the consumer to register (should not be null)

unregister

public final void unregister(IConsumer observer)
Unregister an observer.

Parameters:
observer - the consumer to unregister

handle

public final void handle(ICommand command)
Handle a command.

Specified by:
handle in interface IConsumer
Parameters:
command - the command to handle


Copyright © 2003-2005 . All Rights Reserved.