Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

oracle.adfmf.framework.event
Class EventSource

Object
  extended by oracle.adfmf.framework.event.EventSource

public abstract class EventSource
extends Object

Abstract super-class for classes representing type (or source) of the event.
For ex : Remote Notification, Local Notification, SMS, etc.

See Also:
Event, EventListener

Constructor Summary
EventSource(String srcName)
          Constructor
 
Method Summary
 void addListener(EventListener listener)
          Adds an event listener
 void broadcastError(AdfException error)
          Broadcasts error to registered event listeners.
 void disableBroadcast()
          Called to disable broadcasting of future events to event listener.
 void enableBroadcast()
          Called to enable broadcasting of events to event listener.
 String getId()
          An ID (if any) that can be used for identifying the event source in addition to name
 String getName()
          Return a unique name identifying this event source
 void removeListener(EventListener listener)
          Removes an event listener
 void setId(String id)
          Set id
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventSource

public EventSource(String srcName)
Constructor

Parameters:
srcName - unique name identifying this event source
Method Detail

getName

public String getName()
Return a unique name identifying this event source


getId

public String getId()
An ID (if any) that can be used for identifying the event source in addition to name

Returns:
id of the event source

addListener

public void addListener(EventListener listener)
Adds an event listener

Parameters:
listener - an event listener to add
See Also:
EventListener

removeListener

public void removeListener(EventListener listener)
Removes an event listener

Parameters:
listener - an event listener to remove
See Also:
EventListener

setId

public void setId(String id)
Set id

Parameters:
id - the id of the event source

enableBroadcast

public void enableBroadcast()
Called to enable broadcasting of events to event listener.

It is recommended that the event source subclass implements a queuing mechanism and override this method

See Also:
disableBroadcast()

disableBroadcast

public void disableBroadcast()
Called to disable broadcasting of future events to event listener.

It is recommended that the event source subclass implements a queuing mechanism and override this method

See Also:
enableBroadcast()

broadcastError

public void broadcastError(AdfException error)
Broadcasts error to registered event listeners.

This method invokes EventListener.onError(oracle.adfmf.framework.exception.AdfException) on all registered listeners for this event source.

If an event source wants to implement a queueing mechanism such that the error event is queued when broadcasting is disabled and delivered to the registered listeners after broadcasting is enabled it should override this method to implement queueing logic.

Parameters:
error - error
See Also:
enableBroadcast(), disableBroadcast()

Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

Copyright © 2014 Oracle. All Rights Reserved.