Class IntegrationGraphServer

java.lang.Object
org.springframework.integration.graph.IntegrationGraphServer
All Implemented Interfaces:
java.util.EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

public class IntegrationGraphServer
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
Builds the runtime object model graph.
Since:
4.3
  • Constructor Summary

    Constructors 
    Constructor Description
    IntegrationGraphServer()  
  • Method Summary

    Modifier and Type Method Description
    protected org.springframework.context.ApplicationContext getApplicationContext()  
    protected <T> java.util.Map<java.lang.String,​T> getBeansOfType​(java.lang.Class<T> type)
    Get beans for the provided type from the application context.
    Graph getGraph()
    Return the cached graph.
    void onApplicationEvent​(org.springframework.context.event.ContextRefreshedEvent event)  
    Graph rebuild()
    Rebuild the graph, re-cache it, and return it.
    void setAdditionalPropertiesCallback​(java.util.function.Function<NamedComponent,​java.util.Map<java.lang.String,​java.lang.Object>> additionalPropertiesCallback)
    Specify a callback Function to be called against each NamedComponent to populate additional properties to the target IntegrationNode.
    void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
    void setApplicationName​(java.lang.String applicationName)
    Set the application name that will appear in the 'contentDescriptor' under the 'name' key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setApplicationContext

      public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getApplicationContext

      protected org.springframework.context.ApplicationContext getApplicationContext()
    • setApplicationName

      public void setApplicationName​(java.lang.String applicationName)
      Set the application name that will appear in the 'contentDescriptor' under the 'name' key. If not provided, the property 'spring.application.name' from the application context environment will be used (if present).
      Parameters:
      applicationName - the application name.
    • setAdditionalPropertiesCallback

      public void setAdditionalPropertiesCallback​(@Nullable java.util.function.Function<NamedComponent,​java.util.Map<java.lang.String,​java.lang.Object>> additionalPropertiesCallback)
      Specify a callback Function to be called against each NamedComponent to populate additional properties to the target IntegrationNode.
      Parameters:
      additionalPropertiesCallback - the Function to use for properties.
      Since:
      5.1
    • onApplicationEvent

      public void onApplicationEvent​(org.springframework.context.event.ContextRefreshedEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
    • getGraph

      public Graph getGraph()
      Return the cached graph. Although the graph is cached, the data therein (stats etc.) are dynamic.
      Returns:
      the graph.
      See Also:
      rebuild()
    • rebuild

      public Graph rebuild()
      Rebuild the graph, re-cache it, and return it. Use this method if the application components have changed (added or removed).
      Returns:
      the graph.
      See Also:
      getGraph()
    • getBeansOfType

      protected <T> java.util.Map<java.lang.String,​T> getBeansOfType​(java.lang.Class<T> type)
      Get beans for the provided type from the application context. This method can be extended for some custom logic, e.g. get beans from the parent application context as well.
      Type Parameters:
      T - the type for beans to obtain
      Parameters:
      type - the type for beans to obtain
      Returns:
      a Map of bean for the provided type
      Since:
      5.1