You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2012/08/28 02:41:37 UTC

svn commit: r1377926 - in /openejb/trunk/openejb/container/openejb-core/src: main/java/org/apache/openejb/config/typed/ main/java/org/apache/openejb/config/typed/util/ test/java/org/apache/openejb/config/typed/util/

Author: dblevins
Date: Tue Aug 28 00:41:36 2012
New Revision: 1377926

URL: http://svn.apache.org/viewvc?rev=1377926&view=rev
Log:
TOMEE-405 Strongly typed API for configuration
Improved JAXB usage

Added:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/DurationAdapter.java
Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ActiveMQResourceAdapterBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/BmpEntityContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/CmpEntityContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/DataSourceBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/InitialContextBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JavaMailSessionBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JmsConnectionFactoryBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ManagedContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/MessageDrivenContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ORBBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ProxyFactoryBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/QueueBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SecurityServiceBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SingletonContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatefulContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatelessContainerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TopicBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TransactionManagerBuilder.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ProviderGenerator.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ServerContext.java
    openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ActiveMQResourceAdapterBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ActiveMQResourceAdapterBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ActiveMQResourceAdapterBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ActiveMQResourceAdapterBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,21 +16,26 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
 import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "ActiveMQResourceAdapter")
 public class ActiveMQResourceAdapterBuilder extends Resource {
 
+    @XmlAttribute
     private String brokerXmlConfig = "broker:(tcp://localhost:61616)?useJmx=false";
+    @XmlAttribute
     private java.net.URI serverUrl = java.net.URI.create("vm://localhost?waitForStart=20000&async=true");
+    @XmlAttribute
     private String dataSource = "Default Unmanaged JDBC Database";
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration startupTimeout = org.apache.openejb.util.Duration.parse("10000");
 
     public ActiveMQResourceAdapterBuilder() {
@@ -54,7 +59,6 @@ public class ActiveMQResourceAdapterBuil
         this.brokerXmlConfig = brokerXmlConfig;
     }
 
-    @XmlAttribute
     public String getBrokerXmlConfig() {
         return brokerXmlConfig;
     }
@@ -68,7 +72,6 @@ public class ActiveMQResourceAdapterBuil
         this.serverUrl = serverUrl;
     }
 
-    @XmlAttribute
     public java.net.URI getServerUrl() {
         return serverUrl;
     }
@@ -82,7 +85,6 @@ public class ActiveMQResourceAdapterBuil
         this.dataSource = dataSource;
     }
 
-    @XmlAttribute
     public String getDataSource() {
         return dataSource;
     }
@@ -96,7 +98,6 @@ public class ActiveMQResourceAdapterBuil
         this.startupTimeout = startupTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getStartupTimeout() {
         return startupTimeout;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/BmpEntityContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/BmpEntityContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/BmpEntityContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/BmpEntityContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,16 +16,19 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "BmpEntityContainer")
 public class BmpEntityContainerBuilder extends Container {
 
+    @XmlAttribute
     private int poolSize = 10;
 
     public BmpEntityContainerBuilder() {
@@ -33,7 +36,7 @@ public class BmpEntityContainerBuilder e
         setType("BMP_ENTITY");
         setId("BmpEntityContainer");
 
-        setConstructor("id, securityService, PoolSize");
+        setConstructor("id, securityService, poolSize");
 
     }
 
@@ -51,7 +54,6 @@ public class BmpEntityContainerBuilder e
         this.poolSize = poolSize;
     }
 
-    @XmlAttribute
     public int getPoolSize() {
         return poolSize;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/CmpEntityContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/CmpEntityContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/CmpEntityContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/CmpEntityContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,16 +16,19 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "CmpEntityContainer")
 public class CmpEntityContainerBuilder extends Container {
 
+    @XmlAttribute
     private String cmpEngineFactory = "org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory";
 
     public CmpEntityContainerBuilder() {
@@ -33,7 +36,7 @@ public class CmpEntityContainerBuilder e
         setType("CMP_ENTITY");
         setId("CmpEntityContainer");
 
-        setConstructor("id, transactionManager, securityService, CmpEngineFactory");
+        setConstructor("id, transactionManager, securityService, cmpEngineFactory");
 
     }
 
@@ -51,7 +54,6 @@ public class CmpEntityContainerBuilder e
         this.cmpEngineFactory = cmpEngineFactory;
     }
 
-    @XmlAttribute
     public String getCmpEngineFactory() {
         return cmpEngineFactory;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/DataSourceBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/DataSourceBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/DataSourceBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,43 +16,71 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "DataSource")
 public class DataSourceBuilder extends Resource {
 
+    @XmlAttribute
     private String serviceId = null;
+    @XmlAttribute
     private String definition = null;
+    @XmlAttribute
     private boolean jtaManaged = true;
+    @XmlAttribute
     private String jdbcDriver = "org.hsqldb.jdbcDriver";
+    @XmlAttribute
     private java.net.URI jdbcUrl = java.net.URI.create("jdbc:hsqldb:mem:hsqldb");
+    @XmlAttribute
     private String userName = "sa";
+    @XmlAttribute
     private String password = null;
+    @XmlAttribute
     private String passwordCipher = "PlainText";
+    @XmlAttribute
     private String connectionProperties = null;
+    @XmlAttribute
     private boolean defaultAutoCommit = true;
+    @XmlAttribute
     private String defaultReadOnly = null;
+    @XmlAttribute
     private int initialSize = 0;
+    @XmlAttribute
     private int maxActive = 20;
+    @XmlAttribute
     private int maxIdle = 20;
+    @XmlAttribute
     private int minIdle = 0;
+    @XmlAttribute
     private int maxWait = -1;
+    @XmlAttribute
     private String validationQuery = null;
+    @XmlAttribute
     private boolean testOnBorrow = true;
+    @XmlAttribute
     private boolean testOnReturn = false;
+    @XmlAttribute
     private boolean testWhileIdle = false;
+    @XmlAttribute
     private long timeBetweenEvictionRunsMillis = -1;
+    @XmlAttribute
     private int numTestsPerEvictionRun = 3;
+    @XmlAttribute
     private long minEvictableIdleTimeMillis = 1800000;
+    @XmlAttribute
     private boolean poolPreparedStatements = false;
+    @XmlAttribute
     private int maxOpenPreparedStatements = 0;
+    @XmlAttribute
     private boolean accessToUnderlyingConnectionAllowed = false;
+    @XmlAttribute
     private boolean ignoreDefaultValues = false;
 
     public DataSourceBuilder() {
@@ -80,7 +108,6 @@ public class DataSourceBuilder extends R
         this.serviceId = serviceId;
     }
 
-    @XmlAttribute
     public String getServiceId() {
         return serviceId;
     }
@@ -94,7 +121,6 @@ public class DataSourceBuilder extends R
         this.definition = definition;
     }
 
-    @XmlAttribute
     public String getDefinition() {
         return definition;
     }
@@ -108,7 +134,6 @@ public class DataSourceBuilder extends R
         this.jtaManaged = jtaManaged;
     }
 
-    @XmlAttribute
     public boolean getJtaManaged() {
         return jtaManaged;
     }
@@ -122,7 +147,6 @@ public class DataSourceBuilder extends R
         this.jdbcDriver = jdbcDriver;
     }
 
-    @XmlAttribute
     public String getJdbcDriver() {
         return jdbcDriver;
     }
@@ -136,7 +160,6 @@ public class DataSourceBuilder extends R
         this.jdbcUrl = jdbcUrl;
     }
 
-    @XmlAttribute
     public java.net.URI getJdbcUrl() {
         return jdbcUrl;
     }
@@ -150,7 +173,6 @@ public class DataSourceBuilder extends R
         this.userName = userName;
     }
 
-    @XmlAttribute
     public String getUserName() {
         return userName;
     }
@@ -164,7 +186,6 @@ public class DataSourceBuilder extends R
         this.password = password;
     }
 
-    @XmlAttribute
     public String getPassword() {
         return password;
     }
@@ -178,7 +199,6 @@ public class DataSourceBuilder extends R
         this.passwordCipher = passwordCipher;
     }
 
-    @XmlAttribute
     public String getPasswordCipher() {
         return passwordCipher;
     }
@@ -192,7 +212,6 @@ public class DataSourceBuilder extends R
         this.connectionProperties = connectionProperties;
     }
 
-    @XmlAttribute
     public String getConnectionProperties() {
         return connectionProperties;
     }
@@ -206,7 +225,6 @@ public class DataSourceBuilder extends R
         this.defaultAutoCommit = defaultAutoCommit;
     }
 
-    @XmlAttribute
     public boolean getDefaultAutoCommit() {
         return defaultAutoCommit;
     }
@@ -220,7 +238,6 @@ public class DataSourceBuilder extends R
         this.defaultReadOnly = defaultReadOnly;
     }
 
-    @XmlAttribute
     public String getDefaultReadOnly() {
         return defaultReadOnly;
     }
@@ -234,7 +251,6 @@ public class DataSourceBuilder extends R
         this.initialSize = initialSize;
     }
 
-    @XmlAttribute
     public int getInitialSize() {
         return initialSize;
     }
@@ -248,7 +264,6 @@ public class DataSourceBuilder extends R
         this.maxActive = maxActive;
     }
 
-    @XmlAttribute
     public int getMaxActive() {
         return maxActive;
     }
@@ -262,7 +277,6 @@ public class DataSourceBuilder extends R
         this.maxIdle = maxIdle;
     }
 
-    @XmlAttribute
     public int getMaxIdle() {
         return maxIdle;
     }
@@ -276,7 +290,6 @@ public class DataSourceBuilder extends R
         this.minIdle = minIdle;
     }
 
-    @XmlAttribute
     public int getMinIdle() {
         return minIdle;
     }
@@ -290,7 +303,6 @@ public class DataSourceBuilder extends R
         this.maxWait = maxWait;
     }
 
-    @XmlAttribute
     public int getMaxWait() {
         return maxWait;
     }
@@ -304,7 +316,6 @@ public class DataSourceBuilder extends R
         this.validationQuery = validationQuery;
     }
 
-    @XmlAttribute
     public String getValidationQuery() {
         return validationQuery;
     }
@@ -318,7 +329,6 @@ public class DataSourceBuilder extends R
         this.testOnBorrow = testOnBorrow;
     }
 
-    @XmlAttribute
     public boolean getTestOnBorrow() {
         return testOnBorrow;
     }
@@ -332,7 +342,6 @@ public class DataSourceBuilder extends R
         this.testOnReturn = testOnReturn;
     }
 
-    @XmlAttribute
     public boolean getTestOnReturn() {
         return testOnReturn;
     }
@@ -346,7 +355,6 @@ public class DataSourceBuilder extends R
         this.testWhileIdle = testWhileIdle;
     }
 
-    @XmlAttribute
     public boolean getTestWhileIdle() {
         return testWhileIdle;
     }
@@ -360,7 +368,6 @@ public class DataSourceBuilder extends R
         this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
     }
 
-    @XmlAttribute
     public long getTimeBetweenEvictionRunsMillis() {
         return timeBetweenEvictionRunsMillis;
     }
@@ -382,7 +389,6 @@ public class DataSourceBuilder extends R
         this.numTestsPerEvictionRun = numTestsPerEvictionRun;
     }
 
-    @XmlAttribute
     public int getNumTestsPerEvictionRun() {
         return numTestsPerEvictionRun;
     }
@@ -396,7 +402,6 @@ public class DataSourceBuilder extends R
         this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
     }
 
-    @XmlAttribute
     public long getMinEvictableIdleTimeMillis() {
         return minEvictableIdleTimeMillis;
     }
@@ -418,7 +423,6 @@ public class DataSourceBuilder extends R
         this.poolPreparedStatements = poolPreparedStatements;
     }
 
-    @XmlAttribute
     public boolean getPoolPreparedStatements() {
         return poolPreparedStatements;
     }
@@ -432,7 +436,6 @@ public class DataSourceBuilder extends R
         this.maxOpenPreparedStatements = maxOpenPreparedStatements;
     }
 
-    @XmlAttribute
     public int getMaxOpenPreparedStatements() {
         return maxOpenPreparedStatements;
     }
@@ -446,7 +449,6 @@ public class DataSourceBuilder extends R
         this.accessToUnderlyingConnectionAllowed = accessToUnderlyingConnectionAllowed;
     }
 
-    @XmlAttribute
     public boolean getAccessToUnderlyingConnectionAllowed() {
         return accessToUnderlyingConnectionAllowed;
     }
@@ -460,7 +462,6 @@ public class DataSourceBuilder extends R
         this.ignoreDefaultValues = ignoreDefaultValues;
     }
 
-    @XmlAttribute
     public boolean getIgnoreDefaultValues() {
         return ignoreDefaultValues;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/InitialContextBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/InitialContextBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/InitialContextBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/InitialContextBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.JndiProvider;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "InitialContext")
 public class InitialContextBuilder extends JndiProvider {
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JavaMailSessionBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JavaMailSessionBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JavaMailSessionBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JavaMailSessionBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "JavaMailSession")
 public class JavaMailSessionBuilder extends Resource {
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JmsConnectionFactoryBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JmsConnectionFactoryBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JmsConnectionFactoryBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/JmsConnectionFactoryBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,21 +16,29 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "JmsConnectionFactory")
 public class JmsConnectionFactoryBuilder extends Resource {
 
+    @XmlAttribute
     private String resourceAdapter = "Default JMS Resource Adapter";
+    @XmlAttribute
     private String transactionSupport = "xa";
+    @XmlAttribute
     private int poolMaxSize = 10;
+    @XmlAttribute
     private int poolMinSize = 0;
+    @XmlAttribute
     private int connectionMaxWaitMilliseconds = 5000;
+    @XmlAttribute
     private int connectionMaxIdleMinutes = 15;
 
     public JmsConnectionFactoryBuilder() {
@@ -54,7 +62,6 @@ public class JmsConnectionFactoryBuilder
         this.resourceAdapter = resourceAdapter;
     }
 
-    @XmlAttribute
     public String getResourceAdapter() {
         return resourceAdapter;
     }
@@ -68,7 +75,6 @@ public class JmsConnectionFactoryBuilder
         this.transactionSupport = transactionSupport;
     }
 
-    @XmlAttribute
     public String getTransactionSupport() {
         return transactionSupport;
     }
@@ -82,7 +88,6 @@ public class JmsConnectionFactoryBuilder
         this.poolMaxSize = poolMaxSize;
     }
 
-    @XmlAttribute
     public int getPoolMaxSize() {
         return poolMaxSize;
     }
@@ -96,7 +101,6 @@ public class JmsConnectionFactoryBuilder
         this.poolMinSize = poolMinSize;
     }
 
-    @XmlAttribute
     public int getPoolMinSize() {
         return poolMinSize;
     }
@@ -110,7 +114,6 @@ public class JmsConnectionFactoryBuilder
         this.connectionMaxWaitMilliseconds = connectionMaxWaitMilliseconds;
     }
 
-    @XmlAttribute
     public int getConnectionMaxWaitMilliseconds() {
         return connectionMaxWaitMilliseconds;
     }
@@ -124,7 +127,6 @@ public class JmsConnectionFactoryBuilder
         this.connectionMaxIdleMinutes = connectionMaxIdleMinutes;
     }
 
-    @XmlAttribute
     public int getConnectionMaxIdleMinutes() {
         return connectionMaxIdleMinutes;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ManagedContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ManagedContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ManagedContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ManagedContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "ManagedContainer")
 public class ManagedContainerBuilder extends Container {
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/MessageDrivenContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/MessageDrivenContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/MessageDrivenContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/MessageDrivenContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,19 +16,25 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "MessageDrivenContainer")
 public class MessageDrivenContainerBuilder extends Container {
 
+    @XmlAttribute
     private String resourceAdapter = "Default JMS Resource Adapter";
+    @XmlAttribute
     private String messageListenerInterface = "javax.jms.MessageListener";
+    @XmlAttribute
     private String activationSpecClass = "org.apache.activemq.ra.ActiveMQActivationSpec";
+    @XmlAttribute
     private int instanceLimit = 10;
 
     public MessageDrivenContainerBuilder() {
@@ -36,7 +42,7 @@ public class MessageDrivenContainerBuild
         setType("MESSAGE");
         setId("MessageDrivenContainer");
 
-        setConstructor("id, securityService, ResourceAdapter, MessageListenerInterface, ActivationSpecClass, InstanceLimit");
+        setConstructor("id, securityService, resourceAdapter, messageListenerInterface, activationSpecClass, instanceLimit");
 
     }
 
@@ -54,7 +60,6 @@ public class MessageDrivenContainerBuild
         this.resourceAdapter = resourceAdapter;
     }
 
-    @XmlAttribute
     public String getResourceAdapter() {
         return resourceAdapter;
     }
@@ -68,7 +73,6 @@ public class MessageDrivenContainerBuild
         this.messageListenerInterface = messageListenerInterface;
     }
 
-    @XmlAttribute
     public String getMessageListenerInterface() {
         return messageListenerInterface;
     }
@@ -82,7 +86,6 @@ public class MessageDrivenContainerBuild
         this.activationSpecClass = activationSpecClass;
     }
 
-    @XmlAttribute
     public String getActivationSpecClass() {
         return activationSpecClass;
     }
@@ -96,7 +99,6 @@ public class MessageDrivenContainerBuild
         this.instanceLimit = instanceLimit;
     }
 
-    @XmlAttribute
     public int getInstanceLimit() {
         return instanceLimit;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ORBBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ORBBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ORBBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ORBBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "ORB")
 public class ORBBuilder extends Resource {
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ProxyFactoryBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ProxyFactoryBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ProxyFactoryBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/ProxyFactoryBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.ProxyFactory;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "ProxyFactory")
 public class ProxyFactoryBuilder extends ProxyFactory {
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/QueueBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/QueueBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/QueueBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/QueueBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,16 +16,19 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "Queue")
 public class QueueBuilder extends Resource {
 
+    @XmlAttribute
     private String destination = null;
 
     public QueueBuilder() {
@@ -51,7 +54,6 @@ public class QueueBuilder extends Resour
         this.destination = destination;
     }
 
-    @XmlAttribute
     public String getDestination() {
         return destination;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SecurityServiceBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SecurityServiceBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SecurityServiceBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SecurityServiceBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,16 +16,19 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.SecurityService;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "SecurityService")
 public class SecurityServiceBuilder extends SecurityService {
 
+    @XmlAttribute
     private String defaultUser = "guest         ";
 
     public SecurityServiceBuilder() {
@@ -49,7 +52,6 @@ public class SecurityServiceBuilder exte
         this.defaultUser = defaultUser;
     }
 
-    @XmlAttribute
     public String getDefaultUser() {
         return defaultUser;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SingletonContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SingletonContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SingletonContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/SingletonContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,18 +16,20 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
 import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "SingletonContainer")
 public class SingletonContainerBuilder extends Container {
 
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration accessTimeout = org.apache.openejb.util.Duration.parse("30 seconds");
 
     public SingletonContainerBuilder() {
@@ -53,7 +55,6 @@ public class SingletonContainerBuilder e
         this.accessTimeout = accessTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getAccessTimeout() {
         return accessTimeout;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatefulContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatefulContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatefulContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatefulContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,24 +16,33 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
 import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "StatefulContainer")
 public class StatefulContainerBuilder extends Container {
 
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration accessTimeout = org.apache.openejb.util.Duration.parse("30 seconds");
+    @XmlAttribute
     private String cache = "org.apache.openejb.core.stateful.SimpleCache";
+    @XmlAttribute
     private String passivator = "org.apache.openejb.core.stateful.SimplePassivater";
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration timeOut = org.apache.openejb.util.Duration.parse("20");
+    @XmlAttribute
     private int frequency = 60;
+    @XmlAttribute
     private int capacity = 1000;
+    @XmlAttribute
     private int bulkPassivate = 100;
 
     public StatefulContainerBuilder() {
@@ -59,7 +68,6 @@ public class StatefulContainerBuilder ex
         this.accessTimeout = accessTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getAccessTimeout() {
         return accessTimeout;
     }
@@ -81,7 +89,6 @@ public class StatefulContainerBuilder ex
         this.cache = cache;
     }
 
-    @XmlAttribute
     public String getCache() {
         return cache;
     }
@@ -95,7 +102,6 @@ public class StatefulContainerBuilder ex
         this.passivator = passivator;
     }
 
-    @XmlAttribute
     public String getPassivator() {
         return passivator;
     }
@@ -109,7 +115,6 @@ public class StatefulContainerBuilder ex
         this.timeOut = timeOut;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getTimeOut() {
         return timeOut;
     }
@@ -131,7 +136,6 @@ public class StatefulContainerBuilder ex
         this.frequency = frequency;
     }
 
-    @XmlAttribute
     public int getFrequency() {
         return frequency;
     }
@@ -145,7 +149,6 @@ public class StatefulContainerBuilder ex
         this.capacity = capacity;
     }
 
-    @XmlAttribute
     public int getCapacity() {
         return capacity;
     }
@@ -159,7 +162,6 @@ public class StatefulContainerBuilder ex
         this.bulkPassivate = bulkPassivate;
     }
 
-    @XmlAttribute
     public int getBulkPassivate() {
         return bulkPassivate;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatelessContainerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatelessContainerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatelessContainerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/StatelessContainerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,30 +16,48 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.typed.util.Builders;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
 import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "StatelessContainer")
 public class StatelessContainerBuilder extends Container {
 
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration accessTimeout = org.apache.openejb.util.Duration.parse("30 seconds");
+    @XmlAttribute
     private int maxSize = 10;
+    @XmlAttribute
     private int minSize = 0;
+    @XmlAttribute
     private boolean strictPooling = true;
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration maxAge = org.apache.openejb.util.Duration.parse("0 hours");
+    @XmlAttribute
     private boolean replaceAged = true;
+    @XmlAttribute
     private boolean replaceFlushed = false;
+    @XmlAttribute
     private int maxAgeOffset = -1;
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration idleTimeout = org.apache.openejb.util.Duration.parse("0 minutes");
+    @XmlAttribute
     private boolean garbageCollection = false;
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration sweepInterval = org.apache.openejb.util.Duration.parse("5 minutes");
+    @XmlAttribute
     private int callbackThreads = 5;
+    @XmlJavaTypeAdapter(DurationAdapter.class)
+    @XmlAttribute
     private org.apache.openejb.util.Duration closeTimeout = org.apache.openejb.util.Duration.parse("5 minutes");
 
     public StatelessContainerBuilder() {
@@ -65,7 +83,6 @@ public class StatelessContainerBuilder e
         this.accessTimeout = accessTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getAccessTimeout() {
         return accessTimeout;
     }
@@ -87,7 +104,6 @@ public class StatelessContainerBuilder e
         this.maxSize = maxSize;
     }
 
-    @XmlAttribute
     public int getMaxSize() {
         return maxSize;
     }
@@ -101,7 +117,6 @@ public class StatelessContainerBuilder e
         this.minSize = minSize;
     }
 
-    @XmlAttribute
     public int getMinSize() {
         return minSize;
     }
@@ -115,7 +130,6 @@ public class StatelessContainerBuilder e
         this.strictPooling = strictPooling;
     }
 
-    @XmlAttribute
     public boolean getStrictPooling() {
         return strictPooling;
     }
@@ -129,7 +143,6 @@ public class StatelessContainerBuilder e
         this.maxAge = maxAge;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getMaxAge() {
         return maxAge;
     }
@@ -151,7 +164,6 @@ public class StatelessContainerBuilder e
         this.replaceAged = replaceAged;
     }
 
-    @XmlAttribute
     public boolean getReplaceAged() {
         return replaceAged;
     }
@@ -165,7 +177,6 @@ public class StatelessContainerBuilder e
         this.replaceFlushed = replaceFlushed;
     }
 
-    @XmlAttribute
     public boolean getReplaceFlushed() {
         return replaceFlushed;
     }
@@ -179,7 +190,6 @@ public class StatelessContainerBuilder e
         this.maxAgeOffset = maxAgeOffset;
     }
 
-    @XmlAttribute
     public int getMaxAgeOffset() {
         return maxAgeOffset;
     }
@@ -193,7 +203,6 @@ public class StatelessContainerBuilder e
         this.idleTimeout = idleTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getIdleTimeout() {
         return idleTimeout;
     }
@@ -215,7 +224,6 @@ public class StatelessContainerBuilder e
         this.garbageCollection = garbageCollection;
     }
 
-    @XmlAttribute
     public boolean getGarbageCollection() {
         return garbageCollection;
     }
@@ -229,7 +237,6 @@ public class StatelessContainerBuilder e
         this.sweepInterval = sweepInterval;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getSweepInterval() {
         return sweepInterval;
     }
@@ -251,7 +258,6 @@ public class StatelessContainerBuilder e
         this.callbackThreads = callbackThreads;
     }
 
-    @XmlAttribute
     public int getCallbackThreads() {
         return callbackThreads;
     }
@@ -265,7 +271,6 @@ public class StatelessContainerBuilder e
         this.closeTimeout = closeTimeout;
     }
 
-    @XmlAttribute
     public org.apache.openejb.util.Duration getCloseTimeout() {
         return closeTimeout;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TopicBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TopicBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TopicBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TopicBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,16 +16,19 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.Resource;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "Topic")
 public class TopicBuilder extends Resource {
 
+    @XmlAttribute
     private String destination = null;
 
     public TopicBuilder() {
@@ -51,7 +54,6 @@ public class TopicBuilder extends Resour
         this.destination = destination;
     }
 
-    @XmlAttribute
     public String getDestination() {
         return destination;
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TransactionManagerBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TransactionManagerBuilder.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TransactionManagerBuilder.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/TransactionManagerBuilder.java Tue Aug 28 00:41:36 2012
@@ -16,30 +16,45 @@
  */
 package org.apache.openejb.config.typed;
 
-import org.apache.openejb.config.sys.TransactionManager;
-import org.apache.openejb.config.typed.util.Builders;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
+import org.apache.openejb.config.typed.util.*;
+import org.apache.openejb.config.sys.*;
+import javax.xml.bind.annotation.*;
+import org.apache.openejb.util.Duration;
+import java.util.*;
+import java.util.concurrent.*;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
+@XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "TransactionManager")
 public class TransactionManagerBuilder extends TransactionManager {
 
+    @XmlAttribute
     private long defaultTransactionTimeoutSeconds = 600;
+    @XmlAttribute
     private boolean txRecovery = false;
+    @XmlAttribute
     private int bufferSizeKb = 32;
+    @XmlAttribute
     private boolean checksumEnabled = true;
+    @XmlAttribute
     private boolean adler32Checksum = true;
+    @XmlAttribute
     private long flushSleepTimeMilliseconds = 50;
+    @XmlAttribute
     private String logFileDir = "txlog";
+    @XmlAttribute
     private String logFileExt = "log";
+    @XmlAttribute
     private String logFileName = "howl";
+    @XmlAttribute
     private int maxBlocksPerFile = -1;
+    @XmlAttribute
     private int maxBuffers = 0;
+    @XmlAttribute
     private int maxLogFiles = 2;
+    @XmlAttribute
     private int minBuffers = 4;
+    @XmlAttribute
     private int threadsWaitingForceThreshold = -1;
 
     public TransactionManagerBuilder() {
@@ -47,7 +62,7 @@ public class TransactionManagerBuilder e
         setType("TransactionManager");
         setId("TransactionManager");
 
-        setConstructor("defaultTransactionTimeoutSeconds, TxRecovery, tmId, bufferClassName, bufferSizeKb, checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold");
+        setConstructor("defaultTransactionTimeoutSeconds, txRecovery, tmId, bufferClassName, bufferSizeKb, checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold");
 
         setFactoryName("create");
 
@@ -67,7 +82,6 @@ public class TransactionManagerBuilder e
         this.defaultTransactionTimeoutSeconds = defaultTransactionTimeoutSeconds;
     }
 
-    @XmlAttribute
     public long getDefaultTransactionTimeoutSeconds() {
         return defaultTransactionTimeoutSeconds;
     }
@@ -89,7 +103,6 @@ public class TransactionManagerBuilder e
         this.txRecovery = txRecovery;
     }
 
-    @XmlAttribute
     public boolean getTxRecovery() {
         return txRecovery;
     }
@@ -103,7 +116,6 @@ public class TransactionManagerBuilder e
         this.bufferSizeKb = bufferSizeKb;
     }
 
-    @XmlAttribute
     public int getBufferSizeKb() {
         return bufferSizeKb;
     }
@@ -117,7 +129,6 @@ public class TransactionManagerBuilder e
         this.checksumEnabled = checksumEnabled;
     }
 
-    @XmlAttribute
     public boolean getChecksumEnabled() {
         return checksumEnabled;
     }
@@ -131,7 +142,6 @@ public class TransactionManagerBuilder e
         this.adler32Checksum = adler32Checksum;
     }
 
-    @XmlAttribute
     public boolean getAdler32Checksum() {
         return adler32Checksum;
     }
@@ -145,7 +155,6 @@ public class TransactionManagerBuilder e
         this.flushSleepTimeMilliseconds = flushSleepTimeMilliseconds;
     }
 
-    @XmlAttribute
     public long getFlushSleepTimeMilliseconds() {
         return flushSleepTimeMilliseconds;
     }
@@ -167,7 +176,6 @@ public class TransactionManagerBuilder e
         this.logFileDir = logFileDir;
     }
 
-    @XmlAttribute
     public String getLogFileDir() {
         return logFileDir;
     }
@@ -181,7 +189,6 @@ public class TransactionManagerBuilder e
         this.logFileExt = logFileExt;
     }
 
-    @XmlAttribute
     public String getLogFileExt() {
         return logFileExt;
     }
@@ -195,7 +202,6 @@ public class TransactionManagerBuilder e
         this.logFileName = logFileName;
     }
 
-    @XmlAttribute
     public String getLogFileName() {
         return logFileName;
     }
@@ -209,7 +215,6 @@ public class TransactionManagerBuilder e
         this.maxBlocksPerFile = maxBlocksPerFile;
     }
 
-    @XmlAttribute
     public int getMaxBlocksPerFile() {
         return maxBlocksPerFile;
     }
@@ -223,7 +228,6 @@ public class TransactionManagerBuilder e
         this.maxBuffers = maxBuffers;
     }
 
-    @XmlAttribute
     public int getMaxBuffers() {
         return maxBuffers;
     }
@@ -237,7 +241,6 @@ public class TransactionManagerBuilder e
         this.maxLogFiles = maxLogFiles;
     }
 
-    @XmlAttribute
     public int getMaxLogFiles() {
         return maxLogFiles;
     }
@@ -251,7 +254,6 @@ public class TransactionManagerBuilder e
         this.minBuffers = minBuffers;
     }
 
-    @XmlAttribute
     public int getMinBuffers() {
         return minBuffers;
     }
@@ -265,7 +267,6 @@ public class TransactionManagerBuilder e
         this.threadsWaitingForceThreshold = threadsWaitingForceThreshold;
     }
 
-    @XmlAttribute
     public int getThreadsWaitingForceThreshold() {
         return threadsWaitingForceThreshold;
     }

Added: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/DurationAdapter.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/DurationAdapter.java?rev=1377926&view=auto
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/DurationAdapter.java (added)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/DurationAdapter.java Tue Aug 28 00:41:36 2012
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.openejb.config.typed.util;
+
+import org.apache.openejb.util.Duration;
+
+public class DurationAdapter extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String, Duration> {
+    @Override
+    public Duration unmarshal(String v) throws Exception {
+        return Duration.parse(v);
+    }
+
+    @Override
+    public String marshal(Duration v) throws Exception {
+        return v.toString();
+    }
+}

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ProviderGenerator.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ProviderGenerator.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ProviderGenerator.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ProviderGenerator.java Tue Aug 28 00:41:36 2012
@@ -88,9 +88,11 @@ public class ProviderGenerator extends R
             out.println("import " + Duration.class.getName() + ";");
             out.println("import java.util.*;");
             out.println("import java.util.concurrent.*;");
+            out.println("import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;");
             out.println();
 
             out.println(template(
+                    "@XmlAccessorType(XmlAccessType.FIELD)\n" +
                     "@XmlRootElement(name = \"${name}\")\n" +
                             "public class ${builder} extends ${service} {\n"
             )
@@ -109,8 +111,12 @@ public class ProviderGenerator extends R
                 final String value = entry.getValue().toString();
                 final String type = guessType(key, value);
 
+                if (Duration.class.getName().endsWith(type)) {
+                    out.println("    @XmlJavaTypeAdapter(DurationAdapter.class)");
+                }
                 out.println(
                         template(
+                                "    @XmlAttribute\n" +
                                 "    private ${type} ${key} = ${value};"
                         ).apply(
                                 "builder", builder,
@@ -135,8 +141,6 @@ public class ProviderGenerator extends R
                     .apply(
                             "builder", builder,
                             "className", provider.getClassName() + "",
-                            "constructor", provider.getConstructor() + "",
-                            "factoryName", provider.getFactoryName() + "",
                             "type", types.get(0),
                             "name", name
                     )
@@ -146,7 +150,7 @@ public class ProviderGenerator extends R
                 out.println(template(
                         "        setConstructor(\"${constructor}\");\n")
                         .apply(
-                                "constructor", provider.getConstructor()
+                                "constructor", fixConstructor(provider)
                         ));
             }
 
@@ -209,7 +213,6 @@ public class ProviderGenerator extends R
 
                 // getter
                 out.println(template(
-                        "    @XmlAttribute\n" +
                                 "    public ${type} get${Key}() {\n" +
                                 "        return ${key};\n" +
                                 "    }\n")
@@ -315,6 +318,15 @@ public class ProviderGenerator extends R
         }
     }
 
+    private static String fixConstructor(ServiceProvider provider) {
+        final String s = provider.getConstructor() + "";
+        final String[] split = s.split(" *, *");
+        for (int i = 0; i < split.length; i++) {
+            split[i] = Strings.lcfirst(split[i]);
+        }
+        return Join.join(", ", split);
+    }
+
     private static String asValue(String type, String value) {
         if ("".equals(value)) return "null";
 

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ServerContext.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ServerContext.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ServerContext.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/typed/util/ServerContext.java Tue Aug 28 00:41:36 2012
@@ -32,12 +32,21 @@ import org.apache.openejb.config.sys.Sec
 import org.apache.openejb.config.sys.Service;
 import org.apache.openejb.config.sys.TransactionManager;
 
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
 /**
  * @version $Rev$ $Date$
  */
+@XmlRootElement(name = "ServerContext")
+@XmlAccessorType(XmlAccessType.FIELD)
 public class ServerContext {
 
+    @XmlTransient
     private final ConfigurationFactory factory = new ConfigurationFactory();
+    @XmlTransient
     private final Assembler assembler = new Assembler();
 
     public void createTransactionManager(TransactionManager service) throws OpenEJBException {

Modified: openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java?rev=1377926&r1=1377925&r2=1377926&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java (original)
+++ openejb/trunk/openejb/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java Tue Aug 28 00:41:36 2012
@@ -21,7 +21,11 @@ import org.apache.openejb.config.typed.D
 import org.apache.openejb.config.typed.SecurityServiceBuilder;
 import org.apache.openejb.config.typed.StatelessContainerBuilder;
 import org.apache.openejb.config.typed.TransactionManagerBuilder;
+import org.apache.openejb.jee.JAXBContextFactory;
 
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+import java.io.ByteArrayOutputStream;
 import java.net.URI;
 import java.util.concurrent.TimeUnit;
 
@@ -63,5 +67,22 @@ public class ServerContextTest extends T
                 .withMinEvictableIdleTime(15, TimeUnit.MINUTES)
                 .withTimeBetweenEvictionRuns(5, TimeUnit.MINUTES)
         );
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        JAXBContext jaxbContext = JAXBContextFactory.newInstance(ServerContext.class
+                , TransactionManagerBuilder.class
+                , SecurityServiceBuilder.class
+                , StatelessContainerBuilder.class
+                , DataSourceBuilder.class);
+
+        Marshaller marshaller = jaxbContext.createMarshaller();
+
+        marshaller.setProperty("jaxb.formatted.output", true);
+
+        marshaller.marshal(serverContext, baos);
+
+        final String marshal = new String(baos.toByteArray());
+        System.out.println(marshal);
     }
 }