Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ef-labs/vertx-guice
Create Vert.x Modules and Verticles with dependency injection using Guice
https://github.com/ef-labs/vertx-guice
Last synced: 3 months ago
JSON representation
Create Vert.x Modules and Verticles with dependency injection using Guice
- Host: GitHub
- URL: https://github.com/ef-labs/vertx-guice
- Owner: ef-labs
- License: mit
- Created: 2013-08-20T22:30:55.000Z (over 11 years ago)
- Default Branch: develop
- Last Pushed: 2019-11-02T02:35:17.000Z (over 5 years ago)
- Last Synced: 2024-10-24T09:18:48.032Z (3 months ago)
- Language: Java
- Size: 102 KB
- Stars: 59
- Watchers: 14
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- vertx-awesome - Vert.x Guice - Vert.x verticle factory for Guice dependency injection. (Dependency Injection)
README
# Vert.x Guice Extensions
Enable Verticle dependency injection using Guice. Deploy your verticle with the `java-guice:` prefix to use the `GuiceVerticleFactory`.[![Build Status](http://img.shields.io/travis/ef-labs/vertx-guice.svg?maxAge=2592000&style=flat-square)](https://travis-ci.org/ef-labs/vertx-guice)
[![Maven Central](https://img.shields.io/maven-central/v/com.englishtown.vertx/vertx-guice.svg?maxAge=2592000&style=flat-square)](https://maven-badges.herokuapp.com/maven-central/com.englishtown.vertx/vertx-guice/)## License
http://englishtown.mit-license.org/## Configuration
Either provide a com.englishtown.vertx.guice.BootstrapBinder that implements com.google.inject.Module, or via vert.x config, provide a custom class name.
```json
{
"guice_binder": "my.custom.bootstrap.Binder"
}
```## Example
```java
package com.englishtown.vertx.guice;import com.englishtown.configuration.ConfigValueManager;
import com.englishtown.configuration.OtherBinder1;
import com.englishtown.configuration.OtherBinder2;
import com.englishtown.configuration.impl.PropertiesConfigValueManager;
import com.google.inject.AbstractModule;import javax.inject.Singleton;
public class BootstrapBinder extends AbstractModule {
@Override
protected void configure() {// Configure bindings
bind(ConfigValueManager.class).to(PropertiesConfigValueManager.class).in(Singleton.class);// Install other binders
install(new OtherBinder1(), new OtherBinder2());}
}
```