if(context.getType() == OperationContext.Type.SERVER) {
context.addStep(new OperationStepHandler() {
@Override
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
final ServiceTarget target = context.getServiceTarget();
final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler();
JMXConnectorService.addService(target, serverBinding, registryBinding, verificationHandler);
context.addStep(verificationHandler, OperationContext.Stage.VERIFY);
if(context.completeStep() == OperationContext.ResultAction.ROLLBACK) {
context.removeService(JMXConnectorService.SERVICE_NAME);
}