final ServiceName hqServiceName = MessagingServices.getHornetQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)));
final ServiceController<?> hqService = registry.getService(hqServiceName);
if (hqService != null && hqService.getState() == ServiceController.State.UP) {
final String name = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
final DivertConfiguration divertConfiguration = DivertAdd.createDivertConfiguration(context, name, model);
HornetQServer server = HornetQServer.class.cast(hqService.getValue());
DivertAdd.createDivert(name, divertConfiguration, server.getHornetQServerControl());
}
}