/** {@inheritDoc} */
@Override
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
ModelNode node = context.getModelNode();
if (node.hasDefined(ASYNC_HANDLER)) {
final ModelNode handlers = node.get(ASYNC_HANDLER);
for (Property handlerProp : handlers.asPropertyList()) {
final String name = handlerProp.getName();
final ModelNode handler = handlerProp.getValue();
if (!handler.isDefined()) {
continue;
}
writeAsynchHandler(writer, handler, name);
}
}
if (node.hasDefined(CONSOLE_HANDLER)) {
final ModelNode handlers = node.get(CONSOLE_HANDLER);
for (Property handlerProp : handlers.asPropertyList()) {
final String name = handlerProp.getName();
final ModelNode handler = handlerProp.getValue();
if (!handler.isDefined()) {
continue;
}
writeConsoleHandler(writer, handler, name);
}
}
if (node.hasDefined(FILE_HANDLER)) {
final ModelNode handlers = node.get(FILE_HANDLER);
for (Property handlerProp : handlers.asPropertyList()) {
final String name = handlerProp.getName();
final ModelNode handler = handlerProp.getValue();
if (!handler.isDefined()) {
continue;
}
writeFileHandler(writer, handler, name);
}
}
if (node.hasDefined(PERIODIC_ROTATING_FILE_HANDLER)) {
final ModelNode handlers = node.get(PERIODIC_ROTATING_FILE_HANDLER);
for (Property handlerProp : handlers.asPropertyList()) {
final String name = handlerProp.getName();
final ModelNode handler = handlerProp.getValue();
if (!handler.isDefined()) {
continue;
}
writePeriodicRotatingFileHandler(writer, handler, name);
}
}
if (node.hasDefined(SIZE_ROTATING_FILE_HANDLER)) {
final ModelNode handlers = node.get(SIZE_ROTATING_FILE_HANDLER);
for (Property handlerProp : handlers.asPropertyList()) {
final String name = handlerProp.getName();
final ModelNode handler = handlerProp.getValue();
if (!handler.isDefined()) {
continue;
}
writeSizeRotatingFileHandler(writer, handler, name);
}
}