Search in sources :

Example 1 with ResolvePathHandler

use of org.jboss.as.controller.services.path.ResolvePathHandler in project wildfly by wildfly.

the class FileDataStoreResourceDefinition method registerOperations.

@Override
public void registerOperations(final ManagementResourceRegistration resourceRegistration) {
    super.registerOperations(resourceRegistration);
    if (pathManager != null) {
        final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(pathManager).setPathAttribute(PATH).setRelativeToAttribute(RELATIVE_TO).build();
        resourceRegistration.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler);
    }
}
Also used : ResolvePathHandler(org.jboss.as.controller.services.path.ResolvePathHandler)

Example 2 with ResolvePathHandler

use of org.jboss.as.controller.services.path.ResolvePathHandler in project wildfly by wildfly.

the class TransactionExtension method initialize.

/**
     * {@inheritDoc}
     */
public void initialize(ExtensionContext context) {
    TransactionLogger.ROOT_LOGGER.debug("Initializing Transactions Extension");
    final LogStoreResource resource = new LogStoreResource();
    final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final TransactionSubsystemRootResourceDefinition rootResourceDefinition = new TransactionSubsystemRootResourceDefinition(registerRuntimeOnly);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(rootResourceDefinition);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    // Create the path resolver handlers
    if (context.getProcessType().isServer()) {
        // It's less than ideal to create a separate operation here, but this extension contains two relative-to attributes
        final ResolvePathHandler objectStorePathHandler = ResolvePathHandler.Builder.of(RESOLVE_OBJECT_STORE_PATH, context.getPathManager()).setPathAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH).setRelativeToAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO).build();
        registration.registerOperationHandler(objectStorePathHandler.getOperationDefinition(), objectStorePathHandler);
    }
    ManagementResourceRegistration logStoreChild = registration.registerSubModel(new LogStoreDefinition(resource, registerRuntimeOnly));
    if (registerRuntimeOnly) {
        ManagementResourceRegistration transactionChild = logStoreChild.registerSubModel(new LogStoreTransactionDefinition(resource));
        transactionChild.registerSubModel(LogStoreTransactionParticipantDefinition.INSTANCE);
    }
    subsystem.registerXMLElementWriter(TransactionSubsystemXMLPersister.INSTANCE);
    if (context.isRegisterTransformers()) {
        // Register the model transformers
        registerTransformers(subsystem);
    }
}
Also used : ResolvePathHandler(org.jboss.as.controller.services.path.ResolvePathHandler) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 3 with ResolvePathHandler

use of org.jboss.as.controller.services.path.ResolvePathHandler in project wildfly by wildfly.

the class PathDefinition method registerResolveOperationHandler.

protected static void registerResolveOperationHandler(ExtensionContext context, ManagementResourceRegistration registry) {
    if (context.getProcessType().isServer()) {
        final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()).setPathAttribute(PATHS.get(registry.getPathAddress().getLastElement().getValue())).setRelativeToAttribute(PathDefinition.RELATIVE_TO).build();
        registry.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler);
    }
}
Also used : ResolvePathHandler(org.jboss.as.controller.services.path.ResolvePathHandler)

Example 4 with ResolvePathHandler

use of org.jboss.as.controller.services.path.ResolvePathHandler in project wildfly by wildfly.

the class MessagingExtension method initializeLegacyModel.

@Override
protected Set<ManagementResourceRegistration> initializeLegacyModel(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystem.registerXMLElementWriter(MessagingXMLWriter.INSTANCE);
    // Root resource
    final ManagementResourceRegistration rootRegistration = subsystem.registerSubsystemModel(MessagingSubsystemRootResourceDefinition.INSTANCE);
    // HQ servers
    final ManagementResourceRegistration serverRegistration = rootRegistration.registerSubModel(HornetQServerResourceDefinition.INSTANCE);
    // Address settings
    serverRegistration.registerSubModel(AddressSettingDefinition.INSTANCE);
    // Broadcast groups
    serverRegistration.registerSubModel(BroadcastGroupDefinition.INSTANCE);
    // Discovery groups
    serverRegistration.registerSubModel(DiscoveryGroupDefinition.INSTANCE);
    // Diverts
    serverRegistration.registerSubModel(DivertDefinition.INSTANCE);
    // Core queues
    serverRegistration.registerSubModel(QueueDefinition.INSTANCE);
    // Acceptors
    serverRegistration.registerSubModel(HTTPAcceptorDefinition.INSTANCE);
    serverRegistration.registerSubModel(GenericTransportDefinition.ACCEPTOR_INSTANCE);
    serverRegistration.registerSubModel(RemoteTransportDefinition.ACCEPTOR_INSTANCE);
    serverRegistration.registerSubModel(InVMTransportDefinition.ACCEPTOR_INSTANCE);
    // Connectors
    serverRegistration.registerSubModel(HTTPConnectorDefinition.INSTANCE);
    serverRegistration.registerSubModel(GenericTransportDefinition.CONNECTOR_INSTANCE);
    serverRegistration.registerSubModel(RemoteTransportDefinition.CONNECTOR_INSTANCE);
    serverRegistration.registerSubModel(InVMTransportDefinition.CONNECTOR_INSTANCE);
    // Bridges
    serverRegistration.registerSubModel(BridgeDefinition.INSTANCE);
    // Cluster connections
    serverRegistration.registerSubModel(ClusterConnectionDefinition.INSTANCE);
    // Grouping Handler
    serverRegistration.registerSubModel(GroupingHandlerDefinition.INSTANCE);
    // Connector services
    serverRegistration.registerSubModel(ConnectorServiceDefinition.INSTANCE);
    //todo, shouldn't we leverage Path service from AS? see: package org.jboss.as.controller.services.path
    for (final String path : PathDefinition.PATHS.keySet()) {
        ManagementResourceRegistration binding = serverRegistration.registerSubModel(new PathDefinition(pathElement(ModelDescriptionConstants.PATH, path)));
        // Create the path resolver operation
        if (context.getProcessType().isServer()) {
            final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()).setPathAttribute(PathDefinition.PATHS.get(path)).setRelativeToAttribute(PathDefinition.RELATIVE_TO).build();
            binding.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler);
        }
    }
    // Connection factories
    serverRegistration.registerSubModel(ConnectionFactoryDefinition.INSTANCE);
    // Resource Adapter Pooled connection factories
    serverRegistration.registerSubModel(PooledConnectionFactoryDefinition.INSTANCE);
    // JMS Queues
    serverRegistration.registerSubModel(JMSQueueDefinition.INSTANCE);
    // JMS Topics
    serverRegistration.registerSubModel(JMSTopicDefinition.INSTANCE);
    serverRegistration.registerSubModel(SecuritySettingDefinition.INSTANCE);
    // JMS Bridges
    rootRegistration.registerSubModel(JMSBridgeDefinition.INSTANCE);
    if (context.isRegisterTransformers()) {
        MessagingTransformers.registerTransformers(subsystem);
    }
    return Collections.singleton(rootRegistration);
}
Also used : ResolvePathHandler(org.jboss.as.controller.services.path.ResolvePathHandler) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Aggregations

ResolvePathHandler (org.jboss.as.controller.services.path.ResolvePathHandler)4 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2