December 22, 2014
December 21, 2014
The EE 6 classes are available in maven central.
But when running unit test against them you receive the below error. Thats because they do not contain implementation classes, only api class.
So in practice, the dependecy is in real life unusable. Instead you must use api classes from specific vendors like JBoss.
The below sites summaries all xml schemas defintions for all EE 7 deployment descriptors.
Interceptor was in EE 5 introduced in EJB 3.0, see EJB3 Interceptors javax.ejb.AroundInvoke. In EE 6 that was taken out and made generic into Interceptors (JSR318), package javax.interceptor.*.
You can call Interceptor in EE 6 in two way:
- By annotating method or class with @javax.interceptor.Interceptors(MyInterceptor.class)
- Create custom Annotation with Annotation @javax.interceptor.InterceptorBinding and annotate with that you method or class.
Your custom Interceptor.
Interception in a POJO.
Interception in a Stateless Session Bean.
beans.xml located for war in WEB-INF/.
To use the Interceptor you must let weld create the intercepted class, otherwise will weld never knew about the interceptor and hence will the interceptor never work.
Example usage from a Servlet.
You cannot use Interceptor directly in servlets, see https://java.net/projects/servlet-spec/lists/jsr340-experts/archive/2012-02/message/0.
A better tool is to use the gnome-screenshot tool.
You can install via `sudo apt-get install gnome-screenshot`
Besides dependency jar in a module you also might need to be able to configure it for different server environment. The best way and maybe the natural way, is to make use of a java properties file.
This is a good practice, now you can RPM package your custom module. This is how Red Hat do with JBoss EAP 6. With RPM packing you have now the capability of versioning your module and to centrally install it from, e.g. Red Hat Satellite. And finally centrally configure the property file from, e.g. Satellite 6 via Puppet.
But there is classloading gotchas. You need to add <resource-root path="."/> to you module.xml.
See https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath for longer description.
When deploying a snapshot release or if you by some other reason want to generate sources or javadoc jar, you could always configure maven-source-plugin and maven-javadoc-plugin and hook them in maven life cycle.
But that is not necessary in maven uber pom is that already defined for release. You can reuse that by adding -DperformRelease=true
Different example of usage:
Local build with sources and javadoc jar generation
Deploy target. Use only with snapshot version. Then deploy means snapshot publishing to defined snapshot repository.
Overview of EE evolution
The capabilities and what is supported out of the box in EE, is increasing from next version to next version. The drive behind the new feature are:
- Common task are finally included in standard EE.
- Better maven dependency management.
- Better test support (FINALLY!), but in this area, more can be done.
Summary of JBoss AS, EAP and new Wildfly EE Compliance
EE 4 - JBoss AS 4.X, JBoss EAP 4 *
EE 5 - JBoss AS 5.1, JBoss EAP 5 *
EE 6 - JBoss AS 7.1, JBoss EAP 6 *
EE 7 - Wildfly 8.x, JBoss EAP 7 * (release date Q2-Q3? 2015)
*) The EAP is forked from AS/Wildfly version left to it, but with much more quality (tested, patched, security compliance testing, security patched), documentation and with support.