当前位置: 首页>>代码示例>>Java>>正文


Java ExoContainer类代码示例

本文整理汇总了Java中org.exoplatform.container.ExoContainer的典型用法代码示例。如果您正苦于以下问题:Java ExoContainer类的具体用法?Java ExoContainer怎么用?Java ExoContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExoContainer类属于org.exoplatform.container包,在下文中一共展示了ExoContainer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProvider

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
public <T> Provider<? extends T> getProvider(final Class<T> implementationType)
{
  return new Provider<T>() {
    public T get() {
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      T ret = (T)container.getComponentInstance(implementationType);
      if(ret == null)
      {
        PortalContainer portalContainer = PortalContainer.getInstance();
        ret = (T)portalContainer.getComponentInstanceOfType(implementationType);
        if(ret == null)
        {
          RootContainer rootContainer = RootContainer.getInstance();
          ret = (T)rootContainer.getComponentInstanceOfType(implementationType);
        }
      }
      return ret;
    }
  };
}
 
开发者ID:exo-addons,项目名称:portlet-pack,代码行数:21,代码来源:GateInMetaProvider.java

示例2: getService

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
/**
 * Gets the service.
 *
 * @param clazz the class
 * @param containerName the container's name
 *
 * @return the service
 */
public static <T> T getService(Class<T> clazz, String containerName) {
    ExoContainer container = ExoContainerContext.getCurrentContainer();
    if (containerName != null) {
        container = RootContainer.getInstance().getPortalContainer(containerName);
    }
    if (container.getComponentInstanceOfType(clazz)==null) {
        containerName = PortalContainer.getCurrentPortalContainerName();
        container = RootContainer.getInstance().getPortalContainer(containerName);
    }
    return clazz.cast(container.getComponentInstanceOfType(clazz));
}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:20,代码来源:UIAddOnSearchForm.java

示例3: getRestName

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
public static String getRestName() {
	ExoContainer container = ExoContainerContext.getCurrentContainer();
	PortalContainerInfo containerInfo = (PortalContainerInfo) container .getComponentInstanceOfType(PortalContainerInfo.class);
	String portalName = containerInfo.getContainerName();
	PortalContainerConfig portalContainerConfig = WCMCoreUtils.getService(PortalContainerConfig.class);
	return portalContainerConfig.getRestContextName(portalName);
}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:8,代码来源:AddOnService.java

示例4: registerNodeTypes

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
public void registerNodeTypes(String nodeTypeFilesName, int alreadyExistsBehaviour) throws Exception {
  ExoContainer container = ExoContainerContext.getCurrentContainer();
  ConfigurationManager configurationService = (ConfigurationManager) container.getComponentInstanceOfType(ConfigurationManager.class);
  InputStream isXml = configurationService.getInputStream(nodeTypeFilesName);
  ExtendedNodeTypeManager ntManager = this.repositoryService.getCurrentRepository().getNodeTypeManager();
  LOG.info("\nTrying register node types from xml-file " + nodeTypeFilesName);
  ntManager.registerNodeTypes(isXml, alreadyExistsBehaviour, NodeTypeDataManager.TEXT_XML);
  LOG.info("\nNode types were registered from xml-file " + nodeTypeFilesName);
}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:10,代码来源:AddOnRestService.java

示例5: login

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
@Override
public boolean login() throws LoginException {
    try {
        ExoContainer container = getContainer();

        HttpServletRequest servletRequest = getCurrentHttpServletRequest();
        if (servletRequest == null) {
            log.debug("HttpServletRequest is null. SMRedHatPortalLoginModule will be ignored.");
            return false;
        }

        String username = SSOUtils.getSMUser(servletRequest);
        log.debug("username: " + username);
        if (username == null || "".equals(username.trim())) {
            log.debug("SiteMinder user not found");
            return false;
        } else {
            log.debug("SiteMinder user found");
            addUserToPlatformUsers(username);
        }
        establishSecurityContext(container, username);

        if (log.isTraceEnabled()) {
            log.trace("Successfully established security context for user " + username);
        }
        return true;
    } catch (Exception e) {
        if (log.isTraceEnabled()) {
            log.trace("Exception in login module", e);
        }
        throw new LoginException("OAuth login failed due to exception: " + e.getClass() + ": " + e.getMessage());
    }
}
 
开发者ID:foogaro,项目名称:siteminder-integration,代码行数:34,代码来源:SMRedHatPortalLoginModule.java

示例6: establishSecurityContext

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
protected void establishSecurityContext(ExoContainer container, String username) throws Exception {
    Authenticator authenticator = (Authenticator) container.getComponentInstanceOfType(Authenticator.class);

    if (authenticator == null) {
        throw new LoginException("No Authenticator component found, check your configuration");
    }

    Identity identity = authenticator.createIdentity(username);

    sharedState.put("exo.security.identity", identity);
    sharedState.put("javax.security.auth.login.name", username);
    subject.getPublicCredentials().add(new UsernameCredential(username));
}
 
开发者ID:foogaro,项目名称:siteminder-integration,代码行数:14,代码来源:SMRedHatPortalLoginModule.java

示例7: getPortalName

import org.exoplatform.container.ExoContainer; //导入依赖的package包/类
public static String getPortalName() {
	ExoContainer container = ExoContainerContext.getCurrentContainer();
	PortalContainerInfo containerInfo = (PortalContainerInfo) container
			.getComponentInstanceOfType(PortalContainerInfo.class);
	return containerInfo.getContainerName();
}
 
开发者ID:exo-addons,项目名称:marketplace-extension,代码行数:7,代码来源:AddOnService.java


注:本文中的org.exoplatform.container.ExoContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。