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

Ben Wang bwang at jboss.com
Mon Jul 31 01:13:24 EDT 2006


  User: bwang   
  Date: 06/07/31 01:13:24

  Added:       src-50/org/jboss/cache/pojo   InvocationContext.java
                        Option.java
  Log:
  JBCACHE-702 user-specified region to perpend the id namespace.
  
  Revision  Changes    Path
  1.1      date: 2006/07/31 05:13:24;  author: bwang;  state: Exp;JBossCache/src-50/org/jboss/cache/pojo/InvocationContext.java
  
  Index: InvocationContext.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  package org.jboss.cache.pojo;
  
  /**
   * This context holds information specific to a method invocation.
   *
   * @author Ben Wang
   * @version $Id: InvocationContext.java,v 1.1 2006/07/31 05:13:24 bwang Exp $
   */
  public class InvocationContext
  {
     private static ThreadLocal<InvocationContext> container = new ThreadLocal<InvocationContext>();
     private String region_ = null;
  
     /**
      * @return the current invocation context associated with the current thread.
      */
     public static InvocationContext getCurrent()
     {
        InvocationContext i = container.get();
        if (i == null)
        {
           i = new InvocationContext();
           container.set(i);
        }
        return i;
     }
  
     private InvocationContext()
     {
     }
  
     public void setRegion(String region)
     {
        region_ = region;
     }
  
     public String getRegion()
     {
        return region_;
     }
  }
  
  
  
  1.1      date: 2006/07/31 05:13:24;  author: bwang;  state: Exp;JBossCache/src-50/org/jboss/cache/pojo/Option.java
  
  Index: Option.java
  ===================================================================
  /*
   * JBoss, Home of Professional Open Source
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   */
  
  package org.jboss.cache.pojo;
  
  /** Option class to hold configuration for PojoCache APIs.
   *
   * @author Ben Wang
   * @version $Id: Option.java,v 1.1 2006/07/31 05:13:24 bwang Exp $
   */
  public class Option
  {
     private String region_ = null;
  
     /** Set the region namespace for PojoCache IDs. When this is not null, the ID will be denoted
      * with this region name. E.g., it will be something like "region/ID". Furthermore, the
      * internal storage region will have this concept of region. 
      *
      */
     public void setRegion(String region)
     {
        region_ = region;
     }
  
     public String getRegion()
     {
        return region_;
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list