|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2022 the original author or authors.
|
|
|
|
* Copyright 2012-2023 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -19,34 +19,14 @@ package org.springframework.boot.actuate.integration;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.BindingReflectionHintsRegistrar;
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHints;
|
|
|
|
|
|
|
|
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
|
|
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.OperationResponseBody;
|
|
|
|
import org.springframework.boot.actuate.endpoint.OperationResponseBody;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
|
|
|
|
import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint.IntegrationGraphEndpointRuntimeHints;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.ImportRuntimeHints;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.CompositeMessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.DiscardingMessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.EndpointNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.ErrorCapableCompositeMessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.ErrorCapableDiscardingMessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.ErrorCapableEndpointNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.ErrorCapableMessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.ErrorCapableRoutingNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.Graph;
|
|
|
|
import org.springframework.integration.graph.Graph;
|
|
|
|
import org.springframework.integration.graph.IntegrationGraphServer;
|
|
|
|
import org.springframework.integration.graph.IntegrationGraphServer;
|
|
|
|
import org.springframework.integration.graph.IntegrationNode;
|
|
|
|
import org.springframework.integration.graph.IntegrationNode;
|
|
|
|
import org.springframework.integration.graph.LinkNode;
|
|
|
|
import org.springframework.integration.graph.LinkNode;
|
|
|
|
import org.springframework.integration.graph.MessageChannelNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.MessageGatewayNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.MessageHandlerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.MessageProducerNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.MessageSourceNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.PollableChannelNode;
|
|
|
|
|
|
|
|
import org.springframework.integration.graph.RoutingMessageHandlerNode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link Endpoint @Endpoint} to expose the Spring Integration graph.
|
|
|
|
* {@link Endpoint @Endpoint} to expose the Spring Integration graph.
|
|
|
@ -55,7 +35,6 @@ import org.springframework.integration.graph.RoutingMessageHandlerNode;
|
|
|
|
* @since 2.1.0
|
|
|
|
* @since 2.1.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Endpoint(id = "integrationgraph")
|
|
|
|
@Endpoint(id = "integrationgraph")
|
|
|
|
@ImportRuntimeHints(IntegrationGraphEndpointRuntimeHints.class)
|
|
|
|
|
|
|
|
public class IntegrationGraphEndpoint {
|
|
|
|
public class IntegrationGraphEndpoint {
|
|
|
|
|
|
|
|
|
|
|
|
private final IntegrationGraphServer graphServer;
|
|
|
|
private final IntegrationGraphServer graphServer;
|
|
|
@ -80,23 +59,6 @@ public class IntegrationGraphEndpoint {
|
|
|
|
this.graphServer.rebuild();
|
|
|
|
this.graphServer.rebuild();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static class IntegrationGraphEndpointRuntimeHints implements RuntimeHintsRegistrar {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
|
|
|
|
|
|
|
this.bindingRegistrar.registerReflectionHints(hints.reflection(), Graph.class,
|
|
|
|
|
|
|
|
CompositeMessageHandlerNode.class, DiscardingMessageHandlerNode.class, EndpointNode.class,
|
|
|
|
|
|
|
|
ErrorCapableCompositeMessageHandlerNode.class, ErrorCapableDiscardingMessageHandlerNode.class,
|
|
|
|
|
|
|
|
ErrorCapableEndpointNode.class, ErrorCapableMessageHandlerNode.class, ErrorCapableRoutingNode.class,
|
|
|
|
|
|
|
|
MessageChannelNode.class, MessageGatewayNode.class, MessageHandlerNode.class,
|
|
|
|
|
|
|
|
MessageProducerNode.class, MessageSourceNode.class, PollableChannelNode.class,
|
|
|
|
|
|
|
|
RoutingMessageHandlerNode.class);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Description of a {@link Graph}.
|
|
|
|
* Description of a {@link Graph}.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|