Package org.exoplatform.services.listener

Examples of org.exoplatform.services.listener.ListenerService$RunListener


    */
   private <T extends EventObject> void broadcast(PortalContainer portalContainer, String eventName, T event)
   {
      try
      {
         ListenerService listenerService =
            (ListenerService)portalContainer.getComponentInstanceOfType(ListenerService.class);
         listenerService.broadcast(eventName, portalContainer, event);
      }
      catch (Exception e)
      {
         log.warn("Cannot broadcast the event '" + eventName + "'", e);
      }
View Full Code Here


    */
   private <T extends EventObject> void broadcast(PortalContainer portalContainer, String eventName, T event)
   {
      try
      {
         ListenerService listenerService =
            (ListenerService)portalContainer.getComponentInstanceOfType(ListenerService.class);
         listenerService.broadcast(eventName, portalContainer, event);
      }
      catch (Exception e)
      {
         log.warn("Cannot broadcast the event '" + eventName + "'", e);
      }
View Full Code Here

     * @param eventName the name of the event to broadcast
     * @param event the notification event
     */
    private <T extends EventObject> void broadcast(PortalContainer portalContainer, String eventName, T event) {
        try {
            ListenerService listenerService = (ListenerService) portalContainer
                    .getComponentInstanceOfType(ListenerService.class);
            listenerService.broadcast(eventName, portalContainer, event);
        } catch (Exception e) {
            log.warn("Cannot broadcast the event '" + eventName + "'", e);
        }
    }
View Full Code Here

     * @param eventName the name of the event to broadcast
     * @param event the notification event
     */
    private <T extends EventObject> void broadcast(PortalContainer portalContainer, String eventName, T event) {
        try {
            ListenerService listenerService = (ListenerService) portalContainer
                    .getComponentInstanceOfType(ListenerService.class);
            listenerService.broadcast(eventName, portalContainer, event);
        } catch (Exception e) {
            log.warn("Cannot broadcast the event '" + eventName + "'", e);
        }
    }
View Full Code Here

        // retrieve federating portlet invoker from container
        FederatingPortletInvoker federatingPortletInvoker = (FederatingPortletInvoker) container
                .getComponentInstanceOfType(FederatingPortletInvoker.class);

        // add our Session event listener to the ListenerService for use in org.exoplatform.web.GenericHttpListener
        ListenerService listenerService = (ListenerService) container.getComponentInstanceOfType(ListenerService.class);
        SessionEventListenerAndBroadcaster sessionEventBroadcaster = new SessionEventListenerAndBroadcaster();

        // events from org.exoplatform.web.GenericHttpListener
        listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionCreated", sessionEventBroadcaster);
        listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionDestroyed", sessionEventBroadcaster);

        try {
            JCRPersister persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
            persister.initializeBuilderFor(JCRConsumerRegistry.mappingClasses);

            consumerRegistry = new JCRConsumerRegistry(persister);
            consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
            consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
            consumerRegistry.setConfigurationIS(consumersConfigurationIS);

            // if we run in a cluster, use a distributed cache for consumers
            /*
             * if (ExoContainer.getProfiles().contains("cluster")) { CacheService cacheService =
             * (CacheService)container.getComponentInstanceOfType(CacheService.class); DistributedConsumerCache consumerCache =
             * new DistributedConsumerCache(cacheService); consumerRegistry.setConsumerCache(consumerCache); }
             */

            // create ConsumerStructureProvider and register it to listen to page events
            POMSessionManager sessionManager = (POMSessionManager) container
                    .getComponentInstanceOfType(POMSessionManager.class);
            PortalStructureAccess structureAccess = new MOPPortalStructureAccess(sessionManager);
            MOPConsumerStructureProvider structureprovider = new MOPConsumerStructureProvider(structureAccess);
            listenerService.addListener(EventType.PAGE_CREATED, structureprovider);
            listenerService.addListener(EventType.PAGE_DESTROYED, structureprovider);
            listenerService.addListener(EventType.PAGE_UPDATED, structureprovider);
            listenerService.addListener(DataStorage.PAGE_UPDATED, structureprovider);

            // migration service
            persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
            persister.initializeBuilderFor(JCRMigrationService.mappingClasses);

View Full Code Here

        // retrieve federating portlet invoker from container
        FederatingPortletInvoker federatingPortletInvoker = (FederatingPortletInvoker) container
                .getComponentInstanceOfType(FederatingPortletInvoker.class);

        // add our Session event listener to the ListenerService for use in org.exoplatform.web.GenericHttpListener
        ListenerService listenerService = (ListenerService) container.getComponentInstanceOfType(ListenerService.class);
        SessionEventListenerAndBroadcaster sessionEventBroadcaster = new SessionEventListenerAndBroadcaster();

        // events from org.exoplatform.web.GenericHttpListener
        listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionCreated", sessionEventBroadcaster);
        listenerService.addListener("org.exoplatform.web.GenericHttpListener.sessionDestroyed", sessionEventBroadcaster);

        try {
            JCRPersister persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
            persister.initializeBuilderFor(JCRConsumerRegistry.mappingClasses);

            consumerRegistry = new JCRConsumerRegistry(persister);
            consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
            consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
            consumerRegistry.setConfigurationIS(consumersConfigurationIS);

            // if we run in a cluster, use a distributed cache for consumers
            /*
             * if (ExoContainer.getProfiles().contains("cluster")) { CacheService cacheService =
             * (CacheService)container.getComponentInstanceOfType(CacheService.class); DistributedConsumerCache consumerCache =
             * new DistributedConsumerCache(cacheService); consumerRegistry.setConsumerCache(consumerCache); }
             */

            // create ConsumerStructureProvider and register it to listen to page events
            POMSessionManager sessionManager = (POMSessionManager) container
                    .getComponentInstanceOfType(POMSessionManager.class);
            PortalStructureAccess structureAccess = new MOPPortalStructureAccess(sessionManager);
            MOPConsumerStructureProvider structureprovider = new MOPConsumerStructureProvider(structureAccess);
            listenerService.addListener(EventType.PAGE_CREATED, structureprovider);
            listenerService.addListener(EventType.PAGE_DESTROYED, structureprovider);
            listenerService.addListener(EventType.PAGE_UPDATED, structureprovider);
            listenerService.addListener(DataStorage.PAGE_UPDATED, structureprovider);

            // migration service
            persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
            persister.initializeBuilderFor(JCRMigrationService.mappingClasses);

View Full Code Here

TOP

Related Classes of org.exoplatform.services.listener.ListenerService$RunListener

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.