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:
  • Field Details

    • INVOKER_SEPARATOR

      public static final String INVOKER_SEPARATOR
      The separator used in the id to route to the correct invoker.
      See Also:
    • PRODUCER_CLONE_ID_PREFIX

      public static final String PRODUCER_CLONE_ID_PREFIX
      See Also:
    • 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:
    • 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:
    • CONSUMER_CLONE_ID

      public static final String CONSUMER_CLONE_ID
      See Also:
    • LOCAL_CONSUMER_CLONE

      public static final PortletContext LOCAL_CONSUMER_CLONE
    • INVALID_PORTLET_CONTEXT

      public static final String INVALID_PORTLET_CONTEXT
      See Also:
  • Constructor Details

  • Method Details

    • dereference

      public static PortletContext dereference(PortletContext compoundPortletContext)
    • interpret

      protected PortletContext.Components interpret()
    • reference

      public static PortletContext reference(String invokerId, PortletContext portletContext)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createPortletContext

      @Deprecated public static PortletContext createPortletContext(String id, byte[] state)
      Deprecated.
      Create a PortletContext based on id and optional state.
      Parameters:
      id - the portlet id
      state - 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 of createPortletContext(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 id
      state - 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 use createPortletContext(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 use reference(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