Furnace - CDI Container Tests

Parent POM for JBoss projects. Provides default project build configuration.

License

License

Categories

Categories

JBoss Container Application Servers
GroupId

GroupId

org.jboss.forge.furnace
ArtifactId

ArtifactId

container-cdi-tests
Last Version

Last Version

2.0.0.Alpha9
Release Date

Release Date

Type

Type

jar
Description

Description

Furnace - CDI Container Tests
Parent POM for JBoss projects. Provides default project build configuration.
Project Organization

Project Organization

JBoss by Red Hat

Download container-cdi-tests

How to add to project

<!-- https://jarcasting.com/artifacts/org.jboss.forge.furnace/container-cdi-tests/ -->
<dependency>
    <groupId>org.jboss.forge.furnace</groupId>
    <artifactId>container-cdi-tests</artifactId>
    <version>2.0.0.Alpha9</version>
</dependency>
// https://jarcasting.com/artifacts/org.jboss.forge.furnace/container-cdi-tests/
implementation 'org.jboss.forge.furnace:container-cdi-tests:2.0.0.Alpha9'
// https://jarcasting.com/artifacts/org.jboss.forge.furnace/container-cdi-tests/
implementation ("org.jboss.forge.furnace:container-cdi-tests:2.0.0.Alpha9")
'org.jboss.forge.furnace:container-cdi-tests:jar:2.0.0.Alpha9'
<dependency org="org.jboss.forge.furnace" name="container-cdi-tests" rev="2.0.0.Alpha9">
  <artifact name="container-cdi-tests" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jboss.forge.furnace', module='container-cdi-tests', version='2.0.0.Alpha9')
)
libraryDependencies += "org.jboss.forge.furnace" % "container-cdi-tests" % "2.0.0.Alpha9"
[org.jboss.forge.furnace/container-cdi-tests "2.0.0.Alpha9"]

Dependencies

compile (1)

Group / Artifact Type Version
org.jboss.forge.furnace : container-cdi jar 2.0.0.Alpha9

provided (1)

Group / Artifact Type Version
org.jboss.forge.furnace : furnace-api jar 2.0.0.Alpha9

test (4)

Group / Artifact Type Version
org.jboss.forge.furnace.test : furnace-test-harness jar 2.0.0.Alpha9
org.jboss.forge.furnace.test : arquillian-furnace-classpath jar 2.0.0.Alpha9
org.jboss.forge.furnace : furnace-se jar 2.0.0.Alpha9
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Furnace Container: CDI

Build Status License

This addon is a 'Furnace container' that provides lifecycle and service registry support for dependent addons. Other addons may depend on this to use the CDI 2.0 programming model and dependency injection framework.

Dependencies: None

Setup

This Addon requires the following installation steps.

Add configuration to pom.xml

To use this Furnace container, you must add it as a dependency in the pom.xml of your forge-addon classified artifact:

<dependency>
   <groupId>org.jboss.forge.furnace.container</groupId>
   <artifactId>cdi</artifactId>
   <classifier>forge-addon</classifier>
   <version>${version}</version>
</dependency>

Add META-INF/beans.xml file

In order for CDI to detect your classes, you must add the src/main/resources/META-INF/beans.xml file to your project.

Features

Full CDI support

Your addon may use the full CDI specification, provide CDI extensions, and do anything that would otherwise be possible in a Java SE or Java EE CDI environment.

Automatic service registration

CDI Beans will automatically be added to the local ServiceRegistry for use in other addons.

public class ServiceX {
   // Will be available for use in dependent addons
}
Injection of services

Any types declared as dependencies of your addon will be made available via the dependency injection model. Service wiring occurs automatically.

public class ConsumerY {
   @Inject private ServiceX service; // From some other Addon
}
Observable container events

The Furnace container publishes several observable events to all addons throughout their lifecycle.

Event Type Description

@PostStartup

Fired when this addon is has been fully started by the Furnace container, and may begin its work.

@PreShutdown

Fired when this addon is about to be shut down by the Furnace container.

Automatic event propagation

This container will automatically re-fire any CDI events for all other addons to observe. It also automatically listens for remote events and re-fires them for your local beans to observe.

Injection of Furnace APIs

This container also allows for injection of some of the core Furnace APIs into your objects. Below is a list of all injectable API types.

Injectable Type Description

@Inject private Furnace service;

A handle to the Furnace container in which this addon is being run.

@Inject private Addon self;

A reference to this addon itself. Allows access to the addon version, ClassLoader, service registry, current lifecycle status, and addon dependencies.

@Inject private AddonRegistry addonRegistry;

A reference to the global Furnace addon registry - can be used to retrieve addon and exported service instances.

@Inject private AddonRepository repository;

A reference to the repository in which this addon is deployed. Can be used to

@Inject private ServiceRegistry serviceRegistry;

A reference to the service registry of this addon. Can be used to retrieve service instances from this addon at runtime.

org.jboss.forge.furnace

JBoss Forge

JBoss Forge is a software development tool that extends your Java IDE, providing wizards and extensions (add-ons) for different technologies and solutions

Versions

Version
2.0.0.Alpha9
2.0.0.Alpha8
2.0.0.Alpha7