Tuesday 24 November 2015

Byteman 3.0.3 release trials module imports using the JBoss Modules plugin

Byteman 3.0.3 is now available from the Byteman downloads page 

This release is a trial release for the new module import capability (contributed by Red Hat's very own James Livingstone). This new feature allows Byteman to be fully integrated into a modular JDK runtime. It includes generic support for module imports and a plugin which implements imports for JBoss Modules (plugins for  OSGi and Jigsaw will follow).

Byteman can now be configured to employ a module system-specific plugin to resolve  IMPORT statements embedded in individual rules or at the top level in a rule script. IMPORT statements allow classes deployed in the module named by the IMPORT statement to be used to resolve types mentioned in rules. This solves two common problems.

Firstly, this allows you to deploy your Helper classes in a module, making it possible for the Helper to rely on other modules in the runtime to implement the desired Helper behaviour. For example, you might want to inject code into a method of an XTS (Web Services Transactions) class and call a Helper method which validates execution at the trigger point by checking the state of the WS (Web Services) stack. You would deploy your Helper class in a module which imports the necessary WS API classes and then use an IMPORT statement to make your Helper class visible to your rule.

Secondly, your rules can directly reference classes in modules which are not visible from the rule's trigger class. For example, you might want to inject code into an EJB method which traces the execution of the EJB and also displays some of the current JBoss Transaction statistics. Importing the JBoss Transaction module allows your rule to refer to the JBoss Transaction static data & methods which expose these statistics.

Details of how to configure the JBoss Modules plugin and examples of how to import modules will be provided in a separate blog post. If you are interested in using the plugin and want more information or advice please contact the developers either on IRC or on the Byteman user forum.

Monday 2 November 2015

Byteman 3.0.2 release supporting some exciting and impressive monitoring packages

Byteman 3.0.2 Release

Byteman 3.0.2 is now available from the Byteman downloads page 

This is primarily a bug fix release which has resolved some rare (but still nasty) bugs in the guts of the trigger injection code. Many thanks are due to Radek Koubsky (Brno MSc student) and Red Hat's Marco Rietveld (Drools project) for their help and patience in pinning down these problems and testing the fixes.

The release also includes one new feature, the ability to use array initializer lists to provide initial values for BIND (i.e. rule local) variables of array type e.g.

  BIND heroes:String[][] = {{"Radek","Koubsky"},
                            {"Marco","Rietveld"}};

Full details of the initializer syntax are provided in the latest manual.

Two excellent projects implemented on top of Byteman 3.0.2 deserve special mention:

Byteman Wildfly Log

Radek Koubsky's MSc project uses Byteman to implement a trace package for Wildfly. The package implements fine-scale logging to monitor the operation of code injected into EJBs REST Endpoints JMS Channels Servlets Web Services Endpoints. You can find the code and instructions on how to use it at Radek's github repo.

Hawkular BTM

Red Hat's own Gary Brown has been using Byteman to implement support for Hawkular Business Transaction Management (BTM). This is an extremely powerful tool, still under development, which forms part of the full monitoring and management suite provided by the Hawkular project.

Hawkular BTM is used to track and manage operation of complex business applications whose execution may run in parallel across multiple JVMs and/or hosts. Gary has embedded the Byteman agent at the heart of this tool, using the manager API provided in release 3.0.1 to control uploading and unloading of Byteman rules into the client JVMs which run the business application.

Details of Hawkular BTM itself are available on the Hawkular site.

A demo of the latest version of Hawkular BTM in action is linked from this recent Hawkular blog post.

Finally, the BTM code itself is available from the BTM github repo.

Tuesday 19 May 2015

Byteman 3.0.0 has been released

Byteman 3.0.0 has been released and is available from the Maven Central repository and the Byteman project downloads page.

This release involves a major version update because Byteman has moved on from using ASM library version 3.3.1 to relying on the more JDK8/9 friendly ASM 5.0.3. However, there are no user-visible changes associated with this upgrade.

The release also fixes a small number of issues found in the preceding 2.2.2 release.

Tuesday 21 April 2015

Byteman 2.2.2 has been released

Byteman 2.2.2 has been released and is available from the Maven Central repository and the Byteman project downloads page.

This is a maintenance release which fixes a few bugs (including a regression introduced into script bminstall.sh in release 2.2.1).

The release also introduces one significant new feature, a plugin model to manage loading, unloading and checking the status of the Byteman agent's rule base. So, if you don't like the agent opening a socket listener from within your application you can replace Byteman's TransformListener class with a POJO of your choice and have it take control. Special thanks are due to Red Hat's Gary Brown for contributing the code for this feature.

Tuesday 13 January 2015

Byteman 2.2.1 Has Been Released

Byteman 2.2.1 has been released and is available from the Maven Central repository and the Byteman project downloads page page.

This is a maintenance release which fixes a few small bugs and also includes patches required to ensure that Byteman and BMUnit are able to run on the latest early access release of JDK9.

This release also includes new improved versions of the Byteman tutorials:

  Byteman : Running from the Command Line
  BMUNit :  Using Byteman with JUnit or TestNG from maven or ant
  Advanced Fault Injection with Byteman
  Using the Byteman Rulecheck Maven Plugin

All four tutorials and other documentation are linked from the Byteman project documentation page.