本文整理汇总了Java中org.jboss.msc.service.ServiceName类的典型用法代码示例。如果您正苦于以下问题:Java ServiceName类的具体用法?Java ServiceName怎么用?Java ServiceName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceName类属于org.jboss.msc.service包,在下文中一共展示了ServiceName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installManagementChannelOpenListenerService
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
/**
* Set up the services to create a channel listener. This assumes that an endpoint service called {@code endpointName} exists.
* @param serviceTarget the service target to install the services into
* @param endpointName the name of the endpoint to install a channel listener into
* @param channelName the name of the channel
* @param operationHandlerName the name of the operation handler to handle request for this channel
* @param options the remoting options
* @param onDemand whether to install the services on demand
*/
public static void installManagementChannelOpenListenerService(
final ServiceTarget serviceTarget,
final ServiceName endpointName,
final String channelName,
final ServiceName operationHandlerName,
final OptionMap options,
final boolean onDemand) {
final ManagementChannelOpenListenerService channelOpenListenerService = new ManagementChannelOpenListenerService(channelName, options);
final ServiceBuilder<?> builder = serviceTarget.addService(channelOpenListenerService.getServiceName(endpointName), channelOpenListenerService)
.addDependency(endpointName, Endpoint.class, channelOpenListenerService.getEndpointInjector())
.addDependency(operationHandlerName, ManagementChannelInitialization.class, channelOpenListenerService.getOperationHandlerInjector())
.addDependency(ManagementChannelRegistryService.SERVICE_NAME, ManagementChannelRegistryService.class, channelOpenListenerService.getRegistry())
.addDependency(SHUTDOWN_EXECUTOR_NAME, ExecutorService.class, channelOpenListenerService.getExecutorServiceInjectedValue())
.setInitialMode(onDemand ? ON_DEMAND : ACTIVE);
builder.install();
}
示例2: performRuntime
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
throws OperationFailedException {
RuntimeCapability<Void> runtimeCapability = SASL_SERVER_FACTORY_RUNTIME_CAPABILITY.fromBaseCapability(context.getCurrentAddressValue());
ServiceName saslServerFactoryName = runtimeCapability.getCapabilityServiceName(SaslServerFactory.class);
commonDependencies(installService(context, saslServerFactoryName, model))
.setInitialMode(Mode.ACTIVE)
.install();
}
示例3: startNeo4jDriverService
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
private void startNeo4jDriverService(OperationContext context, ConfigurationBuilder builder, final Set<String> outboundSocketBindings) throws OperationFailedException {
if (builder.getJNDIName() != null && builder.getJNDIName().length() > 0) {
final Neo4jClientConnectionService neo4jClientConnectionService = new Neo4jClientConnectionService(builder);
final ServiceName serviceName = ConnectionServiceAccess.serviceName(builder.getDescription());
final ContextNames.BindInfo bindingInfo = ContextNames.bindInfoFor(builder.getJNDIName());
final BinderService binderService = new BinderService(bindingInfo.getBindName());
context.getServiceTarget().addService(bindingInfo.getBinderServiceName(), binderService)
.addDependency(Neo4jSubsystemService.serviceName())
.addDependency(bindingInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addDependency(serviceName, Neo4jClientConnectionService.class, new Injector<Neo4jClientConnectionService>() {
@Override
public void inject(final Neo4jClientConnectionService value) throws
InjectionException {
binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(new ImmediateValue<>(value.getDriver())));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
}).install();
final ServiceBuilder<Neo4jClientConnectionService> serviceBuilder = context.getServiceTarget().addService(serviceName, neo4jClientConnectionService);
serviceBuilder.addDependency(Neo4jSubsystemService.serviceName(), new CastingInjector<>(neo4jClientConnectionService.getNeo4jSubsystemServiceInjectedValue(), Neo4jSubsystemService.class));
// add service dependency on each separate hostname/port reference in standalone*.xml referenced from this driver profile definition.
for (final String outboundSocketBinding : outboundSocketBindings) {
final ServiceName outboundSocketBindingDependency = context.getCapabilityServiceName(Neo4jDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding, OutboundSocketBinding.class);
serviceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingDependency, OutboundSocketBinding.class, neo4jClientConnectionService.getOutboundSocketBindingInjector(outboundSocketBinding));
}
if (builder.getSecurityDomain() != null) {
serviceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
neo4jClientConnectionService.getSubjectFactoryInjector());
}
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
}
示例4: startServices
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
private void startServices(OperationContext context, Configuration configuration, String outboundSocketBinding) {
ServiceName connectionsServiceName = ConnectionServiceAccess.serviceName(configuration.getProfileName());
OrientInteraction orientInteraction = new OrientInteraction(configuration);
OrientClientConnectionsService connectionsService = new OrientClientConnectionsService(configuration, orientInteraction);
ServiceBuilder<OrientClientConnectionsService> connectionsServiceBuilder = context.getServiceTarget()
.addService(connectionsServiceName, connectionsService);
connectionsServiceBuilder.addDependency(OrientSubsystemService.SERVICE_NAME, new CastingInjector<>(
connectionsService.getOrientSubsystemServiceInjectedValue(), OrientSubsystemService.class));
ServiceName outboundSocketBindingServiceName = context.getCapabilityServiceName(
OrientDriverDefinition.OUTBOUND_SOCKET_BINDING_CAPABILITY_NAME, outboundSocketBinding,
OutboundSocketBinding.class);
connectionsServiceBuilder.addDependency(ServiceBuilder.DependencyType.REQUIRED, outboundSocketBindingServiceName,
new CastingInjector<>(connectionsService.getOutboundSocketBindingInjectedValue(),
OutboundSocketBinding.class));
if (configuration.getSecurityDomain() != null) {
connectionsServiceBuilder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
connectionsService.getSubjectFactoryInjector());
}
connectionsServiceBuilder.setInitialMode(ServiceController.Mode.ACTIVE).install();
bindJndi(context, connectionsServiceName, configuration.getJndiName(), orientInteraction.getDatabasePoolClass());
}
示例5: bindJndi
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
private <T> void bindJndi(OperationContext context, ServiceName serviceName, String jndiName, Class<T> clazz) {
ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(jndiName);
BinderService binderService = new BinderService(bindInfo.getBindName());
context.getServiceTarget().addService(bindInfo.getBinderServiceName(), binderService)
.addDependency(OrientSubsystemService.SERVICE_NAME)
.addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class,
binderService.getNamingStoreInjector())
.addDependency(serviceName, OrientClientConnectionsService.class,
new Injector<OrientClientConnectionsService>() {
@Override
public void inject(final OrientClientConnectionsService value) throws InjectionException {
binderService.getManagedObjectInjector().inject(
new ValueManagedReferenceFactory(new ImmediateValue<>(value.unwrap(clazz))));
}
@Override
public void uninject() {
binderService.getNamingStoreInjector().uninject();
}
})
.install();
}
示例6: performBoottime
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void performBoottime(OperationContext context, ModelNode operation, ModelNode model,
ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers)
throws OperationFailedException {
ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
SmppService service = SmppService.INSTANCE;
service.setModel(fullModel);
ServiceName name = SmppService.getServiceName();
ServiceController<SmppServiceInterface> controller = context.getServiceTarget()
.addService(name, service)
.addDependency(PathManagerService.SERVICE_NAME, PathManager.class, service.getPathManagerInjector())
.addDependency(MBeanServerService.SERVICE_NAME, MBeanServer.class, service.getMbeanServer())
.addListener(verificationHandler)
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
newControllers.add(controller);
}
示例7: install
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
public static ServiceController<Void> install(ServiceTarget target,
String serviceName,
String socketBindingName,
Collection<String> userDefinedTags) {
List<String> tags = new ArrayList<>(userDefinedTags);
tags.add(socketBindingName);
ServiceName socketBinding = ServiceName.parse("org.wildfly.network.socket-binding." + socketBindingName);
RegistrationAdvertiser advertiser = new RegistrationAdvertiser(serviceName, tags.toArray(new String[tags.size()]));
return target.addService(ServiceName.of("swarm", "topology", "register", serviceName, socketBindingName), advertiser)
.addDependency(CONNECTOR_SERVICE_NAME, TopologyConnector.class, advertiser.getTopologyConnectorInjector())
.addDependency(socketBinding, SocketBinding.class, advertiser.getSocketBindingInjector())
.setInitialMode(ServiceController.Mode.PASSIVE)
.install();
}
示例8: activate
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException {
ServiceTarget target = serviceActivatorContext.getServiceTarget();
MetricsService service = new MetricsService();
ServiceBuilder<MetricsService> metricsServiceBuilder = target.addService(MetricsService.SERVICE_NAME, service);
RegistryFactory factory = new RegistryFactoryImpl();
ServiceBuilder<MetricsService> serviceBuilder = metricsServiceBuilder
.addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.getServerEnvironmentInjector())
.addDependency(ServiceName.parse("jboss.eclipse.microprofile.config.config-provider"))
.addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.getModelControllerInjector());
serviceBuilder.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
BinderService binderService = new BinderService(SWARM_MP_METRICS, null, true);
target.addService(ContextNames.buildServiceName(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, SWARM_MP_METRICS), binderService)
.addDependency(ContextNames.JBOSS_CONTEXT_SERVICE_NAME, ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
.addInjection(binderService.getManagedObjectInjector(), new ImmediateManagedReferenceFactory(factory))
.setInitialMode(ServiceController.Mode.ACTIVE)
.install();
}
示例9: doGet
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
ServiceContainer sc = CurrentServiceContainer.getServiceContainer();
// for(ServiceName sn: sc.getServiceNames()) {
// log.info("" + sn);
// }
ServiceName sn = ServiceName.of("jboss", "infinispan", "web", "repl");
ServiceController scon = sc.getService(sn);
Cache cache = (Cache)scon.getValue();
log.info("" + cache);
String path = req.getPathInfo();
Object o = null;
if ("/put".equals(path)) {
cache.put("test", "blah");
}
else if ("/get".equals(path)) {
o = cache.get("test");
}
res.setContentType("text/html");
PrintWriter out = res.getWriter();
if (o != null) {
out.println(o);
}
}
示例10: execute
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
public void execute(OperationContext opContext, ModelNode model) throws OperationFailedException {
try {
ServiceName name = NestService.SERVICE_NAME;
NestService service = (NestService) opContext.getServiceRegistry(true).getRequiredService(name).getValue();
boolean restart = model.get(NestSubsystemDefinition.START_OP_PARAM_RESTART.getName()).asBoolean(false);
if (restart) {
log.debug("Asked to restart the nest. Will stop it, then restart it now.");
service.stopNest();
}
service.startNest();
} catch (ServiceNotFoundException snfe) {
throw new OperationFailedException("Cannot restart nest - the nest is disabled", snfe);
} catch (Exception e) {
throw new OperationFailedException("Cannot restart nest", e);
}
opContext.stepCompleted();
return;
}
示例11: execute
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
public void execute(OperationContext opContext, ModelNode model) throws OperationFailedException {
log.debug("Asked to stop the nest");
NestService service = null;
try {
ServiceName name = NestService.SERVICE_NAME;
service = (NestService) opContext.getServiceRegistry(true).getRequiredService(name).getValue();
} catch (Exception e) {
// The nest service just isn't deployed, so obviously, it is already stopped. Just keep going.
}
if (service != null) {
service.stopNest();
}
opContext.stepCompleted();
return;
}
示例12: performRuntime
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) {
final ModelNode address = operation.require(OP_ADDR);
final PathAddress pathAddress = PathAddress.pathAddress(address);
String transportName = pathAddress.getLastElement().getValue();
final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
ServiceName serviceName = TeiidServiceNames.transportServiceName(transportName);
final ServiceController<?> controller = serviceRegistry.getService(serviceName);
if (controller != null) {
TransportService transport = TransportService.class.cast(controller.getValue());
if (transport.isEmbedded()) {
final ContextNames.BindInfo bindInfo = ContextNames.bindInfoFor(LocalServerConnection.jndiNameForRuntime(transportName));
context.removeService(bindInfo.getBinderServiceName());
context.removeService(TeiidServiceNames.embeddedTransportServiceName(transportName).append("reference-factory")); //$NON-NLS-1$
}
context.removeService(serviceName);
}
}
示例13: updateServices
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
static void updateServices(OperationContext context, RuntimeVDB vdb,
String dsName, ReplaceResult rr) {
if (rr.isNew) {
VDBDeployer.addDataSourceListener(context.getServiceTarget(), new VDBKey(vdb.getVdb().getName(), vdb.getVdb().getVersion()), dsName);
}
if (rr.removedDs != null) {
final ServiceRegistry registry = context.getServiceRegistry(true);
ServiceName serviceName;
try {
serviceName = TeiidServiceNames.dsListenerServiceName(vdb.getVdb().getName(), vdb.getVdb().getVersion(), rr.removedDs);
} catch (InvalidServiceNameException e) {
return; //the old isn't valid
}
final ServiceController<?> controller = registry.getService(serviceName);
if (controller != null) {
context.removeService(serviceName);
}
}
}
示例14: undeploy
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
@Override
public void undeploy(final DeploymentUnit context) {
if (!TeiidAttachments.isTranslator(context)) {
return;
}
VDBTranslatorMetaData metadata = context.getAttachment(TeiidAttachments.TRANSLATOR_METADATA);
if (metadata == null) {
return;
}
final ServiceRegistry registry = context.getServiceRegistry();
final ServiceName serviceName = TeiidServiceNames.translatorServiceName(metadata.getName());
final ServiceController<?> controller = registry.getService(serviceName);
if (controller != null) {
controller.setMode(Mode.REMOVE);
}
}
示例15: removeThreadPoolService
import org.jboss.msc.service.ServiceName; //导入依赖的package包/类
static void removeThreadPoolService(final String threadPoolName,
final ServiceName serviceNameBase,
final String threadFactoryName,
final ThreadFactoryResolver threadFactoryResolver,
final String handoffExecutorName,
final HandoffExecutorResolver handoffExecutorResolver,
final OperationContext operationContext) {
final ServiceName threadPoolServiceName = serviceNameBase.append(threadPoolName);
operationContext.removeService(threadPoolServiceName);
threadFactoryResolver.releaseThreadFactory(threadFactoryName, threadPoolName, threadPoolServiceName, operationContext);
if (handoffExecutorResolver != null) {
handoffExecutorResolver.releaseHandoffExecutor(handoffExecutorName, threadPoolName, threadPoolServiceName, operationContext);
}
}