org.jboss.seam.core
Class Events

java.lang.Object
  extended by org.jboss.seam.core.Events

@Scope(value=EVENT)
@BypassInterceptors
@Name(value="org.jboss.seam.core.events")
@Install(precedence=0)
public class Events
extends Object

Support for Seam component-driven events

Author:
Gavin King

Constructor Summary
Events()
           
 
Method Summary
 void addListener(String type, String methodBindingExpression, Class... argTypes)
          Add a new listener for a given event type
static boolean exists()
           
protected  Dispatcher getDispatcher()
           
static Events instance()
           
 void raiseAsynchronousEvent(String type, Object... parameters)
          Raise an event that is to be processed asynchronously
 void raiseEvent(String type, Object... parameters)
          Raise an event that is to be processed synchronously
 void raiseTimedEvent(String type, Schedule schedule, Object... parameters)
          Raise an event that is to be processed according to a "schedule"
 void raiseTransactionCompletionEvent(String type, Object... parameters)
          Raise an event that is to be processed after the current transaction ends
 void raiseTransactionSuccessEvent(String type, Object... parameters)
          Raise an event that is to be processed after successful completion of the current transaction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Events

public Events()
Method Detail

addListener

public void addListener(String type,
                        String methodBindingExpression,
                        Class... argTypes)
Add a new listener for a given event type

Parameters:
type - the event type
methodBindingExpression - a method binding, expressed in EL
argTypes - the argument types of the method binding

raiseEvent

public void raiseEvent(String type,
                       Object... parameters)
Raise an event that is to be processed synchronously

Parameters:
type - the event type
parameters - parameters to be passes to the listener method

raiseAsynchronousEvent

public void raiseAsynchronousEvent(String type,
                                   Object... parameters)
Raise an event that is to be processed asynchronously

Parameters:
type - the event type
parameters - parameters to be passes to the listener method

raiseTimedEvent

public void raiseTimedEvent(String type,
                            Schedule schedule,
                            Object... parameters)
Raise an event that is to be processed according to a "schedule"

Parameters:
type - the event type
schedule - the schedule object, specific to the dispatcher strategy
parameters - parameters to be passes to the listener method
See Also:
(EJB, quartz or JDK timer service), (quartz timer service only)

raiseTransactionSuccessEvent

public void raiseTransactionSuccessEvent(String type,
                                         Object... parameters)
Raise an event that is to be processed after successful completion of the current transaction

Parameters:
type - the event type
parameters - parameters to be passes to the listener method

raiseTransactionCompletionEvent

public void raiseTransactionCompletionEvent(String type,
                                            Object... parameters)
Raise an event that is to be processed after the current transaction ends

Parameters:
type - the event type
parameters - parameters to be passes to the listener method

getDispatcher

protected Dispatcher getDispatcher()
Returns:
the Dispatcher object to use for dispatching asynchronous and timed events

exists

public static boolean exists()

instance

public static Events instance()


Copyright © 2011 Seam Framework. All Rights Reserved.