Package org.zkoss.zk.ui.event.impl
Interface EventQueueProvider
-
- All Known Implementing Classes:
EventQueueProviderImpl
,EventQueueProviderImpl
public interface EventQueueProvider
Used to instantiate an event queue.- Since:
- 5.0.0
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Event>
EventQueue<T>lookup(java.lang.String name, java.lang.String scope, boolean autoCreate)
Returns the event queue with the specified name in the specified scope.<T extends Event>
EventQueue<T>lookup(java.lang.String name, Session sess, boolean autoCreate)
Returns the event queue with the specified name in the give session (i.e., the scope).<T extends Event>
EventQueue<T>lookup(java.lang.String name, WebApp wapp, boolean autoCreate)
Returns the event queue with the specified name in the give application (i.e., the scope).boolean
remove(java.lang.String name, java.lang.String scope)
Removes the event queue.boolean
remove(java.lang.String name, Session sess)
Removes the event queue of the specified session.boolean
remove(java.lang.String name, WebApp wapp)
Removes the event queue of the specified application.
-
-
-
Method Detail
-
lookup
<T extends Event> EventQueue<T> lookup(java.lang.String name, java.lang.String scope, boolean autoCreate)
Returns the event queue with the specified name in the specified scope.Note:
- This method can be called only in an activated execution,
i.e.,
Executions.getCurrent()
not null. - By default,
EventQueueProviderImpl
is used. To customize it, refer toEventQueues
.
- Parameters:
name
- the name of the event queue.scope
- the scope of the event queue. It must supportEventQueues.DESKTOP
andEventQueues.APPLICATION
. Developers might extend it to support other types of event queues.autoCreate
- whether to create the event queue if not found.- Returns:
- the event queue with the associated name, or null if not found and autoCreate is false
- Throws:
java.lang.IllegalStateException
- if not in an activated executionjava.lang.UnsupportedOperationException
- if the scope is not supported
- This method can be called only in an activated execution,
i.e.,
-
lookup
<T extends Event> EventQueue<T> lookup(java.lang.String name, Session sess, boolean autoCreate)
Returns the event queue with the specified name in the give session (i.e., the scope).Unlike
lookup(String, String, boolean)
, this method can be called without an activated execution.- Parameters:
sess
- the session that the event queue is located (i.e., the scope)- Since:
- 5.0.2
-
lookup
<T extends Event> EventQueue<T> lookup(java.lang.String name, WebApp wapp, boolean autoCreate)
Returns the event queue with the specified name in the give application (i.e., the scope).Unlike
lookup(String, String, boolean)
, this method can be called without an activated execution.- Parameters:
wapp
- the Web application that the event queue is located (i.e., the scope)- Since:
- 5.0.2
-
remove
boolean remove(java.lang.String name, java.lang.String scope)
Removes the event queue.- Parameters:
name
- the name of the event queue.scope
- the scope of the event queue. It must supportEventQueues.DESKTOP
andEventQueues.APPLICATION
. Developers might extend it to support other types of event queues.- Returns:
- true if it is removed successfully
-
remove
boolean remove(java.lang.String name, Session sess)
Removes the event queue of the specified session.Unlike
remove(String, String)
, this method can be called without an activated execution.- Parameters:
name
- the queue name.sess
- the session that the event queue is located (i.e., the session scope)- Returns:
- true if it is removed successfully
- Since:
- 5.0.4
-
remove
boolean remove(java.lang.String name, WebApp wapp)
Removes the event queue of the specified application.Unlike
remove(String, String)
, this method can be called without an activated execution.- Parameters:
name
- the queue name.wapp
- the Web application that the event queue is located (i.e., the application scope)- Returns:
- true if it is removed successfully
- Since:
- 5.0.4
-
-