Skip to content

Jour is designed to simplify the use of Javassist for processing multiple classes. In short Jour is simple Aspect Oriented Programming AOP framework on top of Javassist

Notifications You must be signed in to change notification settings

SingingBush/jour

Repository files navigation

Jour

Maven SonarCloud

Jour is designed to simplify the use of Javassist for processing multiple classes. In short Jour is simple Aspect Oriented Programming AOP framework on top of Javassist.

Forked from https://sourceforge.net/projects/jour/ and updated to support Java version 8 to 21.

Maven Artifacts are now available via github:

<dependency>
    <groupId>net.sf.jour</groupId>
    <artifactId>jour</artifactId>
    <version>2.1.1</version>
</dependency>
<dependency>
    <groupId>net.sf.jour</groupId>
    <artifactId>jour-instrument</artifactId>
    <version>2.1.1</version>
</dependency>
<dependency>
    <groupId>net.sf.jour</groupId>
    <artifactId>jour-maven-plugin</artifactId>
    <version>2.1.1</version>
</dependency>

Documentation

In general the way to use jour is to define a jour.xml file with aspects which define how your code can be instrumented either using your own implementation of net.sf.jour.instrumentor.Instrumentor, or by using one of the included implementations:

  • net.sf.jour.instrumentor.MethodExecutionTimeInstrumentor
  • net.sf.jour.instrumentor.ExceptionCatcherInstrumentor
  • net.sf.jour.instrumentor.MakeEmptyMethodInstrumentor
  • net.sf.jour.instrumentor.ReplaceMethodInstrumentor

For example:

<jour>
    <aspect type="net.sf.jour.instrumentor.MakeEmptyMethodInstrumentor">
        <typedef>com.example.*</typedef>
        <pointcut expr="* debug*(..)"/>
    </aspect>
    
    <aspect type="net.sf.jour.instrumentor.ReplaceMethodInstrumentor">
        <typedef>com.example.*</typedef>
        <pointcut expr="java.lang.String replaceMe(..)"/>
        <property name="code">
            <value><![CDATA[
                {
                return "replacement implementation";
                }
            ]]></value>
        </property>
    </aspect>
</jour>

For more information about how to use jour-instrument please see: http://jour.sourceforge.net/instrumentation.html

About

Jour is designed to simplify the use of Javassist for processing multiple classes. In short Jour is simple Aspect Oriented Programming AOP framework on top of Javassist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •