Examples of ServiceRegistry


Examples of org.jboss.msc.service.ServiceRegistry

        final String name = address.getLastElement().getValue();

        if (context.getType() == OperationContext.Type.SERVER) {
            context.addStep(new OperationStepHandler() {
                public void execute(final OperationContext context, ModelNode operation) {
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
                    final ServiceController<?> controller = serviceRegistry.getService(LogServices.handlerName(name));
                    if (controller != null) {
                        controller.addListener(new AbstractServiceListener<Object>() {
                            public void listenerAdded(ServiceController<?> serviceController) {
                                serviceController.setMode(ServiceController.Mode.NEVER);
                            }
View Full Code Here

Examples of org.jboss.msc.service.ServiceRegistry

    protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model,
                                  final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException {
        String loggerName = getLoggerName(operation);
        String handlerName = getHandlerName(operation);

        final ServiceRegistry serviceRegistry = context.getServiceRegistry(false);
        ServiceController<?> loggerHandlerController = serviceRegistry.getService(LogServices.loggerHandlerName(loggerName, handlerName));
        @SuppressWarnings("unchecked")
        final ServiceController<Handler> handlerController = (ServiceController<Handler>) serviceRegistry.getService(LogServices.handlerName(handlerName));

        if (loggerHandlerController != null) {
            throw createFailureMessage(MESSAGES.handlerAlreadyDefined(handlerName));
        }
View Full Code Here

Examples of org.jboss.msc.service.ServiceRegistry

    @Override
    protected final void performRuntime(OperationContext context, ModelNode operation, ModelNode model) {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        final ServiceName serviceName = LogServices.handlerName(name);
        final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
        @SuppressWarnings("unchecked")
        final ServiceController<Handler> controller = (ServiceController<Handler>) serviceRegistry.getService(serviceName);
        controller.getValue().close();
        context.removeService(serviceName);
        removeAdditionalServices(context, name);
    }
View Full Code Here

Examples of org.jboss.msc.service.ServiceRegistry

        final String name = address.getLastElement().getValue();

        if (context.getType() == OperationContext.Type.SERVER) {
            context.addStep(new OperationStepHandler() {
                public void execute(final OperationContext context, ModelNode operation) {
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(true);
                    final ServiceController<?> controller = serviceRegistry.getService(LogServices.handlerName(name));
                    if (controller != null) {
                        controller.addListener(new AbstractServiceListener<Object>() {
                            public void listenerAdded(ServiceController<?> serviceController) {
                                serviceController.setMode(ServiceController.Mode.ACTIVE);
                            }
View Full Code Here

Examples of org.jboss.msc.service.ServiceRegistry

    @Override
    protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode resolvedValue, final ModelNode currentValue, final HandbackHolder<Logger> handbackHolder) throws OperationFailedException {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        final ServiceRegistry serviceRegistry = context.getServiceRegistry(false);
        @SuppressWarnings("unchecked")
        final ServiceController<Logger> controller = (ServiceController<Logger>) serviceRegistry.getService(LogServices.loggerName(name));
        if (controller == null) {
            return false;
        }
        // Get the logger
        final Logger logger = controller.getValue();
View Full Code Here

Examples of org.jboss.msc.service.ServiceRegistry

            // only after describe do we have a bean
            if (getLifecycleState().isAfter(BeanState.DESCRIBED)) {
                addCallbacks(true);
                addCallbacks(false);

                ServiceRegistry registry = context.getController().getServiceContainer();
                InstancesService.addInstance(registry, context.getChildTarget(), getLifecycleState(), getBean());
            }

            final AbstractPojoPhase nextPhase = createNextPhase(); // do we have a next phase
            if (nextPhase != null) {
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.spi.loader.ServiceRegistry

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static <RESOLVEDTYPE extends ResolvedArtifact<RESOLVEDTYPE>, RETURNTYPE> FormatProcessor<? super RESOLVEDTYPE, RETURNTYPE> find(
            final Class<RESOLVEDTYPE> resolvedTypeClass, final Class<RETURNTYPE> returnTypeClass) {

        ServiceRegistry registry = ServiceRegistry.getInstance();
        Collection<FormatProcessor> processors = registry.all(FormatProcessor.class);

        StringBuilder unsupportedFormatMessage = new StringBuilder("No format processor for ")
                .append(returnTypeClass.getName()).append(
                        " was found. Supported processors are: ");
View Full Code Here

Examples of org.jboss.weld.bootstrap.api.ServiceRegistry

      services.put(serviceType, service);
   }

   public ServiceRegistry create()
   {
      ServiceRegistry serviceRegistry = new SimpleServiceRegistry();
      serviceRegistry.addAll(services.entrySet());
      EjbServices ejbServices = null;
      try
      {
         ejbServices = (EjbServices) ejbServicesFactory.createBean();
      } catch (Throwable e)
      {
         throw new RuntimeException(e);
      }
      serviceRegistry.add(EjbServices.class, ejbServices);
      return serviceRegistry;
   }
View Full Code Here

Examples of org.jboss.weld.bootstrap.api.ServiceRegistry

      Archive archive = archiveLoader.load(beanClass, this);
      loadedArchives.add(archive);
      BeanDeploymentArchive bda = archive.getBeanDeploymentArchive();
      if (archive.getBeanDeploymentArchive() == null)
      {
         ServiceRegistry serviceRegistry = loadedBDAServiceRegistry.create();
         bda = archive.createBeanDeploymentArchive(serviceRegistry);
      }
      return bda;
   }
View Full Code Here

Examples of org.joseki.ServiceRegistry

    log.info("shutting down");
    loader.getMapping().close();
  }

  protected ServiceRegistry createJosekiServiceRegistry() {
    ServiceRegistry services = new ServiceRegistry();
    Service service = new Service(new SPARQL(),
        D2RServer.SPARQL_SERVICE_NAME,
        new D2RQDatasetDesc(this.dataset));
    services.add(D2RServer.SPARQL_SERVICE_NAME, service);
    return services;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.