Getting Started
Core
Relational Databases
NoSQL Databases
Cache
Internationalization
REST Client
Scheduler
Sendmail
Template
Virtual File Storage
Web
Testing
Advanced
Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule
or the interface Module
.
To meet all needs, the Void Framework provides the ability to obtain additional information via the module’s constructor. As a constructor’s parameter, you could optionally use the following elements:
Config
the current configuration of the applicationScannedClassesToLoad
the classes that were scanned when the application startedif a module needs to be loaded before another, you can use the OrderedModule
interface.
public final class MyCustomModule extends AbstractModule implements OrderedModule {
private final Config configuration;
private final ScannedClassesToLoad scannedClassesToLoad;
public MyCustomModule(final Config configuration,
final ScannedClassesToLoad scannedClassesToLoad) {
this.configuration = configuration;
this.scannedClassesToLoad = scannedClassesToLoad;
}
@Override
protected void configure() {
// Place your module code here
}
@Override
public int priority() {
return 50;
}
}
voidframework.core.acceptedScanPaths
.