final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
final ModelNode subModel = resource.getModel();
// validate the protocol type to be added
ModelNode type = TYPE.validateOperation(operation);
PathElement protocolRelativePath = PathElement.pathElement(ModelKeys.PROTOCOL, type.asString());
// if child resource already exists, throw OFE
// TODO not sure if this works ex expected - it may only confirm a registered resource
if (!resource.hasChild(protocolRelativePath)) {
throw new OperationFailedException(new ModelNode().set("protocol with relative path " + protocolRelativePath.toString() + " is not defined"));
}
// remove the resource and its children
context.removeResource(PathAddress.pathAddress(protocolRelativePath));