CDI 2 Guice Bridge

Starts a CDI SE container and add beans in Guice context.

License

License

Categories

Categories

GUI User Interface Guice Application Layer Libs Dependency Injection
GroupId

GroupId

com.github.rmannibucau
ArtifactId

ArtifactId

cdi2guice
Last Version

Last Version

1.0.8
Release Date

Release Date

Type

Type

jar
Description

Description

CDI 2 Guice Bridge
Starts a CDI SE container and add beans in Guice context.
Project URL

Project URL

https://github.com/rmannibucau/cdi2guice
Source Code Management

Source Code Management

https://github.com/rmannibucau/cdi2guice

Download cdi2guice

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
com.google.inject : guice jar 4.1.0

provided (5)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.20
org.apache.geronimo.specs : geronimo-jcdi_2.0_spec jar 1.0.1
org.apache.geronimo.specs : geronimo-annotation_1.3_spec jar 1.0
org.apache.geronimo.specs : geronimo-atinject_1.0_spec jar 1.0
org.apache.geronimo.specs : geronimo-interceptor_1.2_spec jar 1.0

test (2)

Group / Artifact Type Version
org.apache.openwebbeans : openwebbeans-se jar 2.0.6
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

CDI 2 Guice Bridge

<dependency>
  <groupId>com.github.rmannibucau</groupId>
  <artifactId>cdi2guice</artifactId>
  <version>${cdi2guice.version}</version>
</dependency>

Extend Cdi2Guice to configure the container overriding configuredContainer if needed and register this module in Guice to activate the bridge.

Important
call close() of the module once the application exist. In Play-guice it can be done through the ApplicationLifecycle.

Configuration

If you don’t want to extend the base class to configure the container, you can use a META-INF/cdi2guice/container.properties descriptor to resgiter your configuration.

Important
if you import multiple modules with these files the configuration will be merged when possible otherwise the last one wins. To help controlling that, the file are sorted using the configuration.order integer (natural order). Default is 0.
Name Description Default

beanClasses

List of classes to register (comma separated)

-

classPackages

List of classes marking packages to register (comma separated)

-

recursiveClassPackages

List of classes marking packages to register (comma separated), with their subpackages

-

disableDiscovery

Switch off the auto discovery

false

properties

A list of properties (set the value as properties) to register in the container

-

extensions

List of Extension classes to activate manually

-

decorators

List of @Decorator classes to activate manually

-

interceptors

List of @Interceptor classes to activate manually

-

alternatives

List of @Alternative classes to activate manually

-

alternativeStereotypes

List of @Stereotype classes to activate manually

-

configuration.registeredBeans entry will enable you to control which CDI beans are registered into Guice context. If you set it to true (default), all beans will be registered, otherwise only the listed beans will be. Note that only the last matching entry is used (it is not merged to let you control this one).

Versions

Version
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0