Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

WildFly Integration

Thomas Diesler edited this page Jan 22, 2014 · 7 revisions

Preparing WildFly

Gravia provides a patch for for WildFly as a Maven artefact

<dependency>
	<groupId>org.jboss.gravia</groupId>
	<artifactId>gravia-container-wildfly-patch</artifactId>
	<type>zip</type>
</dependency>

It contains the Gravia subsystem and a number of config files and jars that get copied to WildFly.

You can start WildFly with the Gravia integration like this

[tdiesler@localhost wildfly-8.0.0.Beta1]$ bin/standalone.sh -c standalone-gravia.xml
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: .../wildfly-8.0.0.Beta1

  JAVA: .../jdk1.7.0_25.jdk/Contents/Home/bin/java

  JAVA_OPTS:  -server ...

=========================================================================

10:24:53,179 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final
10:24:53,434 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Beta2
10:24:53,506 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.0.0.Beta1 "WildFly" starting
...
10:24:54,538 INFO  [org.wildfly.gravia] (MSC service thread 1-7) JBAS020000: Activating Gravia Subsystem
...
10:24:54,736 INFO  [org.jboss.gravia.runtime] (MSC service thread 1-6) Installed: Module[org.apache.felix.scr:1.6.2]
10:24:54,740 INFO  [org.jboss.gravia.runtime] (MSC service thread 1-6) Installed: Module[org.apache.felix.configadmin:1.6.0]
...
10:24:55,697 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Beta1 "WildFly" started in 2803ms

Preparing a Deployment

Gravia works with already resolved Modules that have a valid ClassLoader. In this case with the ClassLoader provided by WildFly.

In order for a deployment to become a runtime module it must be a valid resource. The minimum criteria is that it has a resource identity (for details see defining a module). The resource identity can be given as a manifest header like this:

Gravia-Identity: org.acme.foo;version=1.0.0

The module lifecycle can be controlled by WildFly, no further action is necessary.

Activating the Module

The Module headers may contain a module activator entry that defines the fully qualified name of a ModuleActivator.

In a manifest this can be defined like this

Module-Activator: org.acme.foo.Activator

In the ModuleActivator you can register/lookup services, work with DS defined components, etc.