Package org.gatein.pc.api
Class PortletContext
- java.lang.Object
-
- org.gatein.pc.api.PortletContext
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
StatefulPortletContext
public class PortletContext extends Object implements Serializable
- Since:
- 2.6
- Version:
- $Revision: 6890 $
- Author:
- Julien Viet, Chris Laprun
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfacePortletContext.Componentsstatic interfacePortletContext.PortletContextComponents
-
Field Summary
Fields Modifier and Type Field Description static StringCONSUMER_CLONE_DUMMY_STATE_IDstatic StringCONSUMER_CLONE_IDstatic StringCONSUMER_CLONE_ID_PREFIXstatic intCONSUMER_CLONE_PREFIX_LENGTHstatic StringINVALID_PORTLET_CONTEXTstatic StringINVOKER_SEPARATORThe separator used in the id to route to the correct invoker.static PortletContextLOCAL_CONSUMER_CLONEstatic StringPRODUCER_CLONE_ID_PREFIXstatic intPRODUCER_CLONE_PREFIX_LENGTH
-
Constructor Summary
Constructors Modifier Constructor Description protectedPortletContext(String id)protectedPortletContext(String id, boolean interpret)protectedPortletContext(PortletContext.Components components)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PortletContextcreatePortletContext(String portletId)Creates a PortletContext by interpreting the specified identifier and breaking it down to its components.static PortletContextcreatePortletContext(String portletId, boolean interpret)static PortletContextcreatePortletContext(String id, byte[] state)Deprecated.static PortletContextcreatePortletContext(String portletId, byte[] state, boolean interpret)static PortletContextcreatePortletContext(String applicationName, String portletName)Creates a new PortletContext referencing the specified portlet in the specified application (usually a web application).static StatefulPortletContext<byte[]>createStatefulPortletContext(String id, byte[] state)Deprecated.static PortletContextdereference(PortletContext compoundPortletContext)booleanequals(Object o)PortletContext.PortletContextComponentsgetComponents()StringgetId()inthashCode()protected PortletContext.Componentsinterpret()static PortletContextreference(String invokerId, PortletContext portletContext)StringtoString()
-
-
-
Field Detail
-
INVOKER_SEPARATOR
public static final String INVOKER_SEPARATOR
The separator used in the id to route to the correct invoker.- See Also:
- Constant Field Values
-
PRODUCER_CLONE_ID_PREFIX
public static final String PRODUCER_CLONE_ID_PREFIX
- See Also:
- Constant Field Values
-
PRODUCER_CLONE_PREFIX_LENGTH
public static final int PRODUCER_CLONE_PREFIX_LENGTH
-
CONSUMER_CLONE_ID_PREFIX
public static final String CONSUMER_CLONE_ID_PREFIX
- See Also:
- Constant Field Values
-
CONSUMER_CLONE_PREFIX_LENGTH
public static final int CONSUMER_CLONE_PREFIX_LENGTH
-
CONSUMER_CLONE_DUMMY_STATE_ID
public static final String CONSUMER_CLONE_DUMMY_STATE_ID
- See Also:
- Constant Field Values
-
CONSUMER_CLONE_ID
public static final String CONSUMER_CLONE_ID
- See Also:
- Constant Field Values
-
LOCAL_CONSUMER_CLONE
public static final PortletContext LOCAL_CONSUMER_CLONE
-
INVALID_PORTLET_CONTEXT
public static final String INVALID_PORTLET_CONTEXT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PortletContext
protected PortletContext(String id) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
PortletContext
protected PortletContext(String id, boolean interpret)
-
PortletContext
protected PortletContext(PortletContext.Components components)
-
-
Method Detail
-
dereference
public static PortletContext dereference(PortletContext compoundPortletContext)
-
interpret
protected PortletContext.Components interpret()
-
reference
public static PortletContext reference(String invokerId, PortletContext portletContext)
-
getId
public String getId()
-
createPortletContext
@Deprecated public static PortletContext createPortletContext(String id, byte[] state)
Deprecated.Create a PortletContext based on id and optional state.- Parameters:
id- the portlet idstate- the optional state- Returns:
- a new PortletContext based on the provided information
-
createStatefulPortletContext
@Deprecated public static StatefulPortletContext<byte[]> createStatefulPortletContext(String id, byte[] state)
Deprecated.Create a PortletContext based on given id and required state: this method will fail if state is not valid. Use this method instead ofcreatePortletContext(String, byte[])for cases when a state is expected and the creation of the PortletContext should fail if no state was given.- Parameters:
id- the portlet idstate- the mandatory state- Returns:
- a new PortletContext
-
createPortletContext
public static PortletContext createPortletContext(String portletId)
Creates a PortletContext by interpreting the specified identifier and breaking it down to its components. When possible, it's better to usecreatePortletContext(String, String)to create the PortletContext from its components instead of trying to build it manually. In case a PortletContext namespaced by a PortletInvoker id is needed, please usereference(String, PortletContext).- Parameters:
portletId- the portlet identifier to interpret as a PortletContext- Returns:
- a newly created PortletContext representing the portlet associated with the specified identifier
- Throws:
IllegalArgumentException- if the specified identifier cannot be properly interpreted into components- See Also:
interpretIntoComponents(String)
-
createPortletContext
public static PortletContext createPortletContext(String portletId, boolean interpret)
-
createPortletContext
public static PortletContext createPortletContext(String portletId, byte[] state, boolean interpret)
-
createPortletContext
public static PortletContext createPortletContext(String applicationName, String portletName)
Creates a new PortletContext referencing the specified portlet in the specified application (usually a web application).- Parameters:
applicationName- the application name (usually a web application context path)portletName- the portlet name- Returns:
- a newly created PortletContext referencing the specified portlet in the specified application.
- Throws:
IllegalArgumentException- if the specified arguments are null or empty and if the application name is not properly formatted.
-
getComponents
public PortletContext.PortletContextComponents getComponents()
-
-