Skip to content

hal/console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify Codebase Chat on Gitter

HAL is the project name for the WildFly and JBoss EAP management console. It's part of every WildFly and JBoss EAP installation. To get started simply fire up your browser and open http://localhost:9990.

Technical Stack

HAL is a client side RIA without any server side dependencies. It is a GWT application - which means it's written almost completely in Java. GWT is used to transpile the Java code into a bunch of JavaScript, HTML and CSS files. HAL uses some external JavaScript libraries as well. These dependencies are managed using NPM which is in turn integrated into the Maven build using the maven-frontend-plugin.

In a nutshell the console uses the following technical stack:

Build

For a full build use

mvn verify

This includes the GWT compiler, which might take a while. If you just want to make sure that there are no compilation or test failures, you can skip the GWT compiler and use

mvn verify -P skip-gwt

To build a HAL release ready to be used for WildFly or JBoss EAP use one of the following commands:

  • WildFly: mvn clean install -P prod,theme-wildfly
  • JBoss EAP: mvn clean install -P prod,theme-eap

Profiles

The POM defines the following profiles:

  • native: Used to build the native binary for the standalone mode
  • prod: Activates GWT settings for the production build
  • release: Builds and signs source and JavaDoc JARs
  • skip-gwt: Skips GWT compilation
  • theme-eap: Theme for JBoss EAP
  • theme-hal: Theme for HAL standalone
  • theme-wildfly: Theme for WildFly

Run

Development Mode

The GWT development mode starts a local Jetty server. As a one time prerequisite you need to add the URL of the local Jetty server as an allowed origin to your WildFly / JBoss EAP configuration:

/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:8888)
reload

resp.

/host=master/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:8888)
reload --host=master

The main GWT application is located in the app folder. To run the console in dev mode use

cd app
mvn gwt:devmode

This will start the development mode. Wait until you see a message like

00:00:15,703 [INFO] Code server started in 15.12 s ms

Then open http://localhost:8888/dev.html in your browser and connect to your WildFly / JBoss EAP instance.

The dev mode allows you to change code and see your changes simply by refreshing the browser. GWT will detect the modifications and only transpile the changed sources.

Standalone Mode

HAL can also be started as standalone Java application. The standalone mode is a Quarkus application which uses port 9090. Similar to GWT dev mode, you have to add the URL as allowed origin to your WildFly / JBoss EAP configuration:

/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:9090)
reload

resp.

/host=master/core-service=management/management-interface=http-interface:list-add(name=allowed-origins,value=http://localhost:9090)
reload --host=master

To build and run the standalone mode use

mvn package --projects standalone --also-make -P prod,theme-hal
java -jar standalone/target/quarkus-app/quarkus-run.jar

Then open http://localhost:9090/ in your browser and connect to your WildFly / JBoss EAP instance.

Debug

Start the console as described in 'Run / Development Mode'. GWT uses the SourceMaps standard to map the Java source code to the transpiled JavaScript code. This makes it possible to use the browser development tools for debugging.

In Chrome open the development tools and switch to the 'Sources' tab. Press ⌘ P and type the name of the Java source file you want to open.

Let's say we want to debug the enable / disable action in the data source column in configuration. Open the class DataSourceColumn and put a breakpoint on the first line of method void setEnabled(ResourceAddress, boolean, SafeHtml). Now select a data source like the default 'ExampleDS' data source and press the enable / disable link in the preview. The browser should stop at the specified line, and you can use the development tools to inspect and change variables.

Inspect Variables

If you're used to debugging Java applications in your favorite IDE, the debugging experience in the browser development tools might feel strange at first. You can inspect simple types like boolean, numbers and strings. Support for native JavaScript types like arrays and objects is also very good. On the other hand Java types like lists or maps are not very well-supported. In addition, most variable names are suffixed with something like _0_g$. We recommend inspecting these variables using the console and call the toString() method on the respective object.

Scripts

This repository contains some scripts to automate various development tasks.

depgraph.sh

Generates a visual dependency graph.

format.sh

Formats the codebase by applying the following maven goals:

validate.sh

Validates the codebase by applying the following maven goals:

release.sh

Releases a new HAL version.

versionBump.sh

Bumps the version to the specified version number.

Licenses

This project uses the following licenses: