當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。