001    package com.sptci.prevayler.transaction;
002    
003    import com.sptci.prevayler.PrevalentObject;
004    
005    /**
006     * A transaction for adding a new prevalent object instance to the prevalent
007     * system.  This transaction merely makes it more convenient to add a new
008     * prevalent object than directly invoking {@link Transaction}.
009     *
010     * <p>&copy; Copyright 2008 <a href='http://sptci.com/' target='_top'>Sans Pareil
011     *   Technologies, Inc.</a></p>
012     * @author Rakesh Vidyadharan 2008-05-24
013     * @version $Id: Save.java 15 2008-07-12 13:39:16Z sptrakesh $
014     */
015    public class Save<P extends PrevalentObject> extends Transaction<P>
016    {
017      private static final long serialVersionUID = 1L;
018    
019      /**
020       * The name of the method in {@link com.sptci.prevayler.PrevalentSystem}
021       * that is invoked in this transaction.
022       */
023      private static final String METHOD = "save";
024    
025      /**
026       * Create a new instance of the transaction using the specified prevalent
027       * object.
028       *
029       * @param object The new prevalent object to add to the system.
030       */
031      public Save( final P object )
032      {
033        super( METHOD, new Parameter( PrevalentObject.class, object ) );
034      }
035    }