Package org.gatein.pc.portlet.container.managed

Examples of org.gatein.pc.portlet.container.managed.ManagedPortletContainer


         ManagedObject managedObject = managedObjectEvent.getManagedObject();

         // we're only interested in portlet events
         if (managedObject instanceof ManagedPortletContainer)
         {
            ManagedPortletContainer portletContainer = (ManagedPortletContainer)managedObject;
            String applicationId = portletContainer.getManagedPortletApplication().getId();
            String containerId = portletContainer.getId();

            org.gatein.pc.api.PortletContext pc = org.gatein.pc.api.PortletContext.createPortletContext(applicationId, containerId);

            // and more specifically, their lifecycle eventds
            if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
            {
               ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
               LifeCycleStatus status = lifeCycleEvent.getStatus();
               if (LifeCycleStatus.STARTED.equals(status))
               {
                  // if the portlet started, add it to the service description
                  final PortletInfo info = portletContainer.getInfo();
                  // but only if it's remotable
                  if (isRemotable(info.getRuntimeOptionsInfo()))
                  {
                     serviceDescription.addPortletDescription(pc, info);
                  }
View Full Code Here


         ManagedObjectEvent managedObjectEvent = (ManagedObjectEvent)event;
         ManagedObject managedObject = managedObjectEvent.getManagedObject();

         if (managedObject instanceof ManagedPortletContainer)
         {
            ManagedPortletContainer portletContainer = (ManagedPortletContainer)managedObject;
            String applicationId = portletContainer.getManagedPortletApplication().getId();
            String containerId = portletContainer.getId();

            org.gatein.pc.api.PortletContext pc = org.gatein.pc.api.PortletContext.createPortletContext(applicationId, containerId);

            if (managedObjectEvent instanceof ManagedObjectLifeCycleEvent)
            {
               ManagedObjectLifeCycleEvent lifeCycleEvent = (ManagedObjectLifeCycleEvent)managedObjectEvent;
               LifeCycleStatus status = lifeCycleEvent.getStatus();
               if (LifeCycleStatus.STARTED.equals(status))
               {
                  final PortletInfo info = portletContainer.getInfo();
                  // only add the portlet if it's remotable
                  if (isRemotable(info.getRuntimeOptionsInfo()))
                  {
                     serviceDescription.addPortletDescription(pc, info);
                  }
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());
View Full Code Here

TOP

Related Classes of org.gatein.pc.portlet.container.managed.ManagedPortletContainer

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.