ASM - Users


AspectWerkz utilizes bytecode modification to weave your classes at project build-time, class load time or runtime. It hooks in using standardized JVM level APIs. It has a rich and highly orthogonal join point model. Aspects, advices and introductions are written in plain Java and your target classes can be regular POJOs. You have the possibility to add, remove and re-structure advice as well as swapping the implementation of your introductions at runtime. Your aspects can be defined using either Java 5 annotations, Java 1.3/1.4 custom doclets or a simple XML definition file.

AspectJ is a seamless aspect-oriented extension to the Java programming language. A typical AspectJ compilation weaves a user specified set of types but needs access to many many other types for resolving dependencies and determining whether pointcuts match - for example it may need to know about core types used from the JVM runtime jar file like java.lang.String. For these types AspectJ doesn't need to load the instructions, it just needs to quickly load the structure - What is the signature? Is it generic? What are the methods? Do they have annotations? ASM is used to quickly load this structural information.

AgitarOne from Agitar automatically generates JUnit tests for your legacy Java code. Agitar has been an early user of ASM and we leverage the framework in all our products for bytecode instrumentation for coverage, call interposing as well as for building control and data flow graphs for higher level dynamic and static analysis. ASM easily offers the lightest and fastest framework for bytecode parsing and manipulation in our experience.

BEA WebLogic Server 9 includes an advanced diagnostic framework (WebLogic Diagnostic Framework) that enables users to monitor a production system. ASM is used for high performant bytecode enhancements tailored for WebLogic Server. Key components of the server as well as custom ones can be observed and have their performance metrics exported through a dedicated API, third party tools, or through the management console.

The goal of the Eclipse API Tools project is to assist developers with API maintenance from release to release, alerting developers when an API change might break existing clients. The project uses ASM to to extract type, method, and field references from .class files, and is also used to generate .class file stubs retaining all API and reference information.

Berkeley DB Java Edition uses the ASM library to provide high performance object-data bindings. By using ASM instead of reflection, binding overhead is no longer a factor in the overall performance of the database application. ASM is very lightweight and has excellent performance -- two characteristics of Berkeley DB Java Edition that we cannot compromise. And ASM's license allows us to embed it without restrictions.

Berkeley DB Java Edition
Oracle TopLink is a rich Java persistence solution. It provides a flexible, productive, and high performing persistence engine that addresses Object-Relational Mapping (ORM) for Java classes, Container and Bean Managed (CMP, BMP) EJB 2 entity beans, and most recently EJB 3.0's Java Persistence API (JPA). In addition to solving ORM challenges TopLink also provides developers with a powerful Object-XML solution implementing JAXB and provides mapping support for non-relational data stores using the Java Connector Architecture. TopLink leverages the ASM library to enhance the application's persistent entities introducing transparent lazy loading and optimized change tracking.

Oracle TopLink
TopLink Essentials is the Free Open Source edition of Oracle TopLink. It is focused on object-relational persistence implementing EJB 3.0's Java Persistence API (JPA). TopLink Essentials is the reference implementation of JPA and is available through GlassFish entity-persistence module and is shipped within the Oracle Application Server, Sun Application Server 9.0, and is included and integrated in the Spring Framework 2.0 release. TopLink Essentials leverages the ASM library to enhance persistent entities introducing transparent lazy loading.

Terracotta believes that enterprise Java is too complex, and scaling out (or clustering) Java applications only makes it worse. Terracotta believes that operational concerns should be clearly separated from business logic. The "Terracotta Virtualization Server" uses byte-code modification to layer in enterprise-class infrastructure services, such as clustering and caching, into applications transparently at runtime, freeing the developer to focus on implementing the business logic with their framework of choice, using simple, single JVM, natural Java.

RIFE relies on ASM for many of its core features. For example its templating engine generates regular Java classes at runtime without resorting to Java compilation of sources, POJOs can remain clean and still be augmented through meta-data by merging sibling classes together and correctly keeping related instances in sync, RIFE/Continuations implements partial JVM continuations to provide a stateful flow specification mechanism in pure Java. Using this allows you to benefit from all the available development tools for the platform and to leverage expressiveness of the Java language to intuitively create complex application flows.

WindowBuilder Pro is a powerful and easy to use bidirectional Java GUI designer based on Eclipse SWT technology. It makes it very easy to create Java GUI (Swing and SWT), Eclipse RCP and GWT/Ajax applications without spending a lot of time writing code to display forms. ASM is an important low level component of WindowBuilder that allows high performance bytecode enhancements, such as Java/JavaScript interaction in GWT, binary execution flow analysis, etc. WindowBuilder

Javeleon is a novel dynamic updating system that is transparent to the Java language and runs on top of a standard unmodified JVM. It allows dynamic type-safe updates of code as well as thread-safe lazy state migration, thus preserving live object instances. Javeleon is intentionally designed to mimic the traditional off-line updating scheme. Hence, binary incompatible updates can be successfully carried out if and only if the type conflict is resolved and the conflicting code has been recompiled. Javeleon

Dr. Garbage offers several Eclipse plugins, in which ASM library is used for parsing of class files and for generation of control flow graph visualizations. The Bytecode Visualizer is a powerful class file viewer and bytecode debugger. Single instruction step and control flow graph shown alongside of any method's bytecode are unique to this product. The Sourcecode Visualizer draws a control flow graph alongside of Java source code. The Control Flow Graph Factory generates control flow graphs from Java source or bytecode, allows for editing them and exporting them to several bitmap and XML formats. Dr. Darbage

EclipseME is a set of Eclipse plugins to help develop J2ME MIDlets. EclipseME does the "grunt work" of connecting Wireless Toolkits to the Eclipse development environment, allowing you to focus on developing your application, rather than worrying about the special needs of J2ME development. EclipseME provides a 100% pure Java CDLC preverifier implementation built using ASM, providing significantly better diagnostics, performance and platform-independence.

Sun Microsystems, Inc. used ASM to build an emulation or hosting environment, currently in prototype form, for running Java ME applications (Connected Device Configuration / Foundation Profile / Personal Basis Profile) on top of a compliant Java SE implementation. The hosting environment supports generic rules for interposing on various class, method, constructor, and field references and calls, and currently contains all of the rules required to pass the CDC and PBP TCKs. ASM was invaluable in supplying advanced techniques such as dataflow over bytecodes which made it straightforward to build several of the rewrite rules in the hosting environment.

MicroEmulator is a pure Java implementation of Java ME in Java SE. It is using ASM to adapt the Java ME application (MIDlet) to Standard and Web Start Java environment. This includes enforcement or resource loading order, access to Java system properties, application log redirection and also injecting Thread creation monitoring in the emulated environment.

Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. Since version 1.1, Cobertura switched "the instrumentation classes to use ASM instead of Apache BCEL. There are three benefits to this: BCEL was throwing exceptions with some source code compiled with JDK 1.5--ASM works fine. ASM is licensed under the revised BSD license, which is compatable with the GPL, which allows us to remove the questionable exception for BCEL from the license. Instrumentation is about 5 times faster with ASM than BCEL."

CGLIB is a powerful, high performance and quality Code Generation Library. It is used to extend JAVA classes and implement interfaces at runtime.

dynaop is a proxy-based Aspect-Oriented Programming (AOP) framework, which enhances Object-Oriented (OO) design in the following areas: code reuse, decomposition, dependency reduction.

Pat Niemeyer said: "I'm very excited about ASM because it's exactly what I need to finish BeanShell scripted classes... [...] I didn't want to use BCEL because it's huge relative to BeanShell (my core language is about 100K). All I really need is the ability to generate a proxy class for an arbitrary type (delegate all the methods to a reflective style handler) which I believe will now be easy.

Clojure is a dynamic programming language that targets the JVM. Clojure is a functional dialect of Lisp, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure dynamically compiles to bytecode in memory using ASM, leveraging its speed and small size.


Coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. While in many modern languages coroutines are built-in (Python being the most notable example) or similar, often simplified, constructs are provided (like C#'s yield), Java lacks any coroutine support - even in this simplified form. This project provides coroutines on bytecode level using instrumentation to rearrange user code.

fun4j brings functional programming to the JVM. It's a framework that integrates major concepts from functional programming into the Java Platform. At its core there is a lambda-to-JVM bytecode compiler. Thanks to some optimization techniques like tail code optimization (TCO) the compiler produces code that runs as fast as hand optimized Java code. The compiler uses the excellent Java bytecode assembler ASM.


Groovy is a new agile dynamic language for the JVM combining lots of great features from languages like Python, Ruby and Smalltalk and making them available to the Java developers using a Java-like syntax.


Jamaica is a JVM Macro Assembler language. Its compiler uses a JavaClassCreator facade to delegate JVM class creation; currently it supports ASM and BCEL. "I like ASM," said James Huang, the author of Jamaica and JudoScript, "this is a JVM class creation API done right. For redistributing software, the compactness of ASM API is a great advantage, too."

JRuby is an implementation of the Ruby programming language that runs on the JVM. JRuby uses ASM extensively in its Ruby compiler and when generating callable method handles for binding Java code to Ruby method names.

Jython is an implementation of the Python programming language for the JVM. Jython uses ASM both to compile Python source to bytecode and to generate the proxies for calling Java from Jython.

NetLogo is a programming language and modeling environment for simulating natural and social phenomena. It uses ASM to partially compile NetLogo code into Java byte code.

Open Quark includes CAL: a general purpose, lazy, strongly-typed, functional language. CAL compiles directly to Java virtual machine bytecodes using ASM. CAL can use any Java class, method, field or constructor. Open Quark's Java APIs allow clients to programmatically create and call CAL functions. This enables logic best expressed in CAL, such as domain specific languages and data transformations, to be combined with regular object-oriented Java application logic. Open Quark includes a visual programming tool called the Gem Cutter, and a CAL Eclipse Plug-in. Open Quark is available for download with sources under a BSD license. The CAL Eclipse Plug-in is available under the Eclipse Public License v1.0.

WebSphere sMash is an agile development environment leveraging scripting runtimes such as Groovy and PHP, and optimized for producing REST-style services, integration, mash-ups, and rich Web interfaces. ASM is used in compiler that compiles PHP scripts to Java bytecode.

webSphere sMash
ProActive is a Java library for parallel, distributed, and concurrent computing, also featuring mobility and security in a uniform framework. With a reduced set of simple primitives, ProActive provides a comprehensive API allowing to simplify the programming of applications that are distributed on Local Area Network (LAN), on cluster of workstations, or on Internet Grids. ProActive uses ASM to dynamically generate stub and proxy classes.

Fractal is a general software composition framework that supports component-based programming, including components (type) definition, configuration, composition and administration. The reference implementation of Fractal uses ASM to generate interceptor classes, to merge classes for optimization purposes, and to provide a basic mixin based inheritance mechanism. Fractal

The EasyBeans is an open source implementation by ObjectWeb of the EJB3 container specification. It uses ASM in many cases: for the annotations processing (to detect @Stateless, @Stateful, etc classes or to search annotations on fields/methods), to manage the new EJB3 interceptors (to allow to intercept business methods or to be notified of some lifecycle events), or for the dependency injection part (to add a method which do the job in the bean's class).

Ebean is a open source ORM persistence layer - simplyfing Object Relational Mapping for Java Developers. It provides the functionality of the Java Persistence API (EJB3 Persistence) without requiring a container. It uses JPA annotated Entity Beans and provides cascading save/delete, batching, caching, clustering without requiring session objects (EntityManager). Ebean uses ASM to enhance the Entity Beans to support transparent "Lazy Loading" and "Old Values Creation". For performance reasons ASM is also used to generate code to replace standard reflection for bean getter and setter methods.

JDBCPersistence is an Object-Relational mapping persistence framework. It differs from its peers in that it generates the bytecode required to map a class to a table. It has been created with the following requirements in mind: be fast to load, support CLOBs and BLOBs, load persistent objects from java.sql.ResultSet, have compact API, have minimal dependencies on other projects, support configuration via API.

JPOX provides transparent persistence of Java objects to heterogeneous datastores. It is a fully-compliant implementation of the JDO1 and JDO2 standards. JPOX 1.2 also implements the JPA1 specification of persistence, along with the OGC Simple Feature Specification for geometric object persistence. JPOX 1.2 and later use ASM in its byte-code enhancer, injecting code into persisted classes allowing detection of changes to fields, and to allow for lazy loading of field values.

Apache OpenEJB is an embeddable and lightweight EJB 3.0 implementation that can be used as a standalone server or embedded into any application. ASM is used extensively for reading annotations allowing for the discovery of EJB 3.0 annotated beans without the security risks and memory usage associated with excessive classloading. We also employ ASM to dynamically generate byte code to adapt older CMP 1.1 or 2.x beans into the newer, more robust, EJB 3.0 Entity beans that leverage the Java Persistence API (JPA) allowing for dynamic and automatic migration from CMP to JPA. ASM is also used for supporting the new EJB 3.1 no-interface view of Session beans for a more "against the metal" proxy involving dynamic subclassing the bean.

Apache OpenEJB
Speedo is an open source implementation of the JDO specification. Speedo uses ASM to enhance the bytecode of persistent classes (i.e. mainly to replace access field instructions with calls to getter and setter methods generated by Speedo). Speedo

The Java Interactive Profiler is a code profiler that is written in 100% Java. JIP allows the developer to start and stop profiling interactively while the target program is running. In addition, JIP lets the developer filter out classes and packages so that the resulting profile is less cluttered. By using the Java5 agent interface, this is accompilshed without the need to recomple or have special libraries included with the target program. "ASM is a great product that was instrumental in allowing me to develop JIP", writes Andrew Wilcox, JIP's creator. "It's lightweight, easy to use and really allowed me to focus on the product I was creating rather than the details of byte code enhancement."

ByCounter is a lightweight approach for exact runtime counting of executed bytecode instructions and method invocations. ByCounter significantly reduces total counting costs by instrumenting only the application bytecode and not the JVM, and it can be used without modifications on any JVM.

Limpid Log is a revolutionary logging system. You do not need to hard code log statements. At runtime, you can register a class of interest and the system will log all important information about the class. When you are done, you can de-register the class and the class will not generate any log information anymore. Limpid Log is an open source program.

SonarJ is an innovative tool, which helps you to manage and monitor the logical architecture and the technical quality of your Java projects. It allows you to define a logical architecture and map it to your system. By analyzing all the dependencies in your system it can efficiently identify all architecture violations (unwanted dependencies) and cyclic dependencies. Most of the dependency information is gathered by analyzing the compiled class files. For this purpose ASM is used and we are very pleased by the ease of use, the low overhead and the compelling performance of this library.

TamiFlex is a tool suite to facilitate static analyses of Java programs that use reflection and custom class loaders. The suite consists of two agents that use the java.lang.instrument API, one Play-out Agent and one Play-in Agent. The Play-out Agent allows you to monitor a Java program using any Java-6 compliant JVM (dumping a reflection trace file, providing information about reflective calls on the program run, etc). With the Play-in Agent you can cause the virtual machine to load classes from a specified directory instead of the default ones. This is useful for replacing classes by statically optimized classes, whatever the classpath.

Kirill Grouchnikov said about using ASM in Substance and Laf-Widget projects: "ASM is used during build process - every compiled UI delegate is changed to "inject" the additional functionality that is common to all 40+ classes. This could have been done manually, of course, but then it would be a mess to maintain in Substance and a major pain to adopt in other LAFs. I considered a few alternatives such as dynamic proxies and AOP and eventually decided to try ASM. Bytecode instrumentation has its disadvantages, but at this moment it's the lesser of evils and ASMifierClassVisitor was a definite winner for me".

SemmleCode is a free Eclipse plugin that helps computing metrics, finding bugs and checking coding conventions. All these tasks are code queries in the plugin's library of predefined rules and metrics. Queries in SemmleCode are defined in an object-oriented query language that is concise and intuitive. Customizing existing queries or writing new ones for your own projects and frameworks is a simple task. SemmleCode works by storing Java codebases in a relational database. We use ASM to traverse bytecode when extracting the structure of a program to store in the database different program elements and relations between them. In our experience ASM has excellent performance and is the most compatible open source library for Java bytecode analysis.

Structure101 lets you control the structural complexity of your code-base and ensure that it conforms to a defined architecture, making it less costly and risky to develop, modify, test, and deploy. Structure101 exposes structure, lets you define how it should be, communicate this to the team and know when architecture deviations make it into the mainline. A rich client, web application, RSS feeds and IDE plug-ins provide the right information at the right time to make architectural control a cinch on any project or process, local or distributed. Structure101 is both rich and easy.
Ian Sutton, Chief Architect, Headway Software, said: "Byte-code parsing is key to structure101, with release 3 we took a look at all the options available to us to replace our own parser. In the end, it was an easy decision to go with ASM - for outstanding performance and language feature support".

JCarder is an open source tool for finding potential deadlocks in concurrent multi-threaded Java programs. It uses ASM to efficiently insert probes into the program under test with minimal overhead.

BTrace is a safe, dynamic tracing system for the Java platform. BTrace works by dynamically bytecode instrumenting (BCI) .class files of running a Java application to insert tracing code. The tracing code is expressed in Java programming language. BTrace uses ASM 3.0 to instrument .class files at runtime. On OpenSolaris platform, there is integration with OpenSolaris DTrace (dynamic tracing for Solaris OS and applications) as well. It is possible to raise DTrace probes from BTrace code and also execute an associated D-script. There is a command line access as well as GUI access to BTrace. VisualVM is all-in-one troubleshooting tool for Java. VisualVM supports plugin model to extend it's capabilities. A VisualVM plugin for BTrace is being developed. It will be available soon.

Byteman is a bytecode injection tool which simplifies development of tests for Java applications using a technique called fault injection. Byteman works by inserting scripted side effects into application code, Test scripts may include actions which create and propagate conditions appropriate to the test scenario. Or they may simply verify correct execution of the application program.

Retrotranslator is a Java bytecode transformer that translates Java classes compiled with JDK 5.0 into classes that can be run on JVM 1.4. Thanks to the ASM framework it is able to analyze and transform classes in an easy and clear way without sacrificing performance. Features supported on JRE 1.4: generics, annotations, reflection on generics and annotations, enums, autoboxing, for-each loop, varargs, covariant return types, formatted output, static import, concurrency utilities, collections framework enhancements.

R-OSGi is a technology to allow transparent access to remote services in OSGi frameworks. The idea is to allow the distribution of arbitrary OSGi services in networks with little management, such as ad-hoc networks. We use ASM to generate dynamic proxy bundles for remote services at runtime. One of our intended areas for applications is the world of mobile and embedded devices. The lightweight design of ASM is ideal for the bytecode manipulations that we require on the client side and the static code analysis on the service provider side.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2018-03-11 10:51 AM