本文整理汇总了Java中org.jboss.msc.service.ValueService类的典型用法代码示例。如果您正苦于以下问题:Java ValueService类的具体用法?Java ValueService怎么用?Java ValueService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueService类属于org.jboss.msc.service包,在下文中一共展示了ValueService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: activate
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
ServiceTarget target = context.getServiceTarget();
target.addService(TopologyManager.SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
.install();
BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);
target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:17,代码来源:TopologyManagerActivator.java
示例2: activate
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext context) throws ServiceRegistryException {
ServiceTarget target = context.getServiceTarget();
TopologyManager.INSTANCE.setServiceTarget(target);
target.addService(SERVICE_NAME, new ValueService<>(new ImmediateValue<>(TopologyManager.INSTANCE)))
.install();
BinderService binderService = new BinderService(Topology.JNDI_NAME, null, true);
target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, Topology.JNDI_NAME), binderService)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(TopologyManager.INSTANCE))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:19,代码来源:TopologyManagerActivator.java
示例3: installAliases
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
private void installAliases(final ModuleSpecification moduleSpecification, final ModuleIdentifier moduleIdentifier, final DeploymentUnit deploymentUnit, final DeploymentPhaseContext phaseContext) {
for (final ModuleIdentifier alias : moduleSpecification.getAliases()) {
final ServiceName moduleSpecServiceName = ServiceModuleLoader.moduleSpecServiceName(alias);
final ModuleSpec spec = ModuleSpec.buildAlias(alias, moduleIdentifier).create();
ModuleDefinition moduleDefinition = new ModuleDefinition(alias, new HashSet<>(moduleSpecification.getAllDependencies()), spec);
final ValueService<ModuleDefinition> moduleSpecService = new ValueService<>(new ImmediateValue<>(moduleDefinition));
phaseContext.getServiceTarget().addService(moduleSpecServiceName, moduleSpecService).addDependencies(
deploymentUnit.getServiceName()).addDependencies(phaseContext.getPhaseServiceName()).setInitialMode(
Mode.ON_DEMAND).install();
ModuleLoadService.installService(phaseContext.getServiceTarget(), alias, Collections.singletonList(moduleIdentifier));
ModuleResolvePhaseService.installService(phaseContext.getServiceTarget(), moduleDefinition);
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:ModuleSpecProcessor.java
示例4: extend
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void extend(ApplicationExtensionContext context) throws Exception {
String appId = context.application().id();
ServiceTarget target = context.target();
URIPolicy policy = new URIPolicy();
target.addService(URIPolicyServices.policy(appId, context.resourceId()), new ValueService<>(new ImmediateValue<>(policy)))
.install();
URIPolicyRootResourceService resource = new URIPolicyRootResourceService(context.resourceId());
target.addService(Services.resource(appId, context.resourceId()), resource)
.addDependency(URIPolicyServices.policy(appId, context.resourceId()), URIPolicy.class, resource.policyInjector())
.install();
URIPolicyConfigResourceService configResource = new URIPolicyConfigResourceService(context.resourceId());
target.addService(Services.adminResource(appId, context.resourceId()), configResource)
.addDependency(URIPolicyServices.policy(appId, context.resourceId()), URIPolicy.class, configResource.policyInjector())
.install();
context.mountPublic();
context.mountPrivate();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:25,代码来源:URIPolicyExtension.java
示例5: extend
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void extend(SystemExtensionContext context) throws Exception {
// mount config resource so we can get access to extension configuration
MongoLauncherConfigResource configResource = new MongoLauncherConfigResource(context.id());
ValueService<RootResource> configService = new ValueService(new ImmediateValue(configResource));
context.target().addService(MONGO_LAUNCHER_CONFIG_NAME, configService).install();
context.mountPrivate(MONGO_LAUNCHER_CONFIG_NAME);
// start launcher service which uses extension configuration via configResource
// make sure to wait for configResource to get mounted in order to make sure
// it was updated with extension configuration
MongoLauncherService launcherService = new MongoLauncherService(context.id());
context.target().addService(MONGO_LAUNCHER_NAME, launcherService)
.addDependency(MONGO_LAUNCHER_CONFIG_NAME.append("mount"))
.addInjection(launcherService.configResourceInjector(), configResource)
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:MongoLauncherExtension.java
示例6: extend
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void extend(ApplicationExtensionContext context) throws Exception {
String appId = context.application().id();
ServiceTarget target = context.target();
DroolsPolicy policy = new DroolsPolicy();
target.addService(DroolsPolicyServices.policy(appId, context.resourceId()), new ValueService<>(new ImmediateValue<>(policy)))
.install();
DroolsPolicyResourceService resource = new DroolsPolicyResourceService(context.resourceId());
target.addService(Services.resource(appId, context.resourceId()), resource)
.addDependency(DroolsPolicyServices.policy(appId, context.resourceId()), DroolsPolicy.class, resource.policyInjector())
.install();
DroolsPolicyConfigResourceService configResource = new DroolsPolicyConfigResourceService(context.resourceId());
target.addService(Services.adminResource(appId, context.resourceId()), configResource)
.addDependency(DroolsPolicyServices.policy(appId, context.resourceId()), DroolsPolicy.class, configResource.policyInjector())
.install();
context.mountPublic();
context.mountPrivate();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:26,代码来源:DroolsPolicyExtension.java
示例7: extend
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void extend(SystemExtensionContext context) throws Exception {
ServiceName serviceName = Services.systemResource(context.moduleId(), context.id());
ApplicationTemplateResource applicationTemplateResource = new ApplicationTemplateResource(context.id());
ValueService applicationTemplateResourceService = new ValueService(new ImmediateValue<>(applicationTemplateResource));
context.target().addService(serviceName, applicationTemplateResourceService)
.install();
context.mountPrivate(serviceName);
TemplateRegistryService templateRegistryService = new TemplateRegistryService();
context.target().addService(SYSTEM_APPLICATION_TEMPLATE_REGISTRY, templateRegistryService)
.addDependency(serviceName, ApplicationTemplateResource.class, templateRegistryService.applicationTemplateResourceInjector())
.addDependency(serviceName.append("mount"))
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:TemplateExtension.java
示例8: start
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
ServiceTarget target = context.getChildTarget();
target.addService(APPLICATIONS_DIR, new ApplicationsDirectoryService(new File(this.applicationsDirectoryInjector.getValue()).getAbsoluteFile()))
.install();
target.addService(APPLICATION_REGISTRY, new ApplicationRegistryService())
.install();
ApplicationsDeployerService deployerService = new ApplicationsDeployerService();
target.addService(APPLICATIONS_DEPLOYER, deployerService)
.addDependency(APPLICATIONS_DIR, File.class, deployerService.applicationsDirectoryInjector())
.addDependency(APPLICATION_REGISTRY, InternalApplicationRegistry.class, deployerService.applicationRegistryInjector())
.install();
Service<GlobalContext> globalContext = new ValueService<GlobalContext>(new ImmediateValue<>(new GlobalContext()));
target.addService(GLOBAL_CONTEXT, globalContext)
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:21,代码来源:TenancyBootstrappingService.java
示例9: start
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
ServiceTarget target = context.getChildTarget();
ExtensionLoader extensionLoader = new ExtensionLoader(new File(this.extensionsDirectoryInjector.getValue()).getAbsoluteFile());
target.addService(EXTENSION_LOADER, extensionLoader)
.addDependency(EXTENSION_INSTALLER, ExtensionInstaller.class, extensionLoader.extensionInstallerInjector())
.install();
ExtensionInstaller installer = new ExtensionInstaller(target);
target.addService(EXTENSION_INSTALLER, new ValueService<>(new ImmediateValue<>(installer)))
.install();
ZeroBootstrapper zero = new ZeroBootstrapper();
target.addService(Services.LIVEOAK.append("zero", "bootstrapper"), zero)
.addDependency(EXTENSION_INSTALLER, ExtensionInstaller.class, zero.extensionInstallerInjector())
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:21,代码来源:ExtensionsBootstrappingService.java
示例10: start
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void start(StartContext context) throws StartException {
this.resource = new ApplicationResource(this.app, this.configManager.getValue(), this.applicationRegistry.getValue(), this.client.getValue());
ServiceTarget target = context.getChildTarget();
ServiceName name = context.getController().getName();
target.addService(name.append("extensions"), new ValueService<>(new ImmediateValue<>(this.resource.extensionsResource())))
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:11,代码来源:ApplicationResourceService.java
示例11: setUpServiceContainer
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Before
public void setUpServiceContainer() throws Exception {
this.serviceContainer = ServiceContainer.Factory.create();
File appDir = new File(getClass().getClassLoader().getResource("apps").getFile());
this.serviceContainer.addService(Services.APPLICATIONS_DIR, new ApplicationsDirectoryService(appDir))
.install();
this.serviceContainer.addService(Services.SERVICE_REGISTRY, new ValueService<>(new ImmediateValue<>(this.serviceContainer))).install();
this.serviceContainer.addService(Services.CLIENT, new ClientService()).install();
this.serviceContainer.addService(Services.SECURITY_CLIENT, new ValueService<>(new ImmediateValue<>(new MockSecurityClient()))).install();
this.serviceContainer.addService(Services.SECURITY_DIRECT_ACCESS_CLIENT, new ValueService<>(new ImmediateValue<>(new MockDirectAccessClient()))).install();
this.serviceContainer.awaitStability();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:18,代码来源:TenancyTest.java
示例12: activate
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
ServiceTarget target = serviceActivatorContext.getServiceTarget();
ServiceController argsController = serviceActivatorContext.getServiceRegistry().getService(ServiceName.of("wildfly", "swarm", "main-args"));
ValueService<String[]> argsService = (ValueService<String[]>) argsController.getService();
String[] args = argsService.getValue();
log.infof("Args available to services: %s\n", Arrays.asList(args));
ScannerService service = new ScannerService(args);
ServiceName serviceName = ServiceName.parse("org.jboss.rhiot.beacon.swarm.ScannerService");
target.addService(serviceName, service)
.install();
}
开发者ID:RHioTResearch,项目名称:SwarmBeaconScanner,代码行数:14,代码来源:ScannerServiceActivator.java
示例13: extend
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void extend(SystemExtensionContext context) throws Exception {
ServiceName serviceName = SYSTEM_MONGO_SERVICE_RESOURCE;
MongoDatastoreService mongoDatastoreService = new MongoDatastoreService();
context.target().addService(serviceName, mongoDatastoreService)
.addDependency(SYSTEM_MONGO_DATASTORE_CONFIG_SERVICE, MongoDatastoresRegistry.class, mongoDatastoreService.mongoDatastoreInjector)
.addInjection(mongoDatastoreService.idInjector, context.id())
.install();
context.mountPrivate(serviceName);
MongoDatastoresRegistry mongoDatastoresResource = new MongoDatastoresRegistry();
ValueService<RootResource> instanceConfigService = new ValueService(new ImmediateValue(mongoDatastoresResource));
context.target().addService(SYSTEM_MONGO_DATASTORE_CONFIG_SERVICE, instanceConfigService).install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:16,代码来源:MongoExtension.java
示例14: installInterceptor
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
public static void installInterceptor(ServiceTarget serviceContainer, String name, Interceptor interceptor) {
ServiceName serviceName = interceptor(name);
ServiceController<Interceptor> controller = serviceContainer.addService(serviceName, new ValueService<Interceptor>(new ImmediateValue<Interceptor>(interceptor)))
.install();
installInterceptor(serviceContainer, controller);
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:9,代码来源:InterceptorRegistrationHelper.java
示例15: mountPublic
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void mountPublic(RootResource publicResource, MediaType mediaType, boolean makeDefault) {
ValueService<RootResource> service = new ValueService<RootResource>(new ImmediateValue<>(publicResource));
this.target.addService(Services.resource(application().id(), resourceId()), service)
.install();
mountPublic(Services.resource(application().id(), resourceId()), mediaType, makeDefault);
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:8,代码来源:ApplicationExtensionContextImpl.java
示例16: mountPrivate
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void mountPrivate(RootResource privateResource, MediaType mediaType, boolean makeDefault) {
ValueService<RootResource> service = new ValueService<RootResource>(new ImmediateValue<>(privateResource));
this.target.addService(Services.adminResource(application().id(), resourceId()), service)
.install();
mountPrivate(Services.adminResource(application().id(), resourceId()), mediaType, makeDefault);
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:8,代码来源:ApplicationExtensionContextImpl.java
示例17: mountPrivate
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
@Override
public void mountPrivate(RootResource resource) {
target.addService(Services.systemResource(moduleId, this.id), new ValueService<RootResource>(new ImmediateValue<>(resource)))
.install();
mountPrivate(Services.systemResource(moduleId, this.id));
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:8,代码来源:SystemExtensionContextImpl.java
示例18: prolog
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
protected void prolog() {
LiveOakSystem system = new LiveOakSystem(serviceContainer);
serviceTarget.addService(LIVEOAK, new ValueService<>(new ImmediateValue<>(system)))
.install();
serviceTarget.addService(SERVICE_REGISTRY, new ValueService<>(new ImmediateValue<>(serviceContainer)))
.install();
serviceTarget.addService(SERVICE_CONTAINER, new ValueService<>(new ImmediateValue<>(serviceContainer)))
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:12,代码来源:LiveOakFactory.java
示例19: createTenancy
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
protected void createTenancy() {
serviceTarget.addService(LIVEOAK.append("apps-dir"),
new ValueService<>(new DefaultValue<>(new ImmediateValue<>(this.appsDir != null ? this.appsDir.getAbsolutePath() : null), new ApplicationsDirectoryPathDefaultValue())))
.install();
TenancyBootstrappingService tenancy = new TenancyBootstrappingService();
serviceTarget.addService(LIVEOAK.append("tenancy-bootstrap"), tenancy)
.addDependency(LIVEOAK.append("apps-dir"), String.class, tenancy.applicationsDirectoryInjector())
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:11,代码来源:LiveOakFactory.java
示例20: createExtensions
import org.jboss.msc.service.ValueService; //导入依赖的package包/类
protected void createExtensions() {
serviceTarget.addService(LIVEOAK.append("extn-dir"), new ValueService<>(new ImmediateValue<>(new File(configDir, "extensions").getAbsolutePath())))
.install();
ExtensionsBootstrappingService extensions = new ExtensionsBootstrappingService();
serviceTarget.addService(LIVEOAK.append("extensions-bootstrap"), extensions)
.addDependency(LIVEOAK.append("extn-dir"), String.class, extensions.extensionsDirectoryInjector())
.install();
}
开发者ID:liveoak-io,项目名称:liveoak,代码行数:10,代码来源:LiveOakFactory.java
注:本文中的org.jboss.msc.service.ValueService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论