com.gentics.api.portalnode.event
Interface EventBroker

All Superinterfaces:
java.io.Serializable

public interface EventBroker
extends java.io.Serializable

Interface for an event broker. An event broker is needed for distributing events to registered event handlers.


Method Summary
 void addListener(EventHandler handler, java.lang.String eventPath)
          Add an event handler for the given event path
 void addListener(EventHandler handler, java.lang.String eventPath, boolean withPriority)
          Add an event handler for the given event path
 void addListener(EventHandler handler, java.lang.String eventPath, java.lang.String Action)
          Add an event handler for the given event path and action
 void addListener(EventHandler handler, java.lang.String eventPath, java.lang.String Action, boolean withPriority)
          Add an event handler for the given event path and action
 ActionEvent createActionEvent(java.lang.String actionCommand)
          Create an action event
 void distributeEvent(ActionEvent e, java.lang.String eventPath)
          Distribute events to registered event handlers.
 boolean isLocked()
          Check whether the event broker is locked
 void removeListener(EventHandler handler, java.lang.String eventPath)
          Remove an event handler
 void removeListener(EventHandler handler, java.lang.String eventPath, java.lang.String Action)
          Remove an event handler
 void setLocked(boolean locked)
          Lock/Unlock the event broker.
 

Method Detail

setLocked

void setLocked(boolean locked)
Lock/Unlock the event broker. When the event broker is locked, no events will be distributed to event handlers

Parameters:
locked - true to lock, false to unlock

isLocked

boolean isLocked()
Check whether the event broker is locked

Returns:
true when the event broker is locked, false if not

distributeEvent

void distributeEvent(ActionEvent e,
                     java.lang.String eventPath)
                     throws NoEventsAllowedException
Distribute events to registered event handlers.

Parameters:
e - event to be distributed
eventPath - event path
Throws:
NoEventsAllowedException - when the event broker is locked

addListener

void addListener(EventHandler handler,
                 java.lang.String eventPath)
Add an event handler for the given event path

Parameters:
handler - event handler
eventPath - event path the handler is listening for

addListener

void addListener(EventHandler handler,
                 java.lang.String eventPath,
                 boolean withPriority)
Add an event handler for the given event path

Parameters:
handler - event handler
eventPath - event path the handler is listening for
withPriority - true when the listener shall be added with priority (means: the listener shall be handled before all other listeners that are already added)

addListener

void addListener(EventHandler handler,
                 java.lang.String eventPath,
                 java.lang.String Action)
Add an event handler for the given event path and action

Parameters:
handler - event handler
eventPath - event path the handler is listening for
Action - action

addListener

void addListener(EventHandler handler,
                 java.lang.String eventPath,
                 java.lang.String Action,
                 boolean withPriority)
Add an event handler for the given event path and action

Parameters:
handler - event handler
eventPath - event path the handler is listening for
Action - action
withPriority - true when the listener shall be added with priority (means: the listener shall be handled before all other listeners that are already added)

removeListener

void removeListener(EventHandler handler,
                    java.lang.String eventPath)
Remove an event handler

Parameters:
handler - event handler
eventPath - event path the handler was listening to

removeListener

void removeListener(EventHandler handler,
                    java.lang.String eventPath,
                    java.lang.String Action)
Remove an event handler

Parameters:
handler - event handler
eventPath - event path the handler was listening to
Action - action

createActionEvent

ActionEvent createActionEvent(java.lang.String actionCommand)
Create an action event

Parameters:
actionCommand - command of the action event
Returns:
action event


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.