* {@inheritDoc}
* @see org.jboss.as.controller.Extension#initialize(org.jboss.as.controller.ExtensionContext)
*/
@Override
public void initialize(ExtensionContext context) {
ModelVersion current = InfinispanModel.CURRENT.getVersion();
SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, current.getMajor(), current.getMinor(), current.getMicro());
// Create the path resolver handler
final ResolvePathHandler resolvePathHandler;
if (context.getProcessType().isServer()) {
resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager())
.setPathAttribute(FileStoreResourceDefinition.RELATIVE_PATH)
.setRelativeToAttribute(FileStoreResourceDefinition.RELATIVE_TO)
.build();
} else {
resolvePathHandler = null;
}
registration.registerSubsystemModel(new InfinispanSubsystemResourceDefinition(resolvePathHandler, context.isRuntimeOnlyRegistrationValid()));
registration.registerXMLElementWriter(new InfinispanSubsystemXMLWriter());
if (context.isRegisterTransformers()) {
// Register transformers for all but the current model
for (InfinispanModel model: EnumSet.complementOf(EnumSet.of(InfinispanModel.CURRENT))) {
ModelVersion version = model.getVersion();
TransformationDescription.Tools.register(InfinispanSubsystemResourceDefinition.buildTransformation(version), registration, version);
}
}
}