Class ServiceChainMethodLevelService

java.lang.Object
edu.university.ecs.lab.detection.antipatterns.services.ServiceChainMethodLevelService

public class ServiceChainMethodLevelService extends Object
Service class for detecting and managing service chains in a network graph.
  • Field Details

    • DEFAULT_CHAIN_LENGTH

      protected static final int DEFAULT_CHAIN_LENGTH
      Length of the chain to consider an anti-pattern.
      See Also:
    • CHAIN_LENGTH

      private final int CHAIN_LENGTH
    • visited

      private Set<Method> visited
    • allChains

      private List<List<String>> allChains
    • graph

      private MethodDependencyGraph graph
    • currentPath

      private List<String> currentPath
  • Constructor Details

    • ServiceChainMethodLevelService

      public ServiceChainMethodLevelService()
      Constructs the service with a default chain length of 3.
    • ServiceChainMethodLevelService

      public ServiceChainMethodLevelService(int CHAIN_LENGTH)
      Constructs the service with a specified chain length.
      Parameters:
      CHAIN_LENGTH - the length of the chain to consider an anti-pattern
  • Method Details

    • getServiceChains

      public ServiceChain getServiceChains(MethodDependencyGraph graph)
      Retrieves all service chains from the given network graph.
      Parameters:
      graph - the network graph to analyze
      Returns:
      a ServiceChain object representing all detected service chains
    • dfs

      private void dfs(Method currentNode)
      Depth-first search (DFS) to explore and detect service chains starting from currentNode.
      Parameters:
      currentNode - the current node being visited