se.jbee.inject.bootstrap.ModularBootstrapperBundle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silk-di Show documentation
Show all versions of silk-di Show documentation
Silk Java dependency injection framework
/*
* Copyright (c) 2012, Jan Bernitt
*
* Licensed under the Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0
*/
package se.jbee.inject.bootstrap;
import se.jbee.inject.Type;
import se.jbee.inject.bootstrap.Bootstrapper.ModularBootstrapper;
/**
* The default utility base class for {@link ModularBundle}s.
*
* @author Jan Bernitt ([email protected])
*/
public abstract class ModularBootstrapperBundle
implements ModularBundle, ModularBootstrapper {
private ModularBootstrapper bootstrap;
@Override
public void bootstrap( ModularBootstrapper bootstrap ) {
Bootstrap.nonnullThrowsReentranceException( this.bootstrap );
this.bootstrap = bootstrap;
bootstrap();
}
@Override
public void install( Class extends Bundle> bundle, M module ) {
bootstrap.install( bundle, module );
}
@Override
public String toString() {
Type> module = Type.supertype( ModularBundle.class, Type.raw( getClass() ) ).parameter( 0 );
return "bundle " + getClass().getSimpleName() + "[" + module + "]";
}
protected abstract void bootstrap();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy