[jboss-cvs] JBossCache/src/org/jboss/cache/loader ...

Manik Surtani msurtani at jboss.com
Tue Jan 2 12:15:29 EST 2007


  User: msurtani
  Date: 07/01/02 12:15:29

  Modified:    src/org/jboss/cache/loader  CacheLoader.java
  Log:
  some api changes
  
  Revision  Changes    Path
  1.14      +19 -32    JBossCache/src/org/jboss/cache/loader/CacheLoader.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CacheLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/loader/CacheLoader.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- CacheLoader.java	30 Dec 2006 19:48:44 -0000	1.13
  +++ CacheLoader.java	2 Jan 2007 17:15:29 -0000	1.14
  @@ -34,6 +34,7 @@
    *
    * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
    * @see CacheSPI
  + * @see org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig
    * @since 2.0.0
    */
   
  @@ -42,11 +43,11 @@
      /**
       * Sets the configuration.  This is called before {@link #create()} and {@link #start()}.
       *
  -    * @param config May be an instance of the IndividualCacheLoaderConfig base
  +    * @param config May be an instance of the {@link org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig} base
       *               class, in which case the cache loader should use the
  -    *               {@link IndividualCacheLoaderConfig#getProperties() getProperties()}
  +    *               {@link org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig#getProperties()}
       *               method to find configuration information. Alternatively,
  -    *               may be a type-specific subclass of IndividualCacheLoaderConfig,
  +    *               may be a type-specific subclass of {@link org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig},
       *               if there is one.
       */
      void setConfig(IndividualCacheLoaderConfig config);
  @@ -54,15 +55,14 @@
      /**
       * Gets the configuration.
       *
  -    * @return the configuration
  +    * @return the configuration, represented by a {@link org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig} object.
       */
      IndividualCacheLoaderConfig getConfig();
   
      /**
       * Sets the {@link CacheSPI} that is maintaining this CacheLoader.
  -    * This method allows this CacheLoader to invoke methods on cache,
  -    * including fetching additional configuration information.  This method is
  -    * called be called after the CacheLoader instance has been constructed.
  +    * This method allows this CacheLoader to set a reference to the {@link CacheSPI}.
  +    * This method is called be called after the CacheLoader instance has been constructed.
       *
       * @param c The cache on which this loader works
       */
  @@ -83,13 +83,9 @@
      Set<String> getChildrenNames(Fqn fqn) throws Exception;
   
      /**
  -    * Returns all keys and values from the persistent store, given a fully qualified name.
  -    * <p/>
  -    * NOTE that the expected return value of this method has changed from JBossCache 1.2.x
  -    * and before!  This will affect cache loaders written prior to JBossCache 1.3.0 and such
  -    * implementations should be checked for compliance with the behaviour expected.
  +    * Returns all keys and values from the persistent store, given a {@link org.jboss.cache.Fqn}
       *
  -    * @param name
  +    * @param name the {@link Fqn} to search for.
       * @return Map<Object,Object> keys and values for the given node. Returns
       *         null if the node is not found.  If the node is found but has no
       *         attributes, this method returns an empty Map.
  @@ -140,7 +136,7 @@
      Object remove(Fqn fqn, Object key) throws Exception;
   
      /**
  -    * Removes the given node and all its subnodes.
  +    * Removes the given node and all its subnodes, does nothing if the node does not exist.
       *
       * @param fqn the {@link Fqn} of the node
       */
  @@ -161,12 +157,13 @@
       * <ol>
       * <li>Create a local (JDBC) transaction
       * <li>Associate the local transaction with <code>tx</code> (tx is the key)
  -    * <li>Execute the coresponding SQL statements against the DB (statements derived from modifications)
  +    * <li>Execute the corresponding SQL statements against the DB (statements derived from modifications)
       * </ol>
  -    * For non-transactional CacheLoader (e.g. file-based), this could be a null operation.
  +    * For non-transactional CacheLoader (e.g. file-based), the implementation could attempt to implement it's own transactional
  +    * logic, attempting to write data to a temp location (or memory) and writing it to the proper location upon commit.
       *
  -    * @param tx            The transaction, just used as a hashmap key
  -    * @param modifications List<Modification>, a list of all modifications within the given transaction
  +    * @param tx            The transaction, indended to be used by implementations as an identifier of the transaction (and not necessarily a JTA {@link javax.transaction.Transaction} object)
  +    * @param modifications A {@link List} containing {@link  org.jboss.cache.Modification}s, for the given transaction
       * @param one_phase     Persist immediately and (for example) commit the local JDBC transaction as well. When true,
       *                      we won't get a {@link #commit(Object)} or {@link #rollback(Object)} method call later
       * @throws Exception
  @@ -178,8 +175,9 @@
       * JDBC transaction asociated with <code>tx</code> and commit that
       * transaction.  Non-transactional CacheLoaders could simply write the data
       * that was previously saved transiently under the given <code>tx</code>
  -    * key, to (for example) a file system (note this only holds if the previous
  -    * prepare() did not define one_phase=true
  +    * key, to (for example) a file system.
  +    * <p/>
  +    * <b>Note</b> this only holds if the previous prepare() did not define <pre>one_phase=true</pre>
       *
       * @param tx transaction to commit
       */
  @@ -201,13 +199,11 @@
       * When the state gets transferred to the new cache instance its cacheloader calls
       * {@link #storeEntireState(ObjectInputStream)}
       * <p/>
  -    * <p/>
       * Implementations of this method should not catch any exception or close the
       * given ObjectOutputStream parameter. In order to ensure cacheloader interoperability
       * contents of the cache are written to the ObjectOutputStream as a sequence of
       * NodeData objects.
       * <p/>
  -    * <p/>
       * Default implementation is provided by {@link AbstractCacheLoader} and ensures cacheloader
       * interoperability. Implementors are encouraged to consider extending AbstractCacheLoader
       * prior to implementing completely custom cacheloader.
  @@ -228,7 +224,6 @@
       * contents of the cache are read from the ObjectInputStream as a sequence of
       * NodeData objects.
       * <p/>
  -    * <p/>
       * Default implementation is provided by {@link AbstractCacheLoader} and ensures cacheloader
       * interoperability. Implementors are encouraged to consider extending AbstractCacheLoader
       * prior to implementing completely custom cacheloader.
  @@ -246,13 +241,11 @@
       * When the state gets transferred to the new cache instance its cacheloader calls
       * {@link #storeState(Fqn,ObjectInputStream)}.
       * <p/>
  -    * <p/>
       * Implementations of this method should not catch any exception or close the
       * given ObjectOutputStream parameter. In order to ensure cacheloader interoperability
       * contents of the cache are written to the ObjectOutputStream as a sequence of
       * NodeData objects.
       * <p/>
  -    * <p/>
       * Default implementation is provided by {@link AbstractCacheLoader} and ensures cacheloader
       * interoperability. Implementors are encouraged to consider extending AbstractCacheLoader
       * prior to implementing completely custom cacheloader.
  @@ -276,22 +269,16 @@
       * backup region for
       * a buddy group; e.g.
       * <p/>
  -    * <p/>
       * If the the transferred state had Fqns starting with "/a" and
       * <code>subtree</code> was "/_BUDDY_BACKUP_/192.168.1.2:5555" then the
       * state should be stored in the local persistent store under
       * "/_BUDDY_BACKUP_/192.168.1.2:5555/a"
  -    * </p>
  -    * <p/>
  -    * <p/>
       * <p/>
       * Implementations of this method should not catch any exception or close the
       * given ObjectInputStream parameter. In order to ensure cacheloader interoperability
       * contents of the cache are read from the ObjectInputStream as a sequence of
       * NodeData objects.
       * <p/>
  -    * <p/>
  -    * <p/>
       * Default implementation is provided by {@link AbstractCacheLoader} and ensures cacheloader
       * interoperability. Implementors are encouraged to consider extending AbstractCacheLoader
       * prior to implementing completely custom cacheloader.
  @@ -314,7 +301,7 @@
       * classloaders.
       * <p/>
       * <strong>NOTE:</strong> This method is only intended to be used
  -    * by the <code>CacheImpl</code> instance this cache loader is
  +    * by the <code>CacheSPI</code> instance this cache loader is
       * associated with.
       * </p>
       *
  
  
  



More information about the jboss-cvs-commits mailing list