@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (SimpleAttributeDefinition ad:ATTRIBUTES){ resourceRegistration.registerReadWriteAttribute(ad, null, new OutboundSocketBindingWriteHandler(ad, false)); } } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Boolean handback) throws OperationFailedException { if (handback != null && handback.booleanValue()) { final String bindingName = context.getCurrentAddressValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); // Back to the old service revertBindingReinstall(context, bindingName, bindingModel, attributeName, valueToRestore); } else { context.revertReloadRequired(); } }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { final String bindingName = PathAddress.pathAddress(operation.get(OP_ADDR)).getLastElement().getValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ServiceController<?> controller = context.getServiceRegistry(true).getRequiredService(OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME.append(bindingName)); final OutboundSocketBinding binding = controller.getState() == ServiceController.State.UP ? OutboundSocketBinding.class.cast(controller.getValue()) : null; final boolean bound = binding != null && binding.isConnected(); // FIXME see if this can be used, or remove if (binding == null) { // existing is not started, so can't "update" it. Instead reinstall the service handleBindingReinstall(context, bindingName, bindingModel); handbackHolder.setHandback(Boolean.TRUE); } else { // We don't allow runtime changes without a context reload for outbound socket bindings // since any services which might have already injected/depended on the outbound // socket binding service would have use the (now stale) attributes. context.reloadRequired(); } return false; // we handle the reloadRequired stuff ourselves; it's clearer }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Boolean handback) throws OperationFailedException { if (handback != null && handback.booleanValue()) { final String bindingName = context.getCurrentAddressValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); // Back to the old service revertBindingReinstall(context, bindingName, bindingModel, attributeName, valueToRestore); } else { context.revertReloadRequired(); } }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { final String bindingName = PathAddress.pathAddress(operation.get(OP_ADDR)).getLastElement().getValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ServiceController<?> controller = context.getServiceRegistry(true).getRequiredService(OutboundSocketBinding.OUTBOUND_SOCKET_BINDING_BASE_SERVICE_NAME.append(bindingName)); final OutboundSocketBinding binding = controller.getState() == ServiceController.State.UP ? OutboundSocketBinding.class.cast(controller.getValue()) : null; final boolean bound = binding != null && binding.isConnected(); // FIXME see if this can be used, or remove if (binding == null) { // existing is not started, so can't "update" it. Instead reinstall the service handleBindingReinstall(context, bindingName, bindingModel); handbackHolder.setHandback(Boolean.TRUE); } else { // We don't allow runtime changes without a context reload for outbound socket bindings // since any services which might have already injected/depended on the outbound // socket binding service would have use the (now stale) attributes. context.reloadRequired(); } return false; // we handle the reloadRequired stuff ourselves; it's clearer }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (SimpleAttributeDefinition ad:ATTRIBUTES){ resourceRegistration.registerReadWriteAttribute(ad, null, new OutboundSocketBindingWriteHandler(ad, false)); } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Boolean handback) throws OperationFailedException { if (handback != null && handback.booleanValue()) { final String bindingName = PathAddress.pathAddress(operation.get(OP_ADDR)).getLastElement().getValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); // Back to the old service revertBindingReinstall(context, bindingName, bindingModel, attributeName, valueToRestore); } else { context.revertReloadRequired(); } }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { final String bindingName = context.getCurrentAddressValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ServiceName serviceName = OUTBOUND_SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(bindingName, OutboundSocketBinding.class); final ServiceController<?> controller = context.getServiceRegistry(true).getRequiredService(serviceName); final OutboundSocketBinding binding = controller.getState() == ServiceController.State.UP ? OutboundSocketBinding.class.cast(controller.getValue()) : null; final boolean bound = binding != null && binding.isConnected(); // FIXME see if this can be used, or remove if (binding == null) { // existing is not started, so can't "update" it. Instead reinstall the service handleBindingReinstall(context, bindingModel, serviceName); handbackHolder.setHandback(Boolean.TRUE); } else { // We don't allow runtime changes without a context reload for outbound socket bindings // since any services which might have already injected/depended on the outbound // socket binding service would have use the (now stale) attributes. context.reloadRequired(); } return false; // we handle the reloadRequired stuff ourselves; it's clearer }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (SimpleAttributeDefinition ad:ATTRIBUTES){ resourceRegistration.registerReadWriteAttribute(ad, null, new OutboundSocketBindingWriteHandler(ad, false)); } } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, Boolean handback) throws OperationFailedException { if (handback != null && handback.booleanValue()) { final String bindingName = PathAddress.pathAddress(operation.get(OP_ADDR)).getLastElement().getValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); // Back to the old service revertBindingReinstall(context, bindingName, bindingModel, attributeName, valueToRestore); } else { context.revertReloadRequired(); } }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Boolean> handbackHolder) throws OperationFailedException { final String bindingName = context.getCurrentAddressValue(); final ModelNode bindingModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ServiceName serviceName = OUTBOUND_SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(bindingName, OutboundSocketBinding.class); final ServiceController<?> controller = context.getServiceRegistry(true).getRequiredService(serviceName); final OutboundSocketBinding binding = controller.getState() == ServiceController.State.UP ? OutboundSocketBinding.class.cast(controller.getValue()) : null; final boolean bound = binding != null && binding.isConnected(); // FIXME see if this can be used, or remove if (binding == null) { // existing is not started, so can't "update" it. Instead reinstall the service handleBindingReinstall(context, bindingModel, serviceName); handbackHolder.setHandback(Boolean.TRUE); } else { // We don't allow runtime changes without a context reload for outbound socket bindings // since any services which might have already injected/depended on the outbound // socket binding service would have use the (now stale) attributes. context.reloadRequired(); } return false; // we handle the reloadRequired stuff ourselves; it's clearer }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (SimpleAttributeDefinition ad:ATTRIBUTES){ resourceRegistration.registerReadWriteAttribute(ad, null, new OutboundSocketBindingWriteHandler(ad, false)); } } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(HOST, null, new OutboundSocketBindingWriteHandler(HOST, true)); resourceRegistration.registerReadWriteAttribute(PORT, null, new OutboundSocketBindingWriteHandler(PORT, true)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(HOST, null, new OutboundSocketBindingWriteHandler(HOST, true)); resourceRegistration.registerReadWriteAttribute(PORT, null, new OutboundSocketBindingWriteHandler(PORT, true)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(HOST, null, new OutboundSocketBindingWriteHandler(HOST, true)); resourceRegistration.registerReadWriteAttribute(PORT, null, new OutboundSocketBindingWriteHandler(PORT, true)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(HOST, null, new OutboundSocketBindingWriteHandler(HOST, true)); resourceRegistration.registerReadWriteAttribute(PORT, null, new OutboundSocketBindingWriteHandler(PORT, true)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING_REF, null, new OutboundSocketBindingWriteHandler(SOCKET_BINDING_REF, false)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING_REF, null, new OutboundSocketBindingWriteHandler(SOCKET_BINDING_REF, false)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING_REF, null, new OutboundSocketBindingWriteHandler(SOCKET_BINDING_REF, false)); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING_REF, null, new OutboundSocketBindingWriteHandler(SOCKET_BINDING_REF, false)); } }