Package org.exoplatform.container

Examples of org.exoplatform.container.PortalContainer


    */
   private static final Log LOG = ExoLogger.getLogger("org.exoplatform.services.scheduler.impl.QueueTaskJob");
  
   public void execute(JobContext context) throws Exception
   {
      PortalContainer manager = PortalContainer.getInstance();
      QueueTasks qtasks = (QueueTasks)manager.getComponentInstanceOfType(QueueTasks.class);
      Task task = qtasks.poll();
      while (task != null)
      {
         try
         {
View Full Code Here


        //
        ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(classLoader);
            PortalContainer portalContainer = PortalContainer.getInstance();
            if (portalContainer != null) {
                ResourceBundleService resourceBundleService = (ResourceBundleService) portalContainer
                        .getComponentInstance(ResourceBundleService.class);
                if (resourceBundleService != null) {
                    String[] portalBundles = resourceBundleService.getSharedResourceBundleNames();
                    if (baseName != null) {
                        String[] bundles = new String[portalBundles.length + 1];
View Full Code Here

   }

   public void jobToBeExecuted(JobExecutionContext context)
   {
      RootContainer rootContainer = RootContainer.getInstance();
      PortalContainer pcontainer = (PortalContainer)rootContainer.getComponentInstance(containerName_);
      PortalContainer.setInstance(pcontainer);
      List<ComponentRequestLifecycle> components =
         pcontainer.getComponentInstancesOfType(ComponentRequestLifecycle.class);
      for (ComponentRequestLifecycle component : components)
      {
         component.startRequest(pcontainer);
      }
   }
View Full Code Here

   }

   public void jobWasExecuted(JobExecutionContext context, JobExecutionException exception)
   {
      RootContainer rootContainer = RootContainer.getInstance();
      PortalContainer pcontainer = (PortalContainer)rootContainer.getComponentInstance(containerName_);
      List<ComponentRequestLifecycle> components =
         pcontainer.getComponentInstancesOfType(ComponentRequestLifecycle.class);
      for (ComponentRequestLifecycle component : components)
      {
         component.endRequest(pcontainer);
      }
      PortalContainer.setInstance(null);
View Full Code Here

    *      javax.servlet.ServletResponse, javax.servlet.FilterChain)
    */
   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
      ServletException
   {
      PortalContainer pcontainer = (PortalContainer)ExoContainerContext.getContainerByName(portalContainerName);
      if (LOG.isDebugEnabled())
         LOG.debug("get-by-name");
      if (pcontainer == null)
      {
         if (LOG.isInfoEnabled())
View Full Code Here

{
   private ListenerService service_;

   public void setUp() throws Exception
   {
      PortalContainer manager = PortalContainer.getInstance();
      service_ = (ListenerService)manager.getComponentInstanceOfType(ListenerService.class);
      TestHolder.tl.set("-suffix");
   }
View Full Code Here

    * @throws Exception
    */
   @SuppressWarnings({"rawtypes", "unchecked"})
   public void testDistributedCache() throws Exception
   {
      PortalContainer pc = PortalContainer.getInstance();
      ExoCacheConfig config = new ExoCacheConfig();
      config.setName("MyCacheDistributed");
      config.setMaxSize(5);
      config.setLiveTime(1);
      config.setImplementation("LRU");
      config.setDistributed(true);
      Map<String, String> params = new HashMap<String, String>();
      params.put("infinispan-num-owners", "1");
      ConfigurationManager cm = (ConfigurationManager)pc.getComponentInstanceOfType(ConfigurationManager.class);
      DistributedCacheManager dcm2 =
         new DistributedCacheManager("jar:/conf/portal/distributed-cache-configuration.xml", params, cm);

      DistributedExoCache<Serializable, Object> cache1 =
         (DistributedExoCache<Serializable, Object>)((ExoCacheFactory)pc
            .getComponentInstanceOfType(ExoCacheFactory.class)).createCache(config);
      DistributionManager dm = cache1.getCache().getDistributionManager();
      DistributedExoCache<Serializable, Object> cache2 =
         (DistributedExoCache<Serializable, Object>)new ExoCacheFactoryImpl(
            (ExoContainerContext)pc.getComponentInstanceOfType(ExoContainerContext.class),
            "jar:/conf/portal/cache-configuration-template.xml", cm, dcm2).createCache(config);
      KeyAffinityService kas1 =
         KeyAffinityServiceFactory.newLocalKeyAffinityService(cache1.getCache(),
            new MyKeyGenerator(cache1.getFullName()), Executors.newSingleThreadExecutor(), 100);
      KeyAffinityService kas2 =
View Full Code Here

      cache.clearCache();
   }

   private ExoCacheFactory getExoCacheFactoryInstance() throws ExoCacheInitException
   {
      PortalContainer pc = PortalContainer.getInstance();
      return new ExoCacheFactoryImpl((ExoContainerContext)pc.getComponentInstanceOfType(ExoContainerContext.class),
         "jar:/conf/portal/cache-configuration-template.xml", (ConfigurationManager)pc
            .getComponentInstanceOfType(ConfigurationManager.class));
   }
View Full Code Here

   private InitialContextInitializer initializer;
  
   public void setUp() throws Exception
   {
      PortalContainer container = PortalContainer.getInstance();
      initializer = (InitialContextInitializer)container.getComponentInstanceOfType(InitialContextInitializer.class);
      assertNotNull(initializer);
   }
View Full Code Here

public class TestSchedulerService extends SchedulerServiceTestBase
{

   public void setUp() throws Exception
   {
      PortalContainer manager = PortalContainer.getInstance();
      service_ = (JobSchedulerService)manager.getComponentInstanceOfType(JobSchedulerService.class);
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.container.PortalContainer

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.