本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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));
}
示例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();
}