portletApplicationRegistry.setSchemaValidated(validated);
// Container Stack
ContainerPortletDispatcher portletContainerDispatcher = new ContainerPortletDispatcher();
FederatingPortletInvoker federatingPortletInvoker = new FederatingPortletInvokerService();
EventPayloadInterceptor eventPayloadInterceptor = new EventPayloadInterceptor();
eventPayloadInterceptor.setNext(portletContainerDispatcher);
RequestAttributeConversationInterceptor requestAttributeConversationInterceptor = new RequestAttributeConversationInterceptor();
requestAttributeConversationInterceptor.setNext(eventPayloadInterceptor);
CCPPInterceptor ccppInterceptor = new CCPPInterceptor();
ccppInterceptor.setNext(requestAttributeConversationInterceptor);
BridgeInterceptor bridgepInterceptor = new BridgeInterceptor();
bridgepInterceptor.setNext(ccppInterceptor);
ProducerCacheInterceptor producerCacheInterceptor = new ProducerCacheInterceptor();
producerCacheInterceptor.setNext(bridgepInterceptor);
// SessionInvalidatorInterceptor is not needed as we have cross-context logout at WCI level
// SessionInvalidatorInterceptor sessionInvalidatorInterceptor = new SessionInvalidatorInterceptor();
// sessionInvalidatorInterceptor.setNext(producerCacheInterceptor);
ContextDispatcherInterceptor contextDispatcherInterceptor = new ContextDispatcherInterceptor();
contextDispatcherInterceptor.setNext(producerCacheInterceptor);
PortletLifecyclePhaseInterceptor portletLifecyclePhaseInterceptor = new PortletLifecyclePhaseInterceptor();
portletLifecyclePhaseInterceptor.setNext(contextDispatcherInterceptor);
SecureTransportInterceptor secureTransportInterceptor = new SecureTransportInterceptor();
secureTransportInterceptor.setNext(portletLifecyclePhaseInterceptor);
ValveInterceptor valveInterceptor = new ValveInterceptor();
valveInterceptor.setPortletApplicationRegistry(portletApplicationRegistry);
valveInterceptor.setNext(secureTransportInterceptor);
// The portlet container invoker continued
containerPortletInvoker.setNext(valveInterceptor);
// register container invoker so that WSRP can use it, WSRP uses its own ProducerPortletInvoker
container.registerComponentInstance(ContainerPortletInvoker.class, containerPortletInvoker);
// The producer persistence manager
PortletStatePersistenceManagerService producerPersistenceManager = new PortletStatePersistenceManagerService();
// The producer state management policy
StateManagementPolicyService producerStateManagementPolicy = new StateManagementPolicyService();
producerStateManagementPolicy.setPersistLocally(false);
// The producer state converter
StateConverter producerStateConverter = new ExoStateConverter();
// The producer portlet invoker
ProducerPortletInvoker producerPortletInvoker = new ProducerPortletInvoker();
producerPortletInvoker.setNext(containerPortletInvoker);
producerPortletInvoker.setPersistenceManager(producerPersistenceManager);
producerPortletInvoker.setStateManagementPolicy(producerStateManagementPolicy);
producerPortletInvoker.setStateConverter(producerStateConverter);
// register the producer portlet invoker if it hasn't been already
if (!federatingPortletInvoker.isResolved(PortletInvoker.LOCAL_PORTLET_INVOKER_ID)) {
federatingPortletInvoker.registerInvoker(PortletInvoker.LOCAL_PORTLET_INVOKER_ID, producerPortletInvoker);
producerPortletInvokerSet = true;
}
// The consumer portlet invoker
PortletCustomizationInterceptor portletCustomizationInterceptor = new PortletCustomizationInterceptor();