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


Java EmbeddedRegistryService.getGovernanceUserRegistry方法代码示例

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


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

示例1: setUp

import org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService; //导入方法依赖的package包/类
public void setUp() throws RegistryException {
        super.setUp();
/*        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain("foo.com");
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(1);*/
        if (registry == null) {
            super.setUp();
            EmbeddedRegistryService embeddedRegistry = ctx.getEmbeddedRegistryService();
            RegistryCoreServiceComponent component = new RegistryCoreServiceComponent() {
                {
                    setRealmService(ctx.getRealmService());
                }
            };
            component.registerBuiltInHandlers(embeddedRegistry);
            registry = embeddedRegistry.getGovernanceUserRegistry("admin", "admin");
        }
    }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:17,代码来源:MessageManagerImplTest.java

示例2: setUp

import org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService; //导入方法依赖的package包/类
public void setUp() throws RegistryException {
        // below SOP will be removed after the testing.
        System.out.println("ActivityManagerImplTest:setUp()");
        super.setUp();
/*        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain("foo.com");
        PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(1);*/
        if (registry == null) {
            super.setUp();
            EmbeddedRegistryService embeddedRegistry = ctx.getEmbeddedRegistryService();
            RegistryCoreServiceComponent component = new RegistryCoreServiceComponent() {
                {
                    setRealmService(ctx.getRealmService());
                }
            };
            component.registerBuiltInHandlers(embeddedRegistry);
            registry = embeddedRegistry.getGovernanceUserRegistry("admin", "admin");
        }
    }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:19,代码来源:ActivityManagerImplTest.java

示例3: setUp

import org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService; //导入方法依赖的package包/类
public void setUp() throws Exception {
    if (System.getProperty("carbon.home") == null) {
        File file = new File("src/test/resources/carbon-home");
        if (file.exists()) {
            System.setProperty("carbon.home", file.getAbsolutePath());
        }
    }
    PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
    PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
    // The line below is responsible for initializing the cache.
    CarbonContext.getThreadLocalCarbonContext();

    String carbonHome = System.getProperty("carbon.home");
    System.out.println("carbon home " + carbonHome);
    String carbonXMLPath = carbonHome + File.separator + "repository"
            + File.separator + "conf" + File.separator + "carbon.xml";
    RegistryConfiguration regConfig = new RegistryConfiguration(carbonXMLPath);
    RegistryCoreServiceComponent.setRegistryConfig(regConfig);

    RealmService realmService = new InMemoryRealmService();
    RegistryDataHolder.getInstance().setRealmService(realmService);
    InputStream is;

    try {
        is = this.getClass().getClassLoader().getResourceAsStream(
                "registry.xml");
    } catch (Exception e) {
        is = null;
    }
    ctx = RegistryContext.getBaseInstance(is, realmService);
    //RegistryConfigurationProcessor.populateRegistryConfig(is, ctx);
    ctx.setSetup(true);
    ctx.selectDBConfig("h2-db");
    ctx.addAspect("DefaultLifecycle", new DefaultLifecycle(), MultitenantConstants.SUPER_TENANT_ID);
    EmbeddedRegistryService embeddedRegistry = ctx.getEmbeddedRegistryService();
    new RegistryCoreServiceComponent().registerBuiltInHandlers(embeddedRegistry);
    registry = embeddedRegistry.getGovernanceUserRegistry("admin", "admin");

    ArtifactCache cache = ArtifactCacheFactory.createArtifactCache();
    ArtifactCacheManager.getCacheManager().addTenantArtifactCache(cache, MultitenantConstants.SUPER_TENANT_ID);
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:42,代码来源:BaseTestCase.java


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