|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Bridge
The Bridge
interface is used by a portlet to execute a JSF artifact. Its lifecycle
follows the pattern used by other web components such as portlets or servlets, namely:
init
: one time (per portlet) initialization. Usually invoked during portlet
init
but may also occur lazily. Context is passed to the Bridge at initialization
via PortletContext
attributes. See method description for details. doFacesRequest
: called for each portlet request that is to be handled by
Faces. Must only be called after the bridge has been initialized. destroy
: called to destroy this bridge instance. Usually invoked during
portlet destroy
but may also occur earlier if the portlet decides to reclaim
resources.
Portlet developers are encouraged to allow deployers an ability to configure the particular
Bridge implementation it uses within a given deployment. This ensures a best fit solution for a
given application server, portlet container, and/or Faces environment. The specifics for this
configuation are undefined. Each portlet can define a preferred mechanism. Subclasses of
GenericFacesPortlet
automatically inherit this behavior as it recognizes a defined
portlet initialization parameter.
Implementations of this Bridge
interface are required to have a code
constructor.
Nested Class Summary | |
---|---|
static class |
Bridge.BridgeRenderPolicy
|
static class |
Bridge.PortletPhase
|
Field Summary | |
---|---|
static String |
AFTER_VIEW_CONTENT
|
static String |
APPLICATION_SCOPE_MAP
|
static String |
BRIDGE_PACKAGE_PREFIX
|
static String |
DEFAULT_VIEWID
|
static String |
DIRECT_LINK
|
static String |
EXCLUDED_REQUEST_ATTRIBUTES
|
static String |
IS_POSTBACK_ATTRIBUTE
|
static String |
LIFECYCLE_ID
|
static String |
MAX_MANAGED_REQUEST_SCOPES
|
static String |
PORTLET_ISNAMESPACED_PROPERTY
|
static String |
PORTLET_LIFECYCLE_PHASE
|
static String |
PORTLET_MODE_PARAMETER
|
static String |
PORTLET_SECURE_PARAMETER
|
static String |
PORTLET_WINDOWSTATE_PARAMETER
|
static String |
PRESERVE_ACTION_PARAMS
|
static String |
RENDER_CONTENT_AFTER_VIEW
|
static String |
RENDER_POLICY
|
static String |
SESSION_APPLICATION_SCOPE_MAP
|
Method Summary | |
---|---|
void |
destroy()
Called by the portlet to take the bridge out of service. |
void |
doFacesRequest(javax.portlet.ActionRequest request,
javax.portlet.ActionResponse response)
Called by the portlet when it wants the bridge to process an action request. |
void |
doFacesRequest(javax.portlet.RenderRequest request,
javax.portlet.RenderResponse response)
Called by the portlet when it wants the bridge to process a render request. |
void |
init(javax.portlet.PortletConfig config)
Called by the portlet. |
Field Detail |
---|
static final String BRIDGE_PACKAGE_PREFIX
static final String MAX_MANAGED_REQUEST_SCOPES
static final String RENDER_POLICY
static final String LIFECYCLE_ID
static final String IS_POSTBACK_ATTRIBUTE
static final String APPLICATION_SCOPE_MAP
static final String PORTLET_MODE_PARAMETER
static final String PORTLET_WINDOWSTATE_PARAMETER
static final String PORTLET_SECURE_PARAMETER
static final String PRESERVE_ACTION_PARAMS
static final String EXCLUDED_REQUEST_ATTRIBUTES
static final String DIRECT_LINK
static final String SESSION_APPLICATION_SCOPE_MAP
static final String RENDER_CONTENT_AFTER_VIEW
static final String AFTER_VIEW_CONTENT
static final String DEFAULT_VIEWID
static final String PORTLET_LIFECYCLE_PHASE
static final String PORTLET_ISNAMESPACED_PROPERTY
Method Detail |
---|
void init(javax.portlet.PortletConfig config) throws BridgeException
The portlet calls the init
method exactly once before invoking other lifecycle
methods. Usually, done immediately after instantiating the bridge. The init
method must complete successfully before the bridge can receive any requests.
The portlet cannot place the bridge into service if the init
method Throws a
BridgeException
.
Initialization context is passed to bridge via PortletContext
attributes. The
following attributes are defined:
javax.portlet.faces.encodeRedirectURL
: instructs the bridge to call
ExternalContext.encodeActionURL()
before processing the redirect request. This
exists because some (newer) versions of JSF 1.2 call encodeActionURL
before
calling redirect
while others do not. This flag adjusts the behavior of the
bridge in accordance with the JSF 1.2 implementation it runs with.
javax.portlet.faces.numManagedActionScopes
: defines the maximum number of
actionScopes this bridge preserves at any given time. Value is an integer. ActionScopes are
managed on a per Bridge class portlet context wide basis. As a typical portlet application uses
the same bridge implementation for all its Faces based portlets, this means that all
actionScopes are managed in a single bucket.NUM_MANAGED_ACTIONSCOPES
constant.
javax.faces.lifecycleID
: defines the Faces Lifecycle
id
that bridge uses when acquiring the Faces.Lifecycle
via which it executes the
request. As a context wide attribute, all bridge instances in this portlet application will use
this lifecyle.
javax.portlet.faces.[portlet name].preserveActionParams
: instructs the
bridge to preserve action parameters in the action scope and represent them in subsequent
renders. Should be used only when binding to a Faces implementation that relies on accessing
such parameters during its render phase. As this is a portlet/bridge instance specific
attribute, the PortletContext
attribute name is qualified by the portlet
instance name. This allows different portlets within the same portlet application to have
different settings.
config
- a PortletConfig
object containing the portlet's configuration and
initialization parameters
javax.portlet.PortletException
- if an exception has occurred that interferes with the portlet's normal operation.
javax.portlet.UnavailableException
- if the portlet cannot perform the initialization at this time.
BridgeException
void doFacesRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) throws BridgeDefaultViewNotSpecifiedException, BridgeException
request
- the request object.response
- the response object.
BridgeDefaultViewNotSpecifiedException
- thrown if the request indicates to the Bridge that is should use the default ViewId
and the portlet hasn't supplied one.
BridgeException
- all other internal exceptions are converted to a BridgeException.void doFacesRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws BridgeDefaultViewNotSpecifiedException, BridgeException
request
- the request object.response
- the response object.
BridgeDefaultViewNotSpecifiedException
- thrown if the request indicates to the Bridge that is should use the default ViewId
and the portlet hasn't supplied one.
BridgeException
- all other internal exceptions are converted to a BridgeException.void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |