[jboss-cvs] JBossCache/src/org/jboss/cache/pojo/notification/annotation ...

Jason Thomas Greene jgreene at jboss.com
Fri Jun 29 00:34:01 EDT 2007


  User: jgreene 
  Date: 07/06/29 00:34:01

  Added:       src/org/jboss/cache/pojo/notification/annotation          
                        ArrayModified.java Attached.java Detached.java
                        FieldModified.java ListModified.java
                        MapModified.java PojoCacheListener.java
                        SetModified.java TransactionCompleted.java
                        TransactionRegistered.java
  Log:
  Implement new POJO Annotation Notification API
  
  Revision  Changes    Path
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/ArrayModified.java
  
  Index: ArrayModified.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.ArrayModifiedEvent;
  
  // $Id: ArrayModified.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an Array is modified.
   * <b>NOTE: This is event not currently implemented yet</b>
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link ArrayModifiedEvent} or any superclass. Otherwise an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *     @PojoCacheListener
   *    public class MyListener()
   *    {
   *        @ArrayModified
   *       public void handleArray(ArrayModifiedEvent event)
   *       {
   *          System.out.println(&quot;Object = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface ArrayModified
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/Attached.java
  
  Index: Attached.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.AttachedEvent;
  
  // $Id: Attached.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an object is attached
   * to the POJO Cache instance.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link AttachedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheListener
   *    public class MyListener()
   *    {
   *       &#064Attached
   *       public void handleAttached(AttachedEvent event)
   *       {
   *          System.out.println(&quot;Object = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface Attached
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/Detached.java
  
  Index: Detached.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.AttachedEvent;
  
  // $Id: Detached.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an object is detached
   * from the POJO Cache instance.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link DetachedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheListener
   *    public class MyListener()
   *    {
   *       &#064Detached
   *       public void handleDetached(DetachedEvent event)
   *       {
   *          System.out.println(&quot;Object = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface Detached
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/FieldModified.java
  
  Index: FieldModified.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.AttachedEvent;
  import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
  
  // $Id: FieldModified.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when a field on an attached
   * object is modified.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link FieldModifiedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheListener
   *    public class MyListener()
   *    {
   *       &#064FieldModified
   *       public void handleModified(FieldModifiedEvent event)
   *       {
   *          System.out.println(&quot;Object = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface FieldModified
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/ListModified.java
  
  Index: ListModified.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.ListModifiedEvent;
  
  // $Id: ListModified.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an attached list is modified.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link ListModifiedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheListener
   *    public class MyListener()
   *    {
   *       &#064ListModified
   *       public void handleModified(ListModifiedEvent event)
   *       {
   *          System.out.println(&quot;List = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface ListModified
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/MapModified.java
  
  Index: MapModified.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.MapModifiedEvent;
  
  // $Id: MapModified.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an attached map is
   * modified.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link MapModifiedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheMapener
   *    public class MyMapener()
   *    {
   *       &#064MapModified
   *       public void handleModified(MapModifiedEvent event)
   *       {
   *          System.out.println(&quot;Map = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface MapModified
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/PojoCacheListener.java
  
  Index: PojoCacheListener.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.notification.event.AttachedEvent;
  import org.jboss.cache.pojo.notification.event.DetachedEvent;
  import org.jboss.cache.pojo.notification.event.FieldModifiedEvent;
  import org.jboss.cache.pojo.notification.event.ListModifiedEvent;
  import org.jboss.cache.pojo.notification.event.MapModifiedEvent;
  import org.jboss.cache.pojo.notification.event.SetModifiedEvent;
  import org.jboss.cache.pojo.notification.event.TransactionCompletedEvent;
  import org.jboss.cache.pojo.notification.event.TransactionRegisteredEvent;
  
  /**
   * Indicates that a class should receive POJO notification events. The class may
   * have zero or more annotated notification methods. Each method may have any name,
   * but must have a method signature that contains the required event type (or super type).
   *
   * <p>
   * There can be multiple methods that are annotated to receive the same event, and a
   * method may receive multiple events by using a super type.
   *
   * <b>Summary of notification annotations</b>
   * <table border="1" cellpadding="1" cellspacing="1" summary="Summary of notification annotations">
   * <tr>
   * <th bgcolor="#CCCCFF" align="left">Annotation</th>
   * <th bgcolor="#CCCCFF" align="left">Event</th>
   * <th bgcolor="#CCCCFF" align="left">Description</th>
   * </tr>
   * <tr><td valign="top">{@link Attached}</td><td valign="top">{@link AttachedEvent}</td>
   *    <td valign="top">An object was attached.</td></tr>
   * <tr><td valign="top">{@link Detached}</td><td valign="top">{@link DetachedEvent}</td>
   *    <td valign="top">An object was detached.</td></tr>
   * <tr><td valign="top">{@link FieldModified}</td><td valign="top">{@link FieldModifiedEvent}</td>
   *    <td valign="top">An attached object's field was modified.</td></tr>
   * <tr><td valign="top">{@link ListModified}</td><td valign="top">{@link ListModifiedEvent}</td>
   *    <td valign="top">An attached list was modified.</td></tr>
   * <tr><td valign="top">{@link SetModified}</td><td valign="top">{@link SetModifiedEvent}</td>
   *    <td valign="top">An attached set was modified.</td></tr>
   * <tr><td valign="top">{@link MapModified}</td><td valign="top">{@link MapModifiedEvent}</td>
   *    <td valign="top">An attached map was modified.</td></tr>
   * <tr><td valign="top">{@link TransactionRegistered}</td><td valign="top">{@link TransactionRegisteredEvent}</td>
   *    <td valign="top">A transaction was registered.</td></tr>
   * <tr><td valign="top">{@link TransactionCompleted}</td><td valign="top">{@link TransactionCompletedEvent}</td>
   *    <td valign="top">A transaction was completed.</td></tr>
   * </table>
   *
   * @author Jason T. Greene
   * @version $Id: PojoCacheListener.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
   * @since 2.0
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.TYPE)
  public @interface PojoCacheListener
  {
  }
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/SetModified.java
  
  Index: SetModified.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.SetModifiedEvent;
  
  // $Id: SetModified.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when an attached set is
   * modified.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link SetModifiedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheSetener
   *    public class MySetener()
   *    {
   *       &#064SetModified
   *       public void handleModified(SetModifiedEvent event)
   *       {
   *          System.out.println(&quot;Set = &quot; + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface SetModified
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/TransactionCompleted.java
  
  Index: TransactionCompleted.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.TransactionCompletedEvent;
  
  /// $Id: TransactionCompleted.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when a transaction has completed.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link TransactionCompletedEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheSetener
   *    public class MySetener()
   *    {
   *       &#064TransactionCompleted
   *       public void handleModified(TransactionCompletedEvent event)
   *       {
   *          System.out.println("Transaction " + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface TransactionCompleted
  {
  }
  
  
  
  1.1      date: 2007/06/29 04:34:01;  author: jgreene;  state: Exp;JBossCache/src/org/jboss/cache/pojo/notification/annotation/TransactionRegistered.java
  
  Index: TransactionRegistered.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2005, JBoss Inc., and individual contributors as indicated
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
   * the License, or (at your option) any later version.
   *
   * This software is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
   * License along with this software; if not, write to the Free
   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
   */
  package org.jboss.cache.pojo.notification.annotation;
  
  import java.lang.annotation.ElementType;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.lang.annotation.Target;
  
  import org.jboss.cache.pojo.PojoCache;
  import org.jboss.cache.pojo.notification.event.TransactionRegisteredEvent;
  
  /// $Id: TransactionRegistered.java,v 1.1 2007/06/29 04:34:01 jgreene Exp $
  
  /**
   * <p>
   * Indicates that the marked method should be called when a transaction has registered.
   *
   * <p>
   * The method can have any name, but should take a single parameter which is
   * either a {@link TransactionRegisteredEvent} or any superclass. Otherwise, an
   * {@link IllegalArgumentException} will be thrown by
   * {@link PojoCache#addListener(java.lang.Object)}
   *
   * <p>
   * Example:
   *
   * <pre>
   *    &#064PojoCacheSetener
   *    public class MySetener()
   *    {
   *       &#064TransactionCompleted
   *       public void handleModified(TransactionRegisteredEvent event)
   *       {
   *          System.out.println("Transaction " + even.getSource());
   *       }
   *    }
   * </pre>
   *
   * @author Jason T. Greene
   */
  @Retention(RetentionPolicy.RUNTIME)
  @Target(ElementType.METHOD)
  public @interface TransactionRegistered
  {
  }
  
  
  



More information about the jboss-cvs-commits mailing list