Class TopologicallySortedDependecyGraph

java.lang.Object
com.fluxtion.generator.model.TopologicallySortedDependecyGraph
All Implemented Interfaces:
com.fluxtion.builder.node.NodeRegistry

public class TopologicallySortedDependecyGraph
extends java.lang.Object
implements com.fluxtion.builder.node.NodeRegistry
Creates a sorted set of dependencies from a supplied set of instances.
Author:
Greg Higgins
  • Constructor Summary

    Constructors 
    Constructor Description
    TopologicallySortedDependecyGraph​(com.fluxtion.builder.node.DeclarativeNodeConiguration declarativeNodeConiguration)  
    TopologicallySortedDependecyGraph​(com.fluxtion.builder.node.SEPConfig config)  
    TopologicallySortedDependecyGraph​(java.lang.Object... obj)  
    TopologicallySortedDependecyGraph​(java.util.List nodes)  
    TopologicallySortedDependecyGraph​(java.util.List nodes, java.util.Map<java.lang.Object,​java.lang.String> publicNodes)  
    TopologicallySortedDependecyGraph​(java.util.List nodes, java.util.Map<java.lang.Object,​java.lang.String> publicNodes, com.fluxtion.builder.node.DeclarativeNodeConiguration declarativeNodeConiguration, com.fluxtion.builder.generation.GenerationContext context, java.util.Map<java.lang.String,​com.fluxtion.api.audit.Auditor> auditorMap, com.fluxtion.builder.node.SEPConfig config)
    Create a new TopologicallySortedDependecyGraph
    TopologicallySortedDependecyGraph​(java.util.Map<java.lang.Object,​java.lang.String> publicNodes)  
  • Method Summary

    Modifier and Type Method Description
    void exportAsGraphMl​(java.io.Writer writer, boolean addEvents)
    exports graph as graphml, can be exported with and without event as nodes on the graph.
    <T> T findOrCreateNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName)  
    <T> T findOrCreateNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName, boolean isPublic)  
    <T> T findOrCreatePublicNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName)  
    void generateDependencyTree()
    Generates the dependency tree for introspection.
    com.fluxtion.builder.node.SEPConfig getConfig()  
    java.util.List<?> getDirectChildren​(java.lang.Object parent)
    returns a list of the direct children of this object in the SEP.node in the SEP
    java.util.List<?> getDirectChildrenListeningForEvent​(java.lang.Object parent)  
    java.util.List<?> getDirectParents​(java.lang.Object child)
    returns a list of the direct parents of this object in the SEP.
    java.util.List<?> getDirectParentsListeningForEvent​(java.lang.Object child)  
    java.util.List<java.lang.Object> getEventSortedDependents​(java.lang.Object obj)  
    java.util.Map<java.lang.Object,​java.lang.String> getInstanceMap()  
    java.util.Map<java.lang.String,​com.fluxtion.api.audit.Auditor> getRegistrationListenerMap()  
    java.util.List<java.lang.Object> getSortedDependents()  
    java.util.List<java.lang.Object> getSortedDependents​(java.lang.Object obj)  
    boolean isPublicNode​(java.lang.Object node)  
    <T extends com.fluxtion.api.audit.Auditor>
    T
    registerAuditor​(T node, java.lang.String auditorName)  
    <T> T registerNode​(T node, java.lang.String variableName)  
    <T> T registerNode​(T node, java.lang.String variableName, boolean isPublic)  
    <T> T registerPublicNode​(T node, java.lang.String variableName)  
    java.lang.String variableName​(java.lang.Object node)
    Accessor to the name mapping for an instance.

    Methods inherited from class java.lang.Object

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

    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(java.lang.Object... obj)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(java.util.List nodes)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(java.util.Map<java.lang.Object,​java.lang.String> publicNodes)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(com.fluxtion.builder.node.DeclarativeNodeConiguration declarativeNodeConiguration)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(java.util.List nodes, java.util.Map<java.lang.Object,​java.lang.String> publicNodes)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(com.fluxtion.builder.node.SEPConfig config)
    • TopologicallySortedDependecyGraph

      public TopologicallySortedDependecyGraph​(java.util.List nodes, java.util.Map<java.lang.Object,​java.lang.String> publicNodes, com.fluxtion.builder.node.DeclarativeNodeConiguration declarativeNodeConiguration, com.fluxtion.builder.generation.GenerationContext context, java.util.Map<java.lang.String,​com.fluxtion.api.audit.Auditor> auditorMap, com.fluxtion.builder.node.SEPConfig config)
      Create a new TopologicallySortedDependecyGraph
      Parameters:
      nodes - The set of nodes that will be sorted as a list.
      publicNodes - Map of public available instances, the value is the unique name of each instance. The names will override existing instances in the nodes List or add the node to the set.
      declarativeNodeConiguration - factory description
      strat - NodeNameProducer strategy
      context - Generation context for this cycle
      auditorMap - Auditors to inject
      config - Config for this generation cycle
  • Method Details

    • variableName

      public java.lang.String variableName​(java.lang.Object node)
      Accessor to the name mapping for an instance.
      Parameters:
      node - The instance to for this lookup.
      Returns:
      the variable name of the instance.
    • getInstanceMap

      public java.util.Map<java.lang.Object,​java.lang.String> getInstanceMap()
    • getSortedDependents

      public java.util.List<java.lang.Object> getSortedDependents() throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getRegistrationListenerMap

      public java.util.Map<java.lang.String,​com.fluxtion.api.audit.Auditor> getRegistrationListenerMap()
    • getSortedDependents

      public java.util.List<java.lang.Object> getSortedDependents​(java.lang.Object obj) throws java.lang.Exception
      Parameters:
      obj - The root object to search from in the graph.
      Returns:
      a sorted dependents list with this object as a root.
      Throws:
      java.lang.Exception - when generating graph
    • getEventSortedDependents

      public java.util.List<java.lang.Object> getEventSortedDependents​(java.lang.Object obj) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • getDirectChildren

      public java.util.List<?> getDirectChildren​(java.lang.Object parent)
      returns a list of the direct children of this object in the SEP.node in the SEP
      Parameters:
      parent - node in the SEP
      Returns:
      list of direct children of this node
    • getDirectChildrenListeningForEvent

      public java.util.List<?> getDirectChildrenListeningForEvent​(java.lang.Object parent)
    • getDirectParents

      public java.util.List<?> getDirectParents​(java.lang.Object child)
      returns a list of the direct parents of this object in the SEP.
      Parameters:
      child - in the SEP
      Returns:
      direct parents of this node
    • getDirectParentsListeningForEvent

      public java.util.List<?> getDirectParentsListeningForEvent​(java.lang.Object child)
    • registerPublicNode

      public <T> T registerPublicNode​(T node, java.lang.String variableName)
      Specified by:
      registerPublicNode in interface com.fluxtion.builder.node.NodeRegistry
    • registerAuditor

      public <T extends com.fluxtion.api.audit.Auditor> T registerAuditor​(T node, java.lang.String auditorName)
      Specified by:
      registerAuditor in interface com.fluxtion.builder.node.NodeRegistry
    • registerNode

      public <T> T registerNode​(T node, java.lang.String variableName, boolean isPublic)
    • registerNode

      public <T> T registerNode​(T node, java.lang.String variableName)
      Specified by:
      registerNode in interface com.fluxtion.builder.node.NodeRegistry
    • findOrCreatePublicNode

      public <T> T findOrCreatePublicNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName)
      Specified by:
      findOrCreatePublicNode in interface com.fluxtion.builder.node.NodeRegistry
    • findOrCreateNode

      public <T> T findOrCreateNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName)
      Specified by:
      findOrCreateNode in interface com.fluxtion.builder.node.NodeRegistry
    • findOrCreateNode

      public <T> T findOrCreateNode​(java.lang.Class<T> clazz, java.util.Map config, java.lang.String variableName, boolean isPublic)
    • generateDependencyTree

      public void generateDependencyTree() throws java.lang.Exception
      Generates the dependency tree for introspection.
      Throws:
      java.lang.Exception - when problem generating the dependency tree
    • isPublicNode

      public boolean isPublicNode​(java.lang.Object node)
    • getConfig

      public com.fluxtion.builder.node.SEPConfig getConfig()
    • exportAsGraphMl

      public void exportAsGraphMl​(java.io.Writer writer, boolean addEvents) throws org.xml.sax.SAXException, javax.xml.transform.TransformerConfigurationException
      exports graph as graphml, can be exported with and without event as nodes on the graph.
      Parameters:
      writer - target
      addEvents - flag to control inclusion of events as nodes
      Throws:
      org.xml.sax.SAXException - problem writing jpgraphMl
      javax.xml.transform.TransformerConfigurationException - problem writing jpgraphMl