@Override public ModelNode execute(ExpressionResolver expressionResolver, ModelNode operation, ChannelFactory factory) throws OperationFailedException { // Create a temporary channel, but don't connect it try (JChannel channel = factory.createChannel(UUID.randomUUID().toString())) { // ProtocolStack.printProtocolSpecAsXML() is very hacky and only works on an uninitialized stack List<Protocol> protocols = channel.getProtocolStack().getProtocols(); Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); return new ModelNode(stack.printProtocolSpecAsXML()); } catch (Exception e) { throw new OperationFailedException(e); } } },
@Override public ModelNode execute(ExpressionResolver expressionResolver, ModelNode operation, ChannelFactory factory) throws OperationFailedException { // Create a temporary channel, but don't connect it try (JChannel channel = factory.createChannel(UUID.randomUUID().toString())) { // ProtocolStack.printProtocolSpecAsXML() is very hacky and only works on an uninitialized stack List<Protocol> protocols = channel.getProtocolStack().getProtocols(); Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); return new ModelNode(stack.printProtocolSpecAsXML()); } catch (Exception e) { throw new OperationFailedException(e); } } },
Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); context.getResult().set(stack.printProtocolSpecAsXML()); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); context.getResult().set(stack.printProtocolSpecAsXML()); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);