Package com.foreach.across.core.annotations

Examples of com.foreach.across.core.annotations.Installer


    for ( Object installer : moduleConfig.getInstallers() ) {
      Assert.notNull( installer, "Installer instance should never be null." );

      Class<?> installerClass = determineInstallerClass( installer );
      Installer metadata = installerClass.getAnnotation( Installer.class );

      if ( metadata == null ) {
        throw new AcrossException( "Installer " + installer.getClass() + " should have @Installer annotation" );
      }

      if ( metadata.phase() == phase ) {
        if ( areDependenciesMet( installerClass ) ) {
          LOG.trace( "Dependencies for installer {} are met.", installerClass );

          // Create installer instance if necessary
          Object instance = determineInstallerInstance( installer );
          InstallerAction action = determineInstallerAction( instance, moduleConfig );
          LOG.trace( "Determined action {} for installer {}.", action, installerClass );

          if ( shouldCheckRunCondition( action ) ) {
            if ( shouldPerformAction( action, moduleConfig.getModule(), installerClass, metadata ) ) {
              performInstallerAction( action, moduleConfig.getModule(), instance, metadata );
            }
            else {
              LOG.debug( "Skipping installer {} because action {} should not be performed.",
                         action, installerClass );
            }
          }
          else {
            LOG.debug( "Skipping installer {} because action is {}", installerClass, action );
          }
        }
        else {
          LOG.debug( "Skipping installer {} because dependencies are not met.", installerClass );
        }
      }
      else {
        LOG.trace( "Ignoring installer {} because it is defined for phase {}", installerClass,
                   metadata.phase().name() );
      }
    }

    LOG.trace( "Finished {} installers for module {}", phase.name(), moduleConfig.getModuleName() );
  }
View Full Code Here

TOP

Related Classes of com.foreach.across.core.annotations.Installer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.