Package org.gatein.pc.api
Interface PortletInvoker
-
public interface PortletInvoker- Version:
- $Revision: 1.1 $
- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static StringLOCAL_PORTLET_INVOKER_IDThe identifier assigned to the local PortletInvoker.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PortletContextcreateClone(PortletStateType stateType, PortletContext portletContext)Clone a portlet.List<DestroyCloneFailure>destroyClones(List<PortletContext> portletContexts)Destroy a cloned portlet.PortletContextexportPortlet(PortletStateType stateType, PortletContext originalPortletContext)Exports a portlet from the invoker which can be used to recreate this portlet during an import portlet operation The returned portlet Id will be the portlet Id of the base portlet, not a cloned portlet Id If the portlet contains state, it will be returned regardless if the portlet invoker is set to persist state locally.PortletgetPortlet(PortletContext portletContext)Get information about a specific portlet.Set<Portlet>getPortlets()Return the set of portlet exposed.PropertyMapgetProperties(PortletContext portletContext)Return all the properties of the specified portlet.PropertyMapgetProperties(PortletContext portletContext, Set<String> keys)Return a subset of the properties of the specified portlet.PortletStatusgetStatus(PortletContext portletContext)Returns the status of a specified#PortletContextor null if the portlet context does not have a relationship with this portlet invoker.PortletContextimportPortlet(PortletStateType stateType, PortletContext contextToImport)Imports a portlet into the invoker.PortletInvocationResponseinvoke(PortletInvocation invocation)Invoke an operation on a specific portlet.booleanisActive()Returns whether this portlet invoker is active and can respond to requests.PortletContextsetProperties(PortletContext portletContext, PropertyChange[] changes)Set the properties on the specified portlet.
-
-
-
Field Detail
-
LOCAL_PORTLET_INVOKER_ID
static final String LOCAL_PORTLET_INVOKER_ID
The identifier assigned to the local PortletInvoker.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPortlets
Set<Portlet> getPortlets() throws PortletInvokerException
Return the set of portlet exposed. Usually, this means only non-customized portlets.- Returns:
- the set of exposed portlets
- Throws:
PortletInvokerException- a portlet invoker exception
-
getPortlet
Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
Get information about a specific portlet. Note that this PortletInvoker can know about more portlets than returned bygetPortlets(). In particular, cloned portlets wouldn't necessarily be exposed to getPortlets and still be known by this PortletInvoker i.e. there exists PortletContextspcas follows:assert getPortlet(pc) != null && !getPortlets().contains(portlet);- Parameters:
portletContext- the portlet context in the scope of this invoker- Returns:
- the
PortletInfofor the specified portlet - Throws:
IllegalArgumentException- if the portlet context is nullPortletInvokerException- a portlet invoker exception
-
getStatus
PortletStatus getStatus(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
Returns the status of a specified#PortletContextor null if the portlet context does not have a relationship with this portlet invoker.- Parameters:
portletContext- the portlet context- Returns:
- the portlet status
- Throws:
IllegalArgumentException- if the portlet context is nullPortletInvokerException- a portlet invoker exception
-
invoke
PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
Invoke an operation on a specific portlet.- Parameters:
invocation- the portlet invocation- Returns:
- the invocation response
- Throws:
IllegalArgumentException- if the invocation is nullPortletInvokerException- a portlet invoker exception
-
createClone
PortletContext createClone(PortletStateType stateType, PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Clone a portlet.- Parameters:
stateType- the portlet state type desiredportletContext- the portlet context to clone @return the clone id- Returns:
- the cloned portlet context
- Throws:
IllegalArgumentException- if the portletId is nullUnsupportedOperationException- if the invoker does not support this operationPortletInvokerException- a portlet invoker exception
-
destroyClones
List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Destroy a cloned portlet.- Parameters:
portletContexts- a list of portlet contexts to destroy- Returns:
- a list of
DestroyCloneFailure, one per clone that couldn't be destroyed - Throws:
IllegalArgumentException- if the portletContext is nullUnsupportedOperationException- if the invoker does not support this operationPortletInvokerException- a portlet invoker exception
-
getProperties
PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Return a subset of the properties of the specified portlet.- Parameters:
portletContext- the portlet contextkeys- the set of keys to retrieve- Returns:
- the properties
- Throws:
IllegalArgumentException- if the portletContext or the keys arguments are nullUnsupportedOperationException- if the invoker does not support this operationPortletInvokerException- a portlet invoker exception
-
getProperties
PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Return all the properties of the specified portlet.- Parameters:
portletContext- the portlet context- Returns:
- the properties
- Throws:
IllegalArgumentException- if the portletContext is nullUnsupportedOperationException- if the invoker does not support this operationPortletInvokerException- a portlet invoker exception
-
setProperties
PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Set the properties on the specified portlet.- Parameters:
portletContext- the portlet contextchanges- the changes- Returns:
- the new portlet context
- Throws:
IllegalArgumentException- if the portletContext or the properties is nullUnsupportedOperationException- if the invoker does not support this operationPortletInvokerException- a portlet invoker exception
-
exportPortlet
PortletContext exportPortlet(PortletStateType stateType, PortletContext originalPortletContext) throws PortletInvokerException
Exports a portlet from the invoker which can be used to recreate this portlet during an import portlet operation The returned portlet Id will be the portlet Id of the base portlet, not a cloned portlet Id If the portlet contains state, it will be returned regardless if the portlet invoker is set to persist state locally.- Parameters:
stateType- the portlet state type desiredoriginalPortletContext- the context of the porlet to be exported- Returns:
- A new portlet context which can be used to import a portlet
- Throws:
PortletInvokerException
-
importPortlet
PortletContext importPortlet(PortletStateType stateType, PortletContext contextToImport) throws PortletInvokerException
Imports a portlet into the invoker.- Parameters:
stateType- the portlet state type desiredcontextToImport- the context to be imported- Returns:
- The portletcontext for the imported portlet
- Throws:
PortletInvokerException
-
isActive
boolean isActive()
Returns whether this portlet invoker is active and can respond to requests.- Returns:
trueif this portlet invoker can respond to requests,falseotherwise
-
-