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() );
}