Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Module bea.wlp.disc.event

This module provides a basic model for interacting with custom Disc events. For documentation about specific events, see the documentation for those events in their parent module's documentation.

Class Event


public class Event

This class provides a simple eventing framework. Instances of this class represent discrete event types, and an occurrence of the event itself is manifested when the event instance is fired. Listeners may be added or removed from event instances to signal their interest in particular event types derived from this class.


 
Method Summary
public void addListener(listener, [cancelListener])
          Adds a function as a listener to an event instance.
public void cancel()
          Cancels the current firing of this event if this is a cancellable event.
public string getName()
          Returns the name of this event.
public boolean isCancellable()
          Returns whether or not the event instance is cancellable when the event is fired.
public void removeListener(listener)
          Removes a listener function (and associated cancel listener function, if any) from an event instance.
 
Method Detail

addListener

public void addListener(listener, [cancelListener]) 
Adds a function as a listener to an event instance. Arguments passed to the listener and cancelListener callbacks on invocation include an event-specific payload object (if any) and a reference to the event being fired, respectively.
Parameters:
function listener - The callback function to execute when this event is fired; not null
function [cancelListener] - An optional listener to be invoked if the firing of this event is cancelled; this will be called iff the listener with which it is associated has already been called, and is not the listener responsible for cancelling the event (i.e. neither unfired listeners nor the listener that cancels the event will have their cancel listeners invoked); note that the cancel listener will also only ever be called if the event instance to which the cancel listener is added is, in fact, cancellable

cancel

public void cancel() 
Cancels the current firing of this event if this is a cancellable event. If this event is not cancellable, an error is thrown.

getName

public string getName() 
Returns the name of this event.
Returns:
string - The name of this event

isCancellable

public boolean isCancellable() 
Returns whether or not the event instance is cancellable when the event is fired.
Returns:
boolean - True if the event instance is cancellable

removeListener

public void removeListener(listener) 
Removes a listener function (and associated cancel listener function, if any) from an event instance.
Parameters:
function listener - The listener function to be removed


Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Copyright © 2011, Oracle. All rights reserved.