当前位置: 首页>>代码示例>>Java>>正文


Java ServiceNotFoundException类代码示例

本文整理汇总了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;
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:22,代码来源:NestSubsystemStart.java

示例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);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:AccessIdentityResourceDefinition.java

示例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);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:ManagementInterfaceAddStepHandler.java

示例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();
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:15,代码来源:NestSubsystemStatus.java

示例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;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:OperationContextImpl.java

示例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;
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:9,代码来源:MscRuntimeContainerDelegate.java

示例7: getRequiredService

import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Override
public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException {
    checkPermission(PERMISSION);
    return delegate.getRequiredService(serviceName);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:SecuredServiceRegistry.java

示例8: serverControllerServiceRemoved

import org.jboss.msc.service.ServiceNotFoundException; //导入依赖的package包/类
@Message(id = 139, value = "Server controller service was removed")
ServiceNotFoundException serverControllerServiceRemoved();
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:3,代码来源:ServerLogger.java


注:本文中的org.jboss.msc.service.ServiceNotFoundException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。