Metadata is information that describes the properties of something (a class, member variable, method, etc.).
In
Java, there have been several ad-hoc ways of specifying metadata in the past. Marker interfaces are one example, the "transient" keyword is another.
Normally, when a class implements an interface, it tells you something about the data type of instances of the class - it's the normal "is a" relationship that you have with inheritance. For example, if your class implements Runnable, then your object
is a Runnable.
With marker interfaces, the inheritance mechanism is abused to specify metadata. For example, if your class implements the marker interface Serializable, it doesn't mean that your object
is a Serializable. (The whole sentence "this object is a Serializable" sounds kind of strange.) Instead, it means that the object has a property; it is Serializable.
In Java 5, annotations were added as a generic way of specifying metadata - now we can use annotations instead of the existing ad-hoc ways to specify properties.
In
J2EE, metadata about EJBs is stored separately from the source code, in an XML deployment descriptor. This has some advantages; you're not mixing up source code and deployment configuration information. In the new EJB 3.0 standard, XML deployment descriptors have been replaced (or amended by, because you can still use XML deployment descriptors if you want) by annotations. The disadvantage of this is that you're mixing up code and configuration information, the advantage is that you don't have to hack in XML and that you have everything in one place (the source code file).