Package org.gatein.pc.portlet.container

Examples of org.gatein.pc.portlet.container.PortletApplication


         if (srcPayload != null)
         {
            PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);

            //
            PortletApplication application = container.getPortletApplication();
            PortletApplicationContext applicationContext = application.getContext();
            ClassLoader applicationClassLoader = applicationContext.getClassLoader();
            String srcPayloadClassName = srcPayload.getClass().getName();
            boolean trace = log.isTraceEnabled();
            QName eventName = eventInvocation.getName();
            String containerId = container.getId();
            String applicationId = application.getId();

            //
            PortletInfo info = container.getInfo();
            EventingInfo eventingInfo = info.getEventing();
            Map<QName, ? extends EventInfo> consumedEventInfos = eventingInfo.getConsumedEvents();
View Full Code Here


                     log.trace("Obtained for event " + eventName + " its payload class " + dstPayloadClass.getName() + " declared by the portlet meta data "
                        + containerId);
                  }

                  // get the portlet application class loader so we can access the war classes
                  PortletApplication application = container.getPortletApplication();
                  PortletApplicationContext applicationContext = application.getContext();
                  ClassLoader loader = applicationContext.getClassLoader();

                  if (srcPayload instanceof SerializableSimplePayload)
                  {
                     dstPayload = ((SerializableSimplePayload)srcPayload).getPayload();
View Full Code Here

         if (srcPayload != null)
         {
            PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);

            //
            PortletApplication application = container.getPortletApplication();
            PortletApplicationContext applicationContext = application.getContext();
            ClassLoader applicationClassLoader = applicationContext.getClassLoader();
            String srcPayloadClassName = srcPayload.getClass().getName();
            boolean trace = log.isTraceEnabled();
            QName eventName = eventInvocation.getName();
            String containerId = container.getId();
            String applicationId = application.getId();

            //
            PortletInfo info = container.getInfo();
            EventingInfo eventingInfo = info.getEventing();
            Map<QName, ? extends EventInfo> consumedEventInfos = eventingInfo.getConsumedEvents();
View Full Code Here

   }

   public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
      PortletApplication portletApplication = container.getPortletApplication();
      ServerContext reqCtx = invocation.getServerContext();
      ServletContext targetCtx = portletApplication.getContext().getServletContext();
      try
      {
         CallableImpl callable = new CallableImpl(invocation);
         reqCtx.dispatch(targetCtx, invocation.getRequest(), invocation.getResponse(), callable);
         return callable.response;
View Full Code Here

      Dispatch dispatch = new Dispatch(type, path);

      //
      try
      {
         PortletApplication application = req.container.getPortletApplication();
         PortletApplicationContext applicationContext = application.getContext();
         ServletContext servletContext = applicationContext.getServletContext();

         //
         HttpServletRequestWrapper realReq = req.getRealRequest();
         HttpServletResponseWrapper realResp = resp.getRealResponse();
View Full Code Here

         if (srcPayload != null)
         {
            PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);

            //
            PortletApplication application = container.getPortletApplication();
            PortletApplicationContext applicationContext = application.getContext();
            ClassLoader applicationClassLoader = applicationContext.getClassLoader();
            String srcPayloadClassName = srcPayload.getClass().getName();
            boolean trace = log.isTraceEnabled();
            QName eventName = eventInvocation.getName();
            String containerId = container.getId();
            String applicationId = application.getId();

            //
            PortletInfo info = container.getInfo();
            EventingInfo eventingInfo = info.getEventing();
            Map<QName, ? extends EventInfo> consumedEventInfos = eventingInfo.getConsumedEvents();
View Full Code Here

   }

   public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
      PortletApplication portletApplication = container.getPortletApplication();
      ServerContext reqCtx = invocation.getServerContext();
      ServletContext targetCtx = portletApplication.getContext().getServletContext();
      ServletContainer servletContainer = servletContainerFactory.getServletContainer();
      try
      {
         return (PortletInvocationResponse)reqCtx.dispatch(servletContainer, targetCtx, callback, invocation);
      }
View Full Code Here

            ManagedObject managedObject = ((ManagedObjectAddedEvent) event).getManagedObject();

            if (managedObject instanceof ManagedPortletContainer) {

                ManagedPortletContainer managedPortletContainer = (ManagedPortletContainer) managedObject;
                PortletApplication portletApp = managedPortletContainer.getManagedPortletApplication().getPortletApplication();

                createMetaData(managedPortletContainer.getId(), portletApp);

            } else if (managedObject instanceof ManagedPortletFilter) {

                ManagedPortletFilter managedPortletFilter = (ManagedPortletFilter) managedObject;
                PortletApplication portletApp = managedPortletFilter.getManagedPortletApplication().getPortletApplication();

                createMetaData(managedPortletFilter.getId(), portletApp);
            }

        } else if (event instanceof ManagedObjectLifeCycleEvent) {

            ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent) event;
            ManagedObject managedObject = lifeCycleEvent.getManagedObject();
            LifeCycleStatus status = lifeCycleEvent.getStatus();

            if (managedObject instanceof ManagedPortletContainer) {

                if (LifeCycleStatus.STARTED == status || LifeCycleStatus.INITIALIZED == status) {
                    return;
                }

                ManagedPortletContainer managedPortletContainer = (ManagedPortletContainer) managedObject;
                CDIMetaData cdiMetaData = cdiMetaDataMap.get(managedPortletContainer.getId());

                if (!cdiMetaData.cdiInjectionEnabled) {
                    return;
                }

                Portlet portlet = managedPortletContainer.getPortletInstance();

                if (null != portlet) {
                    if (null != portlet.getClass() && "javax.portlet.faces.GenericFacesPortlet".equals(portlet.getClass().getName())) {
                        // Only perform injection on non JSF portlets
                        cdiMetaData.cdiInjectionEnabled = false;
                        cdiMetaDataMap.put(cdiMetaData.key, cdiMetaData);
                        return;
                    }

                    PortletApplication portletApp = managedPortletContainer.getManagedPortletApplication().getPortletApplication();

                    if (!cdiMetaData.injectionPerformed) {
                        performInjection(portlet, cdiMetaData, portletApp.getContext().getServletContext());
                    } else {
                        performCleanup(portlet, cdiMetaData, portletApp.getContext().getServletContext());
                    }
                }
            } else if (managedObject instanceof ManagedPortletFilter) {

                if (LifeCycleStatus.INITIALIZED == status) {
                    return;
                }

                ManagedPortletFilter managedPortletFilter = (ManagedPortletFilter) managedObject;
                CDIMetaData cdiMetaData = cdiMetaDataMap.get(managedPortletFilter.getId());

                if (!cdiMetaData.cdiInjectionEnabled) {
                    return;
                }

                PortletFilterImpl portletFilterImpl = (PortletFilterImpl) managedPortletFilter.getPortletFilter();
                PortletFilter portletFilterInstance;

                for (Class type : filterClasses) {
                    portletFilterInstance = (PortletFilter) portletFilterImpl.instance(type);

                    if (null != portletFilterInstance) {
                        PortletApplication portletApp = managedPortletFilter.getManagedPortletApplication().getPortletApplication();

                        if (LifeCycleStatus.STARTED == status && !cdiMetaData.injectionPerformed) {
                            performInjection(portletFilterInstance, cdiMetaData, portletApp.getContext().getServletContext());
                        } else if (LifeCycleStatus.CREATED == status && cdiMetaData.injectionPerformed) {
                            performCleanup(portletFilterInstance, cdiMetaData, portletApp.getContext().getServletContext());
                        }

                        break;
                    }
                }
View Full Code Here

                     log.trace("Obtained for event " + eventName + " its payload class " + dstPayloadClass.getName() + " declared by the portlet meta data "
                        + containerId);
                  }

                  // get the portlet application class loader so we can access the war classes
                  PortletApplication application = container.getPortletApplication();
                  PortletApplicationContext applicationContext = application.getContext();
                  ClassLoader loader = applicationContext.getClassLoader();

                  if (srcPayload instanceof SerializableSimplePayload)
                  {
                     dstPayload = ((SerializableSimplePayload)srcPayload).getPayload();
View Full Code Here

TOP

Related Classes of org.gatein.pc.portlet.container.PortletApplication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.