|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.application.Application
javax.faces.application.ApplicationWrapper
public abstract class ApplicationWrapper
Constructor Summary | |
---|---|
ApplicationWrapper()
|
Method Summary | ||
---|---|---|
void |
addELContextListener(javax.el.ELContextListener listener)
Provide a way for Faces applications to register an ELContextListener that will be notified on creation
of ELContext instances. |
|
void |
addELResolver(javax.el.ELResolver resolver)
Cause an the argument resolver to be added to the
resolver chain as specified in section 5.5.1 of the JavaServer
Faces Specification. |
|
UIComponent |
createComponent(FacesContext context,
Resource componentResource)
Instantiate and return a new |
|
UIComponent |
createComponent(FacesContext context,
String componentType,
String rendererType)
Like |
|
UIComponent |
createComponent(ValueBinding componentBinding,
FacesContext context,
String componentType)
Deprecated. This has been replaced by createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String) . |
|
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext context,
String componentType)
Call the getValue() method on the specified ValueExpression . |
|
UIComponent |
createComponent(javax.el.ValueExpression componentExpression,
FacesContext context,
String componentType,
String rendererType)
Like |
|
MethodBinding |
createMethodBinding(String ref,
Class<?>[] params)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class>, java.lang.Class>[]) . |
|
abstract ValueBinding |
createValueBinding(String ref)
Deprecated. This has been replaced by calling getExpressionFactory() then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class>) . |
|
|
evaluateExpressionGet(FacesContext context,
String expression,
Class<? extends T> expectedType)
Get a value by evaluating an expression. |
|
javax.el.ELContextListener[] |
getELContextListeners()
If no calls have been made to Application.addELContextListener(javax.el.ELContextListener) ,
this method must return an empty array. |
|
javax.el.ELResolver |
getELResolver()
Return the singleton ELResolver instance to be used
for all EL resolution. |
|
javax.el.ExpressionFactory |
getExpressionFactory()
Return the ExpressionFactory instance for this
application. |
|
ProjectStage |
getProjectStage()
Return the project stage for the currently running application instance. |
|
PropertyResolver |
getPropertyResolver()
Deprecated. This has been replaced by getELResolver() . |
|
ResourceBundle |
getResourceBundle(FacesContext ctx,
String name)
Find a ResourceBundle as defined in the
application configuration resources under the specified name. |
|
ResourceHandler |
getResourceHandler()
Return the singleton, stateless, thread-safe |
|
abstract Application |
getWrapped()
A class that implements this interface uses this method to return an instance of the class being wrapped. |
|
void |
publishEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceBaseType,
Object source)
This method functions exactly like
|
|
void |
publishEvent(Class<? extends SystemEvent> systemEventClass,
Object source)
If there are one or more listeners
for events of the type represented by
|
|
void |
removeELContextListener(javax.el.ELContextListener listener)
Remove the argument listener from the list of
ELContextListener s. |
|
void |
setResourceHandler(ResourceHandler resourceHandler)
Set the |
|
void |
subscribeToEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener)
Install the listener instance
referenced by argument |
|
void |
subscribeToEvent(Class<? extends SystemEvent> systemEventClass,
SystemEventListener listener)
Install the listener instance
referenced by argument |
|
void |
unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener)
Remove the listener instance
referenced by argument |
|
void |
unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
SystemEventListener listener)
Remove the listener instance
referenced by argument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationWrapper()
Method Detail |
---|
public abstract Application getWrapped()
FacesWrapper
A class that implements this interface uses this method to return an instance of the class being wrapped.
getWrapped
in interface FacesWrapper<Application>
public void addELContextListener(javax.el.ELContextListener listener)
Application
Provide a way for Faces applications to register an
ELContextListener
that will be notified on creation
of ELContext
instances. This listener will be
called once per request.
An implementation is provided that throws
UnsupportedOperationException
so that users that decorate
the Application
continue to work.
addELContextListener
in class Application
public void addELResolver(javax.el.ELResolver resolver)
Application
Cause an the argument resolver
to be added to the
resolver chain as specified in section 5.5.1 of the JavaServer
Faces Specification.
It is not possible to remove an ELResolver
registered with this method, once it has been registered.
It is illegal to register an ELResolver
after
the application has received any requests from the client. If an
attempt is made to register a listener after that time, an
IllegalStateException
must be thrown. This restriction is
in place to allow the JSP container to optimize for the common
case where no additional ELResolver
s are in the
chain, aside from the standard ones. It is permissible to add
ELResolver
s before or after initialization to a
CompositeELResolver
that is already in the
chain.
The default implementation throws
UnsupportedOperationException
and is provided
for the sole purpose of not breaking existing applications that extend
Application
.
addELResolver
in class Application
public UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType) throws FacesException
Application
Call the
getValue()
method on the specified ValueExpression
. If it returns a UIComponent
instance,
return it as the value of this method. If it does not,
instantiate a new UIComponent
instance of the specified
component type, pass the new component to the
setValue()
method of the specified ValueExpression
, and return it.
Before the component instance is
returned, it must be inspected for the presence of a ListenerFor
(or ListenersFor
) or ResourceDependency
(or ResourceDependencies
) annotation. If any of these
annotations are present, the action listed in ListenerFor
or ResourceDependency
must
be taken on the component, before it is returned from this
method. This variant of createComponent
must
not inspect the Renderer
for the component to be returned for
any of the afore mentioned annotations. Such inspection is the
province of Application.createComponent(ValueExpression,
FacesContext, String, String)
or Application.createComponent(FacesContext, String, String)
.
createComponent
in class Application
componentExpression
- ValueExpression
representing a
component value expression (typically specified by the
component
attribute of a custom tag)context
- FacesContext
for the current requestcomponentType
- Component type to create if the ValueExpression
does not return a component instance
FacesException
- if a UIComponent
cannot be createdpublic UIComponent createComponent(javax.el.ValueExpression componentExpression, FacesContext context, String componentType, String rendererType)
Application
Like Application.createComponent(ValueExpression, FacesContext, String)
except
the Renderer
for the component to be returned must
be inspected for the annotations mentioned in Application.createComponent(ValueExpression, FacesContext, String)
as
specified in the documentation for that method. The
Renderer
instance to inspect must be obtained by
calling FacesContext.getRenderKit()
and calling RenderKit.getRenderer(java.lang.String, java.lang.String)
on the result, passing
the argument componentType
as the first argument and
the result of calling UIComponent.getFamily()
on the newly
created component as the second argument. If no such
Renderer
can be found, a message must be logged with
a helpful error message. Otherwise, UIComponent.setRendererType(java.lang.String)
must be called on the newly created
UIComponent
instance, passing the argument
rendererType
as the argument.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function.
createComponent
in class Application
componentExpression
- ValueExpression
representing a
component value expression (typically specified by the
component
attribute of a custom tag)context
- FacesContext
for the current requestcomponentType
- Component type to create if the ValueExpression
does not return a component instancerendererType
- The renderer-type of the
Renderer
that will render this component. A
null
value must be accepted for this parameter.public UIComponent createComponent(FacesContext context, String componentType, String rendererType)
Application
Like Application.createComponent(String)
except the Renderer
for
the component to be returned must be inspected for the
annotations mentioned in Application.createComponent(ValueExpression,
FacesContext, String)
as specified in the documentation for that
method. The Renderer
instance to inspect must be
obtained by calling FacesContext.getRenderKit()
and calling
RenderKit.getRenderer(java.lang.String, java.lang.String)
on the result,
passing the argument componentType
as the first
argument and the result of calling UIComponent.getFamily()
on the newly created component as the second argument. If no
such Renderer
can be found, a message must be logged
with a helpful error message. Otherwise, UIComponent.setRendererType(java.lang.String)
must be called on the newly created
UIComponent
instance, passing the argument
rendererType
as the argument.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
createComponent
in class Application
context
- FacesContext
for the current requestcomponentType
- Component type to createrendererType
- The renderer-type of the
Renderer
that will render this component. A
null
value must be accepted for this parameter.public UIComponent createComponent(FacesContext context, Resource componentResource)
Application
Instantiate and return a new UIComponent
instance from the argument Resource
. An
algorithm semantically equivalent to the following must be
followed to instantiate the UIComponent
to
return.
Obtain a reference to the PageDeclarationLanguage
for this Application
instance by calling ViewHandler.getPageDeclarationLanguage(javax.faces.context.FacesContext, java.lang.String)
,
passing the viewId
found by calling
UIViewRoot.getViewId()
on the
UIViewRoot
in the argument
FacesContext
.
Obtain a reference to the composite component
metadata for this composite component by calling PageDeclarationLanguage.getComponentMetadata(javax.faces.context.FacesContext, javax.faces.application.Resource)
, passing the
facesContext
and componentResource
arguments to this method. This version of JSF specification
uses JavaBeans as the API to the component metadata.
Determine if the component author declared a
component-type
for this component instance by
obtaining the BeanDescriptor
from the component
metadata and calling its getValue()
method,
passing UIComponent.COMPOSITE_COMPONENT_TYPE_KEY
as
the argument. If non-null
, the result must be a
ValueExpression
whose value is the
component-type
of the UIComponent
to
be created for this Resource
component. Call
through to Application.createComponent(java.lang.String)
to
create the component.
Otherwise, determine if a script based component for
this Resource
can be found by calling PageDeclarationLanguage.getScriptComponentResource(javax.faces.context.FacesContext, javax.faces.application.Resource)
. If the
result is non-null
, and is a script written in
one of the languages listed in 4.3 of the specification prose
document, create a UIComponent
instance from the
script resource.
Otherwise, let library-name be the return from
calling Resource.getLibraryName()
on the argument
componentResource
and resource-name be
the return from calling Resource.getResourceName()
on
the argument componentResource
. Create a fully
qualified Java class name by removing any file extension from
resource-name and let fqcn be
library-name + "." +
resource-name
. If a class with the name of
fqcn cannot be found, take no action and continue to
the next step. If any of InstantiationException
,
IllegalAccessException
, or
ClassCastException
are thrown, wrap the exception
in a FacesException
and re-throw it. If any
other exception is thrown, log the exception and
continue to the next step.
If none of the previous steps have yielded a
UIComponent
instance, call Application.createComponent(java.lang.String)
passing
"javax.faces.NamingContainer
" as the
argument.
Call UIComponent.setRendererType(java.lang.String)
on the
UIComponent
instance, passing
"javax.faces.Composite
" as the argument.
Store the argument Resource
in the
attributes Map
of the UIComponent
under the key, Resource.COMPONENT_RESOURCE_KEY
.
Store composite component metadata in the
attributes Map
of the UIComponent
under the key, UIComponent.BEANINFO_KEY
.
Before the component instance is returned, it must be
inspected for the presence of a ListenerFor
annotation. If this annotation is
present, the action listed in ListenerFor
must be taken on the component,
before it is returned from this method.
A default implementation is provided that throws
UnsupportedOperationException
so that users
that decorate Application
can continue to function.
createComponent
in class Application
context
- FacesContext
for the current requestcomponentResource
- A Resource
that points to a
source file that provides an implementation of a component.public UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType)
createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String)
.
Application
Wrap the argument componentBinding
in an
implementation of ValueExpression
and call through to
Application.createComponent(javax.el.ValueExpression,javax.faces.context.FacesContext,java.lang.String)
.
createComponent
in class Application
componentBinding
- ValueBinding
representing a
component value binding expression (typically specified by the
component
attribute of a custom tag)context
- FacesContext
for the current requestcomponentType
- Component type to create if the ValueBinding
does not return a component instancepublic MethodBinding createMethodBinding(String ref, Class<?>[] params) throws ReferenceSyntaxException
getExpressionFactory()
then ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class>, java.lang.Class>[])
.
Application
Call Application.getExpressionFactory()
then call ExpressionFactory.createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class>, java.lang.Class>[])
, passing the given
arguments, and wrap the result in a MethodBinding
implementation, returning it.
createMethodBinding
in class Application
ref
- Method binding expression for which to return a
MethodBinding
instanceparams
- Parameter signatures that must be compatible with those
of the method to be invoked, or a zero-length array or null
for a method that takes no parameters
ReferenceSyntaxException
- if the specified ref
has invalid syntaxpublic abstract ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException
getExpressionFactory()
then ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class>)
.
Call getExpressionFactory()
then call ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class>)
, passing the argument
ref
, Object.class
for the expectedType,
and null
, for the fnMapper.
createValueBinding
in class Application
ref
- Value binding expression for which to return a
ValueBinding
instance
NullPointerException
- if ref
is null
ReferenceSyntaxException
- if the specified ref
has invalid syntaxpublic PropertyResolver getPropertyResolver()
getELResolver()
.
Application
Return a PropertyResolver
instance that wraps the
ELResolver
instance that Faces provides to the unified EL
for the resolution of expressions that appear programmatically in
an application.
Note that this no longer returns the default
PropertyResolver
since that class is now a no-op
that aids in allowing custom PropertyResolver
s to
affect the EL resolution process.
getPropertyResolver
in class Application
public <T> T evaluateExpressionGet(FacesContext context, String expression, Class<? extends T> expectedType) throws javax.el.ELException
Application
Get a value by evaluating an expression.
Call Application.getExpressionFactory()
then call ExpressionFactory.createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class>)
passing the argument
expression
and expectedType
. Call
FacesContext.getELContext()
and pass it to ValueExpression.getValue(javax.el.ELContext)
, returning the result.
An implementation is provided that throws
UnsupportedOperationException
so that users that decorate
the Application
continue to work.
evaluateExpressionGet
in class Application
javax.el.ELException
public javax.el.ELContextListener[] getELContextListeners()
Application
If no calls have been made to Application.addELContextListener(javax.el.ELContextListener)
,
this method must return an empty array.
Otherwise, return an array representing the list of listeners
added by calls to Application.addELContextListener(javax.el.ELContextListener)
.
An implementation is provided that throws
UnsupportedOperationException
so that users that decorate
the Application
continue to work.
getELContextListeners
in class Application
public javax.el.ELResolver getELResolver()
Application
Return the singleton ELResolver
instance to be used
for all EL resolution. This is actually an instance of CompositeELResolver
that must contain the following
ELResolver
instances in the following order:
ELResolver
instances declared using the
<el-resolver> element in the application configuration
resources.
An implementation
that wraps the head of
the legacy VariableResolver
chain, as per section
VariableResolver ChainWrapper in Chapter 5 in the spec
document.
An implementation
that wraps the head of
the legacy PropertyResolver
chain, as per section
PropertyResolver ChainWrapper in Chapter 5 in the spec
document.
Any ELResolver
instances added by calls to
Application.addELResolver(javax.el.ELResolver)
.
The default implementation throws UnsupportedOperationException
and is provided for the sole purpose of not breaking existing applications
that extend Application
.
getELResolver
in class Application
public javax.el.ExpressionFactory getExpressionFactory()
Application
Return the ExpressionFactory
instance for this
application. This instance is used by the convenience method
Application.evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class extends T>)
.
The implementation must return the
ExpressionFactory
from the JSP container by calling
JspFactory.getDefaultFactory().getJspApplicationContext(servletContext).getExpressionFactory()
.
An implementation is provided that throws
UnsupportedOperationException
so that users that decorate
the Application
continue to work.
getExpressionFactory
in class Application
public ProjectStage getProjectStage()
Application
Return the project stage
for the currently running application instance. The default
value is ProjectStage.Production
The implementation of this method must perform the following algorithm or an equivalent with the same end result to determine the value to return.
If the value has already been determined by a previous call to this method, simply return that value.
Look for a JNDI
environment entry under the key
given by the value of ProjectStage.PROJECT_STAGE_JNDI_NAME
(return type of
java.lang.String
). If found, continue with the
algorithm below, otherwise, look for an entry in the
initParamMap
of the ExternalContext
from the current FacesContext
with the key given by
the value of ProjectStage.PROJECT_STAGE_PARAM_NAME
If a value is found, see if an enum constant can be
obtained by calling ProjectStage.valueOf()
, passing
the value from the initParamMap
. If this succeeds
without exception, save the value and return it.
If not found, or any of the previous attempts to discover the
enum constant value have failed, log a descriptive error message,
assign the value as ProjectStage.Production
and
return it.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
getProjectStage
in class Application
public ResourceBundle getResourceBundle(FacesContext ctx, String name)
Application
Find a ResourceBundle
as defined in the
application configuration resources under the specified name. If
a ResourceBundle
was defined for the name, return an
instance that uses the locale of the current UIViewRoot
.
The default implementation throws
UnsupportedOperationException
and is provided
for the sole purpose of not breaking existing applications that extend
this class.
getResourceBundle
in class Application
ResourceBundle
for the current UIViewRoot,
otherwise nullpublic ResourceHandler getResourceHandler()
Application
Return the singleton, stateless, thread-safe ResourceHandler
for this application. The JSF implementation
must support the following techniques for declaring an alternate
implementation of ResourceHandler
.
The ResourceHandler
implementation is
declared in the application configuration resources by giving
the fully qualified class name as the value of the
<resource-handler>
element within the
<application>
element.
In all of the above cases, the runtime must employ the decorator pattern as for every other pluggable artifact in JSF.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
getResourceHandler
in class Application
public void publishEvent(Class<? extends SystemEvent> systemEventClass, Object source)
Application
If there are one or more listeners
for events of the type represented by
systemEventClass
, call those listeners, passing
source
as the source of the event. The
implementation should be as fast as possible in determining
whether or not a listener for the given
systemEventClass
and source
has been
installed, and should return immediately once such a
determination has been made. The implementation of
publishEvent
must honor the requirements stated in
Application.subscribeToEvent(java.lang.Class extends javax.faces.event.SystemEvent>, java.lang.Class>, javax.faces.event.SystemEventListener)
regarding the storage and retrieval of
listener instances. Specifically, if Application.subscribeToEvent(Class,Class,SystemEventListener)
was called,
the sourceClass
argument must match exactly the
Class
of the source
argument in the
call to publishEvent()
. The implementation must not
do any inheritance hierarachy inspection when looking for a match
between the sourceClass
passed to Application.subscribeToEvent(Class,Class,SystemEventListener)
and the
sourceClass
passed to publishEvent()
in
order to find any listeners to which the event should be
published. In the case where the Class
of the
source
argument does not match the
Class
of the sourceClass
used when the
listener was subscribed using subscribeToEvent()
,
Application.publishEvent(Class,Class,Object)
can be used to provide
the Class
used to perform the listener lookup and
match.
The default implementation must implement an algorithm semantically equivalent to the following to locate listener instances and to invoke them.
If the source
argument implements SystemEventListenerHolder
, call SystemEventListenerHolder.getListenersForEventClass(java.lang.Class extends javax.faces.event.SystemEvent>)
on it, passing the systemEventClass
argument. If
the list is not empty, perform algorithm
traverseListenerList on the list.
If any Application
level listeners have
been installed by previous calls to Application.subscribeToEvent(Class, Class,
javax.faces.event.SystemEventListener)
, perform algorithm
traverseListenerList on the list.
If any Application
level listeners have
been installed by previous calls to Application.subscribeToEvent(Class, javax.faces.event.SystemEventListener)
,
perform algorithm traverseListenerList on the
list.
If the act of invoking the processListener
method
causes an AbortProcessingException
to
be thrown, processing of the listeners must be aborted, no
further processing of the listeners for this event must take
place, and the exception must be logged with
Level.SEVERE
.
Algorithm traverseListenerList: For each listener in the list,
Call SystemEventListener.isListenerForSource(java.lang.Object)
, passing the
source
argument. If this returns
false
, take no action on the listener.
Otherwise, if the event to be passed to the listener
instances has not yet been constructed, construct the event,
passing source
as the argument to the
one-argument constructor that takes an Object
.
This same event instance must be passed to all listener
instances.
Call SystemEvent.isAppropriateListener(javax.faces.event.FacesListener)
,
passing the listener instance as the argument. If this
returns false
, take no action on the
listener.
Call SystemEvent.processListener(javax.faces.event.FacesListener)
,
passing the listener instance.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
publishEvent
in class Application
systemEventClass
- The Class
of event that is
being published.source
- The source for the event of type
systemEventClass
.public void publishEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceBaseType, Object source)
Application
This method functions exactly like
Application.publishEvent(Class,Object)
, except the run-time must use
the argument sourceBaseType
to find the matching
listener instead of using the Class
of the
source
argument.
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
publishEvent
in class Application
systemEventClass
- The Class
of event that is
being published.sourceBaseType
- The Class
of the source event
that must be used to lookup the listener to which this event must
be published. If this argument is null
the return
from source.getClass()
must be used as the
sourceBaseType
.source
- The source for the event of type
systemEventClass
.public void removeELContextListener(javax.el.ELContextListener listener)
Application
Remove the argument listener
from the list of
ELContextListener
s. If listener
is null, no
exception is thrown and no action is performed. If
listener
is not in the list, no exception is thrown
and no action is performed.
An implementation is provided that throws
UnsupportedOperationException
so that users that decorate
the Application
continue to work.
removeELContextListener
in class Application
public void setResourceHandler(ResourceHandler resourceHandler)
Application
Set the ResourceHandler
instance that will be utilized
for rendering the markup for resources, and for satisfying client
requests to serve up resources.
setResourceHandler
in class Application
resourceHandler
- The new ResourceHandler
instancepublic void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
Application
Install the listener instance
referenced by argument listener
into the
application as a listener for events of type
systemEventClass
that originate from objects of type
sourceClass
.
If argument sourceClass
is non-null
,
sourceClass
and systemEventClass
must be
used to store the argument listener
in the application in
such a way that the listener
can be quickly looked
up by the implementation of Application.publishEvent(java.lang.Class extends javax.faces.event.SystemEvent>, java.lang.Object)
given
systemEventClass
and an instance of the
Class
referenced by sourceClass
. If
argument sourceClass
is null
, the
listener
must be discoverable by the implementation
of Application.publishEvent(java.lang.Class extends javax.faces.event.SystemEvent>, java.lang.Object)
given only systemEventClass
.
subscribeToEvent
in class Application
systemEventClass
- the Class
of event for which
listener
must be fired.sourceClass
- the Class
of the instance which
causes events of type systemEventClass
to be fired.
May be null
.listener
- the implementation of SystemEventListener
whose SystemEventListener.processEvent(javax.faces.event.SystemEvent)
method must be called when
events of type systemEventClass
are fired.public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
Application
Install the listener instance
referenced by argument listener
into application as
a listener for events of type systemEventClass
. The
default implementation simply calls through to Application.subscribeToEvent(Class, Class,
javax.faces.event.SystemEventListener)
passing null
as the sourceClass
argument
A default implementation is provided
that throws UnsupportedOperationException
so that
users that decorate Application
can continue to
function
subscribeToEvent
in class Application
systemEventClass
- the Class
of event for which
listener
must be fired.listener
- the implementation of SystemEventListener
whose SystemEventListener.processEvent(javax.faces.event.SystemEvent)
method must
be called when events of type systemEventClass
are
fired.public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, Class<?> sourceClass, SystemEventListener listener)
Application
Remove the listener instance
referenced by argument listener
from the application
as a listener for events of type
systemEventClass
that originate from objects of type
sourceClass
. See Application.subscribeToEvent(Class, Class,
javax.faces.event.SystemEventListener)
for the specification
of how the listener is stored, and therefore, how it must be
removed.
unsubscribeFromEvent
in class Application
systemEventClass
- the Class
of event for which
listener
must be fired.sourceClass
- the Class
of the instance which
causes events of type systemEventClass
to be fired.
May be null
.listener
- the implementation of SystemEventListener
to remove from the internal data
structure.public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass, SystemEventListener listener)
Application
Remove the listener instance
referenced by argument listener
from the application
as a listener for events of type systemEventClass
. The
default implementation simply calls through to Application.unsubscribeFromEvent(Class, javax.faces.event.SystemEventListener)
passing null
as the sourceClass
argument
unsubscribeFromEvent
in class Application
systemEventClass
- the Class
of event for which
listener
must be fired.listener
- the implementation of SystemEventListener
to remove from the internal data
structure.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |