com.cra.bnet.error
Class ErrorNotifier

java.lang.Object
  |
  +--com.cra.bnet.error.ErrorNotifier

public class ErrorNotifier
extends Object

A class used to notify error listeners that an error occurred. Note that this class is a singleton and the only way to obtain the instance is by the getInstance method.

There are two different situations when errors occur:


Method Summary
 void addErrorListener(ErrorListener listener)
          Registers the specified error listener so it will receive errors.
static ErrorNotifier getInstance()
          Returns the single instance of this class.
 void post(BnetError error)
          Notifies all error listeners of the specified error.
 void removeErrorListener(ErrorListener listener)
          Unregisters the specified error listener so it will no longer receive error events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addErrorListener

public void addErrorListener(ErrorListener listener)
Registers the specified error listener so it will receive errors.

Parameters:
listener - error listener.

getInstance

public static ErrorNotifier getInstance()
Returns the single instance of this class.

Returns:
the single instance of this class.

post

public void post(BnetError error)
Notifies all error listeners of the specified error.

Parameters:
error - error event object.

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Unregisters the specified error listener so it will no longer receive error events.

Parameters:
listener - error listener.