JETM Springframework integration
Due to the nature of Spring managed applications JETM performance monitoring can easily added without touching application source code at all. This is done using Spring AOP. With it's help it is possible to monitor execution times purely by configuration.
Depending on your runtime environment choose one of the following integration strategies. Please note that these strategies rely on prerequisites and come with constraints listed below.
- Spring 2.x integration - requires XSD based configuration
- Spring 1.x/2.x integration - uses DTD based configuration
- Extensions for Spring managed web applications
Prerequisites and constraints
Springframework 1.x or 2.x?
Even though JETM supports both Springframework 1.x and 2.x the integration itself slightly differs. This is because of the newly introduced configuration namespace support in Springframework 2.x. If you are free to choose your Springframework version we recommend using Springframework 2.x, otherwhise you need use the old 1.x style JETM configuration.
Feature-wise there is no difference between Springframework 2.x and 1.x, however in 2.x the configuration is simplified.
Classpath Setup
JETM depends on Springframework classes and it's dependencies. It is necessary to add the following jars to the application classpath.
- Spring Framework: spring.jar or spring-aop.jar, spring-beans.jar, spring-context.jar, spring-core.jar
- AOP-Alliance API: aopalliance.jar
- CGLIB: cglib-nodep-x.jar
- Commons-Logging: commons-logging.jar
ApplicationContext required
Be aware that your spring configuration must be running within an ApplicationContext. Normally this is the case if you create the Spring runtime using a Web ContextLoaderListener or Web ContextLoaderServlet or any ApplicationContext subclass. If you just use a BeanFactory JETM performance monitoring will not work automatically (Hint: Register BeanPostProcessors - e.g. BeanNameAutoProxyCreator - manually).