MaintainJ Introduction

MaintainJ generates UML sequence and class diagram at runtime for a use case. This happens in three steps:

1. Instrument Code

This step, inserts log statements before every method call in the class files. Source code is unchanged. You can choose the packages that will be instrumented. All classes and sub-packages under the chosen packages will be instrumented. This can be done either at runtime or build-time.

a) Runtime Instrumentation - Runtime instrumentation is easy and very quick to get started. The following table lists the application server and JRE configurations on which MaintainJ runtime instrumentation is supported. J2SE applications (Swing or non-GUI) are supported on almost all JREs.

Server

JRE Sun's JRE BEA's JRockit IBM JRE
J2SE Apps 1.4, 1.5 , 1.6 1.4 and 1.5 1.5
Tomcat 4 1.4    
Tomcat 5 & 6 1.5, 1.6    
JBoss 3 1.4    
JBoss 4 1.5, 1.6    
WebLogic 8 1.4 JRockit 1.4  
WebLogic 9 1.5 JRockit 1.5  
WebSphere 5 1.4   1.4
WebSphere 6     1.5

Runtime instrumented applications are slow to service the first request but perform with little overhead after that.

b) Build-time Instrumentation - Use build-time instrumentation if runtime instrumentation is not supported for your configuration. MaintainJ Instrumentation Wizard supports build-time instrumentation for J2SE, J2EE and Eclipse applications. Instrumentation Wizard supports J2EE applications when they are deployed directly from Eclipse WTP (Web Tools Platform) based IDEs or RAD 6. If the J2EE applications are built and deployed using Ant scripts, the Ant scripts need to be changed.

2. Generate Trace Files

Run the instrumented Java code. Define the start and end points of a use case. Call trace for the use case will be logged to the given trace file (.ser file).

a) J2EE Applications - A JSP is provided to Start and Tracing. You need to click a 'Start Tracing' button before a use case starts and click 'Stop Tracing' at the end of the use case. The call trace will be logged to the given file name when 'Stop Tracing' is clicked.

b) J2SE and Eclipse Applications - A Swing window where you can start and stop tracing opens when your instrumented application starts. Click a 'Start Tracing' button before a use case starts and 'Stop Tracing' at the end of the use case. The call trace will be logged to the given file name when 'Stop Tracing' is clicked.

3. View the Diagrams

Just copy or move the trace files to any project in Eclipse workspace to view the diagrams.