com.englishtown:vertx-mod-hk2

Provides a VerticleFactory that uses HK2 for dependency injection.

License

License

Categories

Categories

HK2 Application Layer Libs Dependency Injection
GroupId

GroupId

com.englishtown
ArtifactId

ArtifactId

vertx-mod-hk2
Last Version

Last Version

1.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

Provides a VerticleFactory that uses HK2 for dependency injection.
Project URL

Project URL

https://github.com/englishtown/vertx-mod-hk2
Project Organization

Project Organization

Englishtown
Source Code Management

Source Code Management

https://github.com/englishtown/vertx-mod-hk2

Download vertx-mod-hk2

How to add to project

<!-- https://jarcasting.com/artifacts/com.englishtown/vertx-mod-hk2/ -->
<dependency>
    <groupId>com.englishtown</groupId>
    <artifactId>vertx-mod-hk2</artifactId>
    <version>1.7.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.englishtown/vertx-mod-hk2/
implementation 'com.englishtown:vertx-mod-hk2:1.7.0'
// https://jarcasting.com/artifacts/com.englishtown/vertx-mod-hk2/
implementation ("com.englishtown:vertx-mod-hk2:1.7.0")
'com.englishtown:vertx-mod-hk2:jar:1.7.0'
<dependency org="com.englishtown" name="vertx-mod-hk2" rev="1.7.0">
  <artifact name="vertx-mod-hk2" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.englishtown', module='vertx-mod-hk2', version='1.7.0')
)
libraryDependencies += "com.englishtown" % "vertx-mod-hk2" % "1.7.0"
[com.englishtown/vertx-mod-hk2 "1.7.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.glassfish.hk2 : hk2-api jar 2.3.0-b05
org.glassfish.hk2 : hk2-locator jar 2.3.0-b05

provided (2)

Group / Artifact Type Version
io.vertx : vertx-core jar 2.1
io.vertx : vertx-platform jar 2.1

test (3)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.9.5
junit : junit jar 4.11
io.vertx : testtools jar 2.0.3-final

Project Modules

There are no modules declared in this project.

Vert.x HK2 Extension

Enable Verticle dependency injection using HK2. Deploy your verticle with the java-hk2: prefix to use the HK2VerticleFactory.

Build Status Maven Central

License

http://englishtown.mit-license.org/

Configuration

The vertx-mod-hk2 module configuration is as follows:

{
    "hk2_binder": <hk2_binder>
}
  • hk2_binder - The name of the HK2 binder class which contains the injection configuration. Default is "com.englishtown.vertx.hk2.BootstrapBinder". You can also provide an array of binder classes.

Example

package com.englishtown.vertx.hk2;

import com.englishtown.configuration.ConfigValueManager;
import com.englishtown.configuration.OtherBinder1;
import com.englishtown.configuration.OtherBinder2;
import com.englishtown.configuration.impl.PropertiesConfigValueManager;
import org.glassfish.hk2.utilities.binding.AbstractBinder;

import javax.inject.Singleton;

public class BootstrapBinder extends AbstractBinder {

    @Override
    protected void configure() {

        // Configure bindings
        bind(PropertiesConfigValueManager.class).to(ConfigValueManager.class).in(Singleton.class);

        // Install other binders
        install(new OtherBinder1(), new OtherBinder2());

    }

}
com.englishtown

Labs @ EF Education First

Repositories moving to https://github.com/ef-labs

Versions

Version
1.7.0
1.6.1
1.6.0
1.5.0-final
1.4.0-final
1.3.0-final
1.2.0-final
1.1.0-final
1.0.1-final
1.0.0-final
1.0.0-CR3
1.0.0-CR2
1.0.0-beta5
1.0.0-beta4
1.0.0-beta3
1.0.0-beta2
1.0.0-beta1