7.2.1. JDK1.4

7.2.1. JDK1.4

In order to provide maximum transparency, we have created two aop marker interfaces: @@org.jboss.cache.aop.AopMarker and @@org.jboss.cache.aop.InstanceOfAopMarker. The first interface is used to declare a regular POJO, while the latter one is used to declare the POJO and its sub-classes or sub-types.

Finally, to support annotation (to simplify user's development effort), the JBossCache distribution ships with a jboss-aop.xml under the resources directory. When you use the annotation precompiler, this file needs to be in the class path. For example, please refer to the annoc Ant build target. For reference, here is the content of that jboss-aop.xml :

		<aop>
  		<prepare expr="field(* @@org.jboss.cache.aop.AopMarker->*)" />
  		<prepare expr="field(* $instanceof{@@org.jboss.cache.aop.InstanceOfAopMarker}->*)" />
		</aop>
		

Basically, it simply states that any annotation with both marker interfaces will be "aspectized" accordingly.

Here is two code snippets that illustrate the declaration of both types through 1.4 style annotation:

	/**
	* @@org.jboss.cache.aop.AopMarker
	*/
	public class Address {...}
	

The above declaration will instrument the class Address, and

	/**
	* @@org.jboss.cache.aop.InstanceOfAopMarker
	*/
	public class Person {...}
	

The above declaration will instrument the class Person and all of its sub-classes. That is, if Student sub-class from Personal, then it will get instrumented automatically without further annotation declaration.

Note that the simplicity of declaring POJOs through annotation and its marker interfaces (although you will need to use the annotation pre-compiler.) See the build.xml target annoc for example.