You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by da...@apache.org on 2007/06/26 21:23:38 UTC

svn commit: r550914 [1/2] - in /openejb/trunk/openejb3/container/openejb-core/src/main: java/org/apache/openejb/config/ java/org/apache/openejb/config/sys/ resources/schema/

Author: dain
Date: Tue Jun 26 12:23:36 2007
New Revision: 550914

URL: http://svn.apache.org/viewvc?view=rev&rev=550914
Log:
Convert castor openejb configuration code to JaxB2.
Updated schemas to reflect current usage in the config files.
Removed mixed content types from schemas.

Added:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/AbstractService.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ObjectFactory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/package-info.java
Removed:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Unmarshaller.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ClassName.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ClassNameDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManagerDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectorDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ContainerDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ContainerTypes.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ContainerTypesDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/DeploymentsDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JarFileLocation.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JarFileLocationDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProviderDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Lookup.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/LookupDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/OpenejbDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/PropertiesFile.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/PropertiesFileDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ProviderTypes.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ProviderTypesDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ProxyFactoryDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ResourceDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/SecurityServiceDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProviderDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServicesJarDescriptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/TransactionManagerDescriptor.java
Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Service.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManager.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Connector.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Container.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Deployments.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProvider.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Openejb.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ProxyFactory.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Resource.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/SecurityService.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProvider.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServicesJar.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/TransactionManager.java
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/schema/openejb.xsd
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/schema/service-jar.xsd

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java Tue Jun 26 12:23:36 2007
@@ -21,6 +21,7 @@
 import org.apache.openejb.assembler.classic.ContainerInfo;
 import org.apache.openejb.assembler.classic.ResourceInfo;
 import org.apache.openejb.assembler.classic.LinkResolver;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.config.sys.Resource;
 import org.apache.openejb.jee.MessageDrivenBean;
 import org.apache.openejb.jee.ActivationConfig;
@@ -701,12 +702,12 @@
         }
 
         // look for a default resource based on the type
-        Service service = getDefaultResource(type);
-        if (service == null) {
+        Resource resource = getDefaultResource(type);
+        if (resource == null) {
             // no default resource for this type... give up
             throw new OpenEJBException("No default resource defined for reference '" + resourceId + "' of type '" + type  + "' for '" + beanName + "'.");
         }
-        ResourceInfo resourceInfo = configFactory.configureService(service, ResourceInfo.class);
+        ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
         logger.warning("Auto-creating a resource with id '" + resourceInfo.id +  "' of type '" + type  + " for '" + beanName + "'.  THERE IS LITTLE CHANCE THIS WILL WORK!");
         return installResource(beanName, resourceInfo);
     }
@@ -724,15 +725,15 @@
         return resourceInfo.id;
     }
 
-    private Service getDefaultResource(String type) {
+    private Resource getDefaultResource(String type) {
         String providerId = defaultResourceIds.get(type);
         if (providerId == null) {
             return null;
         }
-        Service service = new Resource();
-        service.setProvider(providerId);
-        service.setId(providerId);
-        return service;
+        Resource resource = JaxbOpenejb.createResource();
+        resource.setProvider(providerId);
+        resource.setId(providerId);
+        return resource;
     }
 
     private String getResourceEnvId(String beanName, String resourceId, String type) throws OpenEJBException {

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigUtils.java Tue Jun 26 12:23:36 2007
@@ -16,11 +16,10 @@
  */
 package org.apache.openejb.config;
 
-import org.exolab.castor.xml.MarshalException;
-import org.exolab.castor.xml.ValidationException;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.config.sys.Deployments;
 import org.apache.openejb.config.sys.Openejb;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.Logger;
 import org.apache.openejb.util.Messages;
@@ -29,13 +28,10 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.Writer;
 import java.net.URL;
-import java.util.Enumeration;
 import java.util.Properties;
 
 public class ConfigUtils {
@@ -43,56 +39,6 @@
     public static Messages messages = new Messages("org.apache.openejb.util.resources");
     public static Logger logger = Logger.getInstance("OpenEJB", "org.apache.openejb.util.resources");
 
-    /**
-     * @param config configuration file to read
-     * @return unmarshalled configuration of type {@link org.apache.openejb.OpenEJB}
-     * @throws OpenEJBException something wrong with file reading
-     */
-    public static Openejb readConfig(String config) throws OpenEJBException {
-        return (Openejb) Unmarshaller.unmarshal(Openejb.class, config);
-    }
-
-    public static void writeConfig(String confFile, Openejb confObject) throws OpenEJBException {
-        /* TODO:  Just to be picky, the xml file created by
-        Castor is really hard to read -- it is all on one line.
-        People might want to edit this in the future by hand, so if Castor can 
-        make the output look better that would be great!  Otherwise we could
-        just spruce the output up by adding a few new lines and tabs.
-        */
-        Writer writer = null;
-        try {
-            File file = new File(confFile);
-            writer = new FileWriter(file);
-            confObject.marshal(writer);
-        } catch (IOException e) {
-            throw new OpenEJBException(messages.format("conf.1040", confFile, e.getLocalizedMessage()), e);
-        } catch (MarshalException e) {
-            if (e.getCause() instanceof IOException) {
-                throw new OpenEJBException(messages.format("conf.1040", confFile, e.getLocalizedMessage()), e);
-            } else {
-                throw new OpenEJBException(messages.format("conf.1050", confFile, e.getLocalizedMessage()), e);
-            }
-        } catch (ValidationException e) {
-            /* TODO: Implement informative error handling here. 
-               The exception will say "X doesn't match the regular 
-               expression Y" 
-               This should be checked and more relevant information
-               should be given -- not everyone understands regular 
-               expressions. 
-             */
-            /* NOTE: This doesn't seem to ever happen. When the object graph
-             * is invalid, the MarshalException is thrown, not this one as you
-             * would think.
-             */
-            throw new OpenEJBException(messages.format("conf.1060", confFile, e.getLocalizedMessage()), e);
-        }
-        try {
-            writer.close();
-        } catch (Exception e) {
-            throw new OpenEJBException(messages.format("file.0020", confFile, e.getLocalizedMessage()), e);
-        }
-    }
-
     public static String searchForConfiguration() throws OpenEJBException {
         return searchForConfiguration(SystemInstance.get().getProperty("openejb.configuration"));
     }
@@ -224,12 +170,10 @@
     }
 
     public static boolean addDeploymentEntryToConfig(String jarLocation, Openejb config) {
-        Enumeration enumeration = config.enumerateDeployments();
         File jar = new File(jarLocation);
 
         /* Check to see if the entry is already listed */
-        while (enumeration.hasMoreElements()) {
-            Deployments d = (Deployments) enumeration.nextElement();
+        for (Deployments d : config.getDeploymentsArray()) {
 
             if (d.getJar() != null) {
                 try {
@@ -268,7 +212,7 @@
         }
 
         /* Create a new Deployments entry */
-        Deployments dep = new Deployments();
+        Deployments dep = JaxbOpenejb.createDeployments();
         dep.setJar(jarLocation);
         config.addDeployments(dep);
         return true;

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java Tue Jun 26 12:23:36 2007
@@ -42,6 +42,7 @@
 import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
 import org.apache.openejb.assembler.classic.TransactionServiceInfo;
 import org.apache.openejb.config.sys.ConnectionManager;
+import org.apache.openejb.config.sys.Connector;
 import org.apache.openejb.config.sys.Container;
 import org.apache.openejb.config.sys.JndiProvider;
 import org.apache.openejb.config.sys.Openejb;
@@ -50,7 +51,7 @@
 import org.apache.openejb.config.sys.SecurityService;
 import org.apache.openejb.config.sys.ServiceProvider;
 import org.apache.openejb.config.sys.TransactionManager;
-import org.apache.openejb.config.sys.Connector;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.jee.ApplicationClient;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.jpa.EntityMappings;
@@ -193,9 +194,9 @@
     public OpenEjbConfiguration getOpenEjbConfiguration() throws OpenEJBException {
 
         if (configLocation != null) {
-            openejb = ConfigUtils.readConfig(configLocation);
+            openejb = JaxbOpenejb.readConfig(configLocation);
         } else {
-            openejb = new Openejb();
+            openejb = JaxbOpenejb.createOpenejb();
         }
 
         sys = new OpenEjbConfiguration();
@@ -203,7 +204,7 @@
         sys.facilities = new FacilitiesInfo();
 
 
-        for (JndiProvider provider : openejb.getJndiProvider()) {
+        for (JndiProvider provider : openejb.getJndiProviderArray()) {
 
             JndiContextInfo info = configureService(provider, JndiContextInfo.class);
             sys.facilities.remoteJndiContexts.add(info);
@@ -211,11 +212,11 @@
 
         sys.facilities.securityService = configureService(openejb.getSecurityService(), SecurityServiceInfo.class);
 
-        sys.facilities.transactionService = configureService(openejb.getTransactionService(), TransactionServiceInfo.class);
+        sys.facilities.transactionService = configureService(openejb.getTransactionManager(), TransactionServiceInfo.class);
 
         // convert legacy connector declarations to resource declarations
-        for (Connector connector : openejb.getConnector()) {
-            Resource resource = new Resource();
+        for (Connector connector : openejb.getConnectorArray()) {
+            Resource resource = JaxbOpenejb.createResource();
             resource.setJar(connector.getJar());
             resource.setId(connector.getId());
             resource.setProvider(connector.getProvider());
@@ -223,7 +224,7 @@
             openejb.addResource(resource);
         }
 
-        for (Resource resource : openejb.getResource()) {  
+        for (Resource resource : openejb.getResourceArray()) {
             ResourceInfo resourceInfo = configureService(resource, ResourceInfo.class);
             sys.facilities.resources.add(resourceInfo);
         }
@@ -233,7 +234,7 @@
 
         sys.facilities.intraVmServer = configureService(openejb.getProxyFactory(), ProxyFactoryInfo.class);
 
-        for (Container declaration : openejb.getContainer()) {
+        for (Container declaration : openejb.getContainerArray()) {
 
             Class<? extends ContainerInfo> infoClass = getContainerInfoType(declaration.getCtype());
 
@@ -247,7 +248,7 @@
         }
 
 
-        List<String> jarList = DeploymentsResolver.resolveAppLocations(openejb.getDeployments());
+        List<String> jarList = DeploymentsResolver.resolveAppLocations(openejb.getDeploymentsArray());
 
         for (String pathname : jarList) {
 
@@ -450,7 +451,7 @@
 
         Service service = null;
         try {
-            service = defaultService.type.newInstance();
+            service = JaxbOpenejb.create(defaultService.type);
             service.setProvider(defaultService.id);
             service.setId(defaultService.id);
         } catch (Exception e) {
@@ -664,7 +665,7 @@
             // The only time we'd have one of these is if we were building
             // the above sys instance
             if (openejb != null) {
-                for (Resource resource : openejb.getResource()) {
+                for (Resource resource : openejb.getResourceArray()) {
                     if (isResourceType(resource, type)) {
                         resourceIds.add(resource.getId());
                     }
@@ -722,7 +723,7 @@
             // The only time we'd have one of these is if we were building
             // the above sys instance
             if (openejb != null) {
-                for (Container container : openejb.getContainer()) {
+                for (Container container : openejb.getContainerArray()) {
                     containerIds.add(container.getId());
                 }
             }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Deploy.java Tue Jun 26 12:23:36 2007
@@ -35,9 +35,10 @@
 import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.openejb.jee.oejb3.QueryMethod;
 import org.apache.openejb.jee.oejb3.ResourceLink;
+import org.apache.openejb.config.sys.Openejb;
 import org.apache.openejb.config.sys.Connector;
 import org.apache.openejb.config.sys.Container;
-import org.apache.openejb.config.sys.Openejb;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.jee.ResourceRef;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.JarUtils;
@@ -126,13 +127,13 @@
             if (configFile == null) {
                 configFile = ConfigUtils.searchForConfiguration();
             }
-            config = ConfigUtils.readConfig(configFile);
+            config = JaxbOpenejb.readConfig(configFile);
 
             /* Load container list */
-            containers = config.getContainer();
+            containers = config.getContainerArray();
 
             /* Load resource list */
-            resources = config.getConnector();
+            resources = config.getConnectorArray();
 
         } catch (Exception e) {
             throw new OpenEJBException(e);
@@ -692,7 +693,7 @@
 
         if (configChanged) {
             out.print("Updating your system config...");
-            ConfigUtils.writeConfig(configFile, config);
+            JaxbOpenejb.writeConfig(configFile, config);
 
             out.println("done");
         }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentsResolver.java Tue Jun 26 12:23:36 2007
@@ -17,6 +17,7 @@
 package org.apache.openejb.config;
 
 import org.apache.openejb.config.sys.Deployments;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.loader.FileUtils;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.xbean.finder.UrlSet;
@@ -121,7 +122,7 @@
         //// getOption /////////////////////////////////  END  ////////////////////
 
         if (searchClassPath) {
-            Deployments deployment = new Deployments();
+            Deployments deployment = JaxbOpenejb.createDeployments();
             deployment.setClasspath(Thread.currentThread().getContextClassLoader());
             deployments.add(deployment);
         }
@@ -203,7 +204,7 @@
                 try {
                     Class moduleType = DeploymentLoader.discoverModuleType(url, classLoader, !requireDescriptors);
                     if (AppModule.class.isAssignableFrom(moduleType) || EjbModule.class.isAssignableFrom(moduleType)) {
-                        deployment = new Deployments();
+                        deployment = JaxbOpenejb.createDeployments();
                         if (url.getProtocol().equals("jar")) {
                             url = new URL(url.getFile().replaceFirst("!.*$", ""));
                             File file = new File(url.getFile());

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Service.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Service.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Service.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/Service.java Tue Jun 26 12:23:36 2007
@@ -17,21 +17,19 @@
 package org.apache.openejb.config;
 
 public interface Service {
-    public java.lang.String getContent();
+    public String getContent();
 
-    public java.lang.String getId();
+    public void setContent(String content);
 
-    public java.lang.String getJar();
+    public String getId();
 
-    public java.lang.String getProvider();
+    public void setId(String id);
 
-    public void setContent(java.lang.String content);
+    public String getJar();
 
-    public void setId(java.lang.String id);
+    public void setJar(String jar);
 
-    public void setJar(java.lang.String jar);
+    public String getProvider();
 
-    public void setProvider(java.lang.String provider);
-
-    public void validate() throws org.exolab.castor.xml.ValidationException;
+    public void setProvider(String provider);
 }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ServiceUtils.java Tue Jun 26 12:23:36 2007
@@ -16,18 +16,18 @@
  */
 package org.apache.openejb.config;
 
-import org.exolab.castor.xml.MarshalException;
-import org.exolab.castor.xml.ValidationException;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.config.sys.ServiceProvider;
 import org.apache.openejb.config.sys.ServicesJar;
+import org.apache.openejb.config.sys.JaxbOpenejb;
 import org.apache.openejb.util.Logger;
 import org.apache.openejb.util.Messages;
-import org.apache.xbean.finder.ResourceFinder;
 
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -85,11 +85,12 @@
     private static Map<String, ServiceProvider> getServices(String packageName) throws OpenEJBException {
         Map<String, ServiceProvider> services = loadedServiceJars.get(packageName);
         if (services == null) {
-            ServicesJar servicesJar = readServicesJar(packageName);
+            ServicesJar servicesJar = JaxbOpenejb.readServicesJar(packageName);
 
             // index services by provider id
-            services = new HashMap<String, ServiceProvider>(servicesJar.getServiceProviderCount());
-            for (ServiceProvider serviceProvider : servicesJar.getServiceProvider()) {
+            ServiceProvider[] serviceProviders = servicesJar.getServiceProviderArray();
+            services = new HashMap<String, ServiceProvider>(serviceProviders.length);
+            for (ServiceProvider serviceProvider : serviceProviders) {
                 services.put(serviceProvider.getId(), serviceProvider);
 
             }
@@ -115,66 +116,6 @@
         }
 
         return new ProviderInfo(providerName, serviceName);
-    }
-
-    public static ServicesJar readServicesJar(String providerName) throws OpenEJBException {
-        try {
-            Unmarshaller unmarshaller = new Unmarshaller(ServicesJar.class, "service-jar.xml");
-            ResourceFinder finder = new ResourceFinder("META-INF/", Thread.currentThread().getContextClassLoader());
-            URL url = finder.find(providerName + "/");
-            return (ServicesJar) unmarshaller.unmarshal(url);
-        } catch (MalformedURLException e) {
-            throw new OpenEJBException(e);
-        } catch (IOException e) {
-            throw new OpenEJBException(e);
-        }
-    }
-
-    public static void writeServicesJar(String xmlFile, ServicesJar servicesJarObject) throws OpenEJBException {
-
-        /* TODO:  Just to be picky, the xml file created by
-        Castor is really hard to read -- it is all on one line.
-        People might want to edit this in the future by hand, so if Castor can
-        make the output look better that would be great!  Otherwise we could
-        just spruce the output up by adding a few new lines and tabs.
-        */
-        Writer writer = null;
-
-        try {
-            File file = new File(xmlFile);
-            writer = new FileWriter(file);
-            servicesJarObject.marshal(writer);
-        } catch (IOException e) {
-            throw new OpenEJBException(messages.format("conf.4040", xmlFile, e.getLocalizedMessage()), e);
-        } catch (MarshalException e) {
-            if (e.getCause() instanceof IOException) {
-                throw new OpenEJBException(messages.format("conf.4040", xmlFile, e.getLocalizedMessage()), e);
-            } else {
-                throw new OpenEJBException(messages.format("conf.4050", xmlFile, e.getLocalizedMessage()), e);
-            }
-        } catch (ValidationException e) {
-
-            /* TODO: Implement informative error handling here.
-               The exception will say "X doesn't match the regular
-               expression Y"
-               This should be checked and more relevant information
-               should be given -- not everyone understands regular
-               expressions.
-             */
-
-            /* NOTE: This doesn't seem to ever happen. When the object graph
-             * is invalid, the MarshalException is thrown, not this one as you
-             * would think.
-             */
-
-            throw new OpenEJBException(messages.format("conf.4060", xmlFile, e.getLocalizedMessage()), e);
-        }
-
-        try {
-            writer.close();
-        } catch (Exception e) {
-            throw new OpenEJBException(messages.format("file.0020", xmlFile, e.getLocalizedMessage()), e);
-        }
     }
 
     public static Properties loadProperties(String pFile) throws OpenEJBException {

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/AbstractService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/AbstractService.java?view=auto&rev=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/AbstractService.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/AbstractService.java Tue Jun 26 12:23:36 2007
@@ -0,0 +1,136 @@
+/**
+ *
+ * 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.sys;
+
+import org.apache.openejb.config.Service;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * <p>Java class for Service complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType name="Service">
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *       &lt;attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Service")
+public abstract class AbstractService implements Service {
+    @XmlValue
+    protected String content;
+    @XmlAttribute(required = true)
+    protected String id;
+    @XmlAttribute
+    protected String jar;
+    @XmlAttribute
+    protected String provider;
+
+    /**
+     * Gets the value of the value property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getContent() {
+        return content;
+    }
+
+    /**
+     * Sets the value of the value property.
+     *
+     * @param content allowed object is
+     *                {@link String }
+     */
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    /**
+     * Gets the value of the id property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets the value of the jar property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getJar() {
+        return jar;
+    }
+
+    /**
+     * Sets the value of the jar property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setJar(String value) {
+        this.jar = value;
+    }
+
+    /**
+     * Gets the value of the provider property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getProvider() {
+        return provider;
+    }
+
+    /**
+     * Sets the value of the provider property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setProvider(String value) {
+        this.provider = value;
+    }
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManager.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManager.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManager.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ConnectionManager.java Tue Jun 26 12:23:36 2007
@@ -1,114 +1,50 @@
-/**
- * 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.
- */
-/*
- * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package org.apache.openejb.config.sys;
-
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-public class ConnectionManager implements java.io.Serializable, org.apache.openejb.config.Service {
-
-
-    private java.lang.String _id;
-
-    private java.lang.String _provider;
-
-    private java.lang.String _jar;
-
-    private java.lang.String _content = "";
-
-
-    public ConnectionManager() {
-        super();
-        setContent("");
-    }
-
-
-    public java.lang.String getContent() {
-        return this._content;
-    }
-
-    public java.lang.String getId() {
-        return this._id;
-    }
-
-    public java.lang.String getJar() {
-        return this._jar;
-    }
-
-    public java.lang.String getProvider() {
-        return this._provider;
-    }
-
-    public boolean isValid() {
-        try {
-            validate();
-        }
-        catch (org.exolab.castor.xml.ValidationException vex) {
-            return false;
-        }
-        return true;
-    }
-
-    public void marshal(java.io.Writer out)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, out);
-    }
-
-    public void marshal(org.xml.sax.ContentHandler handler)
-            throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, handler);
-    }
-
-    public void setContent(java.lang.String content) {
-        this._content = content;
-    }
-
-    public void setId(java.lang.String id) {
-        this._id = id;
-    }
-
-    public void setJar(java.lang.String jar) {
-        this._jar = jar;
-    }
-
-    public void setProvider(java.lang.String provider) {
-        this._provider = provider;
-    }
-
-    public static java.lang.Object unmarshal(java.io.Reader reader)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-        return (org.apache.openejb.config.sys.ConnectionManager) Unmarshaller.unmarshal(org.apache.openejb.config.sys.ConnectionManager.class, reader);
-    }
-
-    public void validate()
-            throws org.exolab.castor.xml.ValidationException {
-        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-        validator.validate(this);
-    }
-
-}
+/**
+ *
+ * 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.sys;
+
+import org.apache.openejb.config.Service;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * <p>Java class for anonymous complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType>
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *       &lt;attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "ConnectionManager")
+public class ConnectionManager extends AbstractService {
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Connector.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Connector.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Connector.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Connector.java Tue Jun 26 12:23:36 2007
@@ -1,114 +1,47 @@
-/**
- * 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.
- */
-/*
- * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package org.apache.openejb.config.sys;
-
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-public class Connector implements java.io.Serializable, org.apache.openejb.config.Service {
-
-
-    private java.lang.String _id;
-
-    private java.lang.String _provider;
-
-    private java.lang.String _jar;
-
-    private java.lang.String _content = "";
-
-
-    public Connector() {
-        super();
-        setContent("");
-    }
-
-
-    public java.lang.String getContent() {
-        return this._content;
-    }
-
-    public java.lang.String getId() {
-        return this._id;
-    }
-
-    public java.lang.String getJar() {
-        return this._jar;
-    }
-
-    public java.lang.String getProvider() {
-        return this._provider;
-    }
-
-    public boolean isValid() {
-        try {
-            validate();
-        }
-        catch (org.exolab.castor.xml.ValidationException vex) {
-            return false;
-        }
-        return true;
-    }
-
-    public void marshal(java.io.Writer out)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, out);
-    }
-
-    public void marshal(org.xml.sax.ContentHandler handler)
-            throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, handler);
-    }
-
-    public void setContent(java.lang.String content) {
-        this._content = content;
-    }
-
-    public void setId(java.lang.String id) {
-        this._id = id;
-    }
-
-    public void setJar(java.lang.String jar) {
-        this._jar = jar;
-    }
-
-    public void setProvider(java.lang.String provider) {
-        this._provider = provider;
-    }
-
-    public static java.lang.Object unmarshal(java.io.Reader reader)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-        return (org.apache.openejb.config.sys.Connector) Unmarshaller.unmarshal(org.apache.openejb.config.sys.Connector.class, reader);
-    }
-
-    public void validate()
-            throws org.exolab.castor.xml.ValidationException {
-        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-        validator.validate(this);
-    }
-
-}
+/**
+ *
+ * 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.sys;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType>
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *       &lt;attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "Connector")
+public class Connector extends AbstractService {
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Container.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Container.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Container.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Container.java Tue Jun 26 12:23:36 2007
@@ -1,124 +1,71 @@
-/**
- * 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.
- */
-/*
- * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package org.apache.openejb.config.sys;
-
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-public class Container implements java.io.Serializable, org.apache.openejb.config.Service {
-
-
-    private java.lang.String _id;
-
-    private java.lang.String _provider;
-
-    private java.lang.String _ctype;
-
-    private java.lang.String _jar;
-
-    private java.lang.String _content = "";
-
-
-    public Container() {
-        super();
-        setContent("");
-    }
-
-
-    public java.lang.String getContent() {
-        return this._content;
-    }
-
-    public java.lang.String getCtype() {
-        return this._ctype;
-    }
-
-    public java.lang.String getId() {
-        return this._id;
-    }
-
-    public java.lang.String getJar() {
-        return this._jar;
-    }
-
-    public java.lang.String getProvider() {
-        return this._provider;
-    }
-
-    public boolean isValid() {
-        try {
-            validate();
-        }
-        catch (org.exolab.castor.xml.ValidationException vex) {
-            return false;
-        }
-        return true;
-    }
-
-    public void marshal(java.io.Writer out)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, out);
-    }
-
-    public void marshal(org.xml.sax.ContentHandler handler)
-            throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, handler);
-    }
-
-    public void setContent(java.lang.String content) {
-        this._content = content;
-    }
-
-    public void setCtype(java.lang.String ctype) {
-        this._ctype = ctype;
-    }
-
-    public void setId(java.lang.String id) {
-        this._id = id;
-    }
-
-    public void setJar(java.lang.String jar) {
-        this._jar = jar;
-    }
-
-    public void setProvider(java.lang.String provider) {
-        this._provider = provider;
-    }
-
-    public static java.lang.Object unmarshal(java.io.Reader reader)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-        return (org.apache.openejb.config.sys.Container) Unmarshaller.unmarshal(org.apache.openejb.config.sys.Container.class, reader);
-    }
-
-    public void validate()
-            throws org.exolab.castor.xml.ValidationException {
-        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-        validator.validate(this);
-    }
-
-}
+/**
+ *
+ * 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.sys;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType>
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="ctype" use="required" type="{http://www.openejb.org/System/Configuration}ContainerTypes" />
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *       &lt;attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "Container")
+public class Container extends AbstractService {
+    @XmlAttribute(required = true)
+    protected String ctype;
+
+    /**
+     * Gets the value of the ctype property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getCtype() {
+        return ctype;
+    }
+
+    /**
+     * Sets the value of the ctype property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setCtype(String value) {
+        this.ctype = value;
+    }
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Deployments.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Deployments.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Deployments.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/Deployments.java Tue Jun 26 12:23:36 2007
@@ -1,107 +1,104 @@
-/**
- * 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.
- */
-/*
- * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package org.apache.openejb.config.sys;
-
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-public class Deployments implements java.io.Serializable {
-
-
-    private java.lang.String _jar;
-
-    private java.lang.String _dir;
-
-    /**
-     * This does not specify the classloader to use for loading
-     * deployments, rather it is an alternate to using 'jar' or 'dir'.
-     * The ejb-jar.xml files are searched in the classpath of the
-     * specified classloader.
-     */
-    private ClassLoader classpath;
-
-    public Deployments() {
-        super();
-    }
-
-    public ClassLoader getClasspath() {
-        return classpath;
-    }
-
-    public void setClasspath(ClassLoader classpath) {
-        this.classpath = classpath;
-    }
-
-    public java.lang.String getDir() {
-        return this._dir;
-    }
-
-    public java.lang.String getJar() {
-        return this._jar;
-    }
-
-    public boolean isValid() {
-        try {
-            validate();
-        }
-        catch (org.exolab.castor.xml.ValidationException vex) {
-            return false;
-        }
-        return true;
-    }
-
-    public void marshal(java.io.Writer out)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, out);
-    }
-
-    public void marshal(org.xml.sax.ContentHandler handler)
-            throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, handler);
-    }
-
-    public void setDir(java.lang.String dir) {
-        this._dir = dir;
-    }
-
-    public void setJar(java.lang.String jar) {
-        this._jar = jar;
-    }
-
-    public static java.lang.Object unmarshal(java.io.Reader reader)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-        return (org.apache.openejb.config.sys.Deployments) Unmarshaller.unmarshal(org.apache.openejb.config.sys.Deployments.class, reader);
-    }
-
-    public void validate()
-            throws org.exolab.castor.xml.ValidationException {
-        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-        validator.validate(this);
-    }
-
-}
+/**
+ *
+ * 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.sys;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;attribute name="dir" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "Deployments")
+public class Deployments {
+
+    @XmlAttribute
+    protected String dir;
+    @XmlAttribute
+    protected String jar;
+    @XmlTransient
+    protected ClassLoader classpath;
+
+    /**
+     * Gets the value of the dir property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getDir() {
+        return dir;
+    }
+
+    /**
+     * Sets the value of the dir property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setDir(String value) {
+        this.dir = value;
+    }
+
+    /**
+     * Gets the value of the jar property.
+     *
+     * @return possible object is
+     *         {@link String }
+     */
+    public String getJar() {
+        return jar;
+    }
+
+    /**
+     * Sets the value of the jar property.
+     *
+     * @param value allowed object is
+     *              {@link String }
+     */
+    public void setJar(String value) {
+        this.jar = value;
+    }
+
+
+    public ClassLoader getClasspath() {
+        return classpath;
+    }
+
+    public void setClasspath(ClassLoader classpath) {
+        this.classpath = classpath;
+    }
+}

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java?view=auto&rev=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java Tue Jun 26 12:23:36 2007
@@ -0,0 +1,308 @@
+/**
+ *
+ * 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.sys;
+
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.config.ConfigUtils;
+import org.apache.xbean.finder.ResourceFinder;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.MarshalException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationException;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.sax.SAXSource;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+public abstract class JaxbOpenejb {
+    @SuppressWarnings({"unchecked"})
+    public static <T> T create(Class<T> type) {
+        if (type == null) throw new NullPointerException("type is null");
+
+        if (type == ConnectionManager.class) {
+            return (T) createConnectionManager();
+        } else if (type == Connector.class) {
+            return (T) createConnector();
+        } else if (type == Container.class) {
+            return (T) createContainer();
+        } else if (type == Deployments.class) {
+            return (T) createDeployments();
+        } else if (type == JndiProvider.class) {
+            return (T) createJndiProvider();
+        } else if (type == Openejb.class) {
+            return (T) createOpenejb();
+        } else if (type == ProxyFactory.class) {
+            return (T) createProxyFactory();
+        } else if (type == Resource.class) {
+            return (T) createResource();
+        } else if (type == SecurityService.class) {
+            return (T) createSecurityService();
+        } else if (type == ServiceProvider.class) {
+            return (T) createServiceProvider();
+        } else if (type == ServicesJar.class) {
+            return (T) createServicesJar();
+        } else if (type == TransactionManager.class) {
+            return (T) createTransactionManager();
+        }
+        throw new IllegalArgumentException("Unknown type " + type.getName());
+    }
+
+    public static ServicesJar readServicesJar(String providerName) throws OpenEJBException {
+        InputStream in = null;
+        URL url = null;
+        try {
+            ResourceFinder finder = new ResourceFinder("META-INF/", Thread.currentThread().getContextClassLoader());
+            url = finder.find(providerName + "/service-jar.xml");
+            in = url.openStream();
+
+            ServicesJar servicesJar = unmarshal(ServicesJar.class, in);
+            return servicesJar;
+        } catch (MalformedURLException e) {
+            throw new OpenEJBException("Unable to resolve service provider " + providerName, e);
+        } catch (Exception e) {
+            throw new OpenEJBException("Unable to read OpenEJB service-jar file for provider " + providerName + " at " + url, e);
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+    }
+
+    public static Openejb readConfig(String configFile) throws OpenEJBException {
+        InputStream in = null;
+        try {
+            if (configFile.startsWith("jar:")) {
+                URL url = new URL(configFile);
+                in = url.openStream();
+            } else if (configFile.startsWith("file:")) {
+                URL url = new URL(configFile);
+                in = url.openStream();
+            } else {
+                in = new FileInputStream(configFile);
+            }
+            Openejb openejb = unmarshal(Openejb.class, in);
+            return openejb;
+        } catch (MalformedURLException e) {
+            throw new OpenEJBException("Unable to resolve location " + configFile, e);
+        } catch (Exception e) {
+            throw new OpenEJBException("Unable to read OpenEJB configuration file at " + configFile, e);
+        } finally {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+    }
+
+    public static void writeConfig(String configFile, Openejb openejb) throws OpenEJBException {
+        OutputStream out = null;
+        try {
+            File file = new File(configFile);
+            out = new FileOutputStream(file);
+            marshal(Openejb.class, openejb, out);
+        } catch (IOException e) {
+            throw new OpenEJBException(ConfigUtils.messages.format("conf.1040", configFile, e.getLocalizedMessage()), e);
+        } catch (MarshalException e) {
+            if (e.getCause() instanceof IOException) {
+                throw new OpenEJBException(ConfigUtils.messages.format("conf.1040", configFile, e.getLocalizedMessage()), e);
+            } else {
+                throw new OpenEJBException(ConfigUtils.messages.format("conf.1050", configFile, e.getLocalizedMessage()), e);
+            }
+        } catch (ValidationException e) {
+            /* TODO: Implement informative error handling here.
+               The exception will say "X doesn't match the regular
+               expression Y"
+               This should be checked and more relevant information
+               should be given -- not everyone understands regular
+               expressions.
+             */
+            /* NOTE: This doesn't seem to ever happen. When the object graph
+             * is invalid, the MarshalException is thrown, not this one as you
+             * would think.
+             */
+            throw new OpenEJBException(ConfigUtils.messages.format("conf.1060", configFile, e.getLocalizedMessage()), e);
+        } catch (JAXBException e) {
+            throw new OpenEJBException(e);
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (Exception e) {
+                }
+            }
+        }
+    }
+
+    public static final ThreadLocal<Set<String>> currentPublicId = new ThreadLocal<Set<String>>();
+
+    private static Map<Class, JAXBContext> jaxbContexts = new HashMap<Class, JAXBContext>();
+
+    public static <T> String marshal(Class<T> type, Object object) throws JAXBException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        marshal(type, object, baos);
+
+        return new String(baos.toByteArray());
+    }
+
+    public static <T> void marshal(Class<T> type, Object object, OutputStream out) throws JAXBException {
+        JAXBContext jaxbContext = getContext(type);
+        Marshaller marshaller = jaxbContext.createMarshaller();
+
+        marshaller.setProperty("jaxb.formatted.output", true);
+
+        marshaller.marshal(object, out);
+    }
+
+    private static <T> JAXBContext getContext(Class<T> type) throws JAXBException {
+        JAXBContext jaxbContext = jaxbContexts.get(type);
+        if (jaxbContext == null) {
+            jaxbContext = JAXBContext.newInstance(type);
+            jaxbContexts.put(type, jaxbContext);
+        }
+        return jaxbContext;
+    }
+
+    @SuppressWarnings({"unchecked"})
+    public static <T> T unmarshal(Class<T> type, InputStream in) throws ParserConfigurationException, SAXException, JAXBException {
+        InputSource inputSource = new InputSource(in);
+
+        SAXParserFactory factory = SAXParserFactory.newInstance();
+        factory.setNamespaceAware(true);
+        factory.setValidating(false);
+        SAXParser parser = factory.newSAXParser();
+
+        JAXBContext ctx = getContext(type);
+        Unmarshaller unmarshaller = ctx.createUnmarshaller();
+        unmarshaller.setEventHandler(new ValidationEventHandler() {
+            public boolean handleEvent(ValidationEvent validationEvent) {
+                System.out.println(validationEvent);
+                return false;
+            }
+        });
+
+
+        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
+        xmlFilter.setContentHandler(unmarshaller.getUnmarshallerHandler());
+
+        SAXSource source = new SAXSource(xmlFilter, inputSource);
+
+        currentPublicId.set(new TreeSet<String>());
+        try {
+            return (T) unmarshaller.unmarshal(source);
+        } finally {
+            currentPublicId.set(null);
+        }
+    }
+
+    public static class NamespaceFilter extends XMLFilterImpl {
+
+        public NamespaceFilter(XMLReader xmlReader) {
+            super(xmlReader);
+        }
+
+        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+            Set<String> publicIds = currentPublicId.get();
+            if (publicIds != null) {
+                publicIds.add(publicId);
+            }
+            return super.resolveEntity(publicId, systemId);
+        }
+
+        public void startElement(String uri, String localName, String qname, Attributes atts) throws SAXException {
+            super.startElement("http://www.openejb.org/System/Configuration", localName, qname, atts);
+        }
+    }
+
+
+    public static ConnectionManager createConnectionManager() {
+        return new ConnectionManager();
+    }
+
+    public static Connector createConnector() {
+        return new Connector();
+    }
+
+    public static Container createContainer() {
+        return new Container();
+    }
+
+    public static Deployments createDeployments() {
+        return new Deployments();
+    }
+
+    public static JndiProvider createJndiProvider() {
+        return new JndiProvider();
+    }
+
+    public static Openejb createOpenejb() {
+        return new Openejb();
+    }
+
+    public static ProxyFactory createProxyFactory() {
+        return new ProxyFactory();
+    }
+
+    public static Resource createResource() {
+        return new Resource();
+    }
+
+    public static SecurityService createSecurityService() {
+        return new SecurityService();
+    }
+
+    public static ServiceProvider createServiceProvider() {
+        return new ServiceProvider();
+    }
+
+    public static ServicesJar createServicesJar() {
+        return new ServicesJar();
+    }
+
+    public static TransactionManager createTransactionManager() {
+        return new TransactionManager();
+    }
+}

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProvider.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProvider.java?view=diff&rev=550914&r1=550913&r2=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProvider.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JndiProvider.java Tue Jun 26 12:23:36 2007
@@ -1,114 +1,47 @@
-/**
- * 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.
- */
-/*
- * This class was automatically generated with 
- * <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package org.apache.openejb.config.sys;
-
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-public class JndiProvider implements java.io.Serializable, org.apache.openejb.config.Service {
-
-
-    private java.lang.String _id;
-
-    private java.lang.String _provider;
-
-    private java.lang.String _jar;
-
-    private java.lang.String _content = "";
-
-
-    public JndiProvider() {
-        super();
-        setContent("");
-    }
-
-
-    public java.lang.String getContent() {
-        return this._content;
-    }
-
-    public java.lang.String getId() {
-        return this._id;
-    }
-
-    public java.lang.String getJar() {
-        return this._jar;
-    }
-
-    public java.lang.String getProvider() {
-        return this._provider;
-    }
-
-    public boolean isValid() {
-        try {
-            validate();
-        }
-        catch (org.exolab.castor.xml.ValidationException vex) {
-            return false;
-        }
-        return true;
-    }
-
-    public void marshal(java.io.Writer out)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, out);
-    }
-
-    public void marshal(org.xml.sax.ContentHandler handler)
-            throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-
-        Marshaller.marshal(this, handler);
-    }
-
-    public void setContent(java.lang.String content) {
-        this._content = content;
-    }
-
-    public void setId(java.lang.String id) {
-        this._id = id;
-    }
-
-    public void setJar(java.lang.String jar) {
-        this._jar = jar;
-    }
-
-    public void setProvider(java.lang.String provider) {
-        this._provider = provider;
-    }
-
-    public static java.lang.Object unmarshal(java.io.Reader reader)
-            throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
-        return (org.apache.openejb.config.sys.JndiProvider) Unmarshaller.unmarshal(org.apache.openejb.config.sys.JndiProvider.class, reader);
-    }
-
-    public void validate()
-            throws org.exolab.castor.xml.ValidationException {
-        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
-        validator.validate(this);
-    }
-
-}
+/**
+ *
+ * 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.sys;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * <p/>
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p/>
+ * <pre>
+ * &lt;complexType>
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
+ *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       &lt;attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
+ *       &lt;attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "JndiProvider")
+public class JndiProvider extends AbstractService {
+}

Added: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ObjectFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ObjectFactory.java?view=auto&rev=550914
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ObjectFactory.java (added)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ObjectFactory.java Tue Jun 26 12:23:36 2007
@@ -0,0 +1,121 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2007.06.25 at 06:22:02 PM PDT 
+//
+
+
+package org.apache.openejb.config.sys;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.apache.openejb.config.sys package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups.  Factory methods for each of these are
+ * provided in this class.
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.openejb.config.sys
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.Container }
+     */
+    public Container createContainer() {
+        return new Container();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.ConnectionManager }
+     */
+    public ConnectionManager createConnectionManager() {
+        return new ConnectionManager();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.Resource }
+     */
+    public Resource createResource() {
+        return new Resource();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.SecurityService }
+     */
+    public SecurityService createSecurityService() {
+        return new SecurityService();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.JndiProvider }
+     */
+    public JndiProvider createJndiProvider() {
+        return new JndiProvider();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.Deployments }
+     */
+    public Deployments createDeployments() {
+        return new Deployments();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.Connector }
+     */
+    public Connector createConnector() {
+        return new Connector();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.ProxyFactory }
+     */
+    public ProxyFactory createProxyFactory() {
+        return new ProxyFactory();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.Openejb }
+     */
+    public Openejb createOpenejb() {
+        return new Openejb();
+    }
+
+    /**
+     * Create an instance of {@link org.apache.openejb.config.sys.TransactionManager }
+     */
+    public TransactionManager createTransactionManager() {
+        return new TransactionManager();
+    }
+
+    /**
+     * Create an instance of {@link ServiceProvider }
+     */
+    public ServiceProvider createServiceProvider() {
+        return new ServiceProvider();
+    }
+
+    /**
+     * Create an instance of {@link ServicesJar }
+     */
+    public ServicesJar createServicesJar() {
+        return new ServicesJar();
+    }
+
+}