Weld CDI Verticle Factory

A CDI verticle factory based on weld CDI

Лицензия

Лицензия

Группа

Группа

de.notizwerk
Идентификатор

Идентификатор

weld-verticle-factory
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Weld CDI Verticle Factory
A CDI verticle factory based on weld CDI
Ссылка на сайт

Ссылка на сайт

https://github.com/sibay/weld-verticle-factory
Система контроля версий

Система контроля версий

https://github.com/sibay/weld-verticle-factory

Скачать weld-verticle-factory

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/de.notizwerk/weld-verticle-factory/ -->
<dependency>
    <groupId>de.notizwerk</groupId>
    <artifactId>weld-verticle-factory</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/de.notizwerk/weld-verticle-factory/
implementation 'de.notizwerk:weld-verticle-factory:1.0.0'
// https://jarcasting.com/artifacts/de.notizwerk/weld-verticle-factory/
implementation ("de.notizwerk:weld-verticle-factory:1.0.0")
'de.notizwerk:weld-verticle-factory:jar:1.0.0'
<dependency org="de.notizwerk" name="weld-verticle-factory" rev="1.0.0">
  <artifact name="weld-verticle-factory" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.notizwerk', module='weld-verticle-factory', version='1.0.0')
)
libraryDependencies += "de.notizwerk" % "weld-verticle-factory" % "1.0.0"
[de.notizwerk/weld-verticle-factory "1.0.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
io.vertx : vertx-core jar 3.3.3
org.jboss.weld.se : weld-se-core jar 2.4.0.Final

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

Weld CDI Vert.x Verticle Factory

License

A vert.x verticle factory with dependency injection based on weld CDI. Verticles created by this factory get their dependencies injected.

Installation

Gradle

compile 'de.notizwerk:weld-verticle-factory:1.0.0'

Maven

<dependency>
    <groupId>de.notizwerk</groupId>
    <artifactId>weld-verticle-factory</artifactId>
    <version>1.0.0</version>
</dependency>

Usage

Include the jar in your classpath and deploy your verticle with the wcdi prefix. To setup the weld container correctly you must provide the packages which should be scanned for beans and cdi'ed verticles. To do that set the system property

vertx-weld-cdi-scanned-package-classes

to a comma separated list of class names (like "org.myorg.verticles.FirstVerticle, org.myorg.beans.MyBean") The packages in which the classes reside, are scanned recursively fo beans. Disable the recursion with -Dvertx-weld-cdi-recursive-scan=false

Here is a short bootstrap example:

System.setProperty(WeldVerticleFactory.SCANNED_PACKAGES_PROP,"de.notizwerk.weldcdi.examples.Bootstrap");
System.setProperty(WeldVerticleFactory.RECURSIVE_SCAN_PROP,"true"); // is true by default
Vertx vertx = Vertx.vertx();
vertx.deployVerticle("wcdi:de.notizwerk.weldcdi.examples.MapperVerticle");

The created verticles can annotate their dependencies with CDI annotations like @Inject. These properties are then injected by the factory.

public class MapperVerticle extends AbstractVerticle {
    @Inject
    private Mapper mappper;
    ...
 }

There is example code in the examples directory. You can run the example with

git clone https://github.com/sibay/weld-verticle-factory.git
cd weld-verticle-factory
./gradlew shadow
java -jar weld-verticle-factory-X.Y.Z-SNAPSHOT-all.jar

References

Author

Notizwerk

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Версии библиотеки

Версия
1.0.0