Uploaded image for project: 'WINDUP - Red Hat Application Migration Toolkit'
  1. WINDUP - Red Hat Application Migration Toolkit
  2. WINDUP-272

Refactor GraphContextFactoryImpl and GraphContextImpl

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Beta1
    • 2.0.0.Alpha1
    • MTA CLI
    • None
    • None

      The following methods are inconsistent, see comments.
      Better the producer should call initialize(), which would set graphContext if null to what's returned by create(). setGraphDirectory() should not be called in this class, or handled through a config object.

          // Sets this.graphContext
          @Override
          public GraphContext create()
          {
              return produceGraphContext();
          }
      
          // Does not touch nor inspect this.graphContext
          @Override
          public GraphContext create(Path runDirectory)
          {
              GraphContextImpl context = new GraphContextImpl(graphServices,
                          this.graphTypeRegistry,
                          this.graphApiCompositeClassLoaderProvider);
              context.setGraphDirectory(runDirectory);
              return context;
          }
      
          // Sets this.graphContext
          @Produces
          @ApplicationScoped
          public GraphContext produceGraphContext()
          {
              if (this.graphContext == null)
              {
                  this.graphContext = new GraphContextImpl(graphServices,
                              this.graphTypeRegistry,
                              this.graphApiCompositeClassLoaderProvider);
              }
              return graphContext;
          }
      

              ozizka_jira Ondrej Zizka (Inactive)
              ozizka_jira Ondrej Zizka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: