The Smokejumper supplemental classes for Guice. These are generally-useful Guice modules based on common needs. Their API and implementation has been driven by the needs of real development projects. Everything has been tested through Spock specifications, which is one of the beautiful things of Guice compared to other dependency injection frameworks.
This project is broken into various subprojects. Each subproject provides multiple modules. All the modules are designed to be easily extensible and customizable: see their API and source for more information.
repositories {
jcenter()
}
dependencies {
compile 'com.smokejumperit.guice:core:1.1'
}
These are utility classes and useful modules which do not depend on anything more than the most recent version of Guice and its dependencies.
The module is available at the JCenter Maven Repository, which is located at
http://jcenter.bintray.com/. The Maven coordinates for this module are: com.smokejumperit.guice:core:$VERSION.
Check out the versions that are available here: http://jcenter.bintray.com/com/smokejumperit/guice/core/.
In particular, it currently provides the following modules:
- InstallingModule -- A module which simply installs other modules.
- ThreadFactoryModule -- Provides a default
ThreadFactory, along with the@LowPriority,@MediumPriority, and@HighPriorityannotations for specifying the priority of the injectedThreadFactory. - ExecutorModule -- Presuming that the
ThreadFactoryModule(or equivalent) is loaded, this provides implementations forExecutor,ExecutorService,ThreadPoolExecutor, andScheduledExecutorService. It also provides the@Background,@Process,@Read, and@Writeannotations for acquiring a specially-tuned version of an executor for background processing, CPU-bound processing, reading I/O actions, and writing I/O actions. - ConcurrentModule -- Convenience module for loading
ThreadFactoryModuleandExecutorModule. - PropertiesModule -- Makes system properties, environment variables, and configuration-time String values available via
@Namedparameters, including providing automatic conversion of these values to native types (includingint,double,BigDecimal,BigInteger,Charset,File, and more). Examples of just how easy this makes configuration values are in the JavaDoc. - I18nModule -- Provides access to
ResourceBundlebased internationalization, which is also useful for externalizing your user strings. Simply annotate your string fields with@Localized('foo'), and it will be injected with the resource bundle message with the keyfoo. Also exposes theResourceBundleandLocalefor injection. - CoreModule -- Convenience module providing
PropertiesModule,ConcurrentModule, and a default-configuredI18nModule.
THE IMPLEMENTATION FOR THIS MODULE IS NOT YET RELEASED
This will be a standard wiring module for AWS. It will take an AWSCredentials instance (or an AWSCredentialsProvider).
Based on that information, it will wire up all the Amazon*Client instances so that
you can simply @Inject them. It will be responsible for knowing which ones are thread-safe and which aren't. Its configuration broken down
into overridable modules that will mirror the AWS Java SDK package structure.
Released under the Unlicense. See LICENSE for more information.