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


Java ExtensionContext类代码示例

本文整理汇总了Java中org.jboss.as.controller.ExtensionContext的典型用法代码示例。如果您正苦于以下问题:Java ExtensionContext类的具体用法?Java ExtensionContext怎么用?Java ExtensionContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExtensionContext类属于org.jboss.as.controller包,在下文中一共展示了ExtensionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_VERSION);

    //This subsystem should be runnable on a host
    registration.setHostCapable();

    //This is ugly but for now we don't want to make the audit logger easily available to all extensions
    @SuppressWarnings("deprecation")
    ManagedAuditLogger auditLogger = (ManagedAuditLogger)((ExtensionContextSupplement)context).getAuditLogger(false, true);
    //This is ugly but for now we don't want to make the authorizer easily available to all extensions
    @SuppressWarnings("deprecation")
    JmxAuthorizer authorizer = ((ExtensionContextSupplement)context).getAuthorizer();
  //This is ugly but for now we don't want to make the securityIdentitySupplier easily available to all extensions
    @SuppressWarnings("deprecation")
    Supplier<SecurityIdentity> securityIdentitySupplier = ((ExtensionContextSupplement)context).getSecurityIdentitySupplier();
    //This is ugly but for now we don't want to make the hostInfoAccessor easily available to all extensions
    @SuppressWarnings("deprecation")
    RuntimeHostControllerInfoAccessor hostInfoAccessor = ((ExtensionContextSupplement)context).getHostControllerInfoAccessor();

    registration.registerSubsystemModel(JMXSubsystemRootResource.create(auditLogger, authorizer, securityIdentitySupplier, hostInfoAccessor));
    registration.registerXMLElementWriter(JMXSubsystemWriter::new);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:JMXExtension.java

示例2: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {

    if (context.getProcessType() == ProcessType.DOMAIN_SERVER) {
        // Do nothing. This allows an extension=cmp:add op that's really targeted
        // to legacy servers to work
        ControllerLogger.MGMT_OP_LOGGER.ignoringUnsupportedLegacyExtension(subsystemNames, extensionName);
        return;
    } else if (context.getProcessType() == ProcessType.STANDALONE_SERVER) {
        if (context.getRunningMode() == RunningMode.ADMIN_ONLY) {
            //log a message, but fall through and register the model
            ControllerLogger.MGMT_OP_LOGGER.removeUnsupportedLegacyExtension(subsystemNames, extensionName);
        } else {
            throw new UnsupportedOperationException(ControllerLogger.ROOT_LOGGER.unsupportedLegacyExtension(extensionName));
        }
    }

    Set<ManagementResourceRegistration> subsystemRoots = initializeLegacyModel(context);
    for (ManagementResourceRegistration subsystemRoot : subsystemRoots) {
        subsystemRoot.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION,
            new UnsupportedSubsystemDescribeHandler(extensionName));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:AbstractLegacyExtension.java

示例3: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initialize(ExtensionContext context) {
    ROOT_LOGGER.debug("Initializing Deployment Scanner Extension");

    if (context.getProcessType().isHostController()) {
        throw DeploymentScannerLogger.ROOT_LOGGER.deploymentScannerNotForDomainMode();
    }

    final SubsystemRegistration subsystem = context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER, CURRENT_VERSION);
    subsystem.registerXMLElementWriter(DeploymentScannerParser_2_0::new);

    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new DeploymentScannerSubsystemDefinition());
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    final ManagementResourceRegistration scanner = registration.registerSubModel(new DeploymentScannerDefinition(context.getPathManager()));
    if (context.getProcessType().isServer()) {
        final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager())
                .setRelativeToAttribute(DeploymentScannerDefinition.RELATIVE_TO)
                .setPathAttribute(DeploymentScannerDefinition.PATH)
                .build();
        scanner.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:DeploymentScannerExtension.java

示例4: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1));
    SimpleResourceDefinition subsystemResource = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(
            PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME),
            new NonResolvingResourceDescriptionResolver())
    );
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(subsystemResource);
    //We always need to add an 'add' operation
    registration.registerOperationHandler(
            SimpleOperationDefinitionBuilder.of(ADD, NonResolvingResourceDescriptionResolver.INSTANCE)
                .setParameters(addAttributes)
                .build(),
            new AbstractAddStepHandler(addAttributes));

    //We always need to add a 'describe' operation
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:ValidateSubsystemExtension.java

示例5: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystem.registerXMLElementWriter(SubsytemParser_1_0.INSTANCE);

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

    registration.registerSubModel(new ConfigSourceDefinition());
    registration.registerSubModel(new ConfigSourceProviderDefinition());
}
 
开发者ID:wildfly-extras,项目名称:wildfly-microprofile-config,代码行数:12,代码来源:SubsystemExtension.java

示例6: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystem.registerXMLElementWriter(SubsytemParser_1_0.INSTANCE);

    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new SubsystemDefinition());
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
}
 
开发者ID:jmesnil,项目名称:wildfly-microprofile-health,代码行数:9,代码来源:SubsystemExtension.java

示例7: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(Neo4jDriverDefinition.INSTANCE);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:11,代码来源:Neo4jDriverExtension.java

示例8: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
public void initialize(ExtensionContext context) {
    SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    ManagementResourceRegistration managementResource = subsystem.registerSubsystemModel(OrientDriverDefinition.INSTANCE);
    managementResource.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION,
            GenericSubsystemDescribeHandler.INSTANCE);
    subsystem.registerXMLElementWriter(OrientDriverSubsystemParser.INSTANCE);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:8,代码来源:OrientDriverExtension.java

示例9: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(CassandraDriverDefinition.INSTANCE);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:11,代码来源:CassandraDriverExtension.java

示例10: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(MongoDriverDefinition.INSTANCE);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:11,代码来源:MongoDriverExtension.java

示例11: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION.getMajor(),CURRENT_MODEL_VERSION.getMicro(),CURRENT_MODEL_VERSION.getMinor());
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(JamMetricsRootDefinition.INSTANCE);
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE, false);
    subsystem.registerXMLElementWriter(JamMetricsSubsystemParser_1_0.INSTANCE);
}
 
开发者ID:panossot,项目名称:jam-metrics,代码行数:8,代码来源:JamMetricsExtension.java

示例12: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    msglog.infoInitializingNestSubsystem();

    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
    final ManagementResourceRegistration registration = subsystem
            .registerSubsystemModel(NestSubsystemDefinition.INSTANCE);

    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:11,代码来源:NestSubsystemExtension.java

示例13: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
	final SubsystemRegistration subsystem = context.registerSubsystem(TEIID_SUBSYSTEM, MAJOR_VERSION, MINOR_VERSION);
	
	LogManager.setLogListener(new JBossLogger());
	
	subsystem.registerXMLElementWriter(TeiidSubsystemParser.INSTANCE);

	// Main Teiid system, with children query engine and translators, register only if this is a server
	subsystem.registerSubsystemModel(new TeiidSubsytemResourceDefinition(context.getProcessType().isServer()));
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:12,代码来源:TeiidExtension.java

示例14: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(OpenShiftSubsystemDefinition.INSTANCE);
    registration.registerOperationHandler(DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE);

    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:9,代码来源:OpenShiftSubsystemExtension.java

示例15: initialize

import org.jboss.as.controller.ExtensionContext; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(ModelConstants.SUBSYSTEM_NAME, 1, 0);
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SubsystemDefinition.INSTANCE);

    registration.registerSubModel(DatenpumpeDefinition.INSTANCE);
    registration.registerSubModel(GelfSenderDefinition.INSTANCE);

    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:11,代码来源:SubsystemExtension.java


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