Ejemplo n.º 1
0
  /**
   * {@inheritDoc}
   *
   * @see org.jboss.as.controller.Extension#initialize(org.jboss.as.controller.ExtensionContext)
   */
  @Override
  public void initialize(ExtensionContext context) {
    // IMPORTANT: Management API version != xsd version! Not all Management API changes result in
    // XSD changes
    SubsystemRegistration subsystem =
        context.registerSubsystem(
            SUBSYSTEM_NAME,
            MANAGEMENT_API_MAJOR_VERSION,
            MANAGEMENT_API_MINOR_VERSION,
            MANAGEMENT_API_MICRO_VERSION);
    // Create the path resolver handler
    final ResolvePathHandler resolvePathHandler;
    if (context.getProcessType().isServer()) {
      resolvePathHandler =
          ResolvePathHandler.Builder.of(context.getPathManager())
              .setPathAttribute(FileStoreResource.PATH)
              .setRelativeToAttribute(FileStoreResource.RELATIVE_TO)
              .build();
    } else {
      resolvePathHandler = null;
    }

    subsystem.registerSubsystemModel(new InfinispanSubsystemRootResource(resolvePathHandler));
    subsystem.registerXMLElementWriter(new InfinispanSubsystemXMLWriter());
    registerTransformers(subsystem);
  }
 @Override
 public void initialize(ExtensionContext context) {
   SubsystemRegistration registration =
       context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1));
   registration.registerSubsystemModel(new CliExtCommandsSubsystemResourceDescription());
   registration.registerXMLElementWriter(new CliExtCommandsParser());
 }
Ejemplo n.º 3
0
  @Override
  public void initialize(ExtensionContext context) {

    final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();

    final SubsystemRegistration subsystem =
        context.registerSubsystem(
            SUBSYSTEM_NAME,
            MANAGEMENT_API_MAJOR_VERSION,
            MANAGEMENT_API_MINOR_VERSION,
            MANAGEMENT_API_MICRO_VERSION);
    final ManagementResourceRegistration registration =
        subsystem.registerSubsystemModel(SecuritySubsystemRootResourceDefinition.INSTANCE);
    registration.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    final ManagementResourceRegistration securityDomain =
        registration.registerSubModel(new SecurityDomainResourceDefinition(registerRuntimeOnly));
    final ManagementResourceRegistration jaspi =
        securityDomain.registerSubModel(JASPIAuthenticationResourceDefinition.INSTANCE);
    jaspi.registerSubModel(LoginModuleStackResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(ClassicAuthenticationResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(AuthorizationResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(MappingResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(ACLResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(AuditResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(IdentityTrustResourceDefinition.INSTANCE);
    securityDomain.registerSubModel(JSSEResourceDefinition.INSTANCE);
    registration.registerSubModel(VaultResourceDefinition.INSTANCE);
    subsystem.registerXMLElementWriter(PARSER);

    if (context.isRegisterTransformers()) {
      registerTransformers(subsystem);
    }
  }
Ejemplo n.º 4
0
  @Override
  public void initialize(ExtensionContext context) {
    log.debug("Initializing Security Extension");

    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
    final ModelNodeRegistration registration =
        subsystem.registerSubsystemModel(SecuritySubsystemDescriptions.SUBSYSTEM);
    registration.registerOperationHandler(
        ADD, SecuritySubsystemAdd.INSTANCE, SecuritySubsystemDescriptions.SUBSYSTEM_ADD, false);
    registration.registerOperationHandler(
        DESCRIBE,
        SecurityDescribeHandler.INSTANCE,
        SecuritySubsystemDescriptions.SUBSYSTEM_DESCRIBE,
        false);

    // security domains
    final ModelNodeRegistration securityDomain =
        registration.registerSubModel(
            PathElement.pathElement(CommonAttributes.SECURITY_DOMAIN),
            SecuritySubsystemDescriptions.SECURITY_DOMAIN);
    securityDomain.registerOperationHandler(
        SecurityDomainAdd.OPERATION_NAME,
        SecurityDomainAdd.INSTANCE,
        SecuritySubsystemDescriptions.SECURITY_DOMAIN_ADD,
        false);
    securityDomain.registerOperationHandler(
        SecurityDomainRemove.OPERATION_NAME,
        SecurityDomainRemove.INSTANCE,
        SecuritySubsystemDescriptions.SECURITY_DOMAIN_REMOVE,
        false);

    subsystem.registerXMLElementWriter(PARSER);
  }
Ejemplo n.º 5
0
  @Override
  public void initialize(final ExtensionContext context) {
    log.debugf("Initializing Connector Extension");
    // Register the connector subsystem
    final SubsystemRegistration registration = context.registerSubsystem(JCA);

    registration.registerXMLElementWriter(NewConnectorSubsystemParser.INSTANCE);

    // Connector subsystem description and operation handlers
    final ManagementResourceRegistration subsystem = registration.registerSubsystemModel(SUBSYSTEM);
    subsystem.registerOperationHandler(ADD, JcaSubsystemAdd.INSTANCE, SUBSYSTEM_ADD_DESC, false);
    subsystem.registerOperationHandler(
        REMOVE, JcaSubSystemRemove.INSTANCE, SUBSYSTEM_REMOVE_DESC, false);
    subsystem.registerOperationHandler(
        DESCRIBE,
        ConnectorSubsystemDescribeHandler.INSTANCE,
        ConnectorSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    final ManagementResourceRegistration threadPools =
        subsystem.registerSubModel(
            PathElement.pathElement(THREAD_POOL), BOUNDED_QUEUE_THREAD_POOL_DESC);
    threadPools.registerOperationHandler(
        ADD, BoundedQueueThreadPoolAdd.INSTANCE, BoundedQueueThreadPoolAdd.INSTANCE, false);
    threadPools.registerOperationHandler(
        REMOVE,
        BoundedQueueThreadPoolRemove.INSTANCE,
        BoundedQueueThreadPoolRemove.INSTANCE,
        false);
  }
Ejemplo n.º 6
0
  public void initialize(ExtensionContext context) {
    final DescriptionProvider subsystemDescription =
        new DescriptionProvider() {
          public ModelNode getModelDescription(Locale locale) {
            return JdrReportDescriptions.getJdrSubsystemDescription(locale);
          }
        };

    SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);

    ManagementResourceRegistration root =
        subsystemRegistration.registerSubsystemModel(subsystemDescription);
    root.registerOperationHandler(
        JdrReportSubsystemAdd.OPERATION_NAME,
        JdrReportSubsystemAdd.INSTANCE,
        JdrReportSubsystemAdd.INSTANCE);
    root.registerOperationHandler(
        DESCRIBE,
        JdrSubsystemDescribeHandler.INSTANCE,
        JdrSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);
    root.registerOperationHandler(
        JdrReportSubsystemRemove.OPERATION_NAME,
        JdrReportSubsystemRemove.INSTANCE,
        JdrReportSubsystemRemove.INSTANCE);

    if (context.isRuntimeOnlyRegistrationValid()) {
      root.registerOperationHandler(
          JdrReportRequestHandler.OPERATION_NAME,
          JdrReportRequestHandler.INSTANCE,
          JdrReportRequestHandler.INSTANCE);
    }
    subsystemRegistration.registerXMLElementWriter(JdrReportSubsystemParser.INSTANCE);
  }
Ejemplo n.º 7
0
  /** {@inheritDoc} */
  @Override
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem =
        context.registerSubsystem(
            SUBSYSTEM_NAME,
            MANAGEMENT_API_MAJOR_VERSION,
            MANAGEMENT_API_MINOR_VERSION,
            MANAGEMENT_API_MICRO_VERSION);

    // Register the root subsystem resource.
    final ManagementResourceRegistration rootResource =
        subsystem.registerSubsystemModel(EeSubsystemRootResource.create());

    // Mandatory describe operation
    rootResource.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    // register submodels
    rootResource.registerSubModel(ContextServiceResourceDefinition.INSTANCE);
    rootResource.registerSubModel(ManagedThreadFactoryResourceDefinition.INSTANCE);
    rootResource.registerSubModel(ManagedExecutorServiceResourceDefinition.INSTANCE);
    rootResource.registerSubModel(ManagedScheduledExecutorServiceResourceDefinition.INSTANCE);
    rootResource.registerSubModel(
        new DefaultBindingsResourceDefinition(new DefaultBindingsConfigurationProcessor()));

    subsystem.registerXMLElementWriter(EESubsystemXmlPersister.INSTANCE);

    if (context.isRegisterTransformers()) {
      registerTransformers(subsystem);
    }
  }
Ejemplo n.º 8
0
  /** {@inheritDoc} */
  @Override
  public void initialize(final ExtensionContext context) {
    ROOT_LOGGER.debug("Activating Keycloak Extension");
    final SubsystemRegistration subsystem =
        context.registerSubsystem(SUBSYSTEM_NAME, MGMT_API_VERSION_MAJOR, MGMT_API_VERSION_MINOR);

    subsystem.registerSubsystemModel(KEYCLOAK_SUBSYSTEM_RESOURCE);
    subsystem.registerXMLElementWriter(PARSER);
  }
  protected ManagementResourceRegistration initializeSubsystem(
      final SubsystemRegistration registration) {
    // Common subsystem tasks
    final ResourceDefinition def = createResourceDefinition(SUBSYSTEM_PATH);
    registration.registerXMLElementWriter(getParser());

    final ManagementResourceRegistration reg = registration.registerSubsystemModel(def);
    reg.registerReadWriteAttribute(
        TEST_ATTRIBUTE, null, new BasicAttributeWriteHandler(TEST_ATTRIBUTE));
    return reg;
  }
Ejemplo n.º 10
0
 @Override
 public void initialize(ExtensionContext context) {
   final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
   final ModelNodeRegistration registration =
       subsystem.registerSubsystemModel(OSGiSubsystemProviders.SUBSYSTEM);
   registration.registerOperationHandler(
       ADD, OSGiSubsystemAdd.INSTANCE, OSGiSubsystemProviders.SUBSYSTEM_ADD, false);
   registration.registerOperationHandler(
       DESCRIBE,
       OSGiSubsystemDescribeHandler.INSTANCE,
       OSGiSubsystemDescribeHandler.INSTANCE,
       false);
   subsystem.registerXMLElementWriter(PARSER);
 }
Ejemplo n.º 11
0
  @Override
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
    final ManagementResourceRegistration registration =
        subsystem.registerSubsystemModel(SubsystemDefinition.INSTANCE);
    registration.registerOperationHandler(
        DESCRIBE,
        GenericSubsystemDescribeHandler.INSTANCE,
        GenericSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    subsystem.registerXMLElementWriter(parser);
  }
Ejemplo n.º 12
0
 @Override
 public void initialize(final ExtensionContext context) {
   final SubsystemRegistration subsystem =
       context.registerSubsystem(
           Constants.SUBSYSTEM_NAME,
           MANAGEMENT_API_MAJOR_VERSION,
           MANAGEMENT_API_MINOR_VERSION,
           MANAGEMENT_API_MICRO_VERSION);
   final ManagementResourceRegistration registration =
       subsystem.registerSubsystemModel(SecurityManagerRootDefinition.INSTANCE);
   registration.registerOperationHandler(
       GenericSubsystemDescribeHandler.DEFINITION,
       GenericSubsystemDescribeHandler.INSTANCE,
       false);
   subsystem.registerXMLElementWriter(SecurityManagerSubsystemParser.INSTANCE);
 }
Ejemplo n.º 13
0
  /** {@inheritDoc} */
  @Override
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem =
        context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);

    // Register the root subsystem resource.
    final ManagementResourceRegistration rootResource =
        subsystem.registerSubsystemModel(
            new JSR77ManagementRootResource(
                context.getProcessType() == ProcessType.APPLICATION_CLIENT));

    // Mandatory describe operation
    rootResource.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    subsystem.registerXMLElementWriter(parser);
  }
Ejemplo n.º 14
0
  @Override
  public void initialize(ExtensionContext context) {

    // Register the remoting subsystem
    final SubsystemRegistration registration =
        context.registerSubsystem(
            SUBSYSTEM_NAME,
            MANAGEMENT_API_MAJOR_VERSION,
            MANAGEMENT_API_MINOR_VERSION,
            MANAGEMENT_API_MICRO_VERSION);
    registration.registerXMLElementWriter(RemotingSubsystemXMLPersister.INSTANCE);

    final ManagementResourceRegistration subsystem =
        registration.registerSubsystemModel(
            new RemotingSubsystemRootResource(context.getProcessType()));
    subsystem.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    final ManagementResourceRegistration connector =
        subsystem.registerSubModel(ConnectorResource.INSTANCE);
    connector.registerSubModel(PropertyResource.INSTANCE_CONNECTOR);
    final ManagementResourceRegistration sasl = connector.registerSubModel(SaslResource.INSTANCE);
    sasl.registerSubModel(SaslPolicyResource.INSTANCE);
    sasl.registerSubModel(PropertyResource.INSTANCE_CONNECTOR);

    final ManagementResourceRegistration httpConnector =
        subsystem.registerSubModel(HttpConnectorResource.INSTANCE);
    httpConnector.registerSubModel(PropertyResource.INSTANCE_HTTP_CONNECTOR);
    final ManagementResourceRegistration httpSasl =
        httpConnector.registerSubModel(SaslResource.INSTANCE);
    httpSasl.registerSubModel(SaslPolicyResource.INSTANCE);
    httpSasl.registerSubModel(PropertyResource.INSTANCE_HTTP_CONNECTOR);

    // remote outbound connection
    subsystem.registerSubModel(RemoteOutboundConnectionResourceDefinition.INSTANCE);
    // local outbound connection
    subsystem.registerSubModel(LocalOutboundConnectionResourceDefinition.INSTANCE);
    // (generic) outbound connection
    subsystem.registerSubModel(GenericOutboundConnectionResourceDefinition.INSTANCE);

    if (context.isRegisterTransformers()) {
      registerTransformers_1_1(registration);
      registerTransformers_1_2(registration);
      registerTransformers_1_3(registration);
    }
  }
Ejemplo n.º 15
0
  @Override
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem =
        context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration registration =
        subsystem.registerSubsystemModel(UndertowRootDefinition.INSTANCE);
    registration.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION,
        GenericSubsystemDescribeHandler.INSTANCE,
        false);

    final ManagementResourceRegistration deployments =
        subsystem.registerDeploymentModel(DeploymentDefinition.INSTANCE);
    deployments.registerSubModel(DeploymentServletDefinition.INSTANCE);

    subsystem.registerXMLElementWriter(UndertowSubsystemParser_3_0.INSTANCE);
  }
  @Override
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0, 0);
    final ManagementResourceRegistration registration =
        subsystem.registerSubsystemModel(DependencySubsystemProviders.SUBSYSTEM);
    // We always need to add an 'add' operation
    registration.registerOperationHandler(
        ADD, DependencySubsystemAdd.INSTANCE, DependencySubsystemProviders.SUBSYSTEM_ADD, false);
    // We always need to add a 'describe' operation
    registration.registerOperationHandler(
        DESCRIBE,
        SubsystemDescribeHandler.INSTANCE,
        SubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    subsystem.registerXMLElementWriter(parser);
  }
Ejemplo n.º 17
0
  public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystemRegistration =
        context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystemRegistration.registerXMLElementWriter(MessagingSubsystemParser_1_0.INSTANCE);

    boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();

    // Root resource
    final ManagementResourceRegistration subsystem =
        subsystemRegistration.registerSubsystemModel(
            MessagingSubsystemRootResourceDefinition.INSTANCE);
    subsystem.registerOperationHandler(
        GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    // ActiveMQ Servers
    final ManagementResourceRegistration server =
        subsystem.registerSubModel(new ServerDefinition(registerRuntimeOnly));

    for (PathDefinition path :
        new PathDefinition[] {
          PathDefinition.JOURNAL_INSTANCE,
          PathDefinition.BINDINGS_INSTANCE,
          PathDefinition.LARGE_MESSAGES_INSTANCE,
          PathDefinition.PAGING_INSTANCE
        }) {
      ManagementResourceRegistration pathRegistry = server.registerSubModel(path);
      PathDefinition.registerResolveOperationHandler(context, pathRegistry);
    }

    subsystem.registerSubModel(JMSBridgeDefinition.INSTANCE);

    if (registerRuntimeOnly) {
      final ManagementResourceRegistration deployment =
          subsystemRegistration.registerDeploymentModel(
              new SimpleResourceDefinition(
                  SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed")));
      final ManagementResourceRegistration deployedServer =
          deployment.registerSubModel(
              new SimpleResourceDefinition(SERVER_PATH, getResourceDescriptionResolver(SERVER)));
      deployedServer.registerSubModel(JMSQueueDefinition.DEPLOYMENT_INSTANCE);
      deployedServer.registerSubModel(JMSTopicDefinition.DEPLOYMENT_INSTANCE);
      deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
    }
  }
Ejemplo n.º 18
0
 /** {@inheritDoc} */
 @Override
 public void initialize(final ExtensionContext context) {
   JSFLogger.ROOT_LOGGER.debug("Activating JSF(Mojarra) Extension");
   final SubsystemRegistration subsystem =
       context.registerSubsystem(
           SUBSYSTEM_NAME,
           MANAGEMENT_API_MAJOR_VERSION,
           MANAGEMENT_API_MINOR_VERSION,
           MANAGEMENT_API_MICRO_VERSION);
   final ManagementResourceRegistration registration =
       subsystem.registerSubsystemModel(JSF_SUBSYSTEM_RESOURCE);
   registration.registerOperationHandler(
       DESCRIBE,
       GenericSubsystemDescribeHandler.INSTANCE,
       GenericSubsystemDescribeHandler.INSTANCE,
       false,
       OperationEntry.EntryType.PRIVATE);
   subsystem.registerXMLElementWriter(PARSER);
 }
  @Override
  public void initialize(ExtensionContext context) {
    bootstrap();
    log.info("Initializing HA-Singleton Subsystem");
    final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
    final ManagementResourceRegistration subsystem =
        registration.registerSubsystemModel(HASingletonSubsystemProviders.SUBSYSTEM);

    subsystem.registerOperationHandler(
        ADD,
        HASingletonSubsystemAdd.ADD_INSTANCE,
        HASingletonSubsystemProviders.SUBSYSTEM_ADD,
        false);

    subsystem.registerOperationHandler(
        DESCRIBE,
        GenericSubsystemDescribeHandler.INSTANCE,
        GenericSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    registration.registerXMLElementWriter(HASingletonSubsystemParser.getInstance());
  }
Ejemplo n.º 20
0
 public void initialize(ExtensionContext context) {
   log.debug("Initializing XTS Extension");
   final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
   final ManagementResourceRegistration registration =
       subsystem.registerSubsystemModel(XTSSubsystemProviders.SUBSYSTEM);
   registration.registerOperationHandler(
       ModelDescriptionConstants.ADD,
       XTSSubsystemAdd.INSTANCE,
       XTSSubsystemProviders.SUBSYSTEM_ADD,
       false);
   registration.registerOperationHandler(
       ModelDescriptionConstants.REMOVE,
       XTSSubsystemRemove.INSTANCE,
       XTSSubsystemProviders.SUBSYSTEM_REMOVE,
       false);
   registration.registerOperationHandler(
       DESCRIBE,
       GenericSubsystemDescribeHandler.INSTANCE,
       GenericSubsystemDescribeHandler.INSTANCE,
       false,
       OperationEntry.EntryType.PRIVATE);
   subsystem.registerXMLElementWriter(parser);
 }
Ejemplo n.º 21
0
  /**
   * Register the transformers for transforming from 1.4.0 to 1.3.0 management api versions, in
   * which: - attributes INDEXING_PROPERTIES, SEGMENTS were added in 1.4 - attribute VIRTUAL_NODES
   * was deprecated in 1.4 - expression support was added to most attributes in 1.4, except for
   * CLUSTER, DEFAULT_CACHE and MODE for which it was already enabled in 1.3
   *
   * <p>Chaining of transformers is used in cases where two transformers are required for the same
   * operation.
   *
   * @param subsystem the subsystems registration
   */
  private static void registerTransformers(final SubsystemRegistration subsystem) {

    // define the resource and operation transformers
    final InfinispanOperationTransformer_1_3 removeSelectedCacheAttributes =
        new InfinispanOperationTransformer_1_3();

    final RejectExpressionValuesTransformer cacheContainerReject =
        new RejectExpressionValuesTransformer(
            InfinispanRejectedExpressions_1_3.REJECT_CONTAINER_ATTRIBUTES);
    final RejectExpressionValuesTransformer transportReject =
        new RejectExpressionValuesTransformer(
            InfinispanRejectedExpressions_1_3.REJECT_TRANSPORT_ATTRIBUTES);
    final RejectExpressionValuesTransformer cacheReject =
        new RejectExpressionValuesTransformer(
            InfinispanRejectedExpressions_1_3.REJECT_CACHE_ATTRIBUTES);
    final ChainedOperationTransformer chained =
        new ChainedOperationTransformer(removeSelectedCacheAttributes, cacheReject);

    // Register the model transformers
    TransformersSubRegistration registration =
        subsystem.registerModelTransformers(
            ModelVersion.create(1, 3), new InfinispanSubsystemTransformer_1_3());
    TransformersSubRegistration containerRegistration =
        registration.registerSubResource(
            CacheContainerResource.CONTAINER_PATH, (OperationTransformer) cacheContainerReject);
    containerRegistration.registerSubResource(
        TransportResource.TRANSPORT_PATH, (OperationTransformer) transportReject);

    PathElement[] cachePaths = {
      LocalCacheResource.LOCAL_CACHE_PATH,
      InvalidationCacheResource.INVALIDATION_CACHE_PATH,
      ReplicatedCacheResource.REPLICATED_CACHE_PATH,
      DistributedCacheResource.DISTRIBUTED_CACHE_PATH
    };
    for (int i = 0; i < cachePaths.length; i++) {
      // register chained operation transformers for cache ADD operations where we need to remove
      // and reject
      TransformersSubRegistration cacheRegistration =
          containerRegistration.registerSubResource(cachePaths[i], (OperationTransformer) chained);
      registerCacheChildrenTransformers(cacheRegistration);
    }
  }
Ejemplo n.º 22
0
  @Override
  public void initialize(final ExtensionContext context) {

    log.debugf("Initializing Threading Extension");

    // Register the remoting subsystem
    final SubsystemRegistration registration = context.registerSubsystem(THREADS);
    registration.registerXMLElementWriter(NewThreadsSubsystemParser.INSTANCE);
    // Remoting subsystem description and operation handlers
    final ModelNodeRegistration subsystem = registration.registerSubsystemModel(SUBSYSTEM_PROVIDER);
    subsystem.registerOperationHandler(
        ADD, ThreadsSubsystemAdd.INSTANCE, ThreadsSubsystemAdd.INSTANCE, false);
    subsystem.registerOperationHandler(
        DESCRIBE,
        ThreadsSubsystemDescribeHandler.INSTANCE,
        ThreadsSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    final ModelNodeRegistration threadFactories =
        subsystem.registerSubModel(PathElement.pathElement(THREAD_FACTORY), THREAD_FACTORY_DESC);
    threadFactories.registerOperationHandler(
        ADD, ThreadFactoryAdd.INSTANCE, ThreadFactoryAdd.INSTANCE, false);
    threadFactories.registerOperationHandler(
        REMOVE, ThreadFactoryRemove.INSTANCE, ThreadFactoryRemove.INSTANCE, false);
    threadFactories.registerReadWriteAttribute(
        THREAD_NAME_PATTERN,
        null,
        ThreadFactoryThreadNamePatternUpdate.INSTANCE,
        Storage.CONFIGURATION);
    threadFactories.registerReadWriteAttribute(
        GROUP_NAME, null, ThreadFactoryGroupNameUpdate.INSTANCE, Storage.CONFIGURATION);
    threadFactories.registerReadWriteAttribute(
        PRIORITY, null, ThreadFactoryPriorityUpdate.INSTANCE, Storage.CONFIGURATION);

    final ModelNodeRegistration boundedQueueThreadPools =
        subsystem.registerSubModel(
            PathElement.pathElement(BOUNDED_QUEUE_THREAD_POOL), BOUNDED_QUEUE_THREAD_POOL_DESC);
    boundedQueueThreadPools.registerOperationHandler(
        ADD, BoundedQueueThreadPoolAdd.INSTANCE, BoundedQueueThreadPoolAdd.INSTANCE, false);
    boundedQueueThreadPools.registerOperationHandler(
        REMOVE,
        BoundedQueueThreadPoolRemove.INSTANCE,
        BoundedQueueThreadPoolRemove.INSTANCE,
        false);

    final ModelNodeRegistration unboundedQueueThreadPools =
        subsystem.registerSubModel(
            PathElement.pathElement(UNBOUNDED_QUEUE_THREAD_POOL), UNBOUNDED_QUEUE_THREAD_POOL_DESC);
    unboundedQueueThreadPools.registerOperationHandler(
        ADD, UnboundedQueueThreadPoolAdd.INSTANCE, UnboundedQueueThreadPoolAdd.INSTANCE, false);
    unboundedQueueThreadPools.registerOperationHandler(
        REMOVE,
        UnboundedQueueThreadPoolRemove.INSTANCE,
        UnboundedQueueThreadPoolRemove.INSTANCE,
        false);

    final ModelNodeRegistration queuelessThreadPools =
        subsystem.registerSubModel(
            PathElement.pathElement(QUEUELESS_THREAD_POOL), QUEUELESS_THREAD_POOL_DESC);
    queuelessThreadPools.registerOperationHandler(
        ADD, QueuelessThreadPoolAdd.INSTANCE, QueuelessThreadPoolAdd.INSTANCE, false);
    queuelessThreadPools.registerOperationHandler(
        REMOVE, QueuelessThreadPoolRemove.INSTANCE, QueuelessThreadPoolRemove.INSTANCE, false);

    final ModelNodeRegistration scheduledThreadPools =
        subsystem.registerSubModel(
            PathElement.pathElement(SCHEDULED_THREAD_POOL), SCHEDULED_THREAD_POOL_DESC);
    scheduledThreadPools.registerOperationHandler(
        ADD, ScheduledThreadPoolAdd.INSTANCE, ScheduledThreadPoolAdd.INSTANCE, false);
    scheduledThreadPools.registerOperationHandler(
        REMOVE, ScheduledThreadPoolRemove.INSTANCE, ScheduledThreadPoolRemove.INSTANCE, false);
  }
Ejemplo n.º 23
0
  /**
   * {@inheritDoc}
   *
   * @see org.jboss.as.controller.Extension#initialize(org.jboss.as.controller.ExtensionContext)
   */
  @Override
  public void initialize(ExtensionContext context) {
    SubsystemRegistration subsystem =
        context.registerSubsystem(
            SUBSYSTEM_NAME,
            Namespace.CURRENT.getMajorVersion(),
            Namespace.CURRENT.getMinorVersion());
    subsystem.registerXMLElementWriter(Namespace.CURRENT.getWriter());

    ManagementResourceRegistration registration =
        subsystem.registerSubsystemModel(InfinispanSubsystemProviders.SUBSYSTEM);
    registration.registerOperationHandler(
        ADD, InfinispanSubsystemAdd.INSTANCE, InfinispanSubsystemProviders.SUBSYSTEM_ADD, false);
    registration.registerOperationHandler(
        DESCRIBE,
        InfinispanSubsystemDescribe.INSTANCE,
        InfinispanSubsystemProviders.SUBSYSTEM_DESCRIBE,
        false,
        EntryType.PRIVATE);
    registration.registerOperationHandler(
        REMOVE,
        ReloadRequiredRemoveStepHandler.INSTANCE,
        InfinispanSubsystemProviders.SUBSYSTEM_REMOVE,
        false);

    ManagementResourceRegistration container =
        registration.registerSubModel(containerPath, InfinispanSubsystemProviders.CACHE_CONTAINER);
    container.registerOperationHandler(
        ADD, CacheContainerAdd.INSTANCE, InfinispanSubsystemProviders.CACHE_CONTAINER_ADD, false);
    container.registerOperationHandler(
        REMOVE,
        CacheContainerRemove.INSTANCE,
        InfinispanSubsystemProviders.CACHE_CONTAINER_REMOVE,
        false);
    container.registerOperationHandler(
        "add-alias", AddAliasCommand.INSTANCE, InfinispanSubsystemProviders.ADD_ALIAS, false);
    container.registerOperationHandler(
        "remove-alias",
        RemoveAliasCommand.INSTANCE,
        InfinispanSubsystemProviders.REMOVE_ALIAS,
        false);
    CacheContainerWriteAttributeHandler.INSTANCE.registerAttributes(container);

    // add /subsystem=infinispan/cache-container=*/singleton=transport:write-attribute
    final ManagementResourceRegistration transport =
        container.registerSubModel(transportPath, InfinispanSubsystemProviders.TRANSPORT);
    transport.registerOperationHandler(
        ADD, TransportAdd.INSTANCE, InfinispanSubsystemProviders.TRANSPORT_ADD, false);
    transport.registerOperationHandler(
        REMOVE, TransportRemove.INSTANCE, InfinispanSubsystemProviders.TRANSPORT_REMOVE, false);
    TransportWriteAttributeHandler.INSTANCE.registerAttributes(transport);

    // add /subsystem=infinispan/cache-container=*/local-cache=*
    ManagementResourceRegistration local =
        container.registerSubModel(localCachePath, InfinispanSubsystemProviders.LOCAL_CACHE);
    local.registerOperationHandler(
        ADD, LocalCacheAdd.INSTANCE, InfinispanSubsystemProviders.LOCAL_CACHE_ADD, false);
    local.registerOperationHandler(
        REMOVE, CacheRemove.INSTANCE, InfinispanSubsystemProviders.CACHE_REMOVE, false);
    registerCommonCacheAttributeHandlers(local);

    // add /subsystem=infinispan/cache-container=*/invalidation-cache=*
    ManagementResourceRegistration invalidation =
        container.registerSubModel(
            invalidationCachePath, InfinispanSubsystemProviders.INVALIDATION_CACHE);
    invalidation.registerOperationHandler(
        ADD,
        InvalidationCacheAdd.INSTANCE,
        InfinispanSubsystemProviders.INVALIDATION_CACHE_ADD,
        false);
    invalidation.registerOperationHandler(
        REMOVE, CacheRemove.INSTANCE, InfinispanSubsystemProviders.CACHE_REMOVE, false);
    registerCommonCacheAttributeHandlers(invalidation);

    // add /subsystem=infinispan/cache-container=*/replicated-cache=*
    ManagementResourceRegistration replicated =
        container.registerSubModel(
            replicatedCachePath, InfinispanSubsystemProviders.REPLICATED_CACHE);
    replicated.registerOperationHandler(
        ADD, ReplicatedCacheAdd.INSTANCE, InfinispanSubsystemProviders.REPLICATED_CACHE_ADD, false);
    replicated.registerOperationHandler(
        REMOVE, CacheRemove.INSTANCE, InfinispanSubsystemProviders.CACHE_REMOVE, false);
    registerCommonCacheAttributeHandlers(replicated);

    // add /subsystem=infinispan/cache-container=*/distributed-cache=*
    ManagementResourceRegistration distributed =
        container.registerSubModel(
            distributedCachePath, InfinispanSubsystemProviders.DISTRIBUTED_CACHE);
    distributed.registerOperationHandler(
        ADD,
        DistributedCacheAdd.INSTANCE,
        InfinispanSubsystemProviders.DISTRIBUTED_CACHE_ADD,
        false);
    distributed.registerOperationHandler(
        REMOVE, CacheRemove.INSTANCE, InfinispanSubsystemProviders.CACHE_REMOVE, false);
    registerCommonCacheAttributeHandlers(distributed);
  }
  @Override
  public void initialize(final ExtensionContext context) {
    SUBSYSTEM_RA_LOGGER.debugf("Initializing ResourceAdapters Extension");
    // Register the remoting subsystem
    final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME);

    ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler =
        new ReloadRequiredWriteAttributeHandler();

    registration.registerXMLElementWriter(ResourceAdapterSubsystemParser.INSTANCE);

    // Remoting subsystem description and operation handlers
    final ManagementResourceRegistration subsystem = registration.registerSubsystemModel(SUBSYSTEM);
    subsystem.registerOperationHandler(
        ADD, ResourceAdaptersSubSystemAdd.INSTANCE, SUBSYSTEM_ADD_DESC, false);
    subsystem.registerOperationHandler(
        DESCRIBE,
        GenericSubsystemDescribeHandler.INSTANCE,
        GenericSubsystemDescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);

    final ManagementResourceRegistration resourceadapter =
        subsystem.registerSubModel(
            PathElement.pathElement(RESOURCEADAPTER_NAME), RESOURCEADAPTER_DESC);
    resourceadapter.registerOperationHandler(ADD, RaAdd.INSTANCE, ADD_RESOURCEADAPTER_DESC, false);
    resourceadapter.registerOperationHandler(
        REMOVE, RaRemove.INSTANCE, REMOVE_RESOURCEADAPTER_DESC, false);
    for (final String attribute : ResourceAdaptersSubsystemProviders.RESOURCEADAPTER_ATTRIBUTE) {
      resourceadapter.registerReadWriteAttribute(
          attribute, null, reloadRequiredWriteAttributeHandler, Storage.CONFIGURATION);
    }

    final ManagementResourceRegistration configAdapter =
        resourceadapter.registerSubModel(
            PathElement.pathElement(CONFIG_PROPERTIES.getName()), CONFIG_PROPERTIES_DESC);
    configAdapter.registerOperationHandler(
        ADD, ConfigPropertyAdd.INSTANCE, ADD_CONFIG_PROPERTIES_DESC, false);
    configAdapter.registerOperationHandler(
        REMOVE, ReloadRequiredRemoveStepHandler.INSTANCE, REMOVE_CONFIG_PROPERTIES_DESC, false);

    final ManagementResourceRegistration connectionDefinition =
        resourceadapter.registerSubModel(
            PathElement.pathElement(CONNECTIONDEFINITIONS_NAME), CONNECTION_DEFINITION_DESC);
    connectionDefinition.registerOperationHandler(
        ADD, ConnectionDefinitionAdd.INSTANCE, ADD_CONNECTION_DEFINITION_DESC, false);
    connectionDefinition.registerOperationHandler(
        REMOVE, ReloadRequiredRemoveStepHandler.INSTANCE, REMOVE_CONNECTION_DEFINITION_DESC, false);

    final ManagementResourceRegistration configCF =
        connectionDefinition.registerSubModel(
            PathElement.pathElement(CONFIG_PROPERTIES.getName()), CONFIG_PROPERTIES_DESC);
    configCF.registerOperationHandler(
        ADD, CDConfigPropertyAdd.INSTANCE, ADD_CONFIG_PROPERTIES_DESC, false);
    configCF.registerOperationHandler(
        REMOVE, ReloadRequiredRemoveStepHandler.INSTANCE, REMOVE_CONFIG_PROPERTIES_DESC, false);
    for (final SimpleAttributeDefinition attribute :
        ResourceAdaptersSubsystemProviders.CONNECTIONDEFINITIONS_NODEATTRIBUTE) {
      connectionDefinition.registerReadWriteAttribute(
          attribute.getName(), null, reloadRequiredWriteAttributeHandler, Storage.CONFIGURATION);
    }

    final ManagementResourceRegistration adminObject =
        resourceadapter.registerSubModel(
            PathElement.pathElement(ADMIN_OBJECTS_NAME), ADMIN_OBJECT_DESC);
    adminObject.registerOperationHandler(
        ADD, AdminObjectAdd.INSTANCE, ADD_ADMIN_OBJECT_DESC, false);
    adminObject.registerOperationHandler(
        REMOVE, ReloadRequiredRemoveStepHandler.INSTANCE, REMOVE_ADMIN_OBJECT_DESC, false);

    final ManagementResourceRegistration configAO =
        adminObject.registerSubModel(
            PathElement.pathElement(CONFIG_PROPERTIES.getName()), CONFIG_PROPERTIES_DESC);
    configAO.registerOperationHandler(
        ADD, AOConfigPropertyAdd.INSTANCE, ADD_CONFIG_PROPERTIES_DESC, false);
    configAO.registerOperationHandler(
        REMOVE, ReloadRequiredRemoveStepHandler.INSTANCE, REMOVE_CONFIG_PROPERTIES_DESC, false);
    for (final SimpleAttributeDefinition attribute :
        ResourceAdaptersSubsystemProviders.ADMIN_OBJECTS_NODEATTRIBUTE) {
      adminObject.registerReadWriteAttribute(
          attribute.getName(), null, reloadRequiredWriteAttributeHandler, Storage.CONFIGURATION);
    }

    resourceadapter.registerOperationHandler(
        "flush-idle-connection-in-pool",
        PoolOperations.FlushIdleConnectionInPool.RA_INSTANCE,
        FLUSH_IDLE_CONNECTION_DESC,
        false);
    resourceadapter.registerOperationHandler(
        "flush-all-connection-in-pool",
        PoolOperations.FlushAllConnectionInPool.RA_INSTANCE,
        FLUSH_ALL_CONNECTION_DESC,
        false);
    resourceadapter.registerOperationHandler(
        "test-connection-in-pool",
        PoolOperations.TestConnectionInPool.RA_INSTANCE,
        TEST_CONNECTION_DESC,
        false);

    for (final String attributeName : PoolMetrics.ATTRIBUTES) {
      resourceadapter.registerMetric(attributeName, PoolMetrics.RaPoolMetricsHandler.INSTANCE);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void initialize(ExtensionContext context) {
    ROOT_LOGGER.debug("Initializing Deployment Scanner Extension");

    final SubsystemRegistration subsystem =
        context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER);
    subsystem.registerXMLElementWriter(parser);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SUBSYSTEM);
    registration.registerOperationHandler(
        DeploymentScannerSubsystemAdd.OPERATION_NAME,
        DeploymentScannerSubsystemAdd.INSTANCE,
        DeploymentScannerSubsystemAdd.INSTANCE,
        false);
    registration.registerOperationHandler(
        DeploymentScannerSubsystemRemove.OPERATION_NAME,
        DeploymentScannerSubsystemRemove.INSTANCE,
        DeploymentScannerSubsystemRemove.INSTANCE,
        false);
    // Register operation handlers
    final ManagementResourceRegistration scanners =
        registration.registerSubModel(scannersPath, SCANNER);
    scanners.registerOperationHandler(
        DeploymentScannerAdd.OPERATION_NAME,
        DeploymentScannerAdd.INSTANCE,
        DeploymentScannerAdd.INSTANCE,
        false);
    scanners.registerOperationHandler(
        DeploymentScannerRemove.OPERATION_NAME,
        DeploymentScannerRemove.INSTANCE,
        DeploymentScannerRemove.INSTANCE,
        false);
    scanners.registerReadWriteAttribute(
        Attribute.PATH.getLocalName(),
        null,
        WritePathAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.RELATIVE_TO.getLocalName(),
        null,
        WriteRelativeToAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.SCAN_ENABLED.getLocalName(),
        null,
        WriteEnabledAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.SCAN_INTERVAL.getLocalName(),
        null,
        WriteScanIntervalAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.AUTO_DEPLOY_ZIPPED.getLocalName(),
        null,
        WriteAutoDeployZipAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.AUTO_DEPLOY_EXPLODED.getLocalName(),
        null,
        WriteAutoDeployExplodedAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
    scanners.registerReadWriteAttribute(
        Attribute.DEPLOYMENT_TIMEOUT.getLocalName(),
        null,
        WriteDeploymentTimeoutAttributeHandler.INSTANCE,
        Storage.CONFIGURATION);
  }
Ejemplo n.º 26
0
  @Override
  public void initialize(ExtensionContext context) {
    SubsystemRegistration registration =
        context.registerSubsystem(
            SUBSYSTEM_NAME, MANAGEMENT_API_MAJOR_VERSION, MANAGEMENT_API_MINOR_VERSION);
    final ManagementResourceRegistration nodeRegistration =
        registration.registerSubsystemModel(DESCRIPTION);
    PersistenceUnitRegistryImpl persistenceUnitRegistry = new PersistenceUnitRegistryImpl();
    JPASubSystemAdd subsystemAdd = new JPASubSystemAdd(persistenceUnitRegistry);
    nodeRegistration.registerOperationHandler(
        JPASubSystemAdd.OPERATION_NAME, subsystemAdd, subsystemAdd, false);
    nodeRegistration.registerOperationHandler(
        JPASubSystemRemove.OPERATION_NAME,
        JPASubSystemRemove.INSTANCE,
        JPASubSystemRemove.INSTANCE,
        false);
    nodeRegistration.registerOperationHandler(
        DESCRIBE,
        JPADescribeHandler.INSTANCE,
        JPADescribeHandler.INSTANCE,
        false,
        OperationEntry.EntryType.PRIVATE);
    nodeRegistration.registerReadWriteAttribute(
        CommonAttributes.DEFAULT_DATASOURCE,
        null,
        JPADefaultDatasourceWriteHandler.INSTANCE,
        Storage.CONFIGURATION);
    registration.registerXMLElementWriter(parser);

    try {
      PersistenceProviderLoader.loadDefaultProvider();
    } catch (ModuleLoadException e) {
      JPA_LOGGER.errorPreloadingDefaultProvider(e);
    }

    try {
      // load the default persistence provider adaptor
      PersistenceProviderAdaptor provider =
          PersistenceProviderAdaptorLoader.loadPersistenceAdapterModule(
              Configuration.ADAPTER_MODULE_DEFAULT);
      final ManagementAdaptor managementAdaptor = provider.getManagementAdaptor();
      if (managementAdaptor != null && context.isRuntimeOnlyRegistrationValid()) {
        DescriptionProvider JPA_SUBSYSTEM =
            new DescriptionProvider() {
              @Override
              public ModelNode getModelDescription(Locale locale) {
                ModelNode subsystem = new ModelNode();
                subsystem
                    .get(org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION)
                    .set("Runtime information about JPA use in the deployment.");
                subsystem.get(ATTRIBUTES).setEmptyObject();
                subsystem.get("operations"); // placeholder

                subsystem
                    .get(
                        CHILDREN,
                        managementAdaptor.getIdentificationLabel(),
                        org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION)
                    .set(
                        "Runtime information about "
                            + managementAdaptor.getIdentificationLabel()
                            + " use in the deployment.");

                subsystem
                    .get(CHILDREN, managementAdaptor.getIdentificationLabel(), MIN_OCCURS)
                    .set(0);
                return subsystem;
              }
            };

        final ManagementResourceRegistration jpaSubsystemDeployments =
            registration.registerDeploymentModel(JPA_SUBSYSTEM);

        managementAdaptor.register(jpaSubsystemDeployments, persistenceUnitRegistry);
      }
    } catch (ModuleLoadException e) {
      JPA_LOGGER.errorPreloadingDefaultProviderAdaptor(e);
    }
  }