geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/metadata TransactionDemarcation.java
Date Sat, 01 Nov 2003 16:25:11 GMT
jboynes     2003/11/01 08:25:11

  Modified:    modules/core/src/java/org/apache/geronimo/ejb/metadata
                        TransactionDemarcation.java
  Log:
  Provide factory for creating from value in DD
  
  Revision  Changes    Path
  1.3       +13 -3     incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/metadata/TransactionDemarcation.java
  
  Index: TransactionDemarcation.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/ejb/metadata/TransactionDemarcation.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransactionDemarcation.java	11 Aug 2003 17:59:12 -0000	1.2
  +++ TransactionDemarcation.java	1 Nov 2003 16:25:11 -0000	1.3
  @@ -62,8 +62,8 @@
    * @version $Revision$ $Date$
    */
   public final class TransactionDemarcation {
  -    public static final TransactionDemarcation CONTAINER = new TransactionDemarcation("Container
Managed Transctions");
  -    public static final TransactionDemarcation BEAN = new TransactionDemarcation("Bean
Managed Transactions");
  +    public static final TransactionDemarcation CONTAINER = new TransactionDemarcation("Container");
  +    public static final TransactionDemarcation BEAN = new TransactionDemarcation("Bean");
   
       private final String name;
   
  @@ -81,6 +81,16 @@
   
       public String toString() {
           return name;
  +    }
  +
  +    public static TransactionDemarcation valueOf(String demarcation) {
  +        if (CONTAINER.name.equals(demarcation)) {
  +            return CONTAINER;
  +        } else if (BEAN.name.equals(demarcation)) {
  +            return BEAN;
  +        } else {
  +            throw new IllegalArgumentException("Invalid demarcation type: "+demarcation);
  +        }
       }
   
   }
  
  
  

Mime
View raw message