javax.portlet.faces
Interface Bridge


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:

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

BRIDGE_PACKAGE_PREFIX

static final String BRIDGE_PACKAGE_PREFIX
See Also:
Constant Field Values

MAX_MANAGED_REQUEST_SCOPES

static final String MAX_MANAGED_REQUEST_SCOPES
See Also:
Constant Field Values

RENDER_POLICY

static final String RENDER_POLICY
See Also:
Constant Field Values

LIFECYCLE_ID

static final String LIFECYCLE_ID
See Also:
Constant Field Values

IS_POSTBACK_ATTRIBUTE

static final String IS_POSTBACK_ATTRIBUTE
See Also:
Constant Field Values

APPLICATION_SCOPE_MAP

static final String APPLICATION_SCOPE_MAP
See Also:
Constant Field Values

PORTLET_MODE_PARAMETER

static final String PORTLET_MODE_PARAMETER
See Also:
Constant Field Values

PORTLET_WINDOWSTATE_PARAMETER

static final String PORTLET_WINDOWSTATE_PARAMETER
See Also:
Constant Field Values

PORTLET_SECURE_PARAMETER

static final String PORTLET_SECURE_PARAMETER
See Also:
Constant Field Values

PRESERVE_ACTION_PARAMS

static final String PRESERVE_ACTION_PARAMS
See Also:
Constant Field Values

EXCLUDED_REQUEST_ATTRIBUTES

static final String EXCLUDED_REQUEST_ATTRIBUTES
See Also:
Constant Field Values

DIRECT_LINK

static final String DIRECT_LINK
See Also:
Constant Field Values

SESSION_APPLICATION_SCOPE_MAP

static final String SESSION_APPLICATION_SCOPE_MAP
See Also:
Constant Field Values

RENDER_CONTENT_AFTER_VIEW

static final String RENDER_CONTENT_AFTER_VIEW
See Also:
Constant Field Values

AFTER_VIEW_CONTENT

static final String AFTER_VIEW_CONTENT
See Also:
Constant Field Values

DEFAULT_VIEWID

static final String DEFAULT_VIEWID
See Also:
Constant Field Values

PORTLET_LIFECYCLE_PHASE

static final String PORTLET_LIFECYCLE_PHASE
See Also:
Constant Field Values

PORTLET_ISNAMESPACED_PROPERTY

static final String PORTLET_ISNAMESPACED_PROPERTY
See Also:
Constant Field Values
Method Detail

init

void init(javax.portlet.PortletConfig config)
          throws BridgeException
Called by the portlet. It indicates that the bridge is being placed into service.

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:

Parameters:
config - a PortletConfig object containing the portlet's configuration and initialization parameters
Throws:
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

doFacesRequest

void doFacesRequest(javax.portlet.ActionRequest request,
                    javax.portlet.ActionResponse response)
                    throws BridgeDefaultViewNotSpecifiedException,
                           BridgeException
Called by the portlet when it wants the bridge to process an action request.

Parameters:
request - the request object.
response - the response object.
Throws:
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.

doFacesRequest

void doFacesRequest(javax.portlet.RenderRequest request,
                    javax.portlet.RenderResponse response)
                    throws BridgeDefaultViewNotSpecifiedException,
                           BridgeException
Called by the portlet when it wants the bridge to process a render request.

Parameters:
request - the request object.
response - the response object.
Throws:
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.

destroy

void destroy()
Called by the portlet to take the bridge out of service. Once out of service, the bridge must be reinitialized before processing any further requests.



Copyright © 2007-2008 The Apache Software Foundation. All Rights Reserved.