Package org.gatein.pc.federation.impl
Class FederatingPortletInvokerService
- java.lang.Object
-
- org.gatein.pc.federation.impl.FederatingPortletInvokerService
-
- All Implemented Interfaces:
org.gatein.pc.api.PortletInvoker,FederatingPortletInvoker
public class FederatingPortletInvokerService extends Object implements FederatingPortletInvoker
- Since:
- 2.4
- Version:
- $Revision: 5918 $
- Author:
- Julien Viet, Chris Laprun
-
-
Constructor Summary
Constructors Constructor Description FederatingPortletInvokerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gatein.pc.api.PortletContextcreateClone(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext)List<org.gatein.pc.api.state.DestroyCloneFailure>destroyClones(List<org.gatein.pc.api.PortletContext> portletContexts)org.gatein.pc.api.PortletContextexportPortlet(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext)FederatedPortletInvokergetFederatedInvoker(String federatedId)Returns the registered FederatedPortletInvoker associated with the specified identifier, delegating to thePortletInvokerResolverspecified usingFederatingPortletInvoker.setPortletInvokerResolver(PortletInvokerResolver)if it's not initially resolved or returnsnullif a FederatedPortletInvoker is not found after going through the specified NullInvokerHandler resolution mechanism.Collection<String>getFederatedInvokerIds()Returns the known portlet invoker identifiers, including resolvable ones (though they might not have been already resolved).protected FederatedPortletInvokergetFederatedPortletInvokerFor(org.gatein.pc.api.PortletContext compoundPortletContext)Retrieves the portlet invoker associated with the specified compound portlet id or null if it is not found.Set<org.gatein.pc.api.Portlet>getLocalPortlets()Return only the portlets from local federated invokers.org.gatein.pc.api.PortletgetPortlet(org.gatein.pc.api.PortletContext compoundPortletContext)Set<org.gatein.pc.api.Portlet>getPortlets()org.gatein.pc.api.state.PropertyMapgetProperties(org.gatein.pc.api.PortletContext compoundPortletContext)org.gatein.pc.api.state.PropertyMapgetProperties(org.gatein.pc.api.PortletContext compoundPortletContext, Set<String> keys)Set<org.gatein.pc.api.Portlet>getRemotePortlets()Return only the portlets from remote federated invokers.Collection<String>getResolvedInvokerIds()Returns only the portlet invoker identifiers of the currently resolved invokers, which might be different from the set potentially resolvable invokers as returned byFederatingPortletInvoker.getFederatedInvokerIds().org.gatein.pc.api.PortletStatusgetStatus(org.gatein.pc.api.PortletContext portletContext)org.gatein.pc.api.PortletContextimportPortlet(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext)org.gatein.pc.api.invocation.response.PortletInvocationResponseinvoke(org.gatein.pc.api.invocation.PortletInvocation invocation)booleanisActive()booleanisResolved(String federatedId)Determines whether the FederatedPortletInvoker with the specified identifier has already been resolved.FederatedPortletInvokerregisterInvoker(String federatedId, org.gatein.pc.api.PortletInvoker federatedInvoker)Registers an invoker.voidsetPortletInvokerResolver(PortletInvokerResolver portletResolver)Specifies which NullInvokerHandler to use to attempt retrieval of a federated invoker when default resolution mechanism cannot find an associated invoker.org.gatein.pc.api.PortletContextsetProperties(org.gatein.pc.api.PortletContext compoundPortletContext, org.gatein.pc.api.state.PropertyChange[] changes)voidunregisterInvoker(String federatedId)Unregisters the invoker associated with the specified identifier.
-
-
-
Method Detail
-
registerInvoker
public FederatedPortletInvoker registerInvoker(String federatedId, org.gatein.pc.api.PortletInvoker federatedInvoker)
Description copied from interface:FederatingPortletInvokerRegisters an invoker.- Specified by:
registerInvokerin interfaceFederatingPortletInvoker- Parameters:
federatedId- the invoker id to registerfederatedInvoker- the invoker to register
-
unregisterInvoker
public void unregisterInvoker(String federatedId)
Description copied from interface:FederatingPortletInvokerUnregisters the invoker associated with the specified identifier.- Specified by:
unregisterInvokerin interfaceFederatingPortletInvoker- Parameters:
federatedId- the identifier of the invoker to unregister
-
getFederatedInvoker
public FederatedPortletInvoker getFederatedInvoker(String federatedId) throws IllegalArgumentException
Description copied from interface:FederatingPortletInvokerReturns the registered FederatedPortletInvoker associated with the specified identifier, delegating to thePortletInvokerResolverspecified usingFederatingPortletInvoker.setPortletInvokerResolver(PortletInvokerResolver)if it's not initially resolved or returnsnullif a FederatedPortletInvoker is not found after going through the specified NullInvokerHandler resolution mechanism.- Specified by:
getFederatedInvokerin interfaceFederatingPortletInvoker- Parameters:
federatedId- the id- Returns:
- the invoker
- Throws:
IllegalArgumentException- if the id is null
-
getFederatedInvokerIds
public Collection<String> getFederatedInvokerIds()
Description copied from interface:FederatingPortletInvokerReturns the known portlet invoker identifiers, including resolvable ones (though they might not have been already resolved).- Specified by:
getFederatedInvokerIdsin interfaceFederatingPortletInvoker- Returns:
- a collection of all the resolvable portlet invoker identifiers
-
getResolvedInvokerIds
public Collection<String> getResolvedInvokerIds()
Description copied from interface:FederatingPortletInvokerReturns only the portlet invoker identifiers of the currently resolved invokers, which might be different from the set potentially resolvable invokers as returned byFederatingPortletInvoker.getFederatedInvokerIds().- Specified by:
getResolvedInvokerIdsin interfaceFederatingPortletInvoker- Returns:
- a collection of the currently resolved portlet invoker identifiers
-
isResolved
public boolean isResolved(String federatedId) throws IllegalArgumentException
Description copied from interface:FederatingPortletInvokerDetermines whether the FederatedPortletInvoker with the specified identifier has already been resolved.- Specified by:
isResolvedin interfaceFederatingPortletInvoker- Parameters:
federatedId- the identifier of the FederatedPortletInvoker to test for resolution status- Returns:
trueif the specified invoker is already resolved,falseotherwise- Throws:
IllegalArgumentException- if the specified invoker identifier is not among the known resolvable identifiers as returned byFederatingPortletInvoker.getFederatedInvokerIds()
-
getPortlets
public Set<org.gatein.pc.api.Portlet> getPortlets() throws org.gatein.pc.api.PortletInvokerException
- Specified by:
getPortletsin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
getLocalPortlets
public Set<org.gatein.pc.api.Portlet> getLocalPortlets() throws org.gatein.pc.api.PortletInvokerException
Description copied from interface:FederatingPortletInvokerReturn only the portlets from local federated invokers.- Specified by:
getLocalPortletsin interfaceFederatingPortletInvoker- Returns:
- a Set containing only the portlets from local federated invokers.
- Throws:
org.gatein.pc.api.PortletInvokerException
-
getRemotePortlets
public Set<org.gatein.pc.api.Portlet> getRemotePortlets() throws org.gatein.pc.api.PortletInvokerException
Description copied from interface:FederatingPortletInvokerReturn only the portlets from remote federated invokers.- Specified by:
getRemotePortletsin interfaceFederatingPortletInvoker- Returns:
- a Set containing only the portlets from remote federated invokers.
- Throws:
org.gatein.pc.api.PortletInvokerException
-
getPortlet
public org.gatein.pc.api.Portlet getPortlet(org.gatein.pc.api.PortletContext compoundPortletContext) throws IllegalArgumentException, org.gatein.pc.api.PortletInvokerException- Specified by:
getPortletin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
IllegalArgumentExceptionorg.gatein.pc.api.PortletInvokerException
-
getStatus
public org.gatein.pc.api.PortletStatus getStatus(org.gatein.pc.api.PortletContext portletContext) throws IllegalArgumentException, org.gatein.pc.api.PortletInvokerException- Specified by:
getStatusin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
IllegalArgumentExceptionorg.gatein.pc.api.PortletInvokerException
-
invoke
public org.gatein.pc.api.invocation.response.PortletInvocationResponse invoke(org.gatein.pc.api.invocation.PortletInvocation invocation) throws org.gatein.pc.api.PortletInvokerException- Specified by:
invokein interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
createClone
public org.gatein.pc.api.PortletContext createClone(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext) throws org.gatein.pc.api.PortletInvokerException- Specified by:
createClonein interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
destroyClones
public List<org.gatein.pc.api.state.DestroyCloneFailure> destroyClones(List<org.gatein.pc.api.PortletContext> portletContexts) throws IllegalArgumentException, org.gatein.pc.api.PortletInvokerException, UnsupportedOperationException
- Specified by:
destroyClonesin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
IllegalArgumentExceptionorg.gatein.pc.api.PortletInvokerExceptionUnsupportedOperationException
-
getProperties
public org.gatein.pc.api.state.PropertyMap getProperties(org.gatein.pc.api.PortletContext compoundPortletContext, Set<String> keys) throws org.gatein.pc.api.PortletInvokerException- Specified by:
getPropertiesin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
getProperties
public org.gatein.pc.api.state.PropertyMap getProperties(org.gatein.pc.api.PortletContext compoundPortletContext) throws org.gatein.pc.api.PortletInvokerException- Specified by:
getPropertiesin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
setProperties
public org.gatein.pc.api.PortletContext setProperties(org.gatein.pc.api.PortletContext compoundPortletContext, org.gatein.pc.api.state.PropertyChange[] changes) throws IllegalArgumentException, org.gatein.pc.api.PortletInvokerException, UnsupportedOperationException- Specified by:
setPropertiesin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
IllegalArgumentExceptionorg.gatein.pc.api.PortletInvokerExceptionUnsupportedOperationException
-
exportPortlet
public org.gatein.pc.api.PortletContext exportPortlet(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext) throws org.gatein.pc.api.PortletInvokerException- Specified by:
exportPortletin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
importPortlet
public org.gatein.pc.api.PortletContext importPortlet(org.gatein.pc.api.PortletStateType stateType, org.gatein.pc.api.PortletContext compoundPortletContext) throws org.gatein.pc.api.PortletInvokerException- Specified by:
importPortletin interfaceorg.gatein.pc.api.PortletInvoker- Throws:
org.gatein.pc.api.PortletInvokerException
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceorg.gatein.pc.api.PortletInvoker
-
setPortletInvokerResolver
public void setPortletInvokerResolver(PortletInvokerResolver portletResolver)
Description copied from interface:FederatingPortletInvokerSpecifies which NullInvokerHandler to use to attempt retrieval of a federated invoker when default resolution mechanism cannot find an associated invoker.- Specified by:
setPortletInvokerResolverin interfaceFederatingPortletInvoker
-
getFederatedPortletInvokerFor
protected FederatedPortletInvoker getFederatedPortletInvokerFor(org.gatein.pc.api.PortletContext compoundPortletContext) throws IllegalArgumentException, org.gatein.pc.api.NoSuchPortletException
Retrieves the portlet invoker associated with the specified compound portlet id or null if it is not found.- Parameters:
compoundPortletContext- the portlet context for which the invoker is to be retrieved- Returns:
- the portlet invoker associated with the specified compound portlet id
- Throws:
IllegalArgumentException- if the compound portlet id is not well formed or nullorg.gatein.pc.api.NoSuchPortletException- if not such portlet exist
-
-