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


Java ExoContainer.getComponentInstanceOfType方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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.getComponentInstanceOfType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。