org.jboss.cache.pojo.notification.annotation
Annotation Type Attached


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Attached

Indicates that the marked method should be called when an object is attached to the POJO Cache instance.

The method can have any name, but should take a single parameter which is either a AttachedEvent or any superclass. Otherwise, an IllegalArgumentException will be thrown by PojoCache.addListener(java.lang.Object)

Example:

    @PojoCacheListener
    public class MyListener()
    {
       @Attached
       public void handleAttached(AttachedEvent event)
       {
          System.out.println("Object = " + even.getSource());
       }
    }
 

Author:
Jason T. Greene



Copyright 2008 JBoss, a division of Red Hat. All Rights Reserved.