@Override public ImmutableManagementResourceRegistration getResourceRegistration() { final PathAddress address = activeStep.address; assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null || currentStage == Stage.DONE) { throw MESSAGES.operationAlreadyComplete(); } authorize(false, Collections.<ActionEffect>emptySet()); ImmutableManagementResourceRegistration delegate = modelController.getRootRegistration().getSubModel(address); return delegate == null ? null : new DescriptionCachingImmutableResourceRegistration(delegate, address); }
@Override public ImmutableManagementResourceRegistration getResourceRegistration() { final PathAddress address = activeStep.address; assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null || currentStage == Stage.DONE) { throw MESSAGES.operationAlreadyComplete(); } ImmutableManagementResourceRegistration delegate = modelController.getRootRegistration().getSubModel(address); return delegate == null ? null : new DelegatingImmutableManagementResourceRegistration(delegate); }
public ManagementResourceRegistration getResourceRegistrationForUpdate() { final PathAddress address = activeStep.address; assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } //if (currentStage != Stage.MODEL) { // throw MESSAGES.stageAlreadyComplete(Stage.MODEL); //} if (!affectsResourceRegistration) { takeWriteLock(); affectsResourceRegistration = true; } return modelController.getRootRegistration().getSubModel(address); }
public ModelNode readModel(final PathAddress requestAddress) { final PathAddress address = activeStep.address.append(requestAddress); assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } Resource model = this.model; for (final PathElement element : address) { model = requireChild(model, element, address); } // recursively read the model return Resource.Tools.readModel(model); }
public ModelNode readModel(final PathAddress requestAddress) { authorize(false, READ_CONFIG); final PathAddress address = activeStep.address.append(requestAddress); assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } Resource model = this.model; for (final PathElement element : address) { model = requireChild(model, element, address); } // recursively read the model return Resource.Tools.readModel(model); }
throw MESSAGES.operationAlreadyComplete();
public ServiceTarget getServiceTarget() throws UnsupportedOperationException { assert isControllingThread(); readOnly = false; Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceTargetRuntimeOperationsOnly(); } if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } return serviceTarget; }
public ServiceTarget getServiceTarget() throws UnsupportedOperationException { assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceTargetRuntimeOperationsOnly(); } if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } return serviceTarget; }
Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete();
public ManagementResourceRegistration getResourceRegistrationForUpdate() { assert isControllingThread(); readOnly = false; final PathAddress address = activeStep.address; Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } //if (currentStage != Stage.MODEL) { // throw MESSAGES.stageAlreadyComplete(Stage.MODEL); //} authorize(false, READ_WRITE_CONFIG); if (!affectsResourceRegistration) { takeWriteLock(); affectsResourceRegistration = true; } ManagementResourceRegistration delegate = modelController.getRootRegistration().getSubModel(address); return new DescriptionCachingResourceRegistration(delegate, address); }
public void removeService(final ServiceController<?> controller) throws UnsupportedOperationException { assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceRemovalRuntimeOperationsOnly(); } if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } if (controller != null) { doRemove(controller); } }
public ServiceRegistry getServiceRegistry(final boolean modify) throws UnsupportedOperationException { assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (! (!modify || currentStage == Stage.RUNTIME || currentStage == Stage.MODEL || currentStage == Stage.VERIFY || isRollingBack())) { throw MESSAGES.serviceRegistryRuntimeOperationsOnly(); } if (modify && !affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } return new OperationContextServiceRegistry(modelController.getServiceRegistry()); }
public Resource readResourceForUpdate(PathAddress requestAddress) { final PathAddress address = activeStep.address.append(requestAddress); assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.MODEL) { throw MESSAGES.stageAlreadyComplete(Stage.MODEL); } authorizeModelUpdate(); if (!isModelAffected()) { takeWriteLock(); model = model.clone(); } affectsModel.put(address, NULL); Resource resource = this.model; for (PathElement element : address) { if (element.isMultiTarget()) { throw MESSAGES.cannotWriteTo("*"); } resource = requireChild(resource, element, address); } return resource; }
public void removeService(final ServiceController<?> controller) throws UnsupportedOperationException { assert isControllingThread(); readOnly = false; Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceRemovalRuntimeOperationsOnly(); } authorize(false, WRITE_RUNTIME); if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } if (controller != null) { doRemove(controller); } }
public ServiceController<?> removeService(final ServiceName name) throws UnsupportedOperationException { assert isControllingThread(); Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceRemovalRuntimeOperationsOnly(); } if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } ServiceController<?> controller = modelController.getServiceRegistry().getService(name); if (controller != null) { doRemove(controller); } return controller; }
Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete();
Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete();
public ServiceRegistry getServiceRegistry(final boolean modify) throws UnsupportedOperationException { assert isControllingThread(); if (modify) { readOnly = false; } Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (! (!modify || currentStage == Stage.RUNTIME || currentStage == Stage.MODEL || currentStage == Stage.VERIFY || isRollingBack())) { throw MESSAGES.serviceRegistryRuntimeOperationsOnly(); } authorize(false, modify ? READ_WRITE_RUNTIME : READ_RUNTIME); if (modify && !affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } return new OperationContextServiceRegistry(modelController.getServiceRegistry()); }
public ServiceController<?> removeService(final ServiceName name) throws UnsupportedOperationException { assert isControllingThread(); readOnly = false; Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete(); } if (currentStage != Stage.RUNTIME && currentStage != Stage.VERIFY && !isRollingBack()) { throw MESSAGES.serviceRemovalRuntimeOperationsOnly(); } authorize(false, WRITE_RUNTIME); if (!affectsRuntime) { takeWriteLock(); affectsRuntime = true; acquireContainerMonitor(); awaitContainerMonitor(); } ServiceController<?> controller = modelController.getServiceRegistry().getService(name); if (controller != null) { doRemove(controller); } return controller; }
Stage currentStage = this.currentStage; if (currentStage == null) { throw MESSAGES.operationAlreadyComplete();