Author: dblevins
Date: Sat Jan 12 00:18:53 2013
New Revision: 1432340
URL: http://svn.apache.org/viewvc?rev=1432340&view=rev
Log:
TOMEE-727 - Optimized reading of xml deployment descriptors
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java
(with props)
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java
(with props)
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java
(with props)
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java
(with props)
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java
(with props)
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebXml.java
- copied, changed from r1429686,
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/EjbJarXml.java
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java
(with props)
Modified:
openejb/trunk/openejb/container/openejb-core/pom.xml
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
openejb/trunk/openejb/container/openejb-jee-accessors/pom.xml
openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Warmup.java
Modified: openejb/trunk/openejb/container/openejb-core/pom.xml
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/pom.xml?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/pom.xml (original)
+++ openejb/trunk/openejb/container/openejb-core/pom.xml Sat Jan 12 00:18:53
2013
@@ -424,6 +424,11 @@
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-jee-accessors</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
<artifactId>openejb-itests-app</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Modified:
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
(original)
+++
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/AppInfoBuilder.java
Sat Jan 12 00:18:53 2013
@@ -42,8 +42,12 @@ import org.apache.openejb.assembler.clas
import org.apache.openejb.assembler.classic.ValidatorBuilder;
import org.apache.openejb.assembler.classic.WebAppInfo;
import org.apache.openejb.config.sys.Container;
+import org.apache.openejb.config.sys.JaxbOpenejb;
+import org.apache.openejb.config.sys.Openejb;
import org.apache.openejb.config.sys.Resource;
+import org.apache.openejb.config.sys.Resources;
import org.apache.openejb.config.sys.ServiceProvider;
+import org.apache.openejb.config.sys.ServicesJar;
import org.apache.openejb.jee.AdminObject;
import org.apache.openejb.jee.ApplicationClient;
import org.apache.openejb.jee.ConfigProperty;
@@ -71,6 +75,7 @@ import org.apache.openejb.jee.oejb3.EjbD
import org.apache.openejb.jee.oejb3.OpenejbJar;
import org.apache.openejb.jee.oejb3.PojoDeployment;
import org.apache.openejb.jpa.integration.MakeTxLookup;
+import org.apache.openejb.loader.IO;
import org.apache.openejb.loader.SystemInstance;
import org.apache.openejb.util.CircularReferencesException;
import org.apache.openejb.util.LogCategory;
@@ -81,6 +86,7 @@ import org.apache.openejb.util.Reference
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.IOException;
+import java.io.OutputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
@@ -445,7 +451,8 @@ class AppInfoBuilder {
// the id generation code in AutoConfig$AppResources
//
- final Connector connector = connectorModule.getConnector();
+ final Resources config = new Resources();
+ Connector connector = connectorModule.getConnector();
final ConnectorInfo connectorInfo = new ConnectorInfo();
connectorInfo.description = connector.getDescription();
@@ -472,12 +479,10 @@ class AppInfoBuilder {
final String id = this.getId(connectorModule);
final String className =
resourceAdapter.getResourceAdapterClass();
- final ServiceProvider provider = new
ServiceProvider(className, id, "Resource");
- provider.getTypes().add(className);
+ Resource resource = new Resource(id, className);
+ resource.setType(className);
+ resource.setClassName(className);
- ServiceUtils.registerServiceProvider(appId, provider);
-
- final Resource resource = new Resource(id, className, appId +
"#" + id);
for (final ConfigProperty property :
resourceAdapter.getConfigProperty()) {
final String name = property.getConfigPropertyName();
@@ -486,7 +491,9 @@ class AppInfoBuilder {
resource.getProperties().setProperty(name, value);
}
}
- connectorInfo.resourceAdapter =
this.configFactory.configureService(resource, ResourceInfo.class);
+
+ config.getResource().add(resource);
+ connectorInfo.resourceAdapter =
configFactory.configureService(resource, ResourceInfo.class);
}
final OutboundResourceAdapter outbound =
resourceAdapter.getOutboundResourceAdapter();
@@ -509,16 +516,14 @@ class AppInfoBuilder {
final String className =
connection.getManagedConnectionFactoryClass();
final String type =
connection.getConnectionFactoryInterface();
- final ServiceProvider provider = new
ServiceProvider(className, id, "Resource");
- provider.getTypes().add(type);
-
- ServiceUtils.registerServiceProvider(appId, provider);
-
- final Resource resource = new Resource(id, type, appId +
"#" + id);
- final Properties properties = resource.getProperties();
- for (final ConfigProperty property :
connection.getConfigProperty()) {
- final String name = property.getConfigPropertyName();
- final String value = property.getConfigPropertyValue();
+ Resource resource = new Resource(id, type);
+ resource.setType(type);
+ resource.setClassName(className);
+
+ Properties properties = resource.getProperties();
+ for (ConfigProperty property :
connection.getConfigProperty()) {
+ String name = property.getConfigPropertyName();
+ String value = property.getConfigPropertyValue();
if (value != null) {
properties.setProperty(name, value);
}
@@ -528,7 +533,8 @@ class AppInfoBuilder {
properties.setProperty("ResourceAdapter",
connectorInfo.resourceAdapter.id);
}
- final ResourceInfo resourceInfo =
this.configFactory.configureService(resource, ResourceInfo.class);
+ config.getResource().add(resource);
+ ResourceInfo resourceInfo =
configFactory.configureService(resource, ResourceInfo.class);
connectorInfo.outbound.add(resourceInfo);
}
}
@@ -545,7 +551,8 @@ class AppInfoBuilder {
properties.setProperty("MessageListenerInterface",
messageListener.getMessageListenerType());
properties.setProperty("ActivationSpecClass",
messageListener.getActivationSpec().getActivationSpecClass());
- final MdbContainerInfo mdbContainerInfo =
this.configFactory.configureService(container, MdbContainerInfo.class);
+ config.getContainer().add(container);
+ MdbContainerInfo mdbContainerInfo =
configFactory.configureService(container, MdbContainerInfo.class);
connectorInfo.inbound.add(mdbContainerInfo);
}
}
@@ -556,24 +563,34 @@ class AppInfoBuilder {
final String className = adminObject.getAdminObjectClass();
final String type = adminObject.getAdminObjectInterface();
- final ServiceProvider provider = new
ServiceProvider(className, id, "Resource");
- provider.getTypes().add(type);
-
- ServiceUtils.registerServiceProvider(appId, provider);
-
- final Resource resource = new Resource(id, type, appId + "#" +
id);
- final Properties properties = resource.getProperties();
- for (final ConfigProperty property :
adminObject.getConfigProperty()) {
- final String name = property.getConfigPropertyName();
- final String value = property.getConfigPropertyValue();
+ Resource resource = new Resource(id, type);
+ resource.setType(type);
+ resource.setClassName(className);
+
+ Properties properties = resource.getProperties();
+ for (ConfigProperty property :
adminObject.getConfigProperty()) {
+ String name = property.getConfigPropertyName();
+ String value = property.getConfigPropertyValue();
if (value != null) {
properties.setProperty(name, value);
}
}
- final ResourceInfo resourceInfo =
this.configFactory.configureService(resource, ResourceInfo.class);
+
+ config.getResource().add(resource);
+ ResourceInfo resourceInfo =
configFactory.configureService(resource, ResourceInfo.class);
connectorInfo.adminObject.add(resourceInfo);
}
+ final File file = new File("/tmp/resources.xml");
+
+ try {
+ final OutputStream write = IO.write(file);
+ JaxbOpenejb.marshal(Resources.class, config, write);
+ write.flush();
+ write.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
appInfo.connectors.add(connectorInfo);
}
}
Modified:
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
(original)
+++
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
Sat Jan 12 00:18:53 2013
@@ -31,7 +31,6 @@ import org.apache.openejb.jee.Connector;
import org.apache.openejb.jee.EjbJar;
import org.apache.openejb.jee.FacesConfig;
import org.apache.openejb.jee.JavaWsdlMapping;
-import org.apache.openejb.jee.JaxbJavaee;
import org.apache.openejb.jee.JspConfig;
import org.apache.openejb.jee.Module;
import org.apache.openejb.jee.Taglib;
@@ -43,6 +42,7 @@ import org.apache.openejb.jee.oejb3.Open
import org.apache.openejb.loader.FileUtils;
import org.apache.openejb.loader.IO;
import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.sxc.ApplicationXml;
import org.apache.openejb.util.AnnotationFinder;
import org.apache.openejb.util.JarExtractor;
import org.apache.openejb.util.LogCategory;
@@ -54,9 +54,7 @@ import org.apache.xbean.finder.UrlSet;
import org.apache.xbean.finder.archive.ClassesArchive;
import org.apache.xbean.finder.filter.Filter;
import org.apache.xbean.finder.filter.Filters;
-import org.xml.sax.SAXException;
-import javax.xml.bind.JAXBException;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
@@ -333,7 +331,8 @@ public class DeploymentLoader implements
final Application application;
if (applicationXmlUrl != null) {
- application = unmarshal(Application.class, "application.xml",
applicationXmlUrl);
+
+ application = unmarshal(applicationXmlUrl);
for (final Module module : application.getModule()) {
try {
if (module.getEjb() != null) {
@@ -1471,17 +1470,11 @@ public class DeploymentLoader implements
}
@SuppressWarnings({"unchecked"})
- public static <T> T unmarshal(final Class<T> type, final String
descriptor, final URL url) throws OpenEJBException {
+ public static Application unmarshal(final URL url) throws OpenEJBException
{
try {
- return (T) JaxbJavaee.unmarshalJavaee(type, new
BufferedInputStream(url.openStream()));
- } catch (SAXException e) {
- throw new OpenEJBException("Cannot parse the " + descriptor + "
file: " + url.toExternalForm(), e);
- } catch (JAXBException e) {
- throw new OpenEJBException("Cannot unmarshall the " + descriptor +
" file: " + url.toExternalForm(), e);
- } catch (IOException e) {
- throw new OpenEJBException("Cannot read the " + descriptor + "
file: " + url.toExternalForm(), e);
+ return ApplicationXml.unmarshal(url);
} catch (Exception e) {
- throw new OpenEJBException("Encountered unknown error parsing the
" + descriptor + " file: " + url.toExternalForm(), e);
+ throw new OpenEJBException("Encountered error parsing the
application.xml file: " + url.toExternalForm(), e);
}
}
Modified:
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
(original)
+++
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java
Sat Jan 12 00:18:53 2013
@@ -32,6 +32,7 @@ import org.apache.openejb.jee.oejb3.Open
import org.apache.openejb.loader.IO;
import org.apache.openejb.loader.Options;
import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.sxc.EjbJarXml;
import org.apache.openejb.util.LogCategory;
import org.apache.openejb.util.Logger;
@@ -214,7 +215,7 @@ public class OutputGeneratedDescriptors
final OutputStream out = IO.write(tempFile);
try {
- JaxbJavaee.marshal(EjbJar.class, ejbJar, out);
+ EjbJarXml.marshal(ejbJar, out);
logger.info("Dumping Generated ejb-jar.xml to: " +
tempFile.getAbsolutePath());
} catch (JAXBException e) {
} finally {
Modified:
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
(original)
+++
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Sat Jan 12 00:18:53 2013
@@ -34,6 +34,13 @@ import org.apache.openejb.jee.oejb2.Open
import org.apache.openejb.jee.oejb3.JaxbOpenejbJar3;
import org.apache.openejb.jee.oejb3.OpenejbJar;
import org.apache.openejb.loader.IO;
+import org.apache.openejb.sxc.ApplicationClientXml;
+import org.apache.openejb.sxc.EjbJarXml;
+import org.apache.openejb.sxc.FacesConfigXml;
+import org.apache.openejb.sxc.HandlerChainsXml;
+import org.apache.openejb.sxc.TldTaglibXml;
+import org.apache.openejb.sxc.WebXml;
+import org.apache.openejb.sxc.WebservicesXml;
import org.apache.openejb.util.*;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
@@ -509,7 +516,7 @@ public class ReadDescriptors implements
public static ApplicationClient readApplicationClient(final URL url)
throws OpenEJBException {
final ApplicationClient applicationClient;
try {
- applicationClient = (ApplicationClient)
JaxbJavaee.unmarshalJavaee(ApplicationClient.class, IO.read(url));
+ applicationClient = ApplicationClientXml.unmarshal(url);
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the
application-client.xml file: " + url.toExternalForm(), e);
} catch (JAXBException e) {
@@ -529,15 +536,13 @@ public class ReadDescriptors implements
final String id = getId(new
ByteArrayInputStream(content.getBytes()));
return new EjbJar(id);
}
- return (EjbJar) JaxbJavaee.unmarshalJavaee(EjbJar.class, new
ByteArrayInputStream(content.getBytes()));
+ return EjbJarXml.unmarshal(new
ByteArrayInputStream(content.getBytes()));
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the ejb-jar.xml"); //
file: " + url.toExternalForm(), e);
- } catch (JAXBException e) {
- throw new OpenEJBException("Cannot unmarshall the ejb-jar.xml");
// file: " + url.toExternalForm(), e);
} catch (IOException e) {
throw new OpenEJBException("Cannot read the ejb-jar.xml"); //
file: " + url.toExternalForm(), e);
} catch (Exception e) {
- throw new OpenEJBException("Encountered unknown error parsing the
ejb-jar.xml"); // file: " + url.toExternalForm(), e);
+ throw new OpenEJBException("Encountered error parsing the
ejb-jar.xml"); // file: " + url.toExternalForm(), e);
}
}
@@ -612,9 +617,8 @@ public class ReadDescriptors implements
}
public static Webservices readWebservices(final URL url) throws
OpenEJBException {
- final Webservices webservices;
try {
- webservices = (Webservices)
JaxbJavaee.unmarshalJavaee(Webservices.class, IO.read(url));
+ return WebservicesXml.unmarshal(url);
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the webservices.xml file:
" + url.toExternalForm(), e);
} catch (JAXBException e) {
@@ -624,13 +628,11 @@ public class ReadDescriptors implements
} catch (Exception e) {
throw new OpenEJBException("Encountered unknown error parsing the
webservices.xml file: " + url.toExternalForm(), e);
}
- return webservices;
}
public static HandlerChains readHandlerChains(final URL url) throws
OpenEJBException {
- final HandlerChains handlerChains;
try {
- handlerChains = (HandlerChains)
JaxbJavaee.unmarshalHandlerChains(HandlerChains.class, IO.read(url));
+ return HandlerChainsXml.unmarshal(url);
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the webservices.xml file:
" + url.toExternalForm(), e);
} catch (JAXBException e) {
@@ -640,7 +642,6 @@ public class ReadDescriptors implements
} catch (Exception e) {
throw new OpenEJBException("Encountered unknown error parsing the
webservices.xml file: " + url.toExternalForm(), e);
}
- return handlerChains;
}
public static JavaWsdlMapping readJaxrpcMapping(final URL url) throws
OpenEJBException {
@@ -706,7 +707,7 @@ public class ReadDescriptors implements
public static WebApp readWebApp(final URL url) throws OpenEJBException {
final WebApp webApp;
try {
- webApp = (WebApp) JaxbJavaee.unmarshalJavaee(WebApp.class,
IO.read(url));
+ webApp = (WebApp) WebXml.unmarshal(url);
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the web.xml file: " +
url.toExternalForm(), e);
} catch (JAXBException e) {
@@ -730,9 +731,8 @@ public class ReadDescriptors implements
return taglib;
}
- final TldTaglib tldTaglib;
try {
- tldTaglib = (TldTaglib)
JaxbJavaee.unmarshalTaglib(TldTaglib.class, IO.read(url));
+ return TldTaglibXml.unmarshal(url);
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the JSP tag library
definition file: " + url.toExternalForm(), e);
} catch (JAXBException e) {
@@ -742,7 +742,6 @@ public class ReadDescriptors implements
} catch (Exception e) {
throw new OpenEJBException("Encountered unknown error parsing the
JSP tag library definition file: " + url.toExternalForm(), e);
}
- return tldTaglib;
}
public static FacesConfig readFacesConfig(final URL url) throws
OpenEJBException {
@@ -756,7 +755,7 @@ public class ReadDescriptors implements
if (isEmpty(new ByteArrayInputStream(content.getBytes()),
"faces-config")) {
return new FacesConfig();
}
- return (FacesConfig) JaxbJavaee.unmarshalJavaee(FacesConfig.class,
new ByteArrayInputStream(content.getBytes()));
+ return FacesConfigXml.unmarshal(new
ByteArrayInputStream(content.getBytes()));
} catch (SAXException e) {
throw new OpenEJBException("Cannot parse the faces configuration
file: " + url.toExternalForm(), e);
} catch (JAXBException e) {
Modified: openejb/trunk/openejb/container/openejb-jee-accessors/pom.xml
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/pom.xml?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-jee-accessors/pom.xml (original)
+++ openejb/trunk/openejb/container/openejb-jee-accessors/pom.xml Sat Jan 12
00:18:53 2013
@@ -48,7 +48,6 @@
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-loader</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.ApplicationClient;
+import org.apache.openejb.jee.ApplicationClient$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ApplicationClientXml {
+
+ public static ApplicationClient unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new ApplicationClient$JAXB(), inputStream);
+ }
+
+ public static ApplicationClient unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new ApplicationClient$JAXB(),
inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(ApplicationClient applicationClient,
OutputStream outputStream) throws Exception {
+ Sxc.marshal(new ApplicationClient$JAXB(), applicationClient, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationClientXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,51 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.Application;
+import org.apache.openejb.jee.Application$JAXB;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebApp$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ApplicationXml {
+
+ public static Application unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new Application$JAXB(), inputStream);
+ }
+
+ public static Application unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new Application$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(Application application, OutputStream
outputStream) throws Exception {
+ Sxc.marshal(new Application$JAXB(), application, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/ApplicationXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.FacesConfig;
+import org.apache.openejb.jee.FacesConfig$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class FacesConfigXml {
+
+ public static FacesConfig unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new FacesConfig$JAXB(), inputStream);
+ }
+
+ public static FacesConfig unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new FacesConfig$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(FacesConfig facesConfig, OutputStream
outputStream) throws Exception {
+ Sxc.marshal(new FacesConfig$JAXB(), facesConfig, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/FacesConfigXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.HandlerChains;
+import org.apache.openejb.jee.HandlerChains$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class HandlerChainsXml {
+
+ public static HandlerChains unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new HandlerChains$JAXB(), inputStream);
+ }
+
+ public static HandlerChains unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new HandlerChains$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(HandlerChains handlerChains, OutputStream
outputStream) throws Exception {
+ Sxc.marshal(new HandlerChains$JAXB(), handlerChains, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/HandlerChainsXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.TldTaglib;
+import org.apache.openejb.jee.TldTaglib$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TldTaglibXml {
+
+ public static TldTaglib unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new TldTaglib$JAXB(), inputStream);
+ }
+
+ public static TldTaglib unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new TldTaglib$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(TldTaglib taglib, OutputStream outputStream)
throws Exception {
+ Sxc.marshal(new TldTaglib$JAXB(), taglib, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/TldTaglibXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebXml.java
(from r1429686,
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/EjbJarXml.java)
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebXml.java?p2=openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebXml.java&p1=openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/EjbJarXml.java&r1=1429686&r2=1432340&rev=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/EjbJarXml.java
(original)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebXml.java
Sat Jan 12 00:18:53 2013
@@ -16,23 +16,34 @@
*/
package org.apache.openejb.sxc;
-import org.apache.openejb.jee.EjbJar;
-import org.apache.openejb.jee.EjbJar$JAXB;
+import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.jee.WebApp$JAXB;
+import org.apache.openejb.loader.IO;
import javax.xml.transform.stream.StreamResult;
import java.io.InputStream;
import java.io.OutputStream;
+import java.net.URL;
/**
* @version $Rev$ $Date$
*/
-public class EjbJarXml {
+public class WebXml {
- public static EjbJar unmarshal(InputStream inputStream) throws Exception {
- return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
+ public static WebApp unmarshal(InputStream inputStream) throws Exception {
+ return Sxc.unmarshalJavaee(new WebApp$JAXB(), inputStream);
}
- public static void marshal(EjbJar ejbJar, OutputStream outputStream)
throws Exception {
- Sxc.marshal(new EjbJar$JAXB(), ejbJar, new StreamResult(outputStream));
+ public static WebApp unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new WebApp$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(WebApp webApp, OutputStream outputStream)
throws Exception {
+ Sxc.marshal(new WebApp$JAXB(), webApp, new StreamResult(outputStream));
}
}
Added:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java?rev=1432340&view=auto
==============================================================================
---
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java
(added)
+++
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java
Sat Jan 12 00:18:53 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.sxc;
+
+import org.apache.openejb.jee.Webservices;
+import org.apache.openejb.jee.Webservices$JAXB;
+import org.apache.openejb.loader.IO;
+
+import javax.xml.transform.stream.StreamResult;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WebservicesXml {
+
+ public static Webservices unmarshal(InputStream inputStream) throws
Exception {
+ return Sxc.unmarshalJavaee(new Webservices$JAXB(), inputStream);
+ }
+
+ public static Webservices unmarshal(URL url) throws Exception {
+ final InputStream inputStream = IO.read(url);
+ try {
+ return Sxc.unmarshalJavaee(new Webservices$JAXB(), inputStream);
+ } finally {
+ IO.close(inputStream);
+ }
+ }
+
+ public static void marshal(Webservices webservices, OutputStream
outputStream) throws Exception {
+ Sxc.marshal(new Webservices$JAXB(), webservices, new
StreamResult(outputStream));
+ }
+}
Propchange:
openejb/trunk/openejb/container/openejb-jee-accessors/src/main/java/org/apache/openejb/sxc/WebservicesXml.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Warmup.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Warmup.java?rev=1432340&r1=1432339&r2=1432340&view=diff
==============================================================================
---
openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Warmup.java
(original)
+++
openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Warmup.java
Sat Jan 12 00:18:53 2013
@@ -157,10 +157,10 @@ public class Warmup {
final ClassLoader loader = Warmup.class.getClassLoader();
- final JaxbJavaeeLoad jaxbJavaeeLoad = new JaxbJavaeeLoad(WebApp.class);
- final Thread jaxb = new Thread(jaxbJavaeeLoad);
- jaxb.setDaemon(true);
- jaxb.start();
+// final JaxbJavaeeLoad jaxbJavaeeLoad = new
JaxbJavaeeLoad(WebApp.class);
+// final Thread jaxb = new Thread(jaxbJavaeeLoad);
+// jaxb.setDaemon(true);
+// jaxb.start();
try { // see org.apache.openejb.Core
Class.forName("org.apache.openejb.util.Logger", true, loader);
@@ -214,27 +214,27 @@ public class Warmup {
try {
semaphore.acquire(permits);
tld.join();
- jaxb.join();
+// jaxb.join();
} catch (InterruptedException e) {
Thread.interrupted();
}
}
- private static class JaxbJavaeeLoad implements Runnable {
-
- private final Class<?> type;
-
- private JaxbJavaeeLoad(Class<?> type) {
- this.type = type;
- }
-
- @Override
- public void run() {
- try {
- JaxbJavaee.getContext(type);
- } catch (JAXBException e) {
- }
- }
- }
+// private static class JaxbJavaeeLoad implements Runnable {
+//
+// private final Class<?> type;
+//
+// private JaxbJavaeeLoad(Class<?> type) {
+// this.type = type;
+// }
+//
+// @Override
+// public void run() {
+// try {
+// JaxbJavaee.getContext(type);
+// } catch (JAXBException e) {
+// }
+// }
+// }
}