diff --git a/controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java b/controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java index 3383c48d6d6..1ea8fc2e8b5 100644 --- a/controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java +++ b/controller/src/main/java/org/jboss/as/controller/OperationContextImpl.java @@ -249,22 +249,24 @@ final class OperationContextImpl extends AbstractOperationContext implements Aut @Override public void close() { - this.originalModel = this.managementModel = null; - this.lockStep = this.containerMonitorStep = null; - this.contextAttachments.close(); - synchronized (this.realRemovingControllers) { - this.realRemovingControllers.clear(); - this.removalSteps.clear(); - } - this.addedRequirements.clear(); - this.removedCapabilities.clear(); - this.affectsModel.clear(); - this.authorizations.clear(); - this.serviceTargets.clear(); - this.serviceRegistries.clear(); - - // DON'T close 'attachments' -- that object is owned by ModelControllerImpl - super.close(); + if (getProcessType().isServer()) { + this.originalModel = this.managementModel = null; + this.lockStep = this.containerMonitorStep = null; + this.contextAttachments.close(); + synchronized (this.realRemovingControllers) { + this.realRemovingControllers.clear(); + this.removalSteps.clear(); + } + this.addedRequirements.clear(); + this.removedCapabilities.clear(); + this.affectsModel.clear(); + this.authorizations.clear(); + this.serviceTargets.clear(); + this.serviceRegistries.clear(); + + // DON'T close 'attachments' -- that object is owned by ModelControllerImpl + super.close(); + } } public InputStream getAttachmentStream(final int index) {