if (context.getType() == OperationContext.Type.SERVER) {
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
String identifier = operation.get(ModelDescriptionConstants.OP_ADDR).asObject().get(CommonAttributes.MODULE).asString();
OSGiModule module = new OSGiModule(ModuleIdentifier.fromString(identifier), startLevel);
SubsystemState stateService = (SubsystemState) context.getServiceRegistry(true).getRequiredService(SubsystemState.SERVICE_NAME).getValue();
stateService.addModule(module);
if (context.completeStep() == OperationContext.ResultAction.ROLLBACK) {
stateService.removeModule(identifier);