Examples of ExoContainer


Examples of org.exoplatform.container.ExoContainer

         security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
      }

      try
      {
         ExoContainer container = null;
         if (containerContext == null)
         {
            container = PortalContainer.getInstance();
         }
         else
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

         // Avoid potential naming collision by changing the cluster name
         cache.getConfiguration().setClusterName(
            cache.getConfiguration().getClusterName() + rootFqn.toString().replace('/', '-'));
         return cache;
      }
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      Map<CacheType, Map<ConfigurationKey, CacheInstance>> allCacheTypes = CACHES.get(container);
      if (allCacheTypes == null)
      {
         allCacheTypes = new HashMap<CacheType, Map<ConfigurationKey, CacheInstance>>();
         CACHES.put(container, allCacheTypes);
      }
      Map<ConfigurationKey, CacheInstance> caches = allCacheTypes.get(cacheType);
      if (caches == null)
      {
         caches = new HashMap<ConfigurationKey, CacheInstance>();
         allCacheTypes.put(cacheType, caches);
      }
      Configuration cfg = cache.getConfiguration();
      ConfigurationKey key;
      try
      {
         key = new ConfigurationKey(cfg);
      }
      catch (CloneNotSupportedException e)
      {
         throw new RepositoryConfigurationException("Cannot clone the configuration.", e);
      }

      if (caches.containsKey(key))
      {
         CacheInstance cacheInstance = caches.get(key);
         cacheInstance.acquire();

         cache = cacheInstance.cache;
      }
      else
      {
         CacheInstance cacheInstance = new CacheInstance(cache);
         cacheInstance.acquire();

         caches.put(key, cacheInstance);

         if (LOG.isInfoEnabled())
         {
            LOG.info("A new JBoss Cache instance has been registered for the region " + rootFqn + ", a cache of type "
               + cacheType + " and the container " + container.getContext().getName());
         }
      }
      addEvictionRegion(rootFqn, cache, cfg);
      if (LOG.isInfoEnabled())
      {
         LOG.info("The region " + rootFqn + " has been registered for a cache of type " + cacheType
            + " and the container " + container.getContext().getName());
      }
      return cache;
   }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

   }

   public static synchronized <K, V> void releaseUniqueInstance(CacheType cacheType, Cache<K, V> cache)
      throws RepositoryConfigurationException
   {
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      Map<CacheType, Map<ConfigurationKey, CacheInstance>> allCacheTypes = CACHES.get(container);
      Map<ConfigurationKey, CacheInstance> caches = allCacheTypes.get(cacheType);

      for (Iterator<Entry<ConfigurationKey, CacheInstance>> it = caches.entrySet().iterator(); it.hasNext();)
      {
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

    /**
     * extract ResourceBundle from the ResourceBundleService using the bundle defined in the configuration XML file for the UI
     * application
     */
    public ResourceBundle getResourceBundle(Locale locale) {
        ExoContainer appContainer = getApplicationServiceContainer();
        ResourceBundleService service = (ResourceBundleService) appContainer
                .getComponentInstanceOfType(ResourceBundleService.class);
        ResourceBundle res = service.getResourceBundle(applicationResourceBundleNames_, locale);
        return res;
    }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

    /**
     * extract the ResourceBundle associated with the current user from the ResourceBundleService
     */
    public ResourceBundle getOwnerResourceBundle(String username, Locale locale) {
        ExoContainer appContainer = getApplicationServiceContainer();
        ResourceBundleService service = (ResourceBundleService) appContainer
                .getComponentInstanceOfType(ResourceBundleService.class);
        ResourceBundle res = service.getResourceBundle("locale.users." + username, locale);
        return res;
    }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

            TransientApplicationState<Portlet> transientApplicationState = (TransientApplicationState<Portlet>) state;
            contentId = transientApplicationState.getContentId();
            portlet = transientApplicationState.getContentState();
        } else {
            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    portlet = dataStorage.load(state, ApplicationType.PORTLET);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain portlet state.");
                }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

            TransientApplicationState<Gadget> transientApplicationState = (TransientApplicationState<Gadget>) state;
            contentId = transientApplicationState.getContentId();
            gadget = transientApplicationState.getContentState();
        } else {
            // The only way to retrieve the information if the state is not transient is if we're within a portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                ModelDataStorage dataStorage = (ModelDataStorage) container.getComponentInstanceOfType(ModelDataStorage.class);
                try {
                    gadget = dataStorage.load(state, ApplicationType.GADGET);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain gadget state from custom context.");
                }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

        if (state instanceof TransientApplicationState) {
            TransientApplicationState<WSRP> tas = (TransientApplicationState<WSRP>) state;
            contentId = tas.getContentId();
        } else {
            // The only way to retrieve the information if the state is not transient is if we're within the portal context
            ExoContainer container = ExoContainerContext.getCurrentContainer();
            if (container instanceof PortalContainer) {
                DataStorage dataStorage = (DataStorage) container.getComponentInstanceOfType(DataStorage.class);
                try {
                    contentId = dataStorage.getId(state);
                } catch (Exception e) {
                    throw new XMLStreamException("Could not obtain contentId.", e);
                }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

        this.user = (userId == null) ? User.anonymous() : new User(userId);
        this.siteId = Util.from(context.getSiteKey());
        this.nodePath = NodePath.fromString(context.getNodePath());

        ExoContainer exoContainer = context.getApplication().getApplicationServiceContainer();
        this.portal = (Portal)exoContainer.getComponentInstanceOfType(Portal.class);

        uriResolver = new RequestContextURIResolver();
    }
View Full Code Here

Examples of org.exoplatform.container.ExoContainer

        langSelectBox.setOptions(lang);
        langSelectBox.setValue(defaultValue);
    }

    private ResourceBundle getResourceBundle(Locale locale) {
        ExoContainer appContainer = ExoContainerContext.getCurrentContainer();
        ResourceBundleService service = (ResourceBundleService) appContainer
                .getComponentInstanceOfType(ResourceBundleService.class);
        ResourceBundle res = service.getResourceBundle("locale.portal.webui", locale);
        return res;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.