本文整理汇总了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);
}
示例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));
}
}
示例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);
}
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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()));
}
示例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);
}
示例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);
}