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