/** * Output the model to xml * * @param model the model to marshall * @return the xml */ String outputModel(ModelNode model) throws Exception { StringConfigurationPersister persister = new StringConfigurationPersister(Collections.emptyList(), testParser, true); // Use ProcessType.HOST_CONTROLLER for this ExtensionRegistry so we don't need to provide // a PathManager via the ExtensionContext. All we need the Extension to do here is register the xml writers ExtensionRegistry outputExtensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, new RunningModeControl(RunningMode.NORMAL), null, null, null, RuntimeHostControllerInfoAccessor.SERVER); outputExtensionRegistry.setWriterRegistry(persister); Extension extension = mainExtension.getClass().newInstance(); extension.initialize(outputExtensionRegistry.getExtensionContext("Test", MOCK_RESOURCE_REG, ExtensionRegistryType.SLAVE)); ConfigurationPersister.PersistenceResource resource = persister.store(model, Collections.emptySet()); resource.commit(); return persister.getMarshalled(); }
/** * Output the model to xml * * @param model the model to marshall * @return the xml */ String outputModel(ModelNode model) throws Exception { StringConfigurationPersister persister = new StringConfigurationPersister(Collections.emptyList(), testParser, true); // Use ProcessType.HOST_CONTROLLER for this ExtensionRegistry so we don't need to provide // a PathManager via the ExtensionContext. All we need the Extension to do here is register the xml writers ExtensionRegistry outputExtensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, new RunningModeControl(RunningMode.NORMAL), null, null, null, RuntimeHostControllerInfoAccessor.SERVER); outputExtensionRegistry.setWriterRegistry(persister); Extension extension = mainExtension.getClass().newInstance(); extension.initialize(outputExtensionRegistry.getExtensionContext("Test", MOCK_RESOURCE_REG, ExtensionRegistryType.SLAVE)); ConfigurationPersister.PersistenceResource resource = persister.store(model, Collections.emptySet()); resource.commit(); return persister.getMarshalled(); }
/** * Output the model to xml * * @param model the model to marshall * @return the xml */ String outputModel(ModelNode model) throws Exception { StringConfigurationPersister persister = new StringConfigurationPersister(Collections.<ModelNode>emptyList(), testParser, true); // Use ProcessType.HOST_CONTROLLER for this ExtensionRegistry so we don't need to provide // a PathManager via the ExtensionContext. All we need the Extension to do here is register the xml writers ExtensionRegistry outputExtensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, new RunningModeControl(RunningMode.NORMAL), null, null); outputExtensionRegistry.setSubsystemParentResourceRegistrations(MOCK_RESOURCE_REG, MOCK_RESOURCE_REG); outputExtensionRegistry.setWriterRegistry(persister); Extension extension = mainExtension.getClass().newInstance(); extension.initialize(outputExtensionRegistry.getExtensionContext("Test", false)); ConfigurationPersister.PersistenceResource resource = persister.store(model, Collections.<PathAddress>emptySet()); resource.commit(); return persister.getMarshalled(); }
StringConfigurationPersister persister = new StringConfigurationPersister(bootOperations, testParser, true);
StringConfigurationPersister persister = new StringConfigurationPersister(bootOperations, testParser, true);
StringConfigurationPersister persister = new StringConfigurationPersister(allOps, testParser, persistXml); controllerExtensionRegistry.setWriterRegistry(persister); controllerExtensionRegistry.setPathManager(pathManager);
StringConfigurationPersister persister = new StringConfigurationPersister(allOps, testParser, persistXml); controllerExtensionRegistry.setWriterRegistry(persister); controllerExtensionRegistry.setPathManager(pathManager);
StringConfigurationPersister persister = new StringConfigurationPersister(allOps, testParser, persistXml); controllerExtensionRegistry.setWriterRegistry(persister); controllerExtensionRegistry.setPathManager(pathManager);