本文整理汇总了Java中org.jboss.msc.service.ServiceNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java ServiceNotFoundException类的具体用法?Java ServiceNotFoundException怎么用?Java ServiceNotFoundException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceNotFoundException类属于org.jboss.msc.service包,在下文中一共展示了ServiceNotFoundException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的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;
}
示例2: performRuntime
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
String securityDomain = SECURITY_DOMAIN.resolveModelAttribute(context, model).asString();
final InjectedValue<SecurityDomain> securityDomainInjected = new InjectedValue<>();
final IdentityService service = new IdentityService(securityIdentitySupplier);
ServiceBuilder<Void> serviceBuilder = context.getServiceTarget().addService(MANAGEMENT_IDENTITY_RUNTIME_CAPABILITY.getCapabilityServiceName(), service)
.setInitialMode(Mode.ACTIVE);
serviceBuilder.addDependency(context.getCapabilityServiceName(RuntimeCapability.buildDynamicCapabilityName(SECURITY_DOMAIN_CAPABILITY, securityDomain), SecurityDomain.class), SecurityDomain.class, securityDomainInjected);
service.setConfiguredSecurityDomain(securityDomainInjected);
serviceBuilder.install();
//Let's verify that the IdentityService is correctly started.
context.addStep((OperationContext context1, ModelNode operation1) -> {
try {
ServiceController<?> controller = context1.getServiceRegistry(false).getRequiredService(MANAGEMENT_IDENTITY_RUNTIME_CAPABILITY.getCapabilityServiceName());
if (controller == null || State.UP != controller.getState()) {
context.setRollbackOnly();
}
} catch (ServiceNotFoundException ex) {
context.setRollbackOnly();
}
}, OperationContext.Stage.VERIFY);
}
示例3: execute
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
List<ServiceName> failures = new ArrayList<>();
ServiceRegistry registry = context.getServiceRegistry(false);
for (ServiceName serviceName : requiredServices) {
try {
ServiceController<?> controller = registry.getService(serviceName);
if (controller == null || State.UP != controller.getState()) {
failures.add(serviceName);
}
} catch (ServiceNotFoundException ex) {
failures.add(serviceName);
}
}
if (!failures.isEmpty()) {
Boolean attachment = context.getAttachment(MANAGEMENT_INTERFACE_KEY);
if (attachment == null || !context.getAttachment(MANAGEMENT_INTERFACE_KEY)) {
context.attach(MANAGEMENT_INTERFACE_KEY, false);
context.addStep(new VerifyInstallationStep(), OperationContext.Stage.VERIFY);
}
} else {
context.attach(MANAGEMENT_INTERFACE_KEY, true);
}
}
示例4: execute
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
public void execute(OperationContext opContext, ModelNode model) throws OperationFailedException {
boolean isStarted = false;
try {
ServiceName name = NestService.SERVICE_NAME;
NestService service = (NestService) opContext.getServiceRegistry(true).getRequiredService(name).getValue();
isStarted = service.isStarted();
} catch (ServiceNotFoundException snfe) {
// the nest just isn't deployed, so obviously, it isn't started
isStarted = false;
}
opContext.getResult().set(isStarted ? "STARTED" : "STOPPED");
opContext.stepCompleted();
}
示例5: getRequiredService
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException {
ServiceController<?> result = registry.getRequiredService(serviceName);
synchronized (this) {
if (registryActiveStep != null) {
OperationContextServiceController ocsc = new OperationContextServiceController(result, registryActiveStep);
result = ocsc;
controllers.add(ocsc);
}
}
return result;
}
示例6: getProcessEngineService
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
protected ProcessEngine getProcessEngineService(ServiceName processEngineServiceName) {
try {
ServiceController<ProcessEngine> serviceController = getProcessEngineServiceController(processEngineServiceName);
return serviceController.getValue();
} catch (ServiceNotFoundException e) {
return null;
}
}
示例7: getRequiredService
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException {
checkPermission(PERMISSION);
return delegate.getRequiredService(serviceName);
}
示例8: serverControllerServiceRemoved
import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Message(id = 139, value = "Server controller service was removed")
ServiceNotFoundException serverControllerServiceRemoved();