[maven-scm] copy for tag specs-2.1.0
git-svn-id: https://svn.apache.org/repos/asf/servicemix/smx4/specs/tags/specs-2.1.0@1392986 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/trunk/assembly/pom.xml b/assembly/pom.xml
similarity index 100%
rename from trunk/assembly/pom.xml
rename to assembly/pom.xml
diff --git a/trunk/assembly/src/main/descriptors/src.xml b/assembly/src/main/descriptors/src.xml
similarity index 100%
rename from trunk/assembly/src/main/descriptors/src.xml
rename to assembly/src/main/descriptors/src.xml
diff --git a/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java b/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java
index 6fb3d99..a6ad195 100644
--- a/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java
+++ b/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java
@@ -171,12 +171,18 @@
ClassLoader classLoader = findClassLoader();
try {
// If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(iFactoryId);
+ Class factoryClass = null;
+ if (FactoryFinder.class.getClassLoader() != null) {
+ factoryClass = FactoryFinder.class.getClassLoader().loadClass(iFactoryId);
+ } else {
+ factoryClass = Class.forName(iFactoryId);
+ }
Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, iFactoryId);
if (spiClass != null) {
return spiClass.newInstance();
}
} catch (Throwable e) {
+ if (debug) e.printStackTrace();
}
try {
diff --git a/pom.xml b/pom.xml
index fac862c..10e9cf4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,6 @@
<inceptionYear>2007</inceptionYear>
<modules>
- <module>src-assembly</module>
<module>locator</module>
<module>activator</module>
<module>saaj-api-1.3</module>
@@ -65,6 +64,7 @@
<module>java-persistence-api-2.0</module>
<module>jsr303-api-1.0.0</module>
<module>jcr-api-2.0</module>
+ <module>assembly</module>
</modules>
<scm>
@@ -264,32 +264,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.3</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.bundles</groupId>
- <artifactId>src-assembly</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>make-src-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptorRefs>
- <descriptorRef>src-assembly</descriptorRef>
- </descriptorRefs>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
@@ -394,38 +368,6 @@
</build>
</profile>
<profile>
- <id>setup.eclipse</id>
- <modules>
- <module>assembly</module>
- </modules>
- <properties>
- <eclipse.workspace.dir>${basedir}/../workspace</eclipse.workspace.dir>
- </properties>
- <build>
- <defaultGoal>eclipse:eclipse</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <inherited>false</inherited>
- <executions>
- <execution>
- <id>setup.eclipse.workspace</id>
- <phase>process-test-sources</phase>
- <goals>
- <goal>add-maven-repo</goal>
- </goals>
- <configuration>
- <workspace>${eclipse.workspace.dir}</workspace>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
<id>deploy</id>
<build>
<defaultGoal>deploy</defaultGoal>
diff --git a/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java b/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
index ac9e9f5..b028edc 100644
--- a/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
+++ b/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
@@ -81,7 +81,11 @@
*/
static Object find(Class factory,
String defaultFactoryClassName) throws SOAPException {
- return find(factory.getName(), factory, defaultFactoryClassName);
+ String factoryPropertyName = factory.getName();
+ if ("javax.xml.soap.SAAJMetaFactory".equals(factoryPropertyName)) {
+ factoryPropertyName = "javax.xml.soap.MetaFactory";
+ }
+ return find(factoryPropertyName, factory, defaultFactoryClassName);
}
/**
* Instantiates a factory object given the factory's property name and the default class name.
@@ -106,6 +110,7 @@
static Object find(String factoryPropertyName,
Class factoryClass,
String defaultFactoryClassName) throws SOAPException {
+
try {
// If we are deployed into an OSGi environment, leverage it
if (factoryClass == null) {
diff --git a/src-assembly/pom.xml b/src-assembly/pom.xml
deleted file mode 100644
index d66c19c..0000000
--- a/src-assembly/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <artifactId>src-assembly</artifactId>
-
-</project>
\ No newline at end of file
diff --git a/src-assembly/src/main/resources/assemblies/src-assembly.xml b/src-assembly/src/main/resources/assemblies/src-assembly.xml
deleted file mode 100644
index 7c754d3..0000000
--- a/src-assembly/src/main/resources/assemblies/src-assembly.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-
- <id>src</id>
-
- <formats>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <includes>
- <include>pom.xml</include>
- <include>src/**/*</include>
- </includes>
- <useDefaultExcludes>true</useDefaultExcludes>
- </fileSet>
- </fileSets>
-
- <files>
- <file>
- <source>target/maven-shared-archive-resources/META-INF/LICENSE</source>
- <outputDirectory>.</outputDirectory>
- </file>
- <file>
- <source>target/maven-shared-archive-resources/META-INF/NOTICE</source>
- <outputDirectory>.</outputDirectory>
- </file>
- </files>
-
-</assembly>
\ No newline at end of file
diff --git a/trunk/.gitignore b/trunk/.gitignore
deleted file mode 100644
index e45abe8..0000000
--- a/trunk/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-target
-*.i??
\ No newline at end of file
diff --git a/trunk/LICENSE.txt b/trunk/LICENSE.txt
deleted file mode 100644
index 6b0b127..0000000
--- a/trunk/LICENSE.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
-
diff --git a/trunk/NOTICE.txt b/trunk/NOTICE.txt
deleted file mode 100644
index 15b77cc..0000000
--- a/trunk/NOTICE.txt
+++ /dev/null
@@ -1,9 +0,0 @@
- =========================================================================
- == NOTICE file for use with the Apache License, Version 2.0, ==
- == in this case for the Apache ServiceMix distribution. ==
- =========================================================================
-
- This product contains software developed by
- The Apache Software Foundation (http://www.apache.org/).
-
-
diff --git a/trunk/activation-api-1.1/pom.xml b/trunk/activation-api-1.1/pom.xml
deleted file mode 100644
index 1f678f5..0000000
--- a/trunk/activation-api-1.1/pom.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.activation-api-1.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Activation API 1.4</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.2.0</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <compilerArgument>-Xbootclasspath/p:${settings.localRepository}/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.0.2/geronimo-activation_1.1_spec-1.0.2.jar</compilerArgument>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.activation*;version=1.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>
- *,
- !org.apache.servicemix.specs.activation
- </Import-Package>
- <Private-Package>
- org.apache.servicemix.specs.locator;-split-package:=merge-first,
- org.apache.servicemix.specs.activation;-split-package:=merge-first
- </Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.activation.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-activation_1.1_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-activation_1.1_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/activation-api-1.1/src/main/java/javax/activation/DataHandler.java b/trunk/activation-api-1.1/src/main/java/javax/activation/DataHandler.java
deleted file mode 100644
index 817ef02..0000000
--- a/trunk/activation-api-1.1/src/main/java/javax/activation/DataHandler.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * 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 javax.activation;
-
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.net.URL;
-
-public class DataHandler implements Transferable {
- private final DataSource ds;
- private final DataFlavor flavor;
-
- private CommandMap commandMap;
- private DataContentHandler dch;
-
- public DataHandler(DataSource ds) {
- this.ds = ds;
- this.flavor = new ActivationDataFlavor(ds.getContentType(), null);
- }
-
- public DataHandler(Object data, String type) {
- this.ds = new ObjectDataSource(data, type);
- this.flavor = new ActivationDataFlavor(data.getClass(), null);
- }
-
- public DataHandler(URL url) {
- this.ds = new URLDataSource(url);
- this.flavor = new ActivationDataFlavor(ds.getContentType(), null);
- }
-
- public DataSource getDataSource() {
- return ds;
- }
-
- public String getName() {
- return ds.getName();
- }
-
- public String getContentType() {
- return ds.getContentType();
- }
-
- public InputStream getInputStream() throws IOException {
- return ds.getInputStream();
- }
-
- public void writeTo(OutputStream os) throws IOException {
- if (ds instanceof ObjectDataSource) {
- ObjectDataSource ods = (ObjectDataSource) ds;
- DataContentHandler dch = getDataContentHandler();
- if (dch == null) {
- throw new UnsupportedDataTypeException(ods.mimeType);
- }
- dch.writeTo(ods.data, ods.mimeType, os);
- } else {
- byte[] buffer = new byte[1024];
- InputStream is = getInputStream();
- try {
- int count;
- while ((count = is.read(buffer)) != -1) {
- os.write(buffer, 0, count);
- }
- } finally {
- is.close();
- }
- }
- }
-
- public OutputStream getOutputStream() throws IOException {
- return ds.getOutputStream();
- }
-
- public synchronized DataFlavor[] getTransferDataFlavors() {
- return getDataContentHandler().getTransferDataFlavors();
- }
-
- public boolean isDataFlavorSupported(DataFlavor flavor) {
- DataFlavor[] flavors = getTransferDataFlavors();
- for (int i = 0; i < flavors.length; i++) {
- DataFlavor dataFlavor = flavors[i];
- if (dataFlavor.equals(flavor)) {
- return true;
- }
- }
- return false;
- }
-
- public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
- DataContentHandler dch = getDataContentHandler();
- if (dch != null) {
- return dch.getTransferData(flavor, ds);
- } else if (this.flavor.match(flavor)) {
- if (ds instanceof ObjectDataSource) {
- return ((ObjectDataSource) ds).data;
- } else {
- return ds.getInputStream();
- }
- } else {
- throw new UnsupportedFlavorException(flavor);
- }
- }
-
- public CommandInfo[] getPreferredCommands() {
- return getCommandMap().getPreferredCommands(ds.getContentType());
- }
-
- public CommandInfo[] getAllCommands() {
- return getCommandMap().getAllCommands(ds.getContentType());
- }
-
- public CommandInfo getCommand(String cmdName) {
- return getCommandMap().getCommand(ds.getContentType(), cmdName);
- }
-
- public Object getContent() throws IOException {
- if (ds instanceof ObjectDataSource) {
- return ((ObjectDataSource) ds).data;
- } else {
- DataContentHandler dch = getDataContentHandler();
- if (dch != null) {
- return dch.getContent(ds);
- } else {
- return ds.getInputStream();
- }
- }
- }
-
- public Object getBean(CommandInfo cmdinfo) {
- try {
- return cmdinfo.getCommandObject(this, this.getClass().getClassLoader());
- } catch (IOException e) {
- return null;
- } catch (ClassNotFoundException e) {
- return null;
- }
- }
-
- /**
- * A local implementation of DataSouce used to wrap an Object and mime-type.
- */
- private class ObjectDataSource implements DataSource {
- private final Object data;
- private final String mimeType;
-
- public ObjectDataSource(Object data, String mimeType) {
- this.data = data;
- this.mimeType = mimeType;
- }
-
- public String getName() {
- return null;
- }
-
- public String getContentType() {
- return mimeType;
- }
-
- public InputStream getInputStream() throws IOException {
- final DataContentHandler dch = getDataContentHandler();
- if (dch == null) {
- throw new UnsupportedDataTypeException(mimeType);
- }
- final PipedInputStream is = new PipedInputStream();
- final PipedOutputStream os = new PipedOutputStream(is);
- Thread thread = new Thread("DataHandler Pipe Pump") {
- public void run() {
- try {
- try {
- dch.writeTo(data, mimeType, os);
- } finally {
- os.close();
- }
- } catch (IOException e) {
- // ignore, per spec - doh!
- }
- }
- };
- thread.start();
- return is;
- }
-
- public OutputStream getOutputStream() throws IOException {
- return null;
- }
- }
-
- public synchronized void setCommandMap(CommandMap commandMap) {
- this.commandMap = commandMap;
- this.dch = null;
- }
-
- private synchronized CommandMap getCommandMap() {
- return commandMap != null ? commandMap : CommandMap.getDefaultCommandMap();
- }
-
- /**
- * Search for a DataContentHandler for our mime type.
- * The search is performed by first checking if a global factory has been set using
- * {@link #setDataContentHandlerFactory(DataContentHandlerFactory)};
- * if found then it is called to attempt to create a handler.
- * If this attempt fails, we then call the command map set using {@link #setCommandMap(CommandMap)}
- * (or if that has not been set, the default map returned by {@link CommandMap#getDefaultCommandMap()})
- * to create the handler.
- *
- * The resulting handler is cached until the global factory is changed.
- *
- * @return
- */
- private synchronized DataContentHandler getDataContentHandler() {
- DataContentHandlerFactory localFactory;
- synchronized (DataHandler.class) {
- if (factory != originalFactory) {
- // setDCHF was called - clear our cached copy of the DCH and DCHF
- dch = null;
- originalFactory = factory;
- }
- localFactory = originalFactory;
- }
- if (dch == null) {
- // get the main mime-type portion of the content.
- String mimeType = getMimeType(ds.getContentType());
- if (localFactory != null) {
- dch = localFactory.createDataContentHandler(mimeType);
- }
- if (dch == null) {
- dch = CommandMap.getDefaultCommandMap().createDataContentHandler(mimeType);
- }
- }
- return dch;
- }
-
- /**
- * Retrieve the base MIME type from a content type. This parses
- * the type into its base components, stripping off any parameter
- * information.
- *
- * @param contentType
- * The content type string.
- *
- * @return The MIME type identifier portion of the content type.
- */
- private String getMimeType(String contentType) {
- try {
- MimeType mimeType = new MimeType(contentType);
- return mimeType.getBaseType();
- } catch (MimeTypeParseException e) {
- }
- return contentType;
- }
-
- /**
- * This is used to check if the DataContentHandlerFactory has been changed.
- * This is not specified behaviour but this check is required to make this work like the RI.
- */
- private DataContentHandlerFactory originalFactory;
-
- {
- synchronized (DataHandler.class) {
- originalFactory = factory;
- }
- }
-
- private static DataContentHandlerFactory factory;
-
- /**
- * Set the DataContentHandlerFactory to use.
- * If this method has already been called then an Error is raised.
- *
- * @param newFactory the new factory
- * @throws SecurityException if the caller does not have "SetFactory" RuntimePermission
- */
- public static synchronized void setDataContentHandlerFactory(DataContentHandlerFactory newFactory) {
- if (factory != null) {
- throw new Error("javax.activation.DataHandler.setDataContentHandlerFactory has already been defined");
- }
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkSetFactory();
- }
- factory = newFactory;
- }
-}
diff --git a/trunk/activation-api-1.1/src/main/java/javax/activation/MailcapCommandMap.java b/trunk/activation-api-1.1/src/main/java/javax/activation/MailcapCommandMap.java
deleted file mode 100644
index ef6fd50..0000000
--- a/trunk/activation-api-1.1/src/main/java/javax/activation/MailcapCommandMap.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/*
- * 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 javax.activation;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.security.Security;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @version $Rev$ $Date$
- */
-public class MailcapCommandMap extends CommandMap {
- private final Map mimeTypes = new HashMap();
- private final Map preferredCommands = new HashMap();
- private final Map allCommands = new HashMap();
- // the unparsed commands from the mailcap file.
- private final Map nativeCommands = new HashMap();
- // commands identified as fallbacks...these are used last, and also used as wildcards.
- private final Map fallbackCommands = new HashMap();
- private URL url;
-
- public MailcapCommandMap() {
- ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
- // process /META-INF/mailcap.default
- try {
- InputStream is = MailcapCommandMap.class.getResourceAsStream("/META-INF/mailcap.default");
- if (is != null) {
- try {
- parseMailcap(is);
- } finally {
- is.close();
- }
- }
- } catch (IOException e) {
- // ignore
- }
-
- // process /META-INF/mailcap resources
- try {
- Enumeration e = contextLoader.getResources("META-INF/mailcap");
- while (e.hasMoreElements()) {
- url = ((URL) e.nextElement());
- try {
- InputStream is = url.openStream();
- try {
- parseMailcap(is);
- } finally {
- is.close();
- }
- } catch (IOException e1) {
- continue;
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- // process ${java.home}/lib/mailcap
- try {
- File file = new File(System.getProperty("java.home"), "lib/mailcap");
- InputStream is = new FileInputStream(file);
- try {
- parseMailcap(is);
- } finally {
- is.close();
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- // process ${user.home}/lib/mailcap
- try {
- File file = new File(System.getProperty("user.home"), ".mailcap");
- InputStream is = new FileInputStream(file);
- try {
- parseMailcap(is);
- } finally {
- is.close();
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
- }
-
- public MailcapCommandMap(String fileName) throws IOException {
- this();
- FileReader reader = new FileReader(fileName);
- try {
- parseMailcap(reader);
- } finally {
- reader.close();
- }
- }
-
- public MailcapCommandMap(InputStream is) {
- this();
- parseMailcap(is);
- }
-
- private void parseMailcap(InputStream is) {
- try {
- parseMailcap(new InputStreamReader(is));
- } catch (IOException e) {
- // spec API means all we can do is swallow this
- }
- }
-
- void parseMailcap(Reader reader) throws IOException {
- BufferedReader br = new BufferedReader(reader);
- String line;
- while ((line = br.readLine()) != null) {
- addMailcap(line);
- }
- }
-
- public synchronized void addMailcap(String mail_cap) {
- int index = 0;
- // skip leading whitespace
- index = skipSpace(mail_cap, index);
- if (index == mail_cap.length() || mail_cap.charAt(index) == '#') {
- return;
- }
-
- // get primary type
- int start = index;
- index = getToken(mail_cap, index);
- if (start == index) {
- return;
- }
- String mimeType = mail_cap.substring(start, index);
-
- // skip any spaces after the primary type
- index = skipSpace(mail_cap, index);
- if (index == mail_cap.length() || mail_cap.charAt(index) == '#') {
- return;
- }
-
- // get sub-type
- if (mail_cap.charAt(index) == '/') {
- index = skipSpace(mail_cap, ++index);
- start = index;
- index = getToken(mail_cap, index);
- mimeType = mimeType + '/' + mail_cap.substring(start, index);
- } else {
-
- mimeType = mimeType + "/*";
- }
-
- // we record all mappings using the lowercase version.
- mimeType = mimeType.toLowerCase();
-
- // skip spaces after mime type
- index = skipSpace(mail_cap, index);
-
- // expect a ';' to terminate field 1
- if (index == mail_cap.length() || mail_cap.charAt(index) != ';') {
- return;
- }
- // ok, we've parsed the mime text field, now parse the view field. If there's something
- // there, then we add this to the native text.
- index = skipSpace(mail_cap, index + 1);
- // if the next encountered text is not a ";", then we have a view. This gets added to the
- // native list.
- if (index == mail_cap.length() || mail_cap.charAt(index) != ';') {
- ArrayList nativeCommandList = (ArrayList)nativeCommands.get(mimeType);
-
- // if this is the first for this mimetype, create a holder
- if (nativeCommandList == null) {
- nativeCommandList = new ArrayList();
- nativeCommands.put(mimeType, nativeCommandList);
- }
-
- // now add this as an entry in the list.
- nativeCommandList.add(mail_cap);
- // now skip forward to the next field marker, if any
- index = getMText(mail_cap, index);
- }
-
- // we don't know which list this will be added to until we finish parsing, as there
- // can be an x-java-fallback-entry parameter that moves this to the fallback list.
- List commandList = new ArrayList();
- // but by default, this is not a fallback.
- boolean fallback = false;
-
- int fieldNumber = 0;
-
- // parse fields
- while (index < mail_cap.length() && mail_cap.charAt(index) == ';') {
- index = skipSpace(mail_cap, index + 1);
- start = index;
- index = getToken(mail_cap, index);
- String fieldName = mail_cap.substring(start, index).toLowerCase();
- index = skipSpace(mail_cap, index);
- if (index < mail_cap.length() && mail_cap.charAt(index) == '=') {
- index = skipSpace(mail_cap, index + 1);
- start = index;
- index = getMText(mail_cap, index);
- String value = mail_cap.substring(start, index);
- index = skipSpace(mail_cap, index);
- if (fieldName.startsWith("x-java-") && fieldName.length() > 7) {
- String command = fieldName.substring(7);
- value = value.trim();
- if (command.equals("fallback-entry")) {
- if (value.equals("true")) {
- fallback = true;
- }
- }
- else {
- // create a CommandInfo item and add it the accumulator
- CommandInfo info = new CommandInfo(command, value);
- commandList.add(info);
- }
- }
- }
- }
- addCommands(mimeType, commandList, fallback);
- }
-
- /**
- * Add a parsed list of commands to the appropriate command list.
- *
- * @param mimeType The mimeType name this is added under.
- * @param commands A List containing the command information.
- * @param fallback The target list identifier.
- */
- protected void addCommands(String mimeType, List commands, boolean fallback) {
- // add this to the mimeType set
- mimeTypes.put(mimeType, mimeType);
- // the target list changes based on the type of entry.
- Map target = fallback ? fallbackCommands : preferredCommands;
-
- // now process
- for (Iterator i = commands.iterator(); i.hasNext();) {
- CommandInfo info = (CommandInfo)i.next();
- addCommand(target, mimeType, info);
- // if this is not a fallback position, then this to the allcommands list.
- if (!fallback) {
- List cmdList = (List) allCommands.get(mimeType);
- if (cmdList == null) {
- cmdList = new ArrayList();
- allCommands.put(mimeType, cmdList);
- }
- cmdList.add(info);
- }
- }
- }
-
-
- /**
- * Add a command to a target command list (preferred or fallback).
- *
- * @param commandList
- * The target command list.
- * @param mimeType The MIME type the command is associated with.
- * @param command The command information.
- */
- protected void addCommand(Map commandList, String mimeType, CommandInfo command) {
-
- Map commands = (Map) commandList.get(mimeType);
- if (commands == null) {
- commands = new HashMap();
- commandList.put(mimeType, commands);
- }
- commands.put(command.getCommandName(), command);
- }
-
-
- private int skipSpace(String s, int index) {
- while (index < s.length() && Character.isWhitespace(s.charAt(index))) {
- index++;
- }
- return index;
- }
-
- private int getToken(String s, int index) {
- while (index < s.length() && s.charAt(index) != '#' && !MimeType.isSpecial(s.charAt(index))) {
- index++;
- }
- return index;
- }
-
- private int getMText(String s, int index) {
- while (index < s.length()) {
- char c = s.charAt(index);
- if (c == '#' || c == ';' || Character.isISOControl(c)) {
- return index;
- }
- if (c == '\\') {
- index++;
- if (index == s.length()) {
- return index;
- }
- }
- index++;
- }
- return index;
- }
-
- public synchronized CommandInfo[] getPreferredCommands(String mimeType) {
- // get the mimetype as a lowercase version.
- mimeType = mimeType.toLowerCase();
-
- Map commands = (Map) preferredCommands.get(mimeType);
- if (commands == null) {
- commands = (Map) preferredCommands.get(getWildcardMimeType(mimeType));
- }
-
- Map fallbackCommands = getFallbackCommands(mimeType);
-
- // if we have fall backs, then we need to merge this stuff.
- if (fallbackCommands != null) {
- // if there's no command list, we can just use this as the master list.
- if (commands == null) {
- commands = fallbackCommands;
- }
- else {
- // merge the two lists. The ones in the commands list will take precedence.
- commands = mergeCommandMaps(commands, fallbackCommands);
- }
- }
-
- // now convert this into an array result.
- if (commands == null) {
- return new CommandInfo[0];
- }
- return (CommandInfo[]) commands.values().toArray(new CommandInfo[commands.size()]);
- }
-
- private Map getFallbackCommands(String mimeType) {
- Map commands = (Map) fallbackCommands.get(mimeType);
-
- // now we also need to search this as if it was a wildcard. If we get a wildcard hit,
- // we have to merge the two lists.
- Map wildcardCommands = (Map)fallbackCommands.get(getWildcardMimeType(mimeType));
- // no wildcard version
- if (wildcardCommands == null) {
- return commands;
- }
- // we need to merge these.
- return mergeCommandMaps(commands, wildcardCommands);
- }
-
-
- private Map mergeCommandMaps(Map main, Map fallback) {
- // create a cloned copy of the second map. We're going to use a PutAll operation to
- // overwrite any duplicates.
- Map result = new HashMap(fallback);
- result.putAll(main);
-
- return result;
- }
-
- public synchronized CommandInfo[] getAllCommands(String mimeType) {
- mimeType = mimeType.toLowerCase();
- List exactCommands = (List) allCommands.get(mimeType);
- if (exactCommands == null) {
- exactCommands = Collections.EMPTY_LIST;
- }
- List wildCommands = (List) allCommands.get(getWildcardMimeType(mimeType));
- if (wildCommands == null) {
- wildCommands = Collections.EMPTY_LIST;
- }
-
- Map fallbackCommands = getFallbackCommands(mimeType);
- if (fallbackCommands == null) {
- fallbackCommands = Collections.EMPTY_MAP;
- }
-
-
- CommandInfo[] result = new CommandInfo[exactCommands.size() + wildCommands.size() + fallbackCommands.size()];
- int j = 0;
- for (int i = 0; i < exactCommands.size(); i++) {
- result[j++] = (CommandInfo) exactCommands.get(i);
- }
- for (int i = 0; i < wildCommands.size(); i++) {
- result[j++] = (CommandInfo) wildCommands.get(i);
- }
-
- for (Iterator i = fallbackCommands.keySet().iterator(); i.hasNext();) {
- result[j++] = (CommandInfo) fallbackCommands.get((String)i.next());
- }
- return result;
- }
-
- public synchronized CommandInfo getCommand(String mimeType, String cmdName) {
- mimeType = mimeType.toLowerCase();
- // strip any parameters from the supplied mimeType
- int i = mimeType.indexOf(';');
- if (i != -1) {
- mimeType = mimeType.substring(0, i).trim();
- }
-
- // search for an exact match
- Map commands = (Map) preferredCommands.get(mimeType);
- if (commands == null) {
- // then a wild card match
- commands = (Map) preferredCommands.get(getWildcardMimeType(mimeType));
- if (commands == null) {
- // then fallback searches, both standard and wild card.
- commands = (Map) fallbackCommands.get(mimeType);
- if (commands == null) {
- commands = (Map) fallbackCommands.get(getWildcardMimeType(mimeType));
- }
- if (commands == null) {
- return null;
- }
- }
- }
- return (CommandInfo) commands.get(cmdName.toLowerCase());
- }
-
- private String getWildcardMimeType(String mimeType) {
- int i = mimeType.indexOf('/');
- if (i == -1) {
- return mimeType + "/*";
- } else {
- return mimeType.substring(0, i + 1) + "*";
- }
- }
-
- public synchronized DataContentHandler createDataContentHandler(String mimeType) {
-
- CommandInfo info = getCommand(mimeType, "content-handler");
- if (info == null) {
- return null;
- }
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (cl == null) {
- cl = getClass().getClassLoader();
- }
- try {
- return (DataContentHandler) cl.loadClass(info.getCommandClass()).newInstance();
- } catch (ClassNotFoundException e) {
- return null;
- } catch (IllegalAccessException e) {
- return null;
- } catch (InstantiationException e) {
- return null;
- }
- }
-
- /**
- * Get all MIME types known to this command map.
- *
- * @return A String array of the MIME type names.
- */
- public synchronized String[] getMimeTypes() {
- ArrayList types = new ArrayList(mimeTypes.values());
- return (String[])types.toArray(new String[types.size()]);
- }
-
- /**
- * Return the list of raw command strings parsed
- * from the mailcap files for a given mimeType.
- *
- * @param mimeType The target mime type
- *
- * @return A String array of the raw command strings. Returns
- * an empty array if the mimetype is not currently known.
- */
- public synchronized String[] getNativeCommands(String mimeType) {
- ArrayList commands = (ArrayList)nativeCommands.get(mimeType.toLowerCase());
- if (commands == null) {
- return new String[0];
- }
- return (String[])commands.toArray(new String[commands.size()]);
- }
-}
diff --git a/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/Activator.java b/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/Activator.java
deleted file mode 100644
index ffde31a..0000000
--- a/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/Activator.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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.servicemix.specs.activation;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.activation.CommandMap;
-import javax.activation.DataContentHandler;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * A bundle activator for activation framework
- */
-public class Activator extends org.apache.servicemix.specs.locator.Activator {
-
- private Map<Long, MailCap> mailcaps = new ConcurrentHashMap<Long, MailCap>();
-
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- super.start(bundleContext);
- }
-
- @Override
- public void stop(BundleContext bundleContext) throws Exception {
- super.stop(bundleContext);
- CommandMap.setDefaultCommandMap(null);
- }
-
- @Override
- protected void register(Bundle bundle) {
- debugPrintln("checking bundle " + bundle.getBundleId());
- URL url = bundle.getResource("/META-INF/mailcap");
- if (url != null) {
- debugPrintln("found mailcap at " + url);
-
- try {
- final Class<?> clazz = bundle
- .loadClass("javax.activation.DataContentHandler");
- if (!clazz.isAssignableFrom(DataContentHandler.class)) {
- debugPrintln("incompatible DataContentHandler class in bundle "
- + bundle.getBundleId());
- return;
- }
- } catch (ClassNotFoundException e) {
- // ignored
- }
-
- mailcaps.put(bundle.getBundleId(), new MailCap(bundle, url));
- rebuildCommandMap();
- }
- }
-
- @Override
- protected void unregister(long bundleId) {
- MailCap mailcap = mailcaps.remove(bundleId);
- if (mailcap != null ){
- debugPrintln("removing mailcap at " + mailcap.url);
- rebuildCommandMap();
- }
- }
-
- private void rebuildCommandMap() {
- OsgiMailcapCommandMap commandMap = new OsgiMailcapCommandMap();
- for (MailCap mailcap : mailcaps.values()) {
- try {
- InputStream is = mailcap.url.openStream();
- try {
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
- String line;
- while ((line = br.readLine()) != null) {
- commandMap.addMailcap(line, mailcap.bundle);
- }
- } finally {
- is.close();
- }
- } catch (Exception e) {
- // Ignore
- }
- }
- CommandMap.setDefaultCommandMap(commandMap);
- }
-
- private static class MailCap {
- Bundle bundle;
- URL url;
-
- private MailCap(Bundle bundle, URL url) {
- this.bundle = bundle;
- this.url = url;
- }
- }
-
-}
diff --git a/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/OsgiMailcapCommandMap.java b/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/OsgiMailcapCommandMap.java
deleted file mode 100644
index a914247..0000000
--- a/trunk/activation-api-1.1/src/main/java/org/apache/servicemix/specs/activation/OsgiMailcapCommandMap.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.servicemix.specs.activation;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import javax.activation.MailcapCommandMap;
-import javax.activation.CommandInfo;
-import javax.activation.DataContentHandler;
-
-import org.osgi.framework.Bundle;
-
-/**
- * An OSGi enabled MailcapCommandMap
- */
-public class OsgiMailcapCommandMap extends MailcapCommandMap {
-
- private Bundle currentBundle;
- private Map<CommandInfo, Bundle> bundles = new HashMap<CommandInfo, Bundle>();
-
- public void addMailcap(String line, Bundle bundle) {
- currentBundle = bundle;
- addMailcap(line);
- }
-
- protected void addCommand(Map commandList, String mimeType, CommandInfo command) {
- super.addCommand(commandList, mimeType, command);
- if (currentBundle != null) {
- bundles.put(command, currentBundle);
- }
- }
-
- @Override
- public DataContentHandler createDataContentHandler(String mimeType) {
- CommandInfo info = getCommand(mimeType, "content-handler");
- if (info == null) {
- return null;
- }
-
- Bundle bundle = bundles.get(info);
- if (bundle != null) {
- try {
- return (DataContentHandler) bundle.loadClass(info.getCommandClass()).newInstance();
- } catch (ClassNotFoundException e) {
- return null;
- } catch (IllegalAccessException e) {
- return null;
- } catch (InstantiationException e) {
- return null;
- }
- }
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (cl == null) {
- cl = getClass().getClassLoader();
- }
- try {
- return (DataContentHandler) cl.loadClass(info.getCommandClass()).newInstance();
- } catch (ClassNotFoundException e) {
- return null;
- } catch (IllegalAccessException e) {
- return null;
- } catch (InstantiationException e) {
- return null;
- }
- }
-}
diff --git a/trunk/activator/pom.xml b/trunk/activator/pom.xml
deleted file mode 100644
index 77695ce..0000000
--- a/trunk/activator/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.activator</artifactId>
- <packaging>jar</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Activator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestEntries>
- <Karaf-Activator>org.apache.servicemix.specs.activator.Activator</Karaf-Activator>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/activator/src/main/java/org/apache/servicemix/specs/activator/Activator.java b/trunk/activator/src/main/java/org/apache/servicemix/specs/activator/Activator.java
deleted file mode 100644
index 26e0016..0000000
--- a/trunk/activator/src/main/java/org/apache/servicemix/specs/activator/Activator.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * 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.servicemix.specs.activator;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.servicemix.specs.locator.OsgiLocator;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.SynchronousBundleListener;
-
-public class Activator implements BundleActivator, SynchronousBundleListener {
-
- private static boolean debug = false;
-
- private ConcurrentMap<Long, Map<String, Callable<Class>>> factories = new ConcurrentHashMap<Long, Map<String, Callable<Class>>>();
-
- private BundleContext bundleContext;
-
- static {
- try {
- String prop = System.getProperty("org.apache.servicemix.specs.debug");
- debug = prop != null && !"false".equals(prop);
- } catch (Throwable t) { }
- }
-
- /**
- * <p>Output debugging messages.</p>
- *
- * @param msg <code>String</code> to print to <code>stderr</code>.
- */
- protected void debugPrintln(String msg) {
- if (debug) {
- System.err.println("Spec(" + bundleContext.getBundle().getBundleId() + "): " + msg);
- }
- }
-
- public synchronized void start(BundleContext bundleContext) throws Exception {
- this.bundleContext = bundleContext;
- debugPrintln("activating");
- debugPrintln("adding bundle listener");
- bundleContext.addBundleListener(this);
- debugPrintln("checking existing bundles");
- for (Bundle bundle : bundleContext.getBundles()) {
- if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING ||
- bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STOPPING) {
- register(bundle);
- }
- }
- debugPrintln("activated");
- }
-
- public synchronized void stop(BundleContext bundleContext) throws Exception {
- debugPrintln("deactivating");
- bundleContext.removeBundleListener(this);
- while (!factories.isEmpty()) {
- unregister(factories.keySet().iterator().next());
- }
- debugPrintln("deactivated");
- this.bundleContext = null;
- }
-
- public void bundleChanged(BundleEvent event) {
- if (event.getType() == BundleEvent.RESOLVED) {
- register(event.getBundle());
- } else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) {
- unregister(event.getBundle().getBundleId());
- }
- }
-
- protected void register(final Bundle bundle) {
- debugPrintln("checking bundle " + bundle.getBundleId());
- Map<String, Callable<Class>> map = factories.get(bundle.getBundleId());
- Enumeration e = bundle.findEntries("META-INF/services/", "*", false);
- if (e != null) {
- while (e.hasMoreElements()) {
- final URL u = (URL) e.nextElement();
- final String url = u.toString();
- if (url.endsWith("/")) {
- continue;
- }
- final String factoryId = url.substring(url.lastIndexOf("/") + 1);
- if (map == null) {
- map = new HashMap<String, Callable<Class>>();
- factories.put(bundle.getBundleId(), map);
- }
- map.put(factoryId, new BundleFactoryLoader(factoryId, u, bundle));
- }
- }
- if (map != null) {
- for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
- debugPrintln("registering service for key " + entry.getKey() + " with value " + entry.getValue());
- OsgiLocator.register(entry.getKey(), entry.getValue());
- }
- }
- }
-
- protected void unregister(long bundleId) {
- Map<String, Callable<Class>> map = factories.remove(bundleId);
- if (map != null) {
- for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
- debugPrintln("unregistering service for key " + entry.getKey() + " with value " + entry.getValue());
- OsgiLocator.unregister(entry.getKey(), entry.getValue());
- }
- }
- }
-
- private class BundleFactoryLoader implements Callable<Class> {
- private final String factoryId;
- private final URL u;
- private final Bundle bundle;
- private volatile Class<?> clazz;
-
- public BundleFactoryLoader(String factoryId, URL u, Bundle bundle) {
- this.factoryId = factoryId;
- this.u = u;
- this.bundle = bundle;
- }
-
- public Class call() throws Exception {
- try {
- debugPrintln("loading factory for key: " + factoryId);
-
- if (clazz == null){
- synchronized (this) {
- if (clazz == null){
- debugPrintln("creating factory for key: " + factoryId);
- BufferedReader br = new BufferedReader(new InputStreamReader(u.openStream(), "UTF-8"));
- String factoryClassName = br.readLine();
- br.close();
- debugPrintln("factory implementation: " + factoryClassName);
- clazz = bundle.loadClass(factoryClassName);
- }
- }
- }
- return clazz;
- } catch (Exception e) {
- debugPrintln("exception caught while creating factory: " + e);
- throw e;
- } catch (Error e) {
- debugPrintln("error caught while creating factory: " + e);
- throw e;
- }
- }
-
- @Override
- public String toString() {
- return u.toString();
- }
-
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof BundleFactoryLoader) {
- return u.equals(((BundleFactoryLoader) obj).u);
- } else {
- return false;
- }
- }
- }
-}
diff --git a/trunk/jain-sip-api-1.2/pom.xml b/trunk/jain-sip-api-1.2/pom.xml
deleted file mode 100644
index 3b3fc2f..0000000
--- a/trunk/jain-sip-api-1.2/pom.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jain-sip-api-1.2</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: SIP API 1.2</name>
-
- <repositories>
- <repository>
- <id>jboss</id>
- <url>http://repository.jboss.org/nexus/content/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>javax.sip</groupId>
- <artifactId>jain-sip-api</artifactId>
- <version>1.2</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.sip*;version=1.2;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/java-persistence-api-1.1.1/pom.xml b/trunk/java-persistence-api-1.1.1/pom.xml
deleted file mode 100644
index 9806dfe..0000000
--- a/trunk/java-persistence-api-1.1.1/pom.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Java Persistence API 1.4</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_3.0_spec</artifactId>
- <version>1.1.1</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.persistence*;version=1.1.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-jpa_3.0_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-jpa_3.0_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/java-persistence-api-1.1.1/src/main/java/javax/persistence/Persistence.java b/trunk/java-persistence-api-1.1.1/src/main/java/javax/persistence/Persistence.java
deleted file mode 100644
index b19cc5c..0000000
--- a/trunk/java-persistence-api-1.1.1/src/main/java/javax/persistence/Persistence.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * 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 source code implements specifications defined by the Java
-// Community Process. In order to remain compliant with the specification
-// DO NOT add / change / or delete method signatures!
-//
-package javax.persistence;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.persistence.spi.PersistenceProvider;
-/**
- * @version $Rev$ $Date$
- */
-
-/**
- * Bootstrap class that is used to obtain {@link javax.persistence.EntityManagerFactory}
- * references.
- */
-public class Persistence {
-
- protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
- // Changed to the hard coded PERSISTENCE_PROVIDER value to pass signature tests.
- // public static final java.lang.String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName();
- public static final java.lang.String PERSISTENCE_PROVIDER = "javax.persistence.spi.PeristenceProvider";
- static final String PERSISTENCE_PROVIDER_PROPERTY = "javax.persistence.provider";
- static final String PERSISTENCE_PROVIDER_SERVICE = "META-INF/services/"
- + PersistenceProvider.class.getName();
- /**
- * Create and return an EntityManagerFactory for the named persistence unit.
- *
- * @param persistenceUnitName The name of the persistence unit
- * @return The factory that creates EntityManagers configured according to the
- * specified persistence unit
- */
- public static EntityManagerFactory createEntityManagerFactory(
- String persistenceUnitName) {
- return createEntityManagerFactory(persistenceUnitName, Collections.EMPTY_MAP);
- }
-
- /**
- * Create and return an EntityManagerFactory for the named persistence unit using the
- * given properties.
- *
- * @param persistenceUnitName The name of the persistence unit
- * @param properties Additional properties to use when creating the factory. The values of
- * these properties override any values that may have been configured
- * elsewhere.
- * @return The factory that creates EntityManagers configured according to the
- * specified persistence unit.
- */
- public static EntityManagerFactory createEntityManagerFactory(
- String persistenceUnitName,
- Map properties) {
-
- if (properties == null) {
- properties = Collections.EMPTY_MAP;
- }
-
- // start by loading a provider explicitly specified in properties. The spec
- // doesn't seem to forbid providers that are not deployed as a service
- Object providerName = properties.get(PERSISTENCE_PROVIDER_PROPERTY);
- if (providerName instanceof String) {
- EntityManagerFactory factory = createFactory(
- providerName.toString(),
- persistenceUnitName,
- properties);
- if (factory != null) {
- return factory;
- }
- }
-
- //If we are deployed into an OSGi environment, leverage it
- Class<? extends PersistenceProvider> providerClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(PersistenceProvider.class);
- if (providerClass != null) {
- try {
- PersistenceProvider provider = providerClass.newInstance();
- return provider.createEntityManagerFactory(persistenceUnitName,
- properties);
- }
- catch (Exception e) {
- throw new PersistenceException("Provider error. Provider: "
- + providerName, e);
- }
- }
-
- // load correctly deployed providers
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try {
- Enumeration<URL> providers = loader
- .getResources(PERSISTENCE_PROVIDER_SERVICE);
- while (providers.hasMoreElements()) {
-
- String name = getProviderName(providers.nextElement());
-
- if (name != null) {
-
- EntityManagerFactory factory = createFactory(
- name,
- persistenceUnitName,
- properties);
-
- if (factory != null) {
- return factory;
- }
- }
- }
- }
- catch (IOException e) {
- // spec doesn't mention any exceptions thrown by this method
- }
-
- return null;
- }
-
- static String getProviderName(URL url) throws IOException {
-
- BufferedReader in = new BufferedReader(new InputStreamReader(
- url.openStream(),
- "UTF-8"));
-
- String providerName;
-
- try {
- providerName = in.readLine();
- }
- finally {
- in.close();
- }
-
- if (providerName != null) {
- providerName = providerName.trim();
- }
-
- return providerName;
- }
-
- static EntityManagerFactory createFactory(
- String providerName,
- String persistenceUnitName,
- Map properties)
- throws PersistenceException {
-
- Class providerClass;
- try {
- providerClass = Class.forName(providerName, true, Thread
- .currentThread().getContextClassLoader());
- }
- catch (Exception e) {
- throw new PersistenceException(
- "Invalid or inaccessible provider class: " + providerName,
- e);
- }
-
- try {
- PersistenceProvider provider = (PersistenceProvider) providerClass
- .newInstance();
- return provider.createEntityManagerFactory(persistenceUnitName,
- properties);
- }
- catch (Exception e) {
- throw new PersistenceException("Provider error. Provider: "
- + providerName, e);
- }
- }
-}
-
diff --git a/trunk/java-persistence-api-2.0/pom.xml b/trunk/java-persistence-api-2.0/pom.xml
deleted file mode 100644
index c24312b..0000000
--- a/trunk/java-persistence-api-2.0/pom.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.java-persistence-api-2.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Java Persistence API 2.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jpa_2.0_spec</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.persistence*;version=2.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-jpa_3.0_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-jpa_3.0_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourceJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/java-persistence-api-2.0/src/main/java/javax/persistence/Persistence.java b/trunk/java-persistence-api-2.0/src/main/java/javax/persistence/Persistence.java
deleted file mode 100644
index 37a205d..0000000
--- a/trunk/java-persistence-api-2.0/src/main/java/javax/persistence/Persistence.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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 source code implements specifications defined by the Java
-// Community Process. In order to remain compliant with the specification
-// DO NOT add / change / or delete method signatures!
-//
-package javax.persistence;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.persistence.spi.PersistenceProvider;
-
-/**
- * @version $Rev$ $Date$
- */
-
-/**
- * Bootstrap class that is used to obtain {@link javax.persistence.EntityManagerFactory}
- * references.
- */
-public class Persistence {
-
- protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
- // Changed to the hard coded PERSISTENCE_PROVIDER value to pass signature tests.
- // public static final java.lang.String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName();
- public static final java.lang.String PERSISTENCE_PROVIDER = "javax.persistence.spi.PersistenceProvider";
- static final String PERSISTENCE_PROVIDER_PROPERTY = "javax.persistence.provider";
- static final String PERSISTENCE_PROVIDER_SERVICE = "META-INF/services/"
- + PersistenceProvider.class.getName();
-
- /**
- * Create and return an EntityManagerFactory for the named persistence unit.
- *
- * @param persistenceUnitName The name of the persistence unit
- * @return The factory that creates EntityManagers configured according to the specified persistence unit
- */
- public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName) {
- return createEntityManagerFactory(persistenceUnitName, Collections.EMPTY_MAP);
- }
-
- public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties) {
-
- if (properties == null) {
- properties = Collections.EMPTY_MAP;
- }
-
- // start by loading a provider explicitly specified in properties. The spec
- // doesn't seem to forbid providers that are not deployed as a service
- Object providerName = properties.get(PERSISTENCE_PROVIDER_PROPERTY);
- if (providerName instanceof String) {
- EntityManagerFactory factory = createFactory(providerName.toString(), persistenceUnitName, properties);
- if (factory != null) {
- return factory;
- }
- }
-
- // If we are deployed into an OSGi environment, leverage it
- Class<? extends PersistenceProvider> providerClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(PersistenceProvider.class);
- if (providerClass != null) {
- try {
- PersistenceProvider provider = providerClass.newInstance();
- return provider.createEntityManagerFactory(persistenceUnitName, properties);
- }
- catch (Exception e) {
- throw new PersistenceException("Provider error. Provider: " + providerName, e);
- }
- }
-
- // load correctly deployed providers
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try {
- Enumeration<URL> providers = loader.getResources(PERSISTENCE_PROVIDER_SERVICE);
- while (providers.hasMoreElements()) {
-
- String name = getProviderName(providers.nextElement());
-
- if (name != null) {
-
- EntityManagerFactory factory = createFactory(name, persistenceUnitName, properties);
-
- if (factory != null) {
- return factory;
- }
- }
- }
- }
- catch (IOException e) {
- // spec doesn't mention any exceptions thrown by this method
- }
-
- return null;
- }
-
- static String getProviderName(URL url) throws IOException {
-
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));
-
- String providerName;
-
- try {
- providerName = in.readLine();
- }
- finally {
- in.close();
- }
-
- if (providerName != null) {
- providerName = providerName.trim();
- }
-
- return providerName;
- }
-
- static EntityManagerFactory createFactory(String providerName, String persistenceUnitName, Map properties) throws PersistenceException {
-
- Class providerClass;
- try {
- providerClass = Class.forName(providerName, true, Thread.currentThread().getContextClassLoader());
- }
- catch (Exception e) {
- throw new PersistenceException("Invalid or inaccessible provider class: " + providerName, e);
- }
-
- try {
- PersistenceProvider provider = (PersistenceProvider) providerClass.newInstance();
- return provider.createEntityManagerFactory(persistenceUnitName, properties);
- }
- catch (Exception e) {
- throw new PersistenceException("Provider error. Provider: " + providerName, e);
- }
-
- }
-
-}
diff --git a/trunk/javamail-api-1.4/pom.xml b/trunk/javamail-api-1.4/pom.xml
deleted file mode 100644
index 59f0915..0000000
--- a/trunk/javamail-api-1.4/pom.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.javamail-api-1.4</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JavaMail API 1.4</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-javamail_1.4_spec</artifactId>
- <version>1.6</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.mail*;version=1.4;-split-package:=merge-first,org.apache.geronimo.mail*;version=1.6;-split-package:=merge-first</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-javamail_1.4_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-javamail_1.4_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/javamail-api-1.4/src/main/java/javax/mail/Session.java b/trunk/javamail-api-1.4/src/main/java/javax/mail/Session.java
deleted file mode 100644
index c0471ba..0000000
--- a/trunk/javamail-api-1.4/src/main/java/javax/mail/Session.java
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- * 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 javax.mail;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.WeakHashMap;
-
-
-/**
- * OK, so we have a final class in the API with a heck of a lot of implementation required...
- * let's try and figure out what it is meant to do.
- * <p/>
- * It is supposed to collect together properties and defaults so that they can be
- * shared by multiple applications on a desktop; with process isolation and no
- * real concept of shared memory, this seems challenging. These properties and
- * defaults rely on system properties, making management in a app server harder,
- * and on resources loaded from "mail.jar" which may lead to skew between
- * differnet independent implementations of this API.
- *
- * @version $Rev$ $Date$
- */
-public final class Session {
- private static final Class[] PARAM_TYPES = {Session.class, URLName.class};
- private static final WeakHashMap addressMapsByClassLoader = new WeakHashMap();
- private static Session DEFAULT_SESSION;
-
- private Map passwordAuthentications = new HashMap();
-
- private final Properties properties;
- private final Authenticator authenticator;
- private boolean debug;
- private PrintStream debugOut = System.out;
-
- private static final WeakHashMap providersByClassLoader = new WeakHashMap();
-
- /**
- * No public constrcutor allowed.
- */
- private Session(Properties properties, Authenticator authenticator) {
- this.properties = properties;
- this.authenticator = authenticator;
- debug = Boolean.valueOf(properties.getProperty("mail.debug")).booleanValue();
- }
-
- /**
- * Create a new session initialized with the supplied properties which uses the supplied authenticator.
- * Clients should ensure the properties listed in Appendix A of the JavaMail specification are
- * set as the defaults are unlikey to work in most scenarios; particular attention should be given
- * to:
- * <ul>
- * <li>mail.store.protocol</li>
- * <li>mail.transport.protocol</li>
- * <li>mail.host</li>
- * <li>mail.user</li>
- * <li>mail.from</li>
- * </ul>
- *
- * @param properties the session properties
- * @param authenticator an authenticator for callbacks to the user
- * @return a new session
- */
- public static Session getInstance(Properties properties, Authenticator authenticator) {
- return new Session(new Properties(properties), authenticator);
- }
-
- /**
- * Create a new session initialized with the supplied properties with no authenticator.
- *
- * @param properties the session properties
- * @return a new session
- * @see #getInstance(java.util.Properties, Authenticator)
- */
- public static Session getInstance(Properties properties) {
- return getInstance(properties, null);
- }
-
- /**
- * Get the "default" instance assuming no authenticator is required.
- *
- * @param properties the session properties
- * @return if "default" session
- * @throws SecurityException if the does not have permission to access the default session
- */
- public synchronized static Session getDefaultInstance(Properties properties) {
- return getDefaultInstance(properties, null);
- }
-
- /**
- * Get the "default" session.
- * If there is not current "default", a new Session is created and installed as the default.
- *
- * @param properties
- * @param authenticator
- * @return if "default" session
- * @throws SecurityException if the does not have permission to access the default session
- */
- public synchronized static Session getDefaultInstance(Properties properties, Authenticator authenticator) {
- if (DEFAULT_SESSION == null) {
- DEFAULT_SESSION = getInstance(properties, authenticator);
- } else {
- if (authenticator != DEFAULT_SESSION.authenticator) {
- if (authenticator == null || DEFAULT_SESSION.authenticator == null || authenticator.getClass().getClassLoader() != DEFAULT_SESSION.authenticator.getClass().getClassLoader()) {
- throw new SecurityException();
- }
- }
- // todo we should check with the SecurityManager here as well
- }
- return DEFAULT_SESSION;
- }
-
- /**
- * Enable debugging for this session.
- * Debugging can also be enabled by setting the "mail.debug" property to true when
- * the session is being created.
- *
- * @param debug the debug setting
- */
- public void setDebug(boolean debug) {
- this.debug = debug;
- }
-
- /**
- * Get the debug setting for this session.
- *
- * @return the debug setting
- */
- public boolean getDebug() {
- return debug;
- }
-
- /**
- * Set the output stream where debug information should be sent.
- * If set to null, System.out will be used.
- *
- * @param out the stream to write debug information to
- */
- public void setDebugOut(PrintStream out) {
- debugOut = out == null ? System.out : out;
- }
-
- /**
- * Return the debug output stream.
- *
- * @return the debug output stream
- */
- public PrintStream getDebugOut() {
- return debugOut;
- }
-
- /**
- * Return the list of providers available to this application.
- * This method searches for providers that are defined in the javamail.providers
- * and javamail.default.providers resources available through the current context
- * classloader, or if that is not available, the classloader that loaded this class.
- * <p/>
- * As searching for providers is potentially expensive, this implementation maintains
- * a WeakHashMap of providers indexed by ClassLoader.
- *
- * @return an array of providers
- */
- public Provider[] getProviders() {
- ProviderInfo info = getProviderInfo();
- return (Provider[]) info.all.toArray(new Provider[info.all.size()]);
- }
-
- /**
- * Return the provider for a specific protocol.
- * This implementation initially looks in the Session properties for an property with the name
- * "mail.<protocol>.class"; if found it attempts to create an instance of the class named in that
- * property throwing a NoSuchProviderException if the class cannot be loaded.
- * If this property is not found, it searches the providers returned by {@link #getProviders()}
- * for a entry for the specified protocol.
- *
- * @param protocol the protocol to get a provider for
- * @return a provider for that protocol
- * @throws NoSuchProviderException
- */
- public Provider getProvider(String protocol) throws NoSuchProviderException {
- //If we are deployed into an OSGi environment, leverage it
- Class<? extends Provider> providerClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(Provider.class, protocol);
- if (providerClass != null) {
- try {
- return (Provider) providerClass.newInstance();
- } catch (InstantiationException e) {
- throw new NoSuchProviderException(e.getMessage());
- } catch (IllegalAccessException e) {
- throw new NoSuchProviderException(e.getMessage());
- }
- }
-
- ProviderInfo info = getProviderInfo();
- Provider provider = null;
- String providerName = properties.getProperty("mail." + protocol + ".class");
- if (providerName != null) {
- provider = (Provider) info.byClassName.get(providerName);
- if (debug) {
- writeDebug("DEBUG: new provider loaded: " + provider.toString());
- }
- }
-
- // if not able to locate this by class name, just grab a registered protocol.
- if (provider == null) {
- provider = (Provider) info.byProtocol.get(protocol);
- }
-
- if (provider == null) {
- throw new NoSuchProviderException("Unable to locate provider for protocol: " + protocol);
- }
- if (debug) {
- writeDebug("DEBUG: getProvider() returning provider " + provider.toString());
- }
- return provider;
- }
-
- /**
- * Make the supplied Provider the default for its protocol.
- *
- * @param provider the new default Provider
- * @throws NoSuchProviderException
- */
- public void setProvider(Provider provider) throws NoSuchProviderException {
- ProviderInfo info = getProviderInfo();
- info.byProtocol.put(provider.getProtocol(), provider);
- }
-
- /**
- * Return a Store for the default protocol defined by the mail.store.protocol property.
- *
- * @return the store for the default protocol
- * @throws NoSuchProviderException
- */
- public Store getStore() throws NoSuchProviderException {
- String protocol = properties.getProperty("mail.store.protocol");
- if (protocol == null) {
- throw new NoSuchProviderException("mail.store.protocol property is not set");
- }
- return getStore(protocol);
- }
-
- /**
- * Return a Store for the specified protocol.
- *
- * @param protocol the protocol to get a Store for
- * @return a Store
- * @throws NoSuchProviderException if no provider is defined for the specified protocol
- */
- public Store getStore(String protocol) throws NoSuchProviderException {
- Provider provider = getProvider(protocol);
- return getStore(provider);
- }
-
- /**
- * Return a Store for the protocol specified in the given URL
- *
- * @param url the URL of the Store
- * @return a Store
- * @throws NoSuchProviderException if no provider is defined for the specified protocol
- */
- public Store getStore(URLName url) throws NoSuchProviderException {
- return (Store) getService(getProvider(url.getProtocol()), url);
- }
-
- /**
- * Return the Store specified by the given provider.
- *
- * @param provider the provider to create from
- * @return a Store
- * @throws NoSuchProviderException if there was a problem creating the Store
- */
- public Store getStore(Provider provider) throws NoSuchProviderException {
- if (Provider.Type.STORE != provider.getType()) {
- throw new NoSuchProviderException("Not a Store Provider: " + provider);
- }
- return (Store) getService(provider, null);
- }
-
- /**
- * Return a closed folder for the supplied URLName, or null if it cannot be obtained.
- * <p/>
- * The scheme portion of the URL is used to locate the Provider and create the Store;
- * the returned Store is then used to obtain the folder.
- *
- * @param name the location of the folder
- * @return the requested folder, or null if it is unavailable
- * @throws NoSuchProviderException if there is no provider
- * @throws MessagingException if there was a problem accessing the Store
- */
- public Folder getFolder(URLName name) throws MessagingException {
- Store store = getStore(name);
- return store.getFolder(name);
- }
-
- /**
- * Return a Transport for the default protocol specified by the
- * <code>mail.transport.protocol</code> property.
- *
- * @return a Transport
- * @throws NoSuchProviderException
- */
- public Transport getTransport() throws NoSuchProviderException {
- String protocol = properties.getProperty("mail.transport.protocol");
- if (protocol == null) {
- throw new NoSuchProviderException("mail.transport.protocol property is not set");
- }
- return getTransport(protocol);
- }
-
- /**
- * Return a Transport for the specified protocol.
- *
- * @param protocol the protocol to use
- * @return a Transport
- * @throws NoSuchProviderException
- */
- public Transport getTransport(String protocol) throws NoSuchProviderException {
- Provider provider = getProvider(protocol);
- return getTransport(provider);
- }
-
- /**
- * Return a transport for the protocol specified in the URL.
- *
- * @param name the URL whose scheme specifies the protocol
- * @return a Transport
- * @throws NoSuchProviderException
- */
- public Transport getTransport(URLName name) throws NoSuchProviderException {
- return (Transport) getService(getProvider(name.getProtocol()), name);
- }
-
- /**
- * Return a transport for the protocol associated with the type of this address.
- *
- * @param address the address we are trying to deliver to
- * @return a Transport
- * @throws NoSuchProviderException
- */
- public Transport getTransport(Address address) throws NoSuchProviderException {
- String type = address.getType();
- // load the address map from the resource files.
- Map addressMap = getAddressMap();
- String protocolName = (String)addressMap.get(type);
- if (protocolName == null) {
- throw new NoSuchProviderException("No provider for address type " + type);
- }
- return getTransport(protocolName);
- }
-
- /**
- * Return the Transport specified by a Provider
- *
- * @param provider the defining Provider
- * @return a Transport
- * @throws NoSuchProviderException
- */
- public Transport getTransport(Provider provider) throws NoSuchProviderException {
- return (Transport) getService(provider, null);
- }
-
- /**
- * Set the password authentication associated with a URL.
- *
- * @param name the url
- * @param authenticator the authenticator
- */
- public void setPasswordAuthentication(URLName name, PasswordAuthentication authenticator) {
- if (authenticator == null) {
- passwordAuthentications.remove(name);
- } else {
- passwordAuthentications.put(name, authenticator);
- }
- }
-
- /**
- * Get the password authentication associated with a URL
- *
- * @param name the URL
- * @return any authenticator for that url, or null if none
- */
- public PasswordAuthentication getPasswordAuthentication(URLName name) {
- return (PasswordAuthentication) passwordAuthentications.get(name);
- }
-
- /**
- * Call back to the application supplied authenticator to get the needed username add password.
- *
- * @param host the host we are trying to connect to, may be null
- * @param port the port on that host
- * @param protocol the protocol trying to be used
- * @param prompt a String to show as part of the prompt, may be null
- * @param defaultUserName the default username, may be null
- * @return the authentication information collected by the authenticator; may be null
- */
- public PasswordAuthentication requestPasswordAuthentication(InetAddress host, int port, String protocol, String prompt, String defaultUserName) {
- if (authenticator == null) {
- return null;
- }
- return authenticator.authenticate(host, port, protocol, prompt, defaultUserName);
- }
-
- /**
- * Return the properties object for this Session; this is a live collection.
- *
- * @return the properties for the Session
- */
- public Properties getProperties() {
- return properties;
- }
-
- /**
- * Return the specified property.
- *
- * @param property the property to get
- * @return its value, or null if not present
- */
- public String getProperty(String property) {
- return getProperties().getProperty(property);
- }
-
-
- /**
- * Add a provider to the Session managed provider list.
- *
- * @param provider The new provider to add.
- */
- public synchronized void addProvider(Provider provider) {
- ProviderInfo info = getProviderInfo();
- info.addProvider(provider);
- }
-
-
-
- /**
- * Add a mapping between an address type and a protocol used
- * to process that address type.
- *
- * @param addressType
- * The address type identifier.
- * @param protocol The protocol name mapping.
- */
- public void setProtocolForAddress(String addressType, String protocol) {
- Map addressMap = getAddressMap();
-
- // no protocol specified is a removal
- if (protocol == null) {
- addressMap.remove(addressType);
- }
- else {
- addressMap.put(addressType, protocol);
- }
- }
-
-
- private Service getService(Provider provider, URLName name) throws NoSuchProviderException {
- try {
- if (name == null) {
- name = new URLName(provider.getProtocol(), null, -1, null, null, null);
- }
-
- //If we are deployed into an OSGi environment, leverage it
- Class<? extends Service> providerClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(Service.class, provider.getClassName());
- if (providerClass != null) {
- try {
- Constructor ctr = providerClass.getConstructor(PARAM_TYPES);
- return (Service) ctr.newInstance(this, name);
- } catch (InstantiationException e) {
- throw new NoSuchProviderException(e.getMessage());
- } catch (IllegalAccessException e) {
- throw new NoSuchProviderException(e.getMessage());
- }
- }
-
- ClassLoader cl = getClassLoader();
- Class clazz = cl.loadClass(provider.getClassName());
- Constructor ctr = clazz.getConstructor(PARAM_TYPES);
- return (Service) ctr.newInstance(this, name);
- } catch (ClassNotFoundException e) {
- throw (NoSuchProviderException) new NoSuchProviderException("Unable to load class for provider: " + provider).initCause(e);
- } catch (NoSuchMethodException e) {
- throw (NoSuchProviderException) new NoSuchProviderException("Provider class does not have a constructor(Session, URLName): " + provider).initCause(e);
- } catch (InstantiationException e) {
- throw (NoSuchProviderException) new NoSuchProviderException("Unable to instantiate provider class: " + provider).initCause(e);
- } catch (IllegalAccessException e) {
- throw (NoSuchProviderException) new NoSuchProviderException("Unable to instantiate provider class: " + provider).initCause(e);
- } catch (InvocationTargetException e) {
- throw (NoSuchProviderException) new NoSuchProviderException("Exception from constructor of provider class: " + provider).initCause(e.getCause());
- }
- }
-
- private ProviderInfo getProviderInfo() {
- ClassLoader cl = getClassLoader();
- ProviderInfo info = (ProviderInfo) providersByClassLoader.get(cl);
- if (info == null) {
- info = loadProviders(cl);
- }
- return info;
- }
-
- private Map getAddressMap() {
- ClassLoader cl = getClassLoader();
- Map addressMap = (Map)addressMapsByClassLoader.get(cl);
- if (addressMap == null) {
- addressMap = loadAddressMap(cl);
- }
- return addressMap;
- }
-
-
- /**
- * Resolve a class loader used to resolve context resources. The
- * class loader used is either a current thread context class
- * loader (if set), the class loader used to load an authenticator
- * we've been initialized with, or the class loader used to load
- * this class instance (which may be a subclass of Session).
- *
- * @return The class loader used to load resources.
- */
- private ClassLoader getClassLoader() {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- if (cl == null) {
- if (authenticator != null) {
- cl = authenticator.getClass().getClassLoader();
- }
- else {
- cl = this.getClass().getClassLoader();
- }
- }
- return cl;
- }
-
- private ProviderInfo loadProviders(ClassLoader cl) {
- // we create a merged map from reading all of the potential address map entries. The locations
- // searched are:
- // 1. java.home/lib/javamail.address.map
- // 2. META-INF/javamail.address.map
- // 3. META-INF/javamail.default.address.map
- //
- ProviderInfo info = new ProviderInfo();
-
- // make sure this is added to the global map.
- providersByClassLoader.put(cl, info);
-
-
- // NOTE: Unlike the addressMap, we process these in the defined order. The loading routine
- // will not overwrite entries if they already exist in the map.
-
- try {
- File file = new File(System.getProperty("java.home"), "lib/javamail.providers");
- InputStream is = new FileInputStream(file);
- try {
- loadProviders(info, is);
- if (debug) {
- writeDebug("Loaded lib/javamail.providers from " + file.toString());
- }
- } finally{
- is.close();
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- try {
- Enumeration e = cl.getResources("META-INF/javamail.providers");
- while (e.hasMoreElements()) {
- URL url = (URL) e.nextElement();
- if (debug) {
- writeDebug("Loading META-INF/javamail.providers from " + url.toString());
- }
- InputStream is = url.openStream();
- try {
- loadProviders(info, is);
- } finally{
- is.close();
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- try {
- Enumeration e = cl.getResources("META-INF/javamail.default.providers");
- while (e.hasMoreElements()) {
- URL url = (URL) e.nextElement();
- if (debug) {
- writeDebug("Loading javamail.default.providers from " + url.toString());
- }
-
- InputStream is = url.openStream();
- try {
- loadProviders(info, is);
- } finally{
- is.close();
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- return info;
- }
-
- private void loadProviders(ProviderInfo info, InputStream is) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- String line;
- while ((line = reader.readLine()) != null) {
- // Lines beginning with "#" are just comments.
- if (line.startsWith("#")) {
- continue;
- }
-
- StringTokenizer tok = new StringTokenizer(line, ";");
- String protocol = null;
- Provider.Type type = null;
- String className = null;
- String vendor = null;
- String version = null;
- while (tok.hasMoreTokens()) {
- String property = tok.nextToken();
- int index = property.indexOf('=');
- if (index == -1) {
- continue;
- }
- String key = property.substring(0, index).trim().toLowerCase();
- String value = property.substring(index+1).trim();
- if (protocol == null && "protocol".equals(key)) {
- protocol = value;
- } else if (type == null && "type".equals(key)) {
- if ("store".equals(value)) {
- type = Provider.Type.STORE;
- } else if ("transport".equals(value)) {
- type = Provider.Type.TRANSPORT;
- }
- } else if (className == null && "class".equals(key)) {
- className = value;
- } else if ("vendor".equals(key)) {
- vendor = value;
- } else if ("version".equals(key)) {
- version = value;
- }
- }
- if (protocol == null || type == null || className == null) {
- //todo should we log a warning?
- continue;
- }
-
- if (debug) {
- writeDebug("DEBUG: loading new provider protocol=" + protocol + ", className=" + className + ", vendor=" + vendor + ", version=" + version);
- }
- Provider provider = new Provider(type, protocol, className, vendor, version);
- // add to the info list.
- info.addProvider(provider);
- }
- }
-
- /**
- * Load up an address map associated with a using class loader
- * instance.
- *
- * @param cl The class loader used to resolve the address map.
- *
- * @return A map containing the entries associated with this classloader
- * instance.
- */
- private static Map loadAddressMap(ClassLoader cl) {
- // we create a merged map from reading all of the potential address map entries. The locations
- // searched are:
- // 1. java.home/lib/javamail.address.map
- // 2. META-INF/javamail.address.map
- // 3. META-INF/javamail.default.address.map
- //
- // if all of the above searches fail, we just set up some "default" defaults.
-
- // the format of the address.map file is defined as a property file. We can cheat and
- // just use Properties.load() to read in the files.
- Properties addressMap = new Properties();
-
- // add this to the tracking map.
- addressMapsByClassLoader.put(cl, addressMap);
-
- // NOTE: We are reading these resources in reverse order of what's cited above. This allows
- // user defined entries to overwrite default entries if there are similarly named items.
-
- try {
- Enumeration e = cl.getResources("META-INF/javamail.default.address.map");
- while (e.hasMoreElements()) {
- URL url = (URL) e.nextElement();
- InputStream is = url.openStream();
- try {
- // load as a property file
- addressMap.load(is);
- } finally{
- is.close();
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
-
- try {
- Enumeration e = cl.getResources("META-INF/javamail.address.map");
- while (e.hasMoreElements()) {
- URL url = (URL) e.nextElement();
- InputStream is = url.openStream();
- try {
- // load as a property file
- addressMap.load(is);
- } finally{
- is.close();
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
-
- try {
- File file = new File(System.getProperty("java.home"), "lib/javamail.address.map");
- InputStream is = new FileInputStream(file);
- try {
- // load as a property file
- addressMap.load(is);
- } finally{
- is.close();
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
- try {
- Enumeration e = cl.getResources("META-INF/javamail.address.map");
- while (e.hasMoreElements()) {
- URL url = (URL) e.nextElement();
- InputStream is = url.openStream();
- try {
- // load as a property file
- addressMap.load(is);
- } finally{
- is.close();
- }
- }
- } catch (SecurityException e) {
- // ignore
- } catch (IOException e) {
- // ignore
- }
-
-
- // if unable to load anything, at least create the MimeMessage-smtp protocol mapping.
- if (addressMap.isEmpty()) {
- addressMap.put("rfc822", "smtp");
- }
-
- return addressMap;
- }
-
- /**
- * Private convenience routine for debug output.
- *
- * @param msg The message to write out to the debug stream.
- */
- private void writeDebug(String msg) {
- debugOut.println(msg);
- }
-
-
- private static class ProviderInfo {
- private final Map byClassName = new HashMap();
- private final Map byProtocol = new HashMap();
- private final List all = new ArrayList();
-
- public void addProvider(Provider provider) {
- String className = provider.getClassName();
-
- if (!byClassName.containsKey(className)) {
- byClassName.put(className, provider);
- }
-
- String protocol = provider.getProtocol();
- if (!byProtocol.containsKey(protocol)) {
- byProtocol.put(protocol, provider);
- }
- all.add(provider);
- }
- }
-}
diff --git a/trunk/jaxb-api-2.0/pom.xml b/trunk/jaxb-api-2.0/pom.xml
deleted file mode 100644
index 4ca45fb..0000000
--- a/trunk/jaxb-api-2.0/pom.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXB API 2.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.google.code.japidiff</groupId>
- <artifactId>maven-japidiff-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>diff</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <filter>javax/xml/bind.*</filter>
- <jar>javax.xml.bind:jaxb-api:2.0</jar>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.bind*;version=2.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>${project.groupId}:${project.artifactId}</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Binder.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Binder.java
deleted file mode 100644
index 125a1be..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Binder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import javax.xml.validation.Schema;
-
-public abstract class Binder<XmlNode> {
-
- public abstract ValidationEventHandler getEventHandler() throws JAXBException;
-
- public abstract Object getJAXBNode(XmlNode xmlNode);
-
- public abstract Object getProperty(String name) throws PropertyException;
-
- public abstract Schema getSchema();
-
- public abstract XmlNode getXMLNode(Object jaxbObject);
-
- public abstract void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException;
-
- public abstract void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- public abstract void setProperty(String name, Object value) throws PropertyException;
-
- public abstract void setSchema(Schema schema);
-
- public abstract Object unmarshal(XmlNode xmlNode) throws JAXBException;
-
- public abstract <T> JAXBElement<T> unmarshal(XmlNode xmlNode, Class<T> declaredType) throws JAXBException;
-
- public abstract Object updateJAXB(XmlNode xmlNode) throws JAXBException;
-
- public abstract XmlNode updateXML(Object jaxbObject) throws JAXBException;
-
- public abstract XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException;
-
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java
deleted file mode 100644
index 61dcd65..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ContextFinder.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Properties;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-class ContextFinder {
-
- private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.bind.v2.ContextFactory";
- private static final String JAXB_CONTEXT_PROPERTY = JAXBContext.class.getName();
- private static final String JAXB_CONTEXT_FACTORY = JAXBContext.JAXB_CONTEXT_FACTORY;
-
- public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties) throws JAXBException {
- String className = null;
- if (contextPath == null || contextPath.length() == 0) {
- throw new JAXBException("Invalid contextPath");
- }
- String[] packages = contextPath.split(":");
- if (packages == null || packages.length == 0) {
- throw new JAXBException("Invalid contextPath");
- }
- for (String pkg : packages) {
- String url = pkg.replace('.', '/') + "/jaxb.properties";
- className = loadClassNameFromProperties(url, classLoader);
- if (className != null) {
- break;
- }
- }
- if (className == null) {
- className = System.getProperty(JAXB_CONTEXT_PROPERTY);
- }
- if (className == null) {
- String url = "META-INF/services/" + JAXB_CONTEXT_PROPERTY;
- className = loadClassName(url, classLoader);
- }
- if (className == null) {
- className = PLATFORM_DEFAULT_FACTORY_CLASS;
- }
- Class spi = loadSpi(className, classLoader);
- try {
- Method m = spi.getMethod("createContext", new Class[] { String.class, ClassLoader.class, Map.class });
- return (JAXBContext) m.invoke(null, new Object[] { contextPath, classLoader, properties });
- } catch (Throwable t) {
- throw new JAXBException("Unable to create context", t);
- }
- }
-
-
- public static JAXBContext find(Class[] classes, Map properties) throws JAXBException {
- String className = null;
- for (Class cl : classes) {
- Package pkg = cl.getPackage();
- if (pkg != null) {
- String url = pkg.getName().replace('.', '/') + "/jaxb.properties";
- className = loadClassNameFromProperties(url, cl.getClassLoader());
- if (className != null) {
- break;
- }
- }
- }
- if (className == null) {
- className = System.getProperty(JAXB_CONTEXT_PROPERTY);
- }
- if (className == null) {
- String url = "META-INF/services/" + JAXB_CONTEXT_PROPERTY;
- className = loadClassName(url, Thread.currentThread().getContextClassLoader());
- }
- if (className == null) {
- className = PLATFORM_DEFAULT_FACTORY_CLASS;
- }
- Class spi = loadSpi(className, Thread.currentThread().getContextClassLoader());
- try {
- Method m = spi.getMethod("createContext", new Class[] { Class[].class, Map.class });
- return (JAXBContext) m.invoke(null, new Object[] { classes, properties });
- } catch (Throwable t) {
- throw new JAXBException("Unable to create context", t);
- }
- }
-
- private static String loadClassNameFromProperties(String url, ClassLoader classLoader) throws JAXBException {
- try {
- InputStream is;
- if (classLoader != null) {
- is = classLoader.getResourceAsStream(url);
- } else {
- is = ClassLoader.getSystemResourceAsStream(url);
- }
- if (is != null) {
- try {
- Properties props = new Properties();
- props.load(is);
- String className = props.getProperty(JAXB_CONTEXT_FACTORY);
- if (className == null) {
- throw new JAXBException("jaxb.properties file " + url + " should contain a " + JAXB_CONTEXT_FACTORY + " property");
- }
- return className.trim();
- } finally {
- is.close();
- }
- } else {
- return null;
- }
- } catch (IOException e) {
- throw new JAXBException(e);
- }
- }
-
- private static String loadClassName(String url, ClassLoader classLoader) throws JAXBException {
- try {
- InputStream is;
- if (classLoader != null) {
- is = classLoader.getResourceAsStream(url);
- } else {
- is = ClassLoader.getSystemResourceAsStream(url);
- }
- if (is != null) {
- try {
- BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- return r.readLine().trim();
- } finally {
- is.close();
- }
- }
- return null;
- } catch (IOException e) {
- throw new JAXBException(e);
- }
- }
-
- private static Class loadSpi(String className, ClassLoader classLoader) throws JAXBException {
- Class spiClass;
- try {
- spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(JAXBContext.class);
- if (spiClass != null) {
- return spiClass;
- }
- } catch (Throwable t) {
- }
- try {
- if (classLoader != null) {
- spiClass = classLoader.loadClass(className);
- } else {
- spiClass = Class.forName(className);
- }
- } catch (ClassNotFoundException e) {
- throw new JAXBException("Provider " + className + " not found", e);
- }
- return spiClass;
- }
-
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverter.java
deleted file mode 100644
index e8dd3c6..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverter.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.util.Calendar;
-import java.math.BigInteger;
-import java.math.BigDecimal;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-public final class DatatypeConverter {
-
- private static DatatypeConverterInterface converter = null;
-
- private DatatypeConverter() {
- }
-
- public static void setDatatypeConverter(DatatypeConverterInterface converter) {
- if (converter == null) {
- throw new IllegalArgumentException("The DatatypeConverterInterface parameter must not be null");
- }
- if (DatatypeConverter.converter == null) {
- DatatypeConverter.converter = converter;
- }
- }
-
- public static String parseString(String lexicalXSDString) {
- return converter.parseString(lexicalXSDString);
- }
-
- public static BigInteger parseInteger(String lexicalXSDInteger) {
- return converter.parseInteger(lexicalXSDInteger);
- }
-
- public static int parseInt(String lexicalXSDInt) {
- return converter.parseInt(lexicalXSDInt);
- }
-
- public static long parseLong(String lexicalXSDLong) {
- return converter.parseLong(lexicalXSDLong);
- }
-
- public static short parseShort(String lexicalXSDShort) {
- return converter.parseShort(lexicalXSDShort);
- }
-
- public static BigDecimal parseDecimal(String lexicalXSDDecimal) {
- return converter.parseDecimal(lexicalXSDDecimal);
- }
-
- public static float parseFloat(String lexicalXSDFloat) {
- return converter.parseFloat(lexicalXSDFloat);
- }
-
- public static double parseDouble(String lexicalXSDDouble) {
- return converter.parseDouble(lexicalXSDDouble);
- }
-
- public static boolean parseBoolean(String lexicalXSDBoolean) {
- return converter.parseBoolean(lexicalXSDBoolean);
- }
-
- public static byte parseByte(String lexicalXSDByte) {
- return converter.parseByte(lexicalXSDByte);
- }
-
- public static QName parseQName(String lexicalXSDQName, NamespaceContext nsc) {
- return converter.parseQName(lexicalXSDQName, nsc);
- }
-
- public static Calendar parseDateTime(String lexicalXSDDateTime) {
- return converter.parseDateTime(lexicalXSDDateTime);
- }
-
- public static byte[] parseBase64Binary(String lexicalXSDBase64Binary) {
- return converter.parseBase64Binary(lexicalXSDBase64Binary);
- }
-
- public static byte[] parseHexBinary(String lexicalXSDHexBinary) {
- return converter.parseHexBinary(lexicalXSDHexBinary);
- }
-
- public static long parseUnsignedInt(String lexicalXSDUnsignedInt) {
- return converter.parseUnsignedInt(lexicalXSDUnsignedInt);
- }
-
- public static int parseUnsignedShort(String lexicalXSDUnsignedShort) {
- return converter.parseUnsignedShort(lexicalXSDUnsignedShort);
- }
-
- public static Calendar parseTime(String lexicalXSDTime) {
- return converter.parseTime(lexicalXSDTime);
- }
-
- public static Calendar parseDate(String lexicalXSDDate) {
- return converter.parseDate(lexicalXSDDate);
- }
-
- public static String parseAnySimpleType(String lexicalXSDAnySimpleType) {
- return converter.parseAnySimpleType(lexicalXSDAnySimpleType);
- }
-
- public static String printString(String val) {
- return converter.printString(val);
- }
-
- public static String printInteger(BigInteger val) {
- return converter.printInteger(val);
- }
-
- public static String printInt(int val) {
- return converter.printInt(val);
- }
-
- public static String printLong(long val) {
- return converter.printLong(val);
- }
-
- public static String printShort(short val) {
- return converter.printShort(val);
- }
-
- public static String printDecimal(BigDecimal val) {
- return converter.printDecimal(val);
- }
-
- public static String printFloat(float val) {
- return converter.printFloat(val);
- }
-
- public static String printDouble(double val) {
- return converter.printDouble(val);
- }
-
- public static String printBoolean(boolean val) {
- return converter.printBoolean(val);
- }
-
- public static String printByte(byte val) {
- return converter.printByte(val);
- }
-
- public static String printQName(QName val, NamespaceContext nsc) {
- return converter.printQName(val, nsc);
- }
-
- public static String printDateTime(Calendar val) {
- return converter.printDateTime(val);
- }
-
- public static String printBase64Binary(byte val[]) {
- return converter.printBase64Binary(val);
- }
-
- public static String printHexBinary(byte val[]) {
- return converter.printHexBinary(val);
- }
-
- public static String printUnsignedInt(long val) {
- return converter.printUnsignedInt(val);
- }
-
- public static String printUnsignedShort(int val) {
- return converter.printUnsignedShort(val);
- }
-
- public static String printTime(Calendar val) {
- return converter.printTime(val);
- }
-
- public static String printDate(Calendar val) {
- return converter.printDate(val);
- }
-
- public static String printAnySimpleType(String val) {
- return converter.printAnySimpleType(val);
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverterInterface.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
deleted file mode 100644
index d0a4a63..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.util.Calendar;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-public interface DatatypeConverterInterface {
-
- String parseAnySimpleType(String lexicalXSDAnySimpleType);
-
- byte[] parseBase64Binary(String lexicalXSDBase64Binary);
-
- boolean parseBoolean(String lexicalXSDBoolean);
-
- byte parseByte(String lexicalXSDByte);
-
- Calendar parseDate(String lexicalXSDDate);
-
- Calendar parseDateTime(String lexicalXSDDateTime);
-
- BigDecimal parseDecimal(String lexicalXSDDecimal);
-
- double parseDouble(String lexicalXSDDouble);
-
- float parseFloat(String lexicalXSDFloat);
-
- byte[] parseHexBinary(String lexicalXSDHexBinary);
-
- int parseInt(String lexicalXSDInt);
-
- BigInteger parseInteger(String lexicalXSDInteger);
-
- long parseLong(String lexicalXSDLong);
-
- QName parseQName(String lexicalXSDQName, NamespaceContext nsc);
-
- short parseShort(String lexicalXSDShort);
-
- String parseString(String lexicalXSDString);
-
- Calendar parseTime(String lexicalXSDTime);
-
- long parseUnsignedInt(String lexicalXSDUnsignedInt);
-
- int parseUnsignedShort(String lexicalXSDUnsignedShort);
-
- String printAnySimpleType(String val);
-
- String printBase64Binary(byte[] val);
-
- String printBoolean(boolean val);
-
- String printByte(byte val);
-
- String printDate(Calendar val);
-
- String printDateTime(Calendar val);
-
- String printDecimal(BigDecimal val);
-
- String printDouble(double val);
-
- String printFloat(float val);
-
- String printHexBinary(byte[] val);
-
- String printInt(int val);
-
- String printInteger(BigInteger val);
-
- String printLong(long val);
-
- String printQName(QName val, NamespaceContext nsc);
-
- String printShort(short val);
-
- String printString(String val);
-
- String printTime(Calendar val);
-
- String printUnsignedInt(long val);
-
- String printUnsignedShort(int val);
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Element.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Element.java
deleted file mode 100644
index 1d9d263..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Element.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface Element {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBContext.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBContext.java
deleted file mode 100644
index 849ba92..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBContext.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-
-import java.util.Map;
-import java.util.Collections;
-
-import org.w3c.dom.Node;
-
-public abstract class JAXBContext {
-
- public static final String JAXB_CONTEXT_FACTORY = "javax.xml.bind.context.factory";
-
- protected JAXBContext() {
- }
-
- public Binder<Node> createBinder() {
- throw new UnsupportedOperationException();
- }
-
- public <T> Binder<T> createBinder(Class<T> domType) {
- throw new UnsupportedOperationException();
- }
-
- public JAXBIntrospector createJAXBIntrospector() {
- throw new UnsupportedOperationException();
- }
-
- public abstract Marshaller createMarshaller() throws JAXBException;
-
- public abstract Unmarshaller createUnmarshaller() throws JAXBException;
-
- public abstract Validator createValidator() throws JAXBException;
-
- public void generateSchema(SchemaOutputResolver resolver) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- public static JAXBContext newInstance(Class... classesToBeBound) throws JAXBException {
- return newInstance(classesToBeBound, Collections.<String, Object>emptyMap());
- }
-
- public static JAXBContext newInstance(Class[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
- for (Class cl : classesToBeBound) {
- if (cl == null) {
- throw new IllegalArgumentException();
- }
- }
- return ContextFinder.find(classesToBeBound, properties);
- }
-
- public static JAXBContext newInstance(String contextPath) throws JAXBException {
- return newInstance(contextPath, Thread.currentThread().getContextClassLoader());
- }
-
- public static JAXBContext newInstance(String contextPath, ClassLoader classLoader) throws JAXBException {
- return newInstance(contextPath, classLoader, Collections.<String, Object>emptyMap());
- }
-
- public static JAXBContext newInstance(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws JAXBException {
- return ContextFinder.find(contextPath, classLoader, properties);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBElement.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBElement.java
deleted file mode 100644
index fdfcf2d..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBElement.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-public class JAXBElement<T> implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public final static class GlobalScope {
- }
-
- protected final QName name;
- protected final Class<T> declaredType;
- protected final Class scope;
- protected T value;
- protected boolean nil;
-
- public JAXBElement(QName name, Class<T> declaredType, Class scope, T value) {
- this.nil = false;
- if (declaredType == null || name == null) {
- throw new IllegalArgumentException();
- }
- this.declaredType = declaredType;
- if (scope == null) {
- scope = GlobalScope.class;
- }
- this.scope = scope;
- this.name = name;
- setValue(value);
- }
-
- public JAXBElement(QName name, Class<T> declaredType, T value) {
- this(name, declaredType, GlobalScope.class, value);
- }
-
- public Class<T> getDeclaredType() {
- return declaredType;
- }
-
- public QName getName() {
- return name;
- }
-
- public void setValue(T value) {
- this.value = value;
- }
-
- public T getValue() {
- return value;
- }
-
- public Class getScope() {
- return scope;
- }
-
- public boolean isNil() {
- return value == null || nil;
- }
-
- public void setNil(boolean nil) {
- this.nil = nil;
- }
-
- public boolean isGlobalScope() {
- return scope == GlobalScope.class;
- }
-
- public boolean isTypeSubstituted() {
- if (value == null) {
- return false;
- } else {
- return value.getClass() != declaredType;
- }
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBException.java
deleted file mode 100644
index 200837d..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-public class JAXBException extends Exception {
-
- private static final long serialVersionUID = 0x5dd94775L;
-
- private String errorCode;
- private Throwable linkedException;
-
- public JAXBException(String message) {
- this(message, null, null);
- }
-
- public JAXBException(String message, String errorCode) {
- this(message, errorCode, null);
- }
-
- public JAXBException(String message, String errorCode, Throwable cause) {
- super(message);
- this.errorCode = errorCode;
- this.linkedException = cause;
- }
-
- public JAXBException(String message, Throwable cause) {
- this(message, null, cause);
- }
-
- public JAXBException(Throwable cause) {
- this(null, null, cause);
- }
-
- public String getErrorCode() {
- return errorCode;
- }
-
- public Throwable getLinkedException() {
- return getCause();
- }
-
- public synchronized void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public String toString() {
- return linkedException != null ?
- super.toString() + "\n - with linked exception:\n[" + linkedException.toString() + "]" :
- super.toString();
- }
-
- @Override
- public Throwable getCause() {
- return linkedException;
- }
-
- public void printStackTrace() {
- super.printStackTrace();
- }
-
- public void printStackTrace(PrintStream ps) {
- super.printStackTrace(ps);
- }
-
- public void printStackTrace(PrintWriter pw) {
- super.printStackTrace(pw);
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBIntrospector.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBIntrospector.java
deleted file mode 100644
index 29323b8..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/JAXBIntrospector.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import javax.xml.namespace.QName;
-
-public abstract class JAXBIntrospector {
-
- public abstract QName getElementName(Object jaxbElement);
-
- public static Object getValue(Object jaxbElement) {
- if (jaxbElement instanceof JAXBElement) {
- return ((JAXBElement) jaxbElement).getValue();
- } else {
- return jaxbElement;
- }
- }
-
- public abstract boolean isElement(Object object);
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/MarshalException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/MarshalException.java
deleted file mode 100644
index 3f6377b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/MarshalException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class MarshalException extends JAXBException {
-
- public MarshalException(String message) {
- super(message);
- }
-
- public MarshalException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public MarshalException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public MarshalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public MarshalException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Marshaller.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Marshaller.java
deleted file mode 100644
index fd3bc7b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Marshaller.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.OutputStream;
-import java.io.Writer;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Result;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-
-public interface Marshaller {
-
- String JAXB_ENCODING = "jaxb.encoding";
- String JAXB_FORMATTED_OUTPUT = "jaxb.formatted.output";
- String JAXB_FRAGMENT = "jaxb.fragment";
- String JAXB_NO_NAMESPACE_SCHEMA_LOCATION = "jaxb.noNamespaceSchemaLocation";
- String JAXB_SCHEMA_LOCATION = "jaxb.schemaLocation";
-
- abstract class Listener {
- public void beforeMarshal(Object source) {
- }
- public void afterMarshal(Object source) {
- }
- }
-
- <A extends XmlAdapter> A getAdapter(Class<A> type);
-
- AttachmentMarshaller getAttachmentMarshaller();
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Listener getListener();
-
- Node getNode(Object contentTree) throws JAXBException;
-
- Object getProperty(String name) throws PropertyException;
-
- Schema getSchema();
-
- void marshal(Object jaxbElement, ContentHandler handler) throws JAXBException;
-
- void marshal(Object jaxbElement, Node node) throws JAXBException;
-
- void marshal(Object jaxbElement, OutputStream os) throws JAXBException;
-
- void marshal(Object jaxbElement, Result result) throws JAXBException;
-
- void marshal(Object jaxbElement, Writer writer) throws JAXBException;
-
- void marshal(Object jaxbElement, XMLEventWriter writer) throws JAXBException;
-
- void marshal(Object jaxbElement, XMLStreamWriter writer) throws JAXBException;
-
- <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter);
-
- void setAdapter(XmlAdapter adapter);
-
- void setAttachmentMarshaller(AttachmentMarshaller am);
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setListener(Listener listener);
-
- void setProperty(String name, Object value) throws PropertyException;
-
- void setSchema(Schema schema);
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/NotIdentifiableEvent.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
deleted file mode 100644
index 7ab70c2..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface NotIdentifiableEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ParseConversionEvent.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ParseConversionEvent.java
deleted file mode 100644
index fc16ae4..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ParseConversionEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ParseConversionEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PrintConversionEvent.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PrintConversionEvent.java
deleted file mode 100644
index 4a9f94f..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PrintConversionEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface PrintConversionEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PropertyException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PropertyException.java
deleted file mode 100644
index 23bc367..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/PropertyException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class PropertyException extends JAXBException {
-
- public PropertyException(String message) {
- super(message);
- }
-
- public PropertyException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public PropertyException(Throwable cause) {
- super(cause);
- }
-
- public PropertyException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public PropertyException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public PropertyException(String name, Object value) {
- super("name: " + name + ", value: " + value);
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/SchemaOutputResolver.java
deleted file mode 100644
index d74e563..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/SchemaOutputResolver.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-
-import javax.xml.transform.Result;
-
-public abstract class SchemaOutputResolver {
-
- public abstract Result createOutput(String namespaceUri, String suggestedFileName) throws IOException;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/TypeConstraintException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/TypeConstraintException.java
deleted file mode 100644
index 8713b4b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/TypeConstraintException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.PrintStream;
-
-public class TypeConstraintException extends RuntimeException {
-
- private String errorCode;
- private Throwable linkedException;
-
- public TypeConstraintException(String message) {
- this(message, null, null);
- }
-
- public TypeConstraintException(String message, String errorCode) {
- this(message, errorCode, null);
- }
-
- public TypeConstraintException(String message, String errorCode, Throwable cause) {
- super(message);
- this.errorCode = errorCode;
- this.linkedException = cause;
- }
-
- public TypeConstraintException(String message, Throwable cause) {
- this(message, null, cause);
- }
-
- public TypeConstraintException(Throwable cause) {
- this(null, null, cause);
- }
-
- public String getErrorCode() {
- return errorCode;
- }
-
- public Throwable getLinkedException() {
- return getCause();
- }
-
- public synchronized void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public String toString() {
- return linkedException != null ?
- super.toString() + "\n - with linked exception:\n[" + linkedException.toString() + "]" :
- super.toString();
- }
-
- public void printStackTrace() {
- super.printStackTrace();
- }
-
- public void printStackTrace(PrintStream ps) {
- super.printStackTrace(ps);
- }
-
-}
\ No newline at end of file
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshalException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshalException.java
deleted file mode 100644
index d17cdb1..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshalException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class UnmarshalException extends JAXBException {
-
- public UnmarshalException(String message) {
- super(message);
- }
-
- public UnmarshalException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public UnmarshalException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public UnmarshalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public UnmarshalException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Unmarshaller.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Unmarshaller.java
deleted file mode 100644
index 40a774a..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Unmarshaller.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Source;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-public interface Unmarshaller {
-
- abstract class Listener {
- public void beforeUnmarshal(Object target, Object parent) {
- }
- public void afterUnmarshal(Object target, Object parent) {
- }
- }
-
- <A extends XmlAdapter> A getAdapter(Class<A> type);
-
- AttachmentUnmarshaller getAttachmentUnmarshaller();
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Listener getListener();
-
- Object getProperty(String name) throws PropertyException;
-
- Schema getSchema();
-
- UnmarshallerHandler getUnmarshallerHandler();
-
- boolean isValidating() throws JAXBException;
-
- <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter);
-
- void setAdapter(XmlAdapter adapter);
-
- void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setListener(Listener listener);
-
- void setProperty(String name, Object value) throws PropertyException;
-
- void setSchema(Schema schema);
-
- void setValidating(boolean validating) throws JAXBException;
-
- Object unmarshal(File f) throws JAXBException;
-
- Object unmarshal(InputSource source) throws JAXBException;
-
- Object unmarshal(InputStream is) throws JAXBException;
-
- Object unmarshal(Node node) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(Node node, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(Reader reader) throws JAXBException;
-
- Object unmarshal(Source source) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(Source source, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(URL url) throws JAXBException;
-
- Object unmarshal(XMLEventReader reader) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(XMLStreamReader reader) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> declaredType) throws JAXBException;
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshallerHandler.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshallerHandler.java
deleted file mode 100644
index b4bb32b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/UnmarshallerHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import org.xml.sax.ContentHandler;
-
-public interface UnmarshallerHandler extends ContentHandler {
-
- Object getResult() throws JAXBException, IllegalStateException;
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEvent.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEvent.java
deleted file mode 100644
index 64646df..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEvent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ValidationEvent {
-
- int ERROR = 1;
- int FATAL_ERROR = 2;
- int WARNING = 0;
-
- Throwable getLinkedException();
-
- ValidationEventLocator getLocator();
-
- String getMessage();
-
- int getSeverity();
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventHandler.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventHandler.java
deleted file mode 100644
index 36a8388..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventHandler.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ValidationEventHandler {
-
- boolean handleEvent(ValidationEvent event);
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventLocator.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventLocator.java
deleted file mode 100644
index a5fd082..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationEventLocator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.net.URL;
-
-import org.w3c.dom.Node;
-
-public interface ValidationEventLocator {
-
- int getColumnNumber();
-
- int getLineNumber();
-
- Node getNode();
-
- Object getObject();
-
- int getOffset();
-
- URL getURL();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationException.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationException.java
deleted file mode 100644
index 78b1a2b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/ValidationException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class ValidationException extends JAXBException {
-
- public ValidationException(String message) {
- super(message);
- }
-
- public ValidationException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public ValidationException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public ValidationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ValidationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Validator.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Validator.java
deleted file mode 100644
index 94790bb..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/Validator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface Validator {
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Object getProperty(String name) throws PropertyException;
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setProperty(String name, Object value) throws PropertyException;
-
- boolean validate(Object subRoot) throws JAXBException;
-
- boolean validateRoot(Object rootObj) throws JAXBException;
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/DomHandler.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/DomHandler.java
deleted file mode 100644
index e5fbf90..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/DomHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.bind.ValidationEventHandler;
-
-public interface DomHandler<ElementT, ResultT extends Result> {
-
- ResultT createUnmarshaller(ValidationEventHandler errorHandler);
-
- ElementT getElement(ResultT rt);
-
- Source marshal(ElementT n, ValidationEventHandler errorHandler);
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
deleted file mode 100644
index 2794e14..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.Source;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.bind.ValidationEventHandler;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.DocumentFragment;
-
-public class W3CDomHandler implements DomHandler<Element, DOMResult> {
-
- private DocumentBuilder builder;
-
- public W3CDomHandler() {
- }
-
- public W3CDomHandler(DocumentBuilder builder) {
- if (builder == null) {
- throw new IllegalArgumentException();
- }
- this.builder = builder;
- }
-
- public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
- if (builder == null) {
- return new DOMResult();
- } else {
- return new DOMResult(builder.newDocument());
- }
- }
-
- public DocumentBuilder getBuilder() {
- return builder;
- }
-
- public Element getElement(DOMResult rt) {
- Node n = rt.getNode();
- if (n instanceof Document) {
- return ((Document)n).getDocumentElement();
- }
- if (n instanceof Element) {
- return (Element)n;
- }
- if (n instanceof DocumentFragment) {
- return (Element)n.getChildNodes().item(0);
- } else {
- throw new IllegalStateException(n.toString());
- }
- }
-
- public Source marshal(Element n, ValidationEventHandler errorHandler) {
- return new DOMSource(n);
- }
-
- public void setBuilder(DocumentBuilder builder) {
- this.builder = builder;
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
deleted file mode 100644
index 45d6bc0..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlAccessOrder {
-
- ALPHABETICAL,
- UNDEFINED
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessType.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
deleted file mode 100644
index a34a650..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlAccessType {
-
- FIELD,
- NONE,
- PROPERTY,
- PUBLIC_MEMBER
-
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
deleted file mode 100644
index d800634..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.TYPE})
-public @interface XmlAccessorOrder {
-
- XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
deleted file mode 100644
index 6662588..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.TYPE })
-public @interface XmlAccessorType {
-
- XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
deleted file mode 100644
index 41ab490..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAnyAttribute {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
deleted file mode 100644
index 3828a9e..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAnyElement {
-
- boolean lax() default false;
-
- Class<? extends DomHandler> value() default W3CDomHandler.class;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
deleted file mode 100644
index 23bd034..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
-public @interface XmlAttachmentRef {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttribute.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
deleted file mode 100644
index ed2fb7c..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAttribute {
-
- String name() default "##default";
-
- boolean required() default false;
-
- String namespace() default "##default";
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElement.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElement.java
deleted file mode 100644
index e45cbad..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlElement {
-
- final class DEFAULT {
- }
-
- String name() default "##default";
-
- boolean nillable() default false;
-
- boolean required() default false;
-
- String namespace() default "##default";
-
- String defaultValue() default "\u0000";
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
deleted file mode 100644
index 79d60a1..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface XmlElementDecl {
-
- final class GLOBAL {
- }
-
- String name();
-
- Class scope() default GLOBAL.class;
-
- String namespace() default "##default";
-
- String substitutionHeadNamespace() default "##default";
-
- String substitutionHeadName() default "";
-
- String defaultValue() default "\u0000";
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
deleted file mode 100644
index ffdde6d..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementRef {
-
- final class DEFAULT {
- }
-
- String name() default "##default";
-
- String namespace() default "";
-
- Class type() default DEFAULT.class;
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
deleted file mode 100644
index 2e56e41..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementRefs {
-
- XmlElementRef[] value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
deleted file mode 100644
index d8940a8..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementWrapper {
-
- String name() default "##default";
-
- String namespace() default "##default";
-
- boolean nillable() default false;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElements.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElements.java
deleted file mode 100644
index f213cb6..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlElements.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElements {
-
- XmlElement[] value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnum.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnum.java
deleted file mode 100644
index 6700a99..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnum.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlEnum {
-
- Class<?> value() default String.class;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
deleted file mode 100644
index 62a97eb..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface XmlEnumValue {
-
- String value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlID.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlID.java
deleted file mode 100644
index 8a5bfdb..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlID.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlID {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlIDREF.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
deleted file mode 100644
index 3cd2c98..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlIDREF {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
deleted file mode 100644
index ded1639..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
-public @interface XmlInlineBinaryData {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlList.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlList.java
deleted file mode 100644
index d28b510..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlList.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-public @interface XmlList {
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMimeType.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
deleted file mode 100644
index f7f8ec3..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-public @interface XmlMimeType {
-
- String value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMixed.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMixed.java
deleted file mode 100644
index ac052fe..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlMixed.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlMixed {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNs.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNs.java
deleted file mode 100644
index c43f6f9..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNs.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {})
-public @interface XmlNs {
-
- String namespaceURI();
-
- String prefix();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNsForm.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
deleted file mode 100644
index 60e93f9..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlNsForm {
-
- UNQUALIFIED,
- QUALIFIED,
- UNSET
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRegistry.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
deleted file mode 100644
index 06733ec..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlRegistry {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRootElement.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
deleted file mode 100644
index 981043d..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlRootElement {
-
- String name() default "##default";
-
- String namespace() default "##default";
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchema.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchema.java
deleted file mode 100644
index e316a21..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchema.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PACKAGE)
-public @interface XmlSchema {
-
- XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
-
- XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
-
- String namespace() default "";
-
- XmlNs[] xmlns() default {};
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
deleted file mode 100644
index 0ab565a..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PACKAGE})
-public @interface XmlSchemaType {
-
- final class DEFAULT {
- }
-
- String name();
-
- String namespace() default "http://www.w3.org/2001/XMLSchema";
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
deleted file mode 100644
index 0dc20e1..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PACKAGE)
-public @interface XmlSchemaTypes {
-
- XmlSchemaType[] value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlTransient.java
deleted file mode 100644
index 8e95ba2..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlTransient.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlTransient {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlType.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlType.java
deleted file mode 100644
index 596fc96..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlType {
-
- final class DEFAULT {
- }
-
- Class factoryClass() default DEFAULT.class;
-
- String factoryMethod() default "";
-
- String name() default "##default";
-
- String namespace() default "##default";
-
- String[] propOrder() default "";
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlValue.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlValue.java
deleted file mode 100644
index ee9a41d..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/XmlValue.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlValue {
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
deleted file mode 100644
index 4266ab6..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public class CollapsedStringAdapter extends XmlAdapter<String, String> {
-
- public String marshal(String v) {
- return v;
- }
-
- public String unmarshal(String v) {
- if(v == null) {
- return null;
- }
- int len = v.length();
- int s;
- for (s = 0; s < len && !isWhiteSpace(v.charAt(s)); s++);
- if (s == len) {
- return v;
- }
- StringBuffer result = new StringBuffer(len);
- if (s != 0) {
- for(int i = 0; i < s; i++) {
- result.append(v.charAt(i));
- }
- result.append(' ');
- }
- boolean inStripMode = true;
- for (int i = s + 1; i < len; i++) {
- char ch = v.charAt(i);
- boolean b = isWhiteSpace(ch);
- if (inStripMode && b) {
- continue;
- }
- inStripMode = b;
- result.append(inStripMode ? ' ' : ch);
- }
- len = result.length();
- if (len > 0 && result.charAt(len - 1) == ' ') {
- result.setLength(len - 1);
- }
- return result.toString();
- }
-
- protected static boolean isWhiteSpace(char ch) {
- if (ch > ' ') {
- return false;
- } else {
- return ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ';
- }
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
deleted file mode 100644
index a3359f1..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import javax.xml.bind.DatatypeConverter;
-
-public final class HexBinaryAdapter extends XmlAdapter<String, byte[]> {
-
- public String marshal(byte[] v) {
- return DatatypeConverter.printHexBinary(v);
- }
-
- public byte[] unmarshal(String v) {
- return DatatypeConverter.parseHexBinary(v);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
deleted file mode 100644
index f0071e9..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public final class NormalizedStringAdapter extends XmlAdapter<String, String> {
-
- public String marshal(String v) {
- return v;
- }
-
- public String unmarshal(String v) {
- if (v == null) {
- return null;
- }
- int i;
- for (i = v.length() - 1; i >= 0 && !isWhiteSpaceExceptSpace(v.charAt(i)); i--);
- if (i < 0) {
- return v;
- }
- char buf[] = v.toCharArray();
- buf[i--] = ' ';
- for(; i >= 0; i--) {
- if(isWhiteSpaceExceptSpace(buf[i])) {
- buf[i] = ' ';
- }
- }
- return new String(buf);
- }
-
- protected static boolean isWhiteSpaceExceptSpace(char ch) {
- if (ch >= ' ') {
- return false;
- } else {
- return ch == '\t' || ch == '\n' || ch == '\r';
- }
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
deleted file mode 100644
index 0a1c2fe..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public abstract class XmlAdapter<ValueType, BoundType> {
-
- protected XmlAdapter() {
- }
-
- public abstract ValueType marshal(BoundType v) throws Exception;
-
- public abstract BoundType unmarshal(ValueType v) throws Exception;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
deleted file mode 100644
index cb8e530..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
-public @interface XmlJavaTypeAdapter {
-
- final class DEFAULT {
- }
-
- Class<? extends XmlAdapter> value();
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
deleted file mode 100644
index a3c85ce..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE})
-public @interface XmlJavaTypeAdapters {
-
- XmlJavaTypeAdapter[] value();
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
deleted file mode 100644
index 6a768b3..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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 javax.xml.bind.attachment;
-
-import javax.activation.DataHandler;
-
-public abstract class AttachmentMarshaller {
-
- public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName);
-
- public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName);
-
- public abstract String addSwaRefAttachment(DataHandler data);
-
- public boolean isXOPPackage() {
- return false;
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
deleted file mode 100644
index d67426b..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.attachment;
-
-import javax.activation.DataHandler;
-
-public abstract class AttachmentUnmarshaller {
-
- public abstract byte[] getAttachmentAsByteArray(String cid);
-
- public abstract DataHandler getAttachmentAsDataHandler(String cid);
-
- public boolean isXOPPackage() {
- return false;
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
deleted file mode 100644
index 7378cdc..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Result;
-import javax.xml.validation.Schema;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-
-public abstract class AbstractMarshallerImpl implements Marshaller {
-
- static String aliases[] = {
- "UTF-8", "UTF8",
- "UTF-16", "Unicode",
- "UTF-16BE", "UnicodeBigUnmarked",
- "UTF-16LE", "UnicodeLittleUnmarked",
- "US-ASCII", "ASCII",
- "TIS-620", "TIS620",
- "ISO-10646-UCS-2", "Unicode",
- "EBCDIC-CP-US", "cp037",
- "EBCDIC-CP-CA", "cp037",
- "EBCDIC-CP-NL", "cp037",
- "EBCDIC-CP-WT", "cp037",
- "EBCDIC-CP-DK", "cp277",
- "EBCDIC-CP-NO", "cp277",
- "EBCDIC-CP-FI", "cp278",
- "EBCDIC-CP-SE", "cp278",
- "EBCDIC-CP-IT", "cp280",
- "EBCDIC-CP-ES", "cp284",
- "EBCDIC-CP-GB", "cp285",
- "EBCDIC-CP-FR", "cp297",
- "EBCDIC-CP-AR1", "cp420",
- "EBCDIC-CP-HE", "cp424",
- "EBCDIC-CP-BE", "cp500",
- "EBCDIC-CP-CH", "cp500",
- "EBCDIC-CP-ROECE", "cp870",
- "EBCDIC-CP-YU", "cp870",
- "EBCDIC-CP-IS", "cp871",
- "EBCDIC-CP-AR2", "cp918"
- };
-
- private ValidationEventHandler eventHandler = new DefaultValidationEventHandler();
- private String encoding = "UTF-8";
- private String schemaLocation;
- private String noNSSchemaLocation;
- private boolean formattedOutput;
- private boolean fragment;
-
- public final void marshal(Object obj, OutputStream os) throws JAXBException {
- checkNotNull(obj, "obj", os, "os");
- marshal(obj, new StreamResult(os));
- }
-
- public final void marshal(Object obj, Writer w) throws JAXBException {
- checkNotNull(obj, "obj", w, "writer");
- marshal(obj, new StreamResult(w));
- }
-
- public final void marshal(Object obj, ContentHandler handler) throws JAXBException {
- checkNotNull(obj, "obj", handler, "handler");
- marshal(obj, new SAXResult(handler));
- }
-
- public final void marshal(Object obj, Node node) throws JAXBException {
- checkNotNull(obj, "obj", node, "node");
- marshal(obj, new DOMResult(node));
- }
-
- public Node getNode(Object obj) throws JAXBException {
- checkNotNull(obj, "obj", "foo", "bar");
- throw new UnsupportedOperationException();
- }
-
- protected String getEncoding() {
- return encoding;
- }
-
- protected void setEncoding(String encoding) {
- this.encoding = encoding;
- }
-
- protected String getSchemaLocation() {
- return schemaLocation;
- }
-
- protected void setSchemaLocation(String location) {
- schemaLocation = location;
- }
-
- protected String getNoNSSchemaLocation() {
- return noNSSchemaLocation;
- }
-
- protected void setNoNSSchemaLocation(String location) {
- noNSSchemaLocation = location;
- }
-
- protected boolean isFormattedOutput() {
- return formattedOutput;
- }
-
- protected void setFormattedOutput(boolean v) {
- formattedOutput = v;
- }
-
- protected boolean isFragment() {
- return fragment;
- }
-
- protected void setFragment(boolean v) {
- fragment = v;
- }
-
- protected String getJavaEncoding(String encoding) throws UnsupportedEncodingException {
- try {
- "dummy".getBytes(encoding);
- return encoding;
- }
- catch (UnsupportedEncodingException e) {
- }
- for (int i = 0; i < aliases.length; i += 2) {
- if (encoding.equals(aliases[i])) {
- "dummy".getBytes(aliases[i + 1]);
- return aliases[i + 1];
- }
- }
- throw new UnsupportedEncodingException(encoding);
- }
-
- public void setProperty(String name, Object value) throws PropertyException {
- if (name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- if (JAXB_ENCODING.equals(name)) {
- checkString(name, value);
- setEncoding((String) value);
- } else if (JAXB_FORMATTED_OUTPUT.equals(name)) {
- checkBoolean(name, value);
- setFormattedOutput(((Boolean) value).booleanValue());
- } else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name)) {
- checkString(name, value);
- setNoNSSchemaLocation((String) value);
- } else if (JAXB_SCHEMA_LOCATION.equals(name)) {
- checkString(name, value);
- setSchemaLocation((String) value);
- } else if (JAXB_FRAGMENT.equals(name)) {
- checkBoolean(name, value);
- setFragment(((Boolean) value).booleanValue());
- } else {
- throw new PropertyException(name, value);
- }
- }
-
- public Object getProperty(String name) throws PropertyException {
- if (name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- if (JAXB_ENCODING.equals(name)) {
- return getEncoding();
- } else if (JAXB_FORMATTED_OUTPUT.equals(name)) {
- return isFormattedOutput() ? Boolean.TRUE : Boolean.FALSE;
- } else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name)) {
- return getNoNSSchemaLocation();
- } else if (JAXB_SCHEMA_LOCATION.equals(name)) {
- return getSchemaLocation();
- } else if (JAXB_FRAGMENT.equals(name)) {
- return isFragment() ? Boolean.TRUE : Boolean.FALSE;
- } else {
- throw new PropertyException(name);
- }
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return eventHandler;
- }
-
- public void setEventHandler(ValidationEventHandler handler) throws JAXBException {
- if (handler == null) {
- eventHandler = new DefaultValidationEventHandler();
- } else {
- eventHandler = handler;
- }
- }
-
- private void checkBoolean(String name, Object value) throws PropertyException {
- if (!(value instanceof Boolean)) {
- throw new PropertyException(name + " must be a boolean");
- }
- }
-
- private void checkString(String name, Object value) throws PropertyException {
- if (!(value instanceof String)) {
- throw new PropertyException(name + " must be a string");
- }
- }
-
- private void checkNotNull(Object o1, String o1Name, Object o2, String o2Name) {
- if (o1 == null) {
- throw new IllegalArgumentException(o1Name + " must not be null");
- }
- if (o2 == null) {
- throw new IllegalArgumentException(o2Name + " must not be null");
- }
- }
-
- public void marshal(Object obj, XMLEventWriter writer)
- throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException();
- }
-
- public Schema getSchema() {
- throw new UnsupportedOperationException();
- }
-
- public void setAdapter(XmlAdapter adapter) {
- if (adapter == null) {
- throw new IllegalArgumentException();
- }
- setAdapter((Class<XmlAdapter>) adapter.getClass(), adapter);
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- throw new UnsupportedOperationException();
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- throw new UnsupportedOperationException();
- }
-
- public void setAttachmentMarshaller(AttachmentMarshaller am) {
- throw new UnsupportedOperationException();
- }
-
- public AttachmentMarshaller getAttachmentMarshaller() {
- throw new UnsupportedOperationException();
- }
-
- public void setListener(javax.xml.bind.Marshaller.Listener listener) {
- throw new UnsupportedOperationException();
- }
-
- public javax.xml.bind.Marshaller.Listener getListener() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
deleted file mode 100644
index fe14154..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-public abstract class AbstractUnmarshallerImpl implements Unmarshaller {
-
- protected boolean validating;
- private ValidationEventHandler eventHandler;
- private XMLReader reader;
-
- protected UnmarshalException createUnmarshalException(SAXException e) {
- Exception nested = e.getException();
- if (nested instanceof UnmarshalException) {
- return (UnmarshalException)nested;
- } else if(nested instanceof RuntimeException) {
- throw (RuntimeException)nested;
- } else if (nested != null) {
- return new UnmarshalException(nested);
- } else {
- return new UnmarshalException(e);
- }
- }
-
- protected XMLReader getXMLReader() throws JAXBException {
- if (reader == null) {
- try {
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- parserFactory.setNamespaceAware(true);
- parserFactory.setValidating(false);
- reader = parserFactory.newSAXParser().getXMLReader();
- } catch(ParserConfigurationException e) {
- throw new JAXBException(e);
- } catch(SAXException e) {
- throw new JAXBException(e);
- }
- }
- return reader;
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- throw new UnsupportedOperationException();
- }
-
- public AttachmentUnmarshaller getAttachmentUnmarshaller() {
- throw new UnsupportedOperationException();
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return eventHandler;
- }
-
- public Listener getListener() {
- throw new UnsupportedOperationException();
- }
-
- public Object getProperty(String name) throws PropertyException {
- if(name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- throw new PropertyException(name);
- }
-
- public Schema getSchema() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isValidating() throws JAXBException {
- return validating;
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- throw new UnsupportedOperationException();
- }
-
- public void setAdapter(XmlAdapter adapter) {
- if (adapter == null) {
- throw new IllegalArgumentException();
- }
- setAdapter((Class<XmlAdapter>) adapter.getClass(), adapter);
- }
-
- public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) {
- throw new UnsupportedOperationException();
- }
-
- public void setEventHandler(ValidationEventHandler handler) throws JAXBException {
- if (handler == null) {
- handler = new DefaultValidationEventHandler();
- }
- eventHandler = handler;
- }
-
- public void setListener(Listener listener) {
- throw new UnsupportedOperationException();
- }
-
- public void setProperty(String name, Object value) throws PropertyException {
- if(name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- throw new PropertyException(name, value);
- }
-
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException();
- }
-
- public void setValidating(boolean validating) throws JAXBException {
- this.validating = validating;
- }
-
- public final Object unmarshal(File file) throws JAXBException {
- if (file == null) {
- throw new IllegalArgumentException("file must not be null");
- }
- try
- {
- String path = file.getAbsolutePath();
- if (File.separatorChar != '/') {
- path = path.replace(File.separatorChar, '/');
- }
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- if (!path.endsWith("/") && file.isDirectory()) {
- path = path + "/";
- }
- return unmarshal(new URL("file", "", path));
- }
- catch(MalformedURLException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
- }
-
- public final Object unmarshal(InputSource source) throws JAXBException {
- if (source == null) {
- throw new IllegalArgumentException("source must not be null");
- }
- return unmarshal(getXMLReader(), source);
- }
-
- public final Object unmarshal(InputStream is) throws JAXBException {
- if (is == null) {
- throw new IllegalArgumentException("is must not be null");
- }
- return unmarshal(new InputSource(is));
- }
-
- public <T> JAXBElement<T> unmarshal(Node node, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public final Object unmarshal(Reader reader) throws JAXBException {
- if (reader == null) {
- throw new IllegalArgumentException("reader must not be null");
- }
- return unmarshal(new InputSource(reader));
- }
-
- public Object unmarshal(Source source) throws JAXBException {
- if (source == null) {
- throw new IllegalArgumentException("source must not be null");
- } else if (source instanceof SAXSource) {
- SAXSource saxSource = (SAXSource) source;
- XMLReader reader = saxSource.getXMLReader();
- if (reader == null) {
- reader = getXMLReader();
- }
- return unmarshal(reader, saxSource.getInputSource());
- } else if (source instanceof StreamSource) {
- StreamSource ss = (StreamSource) source;
- InputSource is = new InputSource();
- is.setSystemId(ss.getSystemId());
- is.setByteStream(ss.getInputStream());
- is.setCharacterStream(ss.getReader());
- return unmarshal(is);
- } else if (source instanceof DOMSource)
- return unmarshal(((DOMSource) source).getNode());
- else
- throw new IllegalArgumentException();
- }
-
- protected abstract Object unmarshal(XMLReader xmlreader, InputSource inputsource) throws JAXBException;
-
- public <T> JAXBElement<T> unmarshal(Source source, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public final Object unmarshal(URL url) throws JAXBException {
- if(url == null) {
- throw new IllegalArgumentException("url must not be null");
- }
- return unmarshal(new InputSource(url.toExternalForm()));
- }
-
- public Object unmarshal(XMLEventReader reader) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public Object unmarshal(XMLStreamReader reader) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
deleted file mode 100644
index d54d458..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.net.URL;
-
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.ValidationEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-import org.w3c.dom.Node;
-
-public class DefaultValidationEventHandler implements ValidationEventHandler {
-
- public boolean handleEvent(ValidationEvent event) {
- if (event == null) {
- throw new IllegalArgumentException();
- }
- String severity = null;
- boolean retVal = false;
- switch(event.getSeverity()) {
- case ValidationEvent.WARNING:
- severity = "[WARNING]: ";
- retVal = true;
- break;
-
- case ValidationEvent.ERROR:
- severity = "[ERROR]: ";
- retVal = false;
- break;
-
- case ValidationEvent.FATAL_ERROR:
- severity = "[FATAL_ERROR]: ";
- retVal = false;
- break;
- }
- String location = getLocation(event);
- System.out.println("DefaultValidationEventHandler " + severity + " " + event.getMessage() + "\n Location: " + location);
- return retVal;
- }
-
- private String getLocation(ValidationEvent event) {
- StringBuffer msg = new StringBuffer();
- ValidationEventLocator locator = event.getLocator();
- if (locator != null) {
- URL url = locator.getURL();
- Object obj = locator.getObject();
- Node node = locator.getNode();
- int line = locator.getLineNumber();
- if(url != null || line != -1) {
- msg.append("line ").append(line);
- if(url != null) {
- msg.append(" of ").append(url);
- }
- } else {
- if (obj != null) {
- msg.append(" obj: ").append(obj.toString());
- } else if(node != null) {
- msg.append(" node: ").append(node.toString());
- }
- }
- } else {
- msg.append("unavailable");
- }
- return msg.toString();
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
deleted file mode 100644
index 8a08cdd..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.NotIdentifiableEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class NotIdentifiableEventImpl extends ValidationEventImpl implements NotIdentifiableEvent {
-
- public NotIdentifiableEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public NotIdentifiableEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
deleted file mode 100644
index 5e88c93..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.ParseConversionEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class ParseConversionEventImpl extends ValidationEventImpl implements ParseConversionEvent {
-
- public ParseConversionEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public ParseConversionEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
deleted file mode 100644
index b0eb10f..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.PrintConversionEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class PrintConversionEventImpl extends ValidationEventImpl implements PrintConversionEvent {
-
- public PrintConversionEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public PrintConversionEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
deleted file mode 100644
index ca5e8b1..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.ValidationEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class ValidationEventImpl implements ValidationEvent {
-
- private int severity;
- private String message;
- private Throwable linkedException;
- private ValidationEventLocator locator;
-
- public ValidationEventImpl(int severity, String message, ValidationEventLocator locator) {
- this(severity, message, locator, null);
- }
-
- public ValidationEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- setSeverity(severity);
- this.message = message;
- this.locator = locator;
- this.linkedException = linkedException;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- public void setSeverity(int severity) {
- if (severity != 0 && severity != 1 && severity != 2) {
- throw new IllegalArgumentException("Illegal severity");
- }
- this.severity = severity;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public Throwable getLinkedException() {
- return linkedException;
- }
-
- public void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public ValidationEventLocator getLocator() {
- return locator;
- }
-
- public void setLocator(ValidationEventLocator locator) {
- this.locator = locator;
- }
-
- public String toString() {
- String s;
- switch (getSeverity()) {
- case WARNING:
- s = "WARNING";
- break;
- case ERROR:
- s = "ERROR";
- break;
- case FATAL_ERROR:
- s = "FATAL_ERROR";
- break;
- default:
- s = String.valueOf(getSeverity());
- break;
- }
- return "[severity=" + s + ", message=" + getMessage() + ", locator=" + getLocator() + "]";
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
deleted file mode 100644
index b1ddf78..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import javax.xml.bind.ValidationEventLocator;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.SAXParseException;
-import org.xml.sax.Locator;
-
-public class ValidationEventLocatorImpl implements ValidationEventLocator {
-
- private URL url;
- private int offset = -1;
- private int lineNumber = -1;
- private int columnNumber = -1;
- private Object object;
- private Node node;
-
- public ValidationEventLocatorImpl() {
- }
-
- public ValidationEventLocatorImpl(Locator loc) {
- if (loc == null) {
- throw new IllegalArgumentException("loc must not be null");
- }
- url = toURL(loc.getSystemId());
- columnNumber = loc.getColumnNumber();
- lineNumber = loc.getLineNumber();
- }
-
- public ValidationEventLocatorImpl(SAXParseException e) {
- if (e == null) {
- throw new IllegalArgumentException("e must not be null");
- }
- url = toURL(e.getSystemId());
- columnNumber = e.getColumnNumber();
- lineNumber = e.getLineNumber();
- }
-
- public ValidationEventLocatorImpl(Node node) {
- if (node == null) {
- throw new IllegalArgumentException("node must not be null");
- }
- this.node = node;
- }
-
- public ValidationEventLocatorImpl(Object object) {
- if (object == null) {
- throw new IllegalArgumentException("object must not be null");
- }
- this.object = object;
- }
-
- private static URL toURL(String systemId) {
- try {
- return new URL(systemId);
- }
- catch (MalformedURLException e) {
- return null;
- }
- }
-
- public URL getURL() {
- return url;
- }
-
- public void setURL(URL url) {
- this.url = url;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
- public int getLineNumber() {
- return lineNumber;
- }
-
- public void setLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- public int getColumnNumber() {
- return columnNumber;
- }
-
- public void setColumnNumber(int columnNumber) {
- this.columnNumber = columnNumber;
- }
-
- public Object getObject() {
- return object;
- }
-
- public void setObject(Object object) {
- this.object = object;
- }
-
- public Node getNode() {
- return node;
- }
-
- public void setNode(Node node) {
- this.node = node;
- }
-
- public String toString() {
- return "[node=" + getNode() + ", " +
- "object=" + getObject() + ", " +
- "url=" + getURL() + ", " +
- "line=" + String.valueOf(getLineNumber()) + "," +
- "col=" + String.valueOf(getColumnNumber()) + "," +
- "offset=" + String.valueOf(getOffset()) + "]";
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBResult.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBResult.java
deleted file mode 100644
index 1584b41..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBResult.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-public class JAXBResult extends SAXResult {
-
- private final UnmarshallerHandler unmarshallerHandler;
-
- public JAXBResult(JAXBContext context) throws JAXBException {
- if (context == null) {
- throw new JAXBException("context must not be null");
- }
- unmarshallerHandler = context.createUnmarshaller().getUnmarshallerHandler();
- super.setHandler(unmarshallerHandler);
- }
-
- public JAXBResult(Unmarshaller unmarshaller) throws JAXBException {
- if (unmarshaller == null) {
- throw new JAXBException("unmarshaller must not be null");
- }
- unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
- super.setHandler(unmarshallerHandler);
- }
-
- public Object getResult() throws JAXBException {
- return unmarshallerHandler.getResult();
- }
-
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBSource.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBSource.java
deleted file mode 100644
index abd6457..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/JAXBSource.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.XMLFilterImpl;
-import org.xml.sax.ext.LexicalHandler;
-
-public class JAXBSource extends SAXSource {
-
- public JAXBSource(JAXBContext context, Object contentObject) throws JAXBException {
- if (context == null) {
- throw new JAXBException("context must not be null");
- }
- if (contentObject == null) {
- throw new JAXBException("contentObject must not be null");
- }
- setXMLReader(new Reader(context.createMarshaller(), contentObject));
- setInputSource(new InputSource());
- }
-
- public JAXBSource(final Marshaller marshaller, final Object contentObject) throws JAXBException {
- if (marshaller == null) {
- throw new JAXBException("marshaller must not be null");
- }
- if (contentObject == null) {
- throw new JAXBException("contentObject must not be null");
- }
- setXMLReader(new Reader(marshaller, contentObject));
- setInputSource(new InputSource());
- }
-
- private static class Reader implements XMLReader {
-
- private LexicalHandler lexicalHandler;
- private EntityResolver entityResolver;
- private DTDHandler dtdHandler;
- private XMLFilterImpl repeater;
- private ErrorHandler errorHandler;
- private final Marshaller marshaller;
- private final Object contentObject;
-
- public Reader(Marshaller marshaller, Object contentObject) {
- this.marshaller = marshaller;
- this.contentObject = contentObject;
- repeater = new XMLFilterImpl();
- }
-
- public boolean getFeature(String name) throws SAXNotRecognizedException {
- if (name.equals("http://xml.org/sax/features/namespaces")) {
- return true;
- }
- if (name.equals("http://xml.org/sax/features/namespace-prefixes")) {
- return false;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
- if (name.equals("http://xml.org/sax/features/namespaces") && value) {
- return;
- }
- if (name.equals("http://xml.org/sax/features/namespace-prefixes") && !value) {
- return;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public Object getProperty(String name) throws SAXNotRecognizedException {
- if("http://xml.org/sax/properties/lexical-handler".equals(name)) {
- return lexicalHandler;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setProperty(String name, Object value) throws SAXNotRecognizedException {
- if("http://xml.org/sax/properties/lexical-handler".equals(name)) {
- lexicalHandler = (LexicalHandler) value;
- return;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setEntityResolver(EntityResolver resolver) {
- entityResolver = resolver;
- }
-
- public EntityResolver getEntityResolver() {
- return entityResolver;
- }
-
- public void setDTDHandler(DTDHandler handler) {
- dtdHandler = handler;
- }
-
- public DTDHandler getDTDHandler() {
- return dtdHandler;
- }
-
- public void setContentHandler(ContentHandler handler) {
- repeater.setContentHandler(handler);
- }
-
- public ContentHandler getContentHandler() {
- return repeater.getContentHandler();
- }
-
- public void setErrorHandler(ErrorHandler handler) {
- errorHandler = handler;
- }
-
- public ErrorHandler getErrorHandler() {
- return errorHandler;
- }
-
- public void parse(InputSource input) throws SAXException {
- parse();
- }
-
- public void parse(String systemId) throws SAXException {
- parse();
- }
-
- public void parse() throws SAXException {
- try {
- marshaller.marshal(contentObject, repeater);
- } catch(JAXBException e) {
- SAXParseException se = new SAXParseException(e.getMessage(), null, null, -1, -1, e);
- if (errorHandler != null) {
- errorHandler.fatalError(se);
- }
- throw se;
- }
- }
-
- }
-}
diff --git a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/ValidationEventCollector.java b/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
deleted file mode 100644
index e4cc436..0000000
--- a/trunk/jaxb-api-2.0/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import java.util.ArrayList;
-
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.ValidationEvent;
-
-public class ValidationEventCollector implements ValidationEventHandler {
-
- private ArrayList<ValidationEvent> events = new ArrayList<ValidationEvent>();
-
- public ValidationEvent[] getEvents() {
- return events.toArray(new ValidationEvent[events.size()]);
- }
-
- public boolean handleEvent(ValidationEvent event) {
- events.add(event);
- return event.getSeverity() != ValidationEvent.FATAL_ERROR;
- }
-
- public boolean hasEvents() {
- return !events.isEmpty();
- }
-
- public void reset() {
- events.clear();
- }
-}
diff --git a/trunk/jaxb-api-2.1/pom.xml b/trunk/jaxb-api-2.1/pom.xml
deleted file mode 100644
index cae2f80..0000000
--- a/trunk/jaxb-api-2.1/pom.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXB API 2.1</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.google.code.japidiff</groupId>
- <artifactId>maven-japidiff-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>diff</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <filter>javax/xml/bind.*</filter>
- <jar>javax.xml.bind:jaxb-api:2.1</jar>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.bind*;version=2.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>${project.groupId}:${project.artifactId}</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Binder.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Binder.java
deleted file mode 100644
index 125a1be..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Binder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import javax.xml.validation.Schema;
-
-public abstract class Binder<XmlNode> {
-
- public abstract ValidationEventHandler getEventHandler() throws JAXBException;
-
- public abstract Object getJAXBNode(XmlNode xmlNode);
-
- public abstract Object getProperty(String name) throws PropertyException;
-
- public abstract Schema getSchema();
-
- public abstract XmlNode getXMLNode(Object jaxbObject);
-
- public abstract void marshal(Object jaxbObject, XmlNode xmlNode) throws JAXBException;
-
- public abstract void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- public abstract void setProperty(String name, Object value) throws PropertyException;
-
- public abstract void setSchema(Schema schema);
-
- public abstract Object unmarshal(XmlNode xmlNode) throws JAXBException;
-
- public abstract <T> JAXBElement<T> unmarshal(XmlNode xmlNode, Class<T> declaredType) throws JAXBException;
-
- public abstract Object updateJAXB(XmlNode xmlNode) throws JAXBException;
-
- public abstract XmlNode updateXML(Object jaxbObject) throws JAXBException;
-
- public abstract XmlNode updateXML(Object jaxbObject, XmlNode xmlNode) throws JAXBException;
-
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java
deleted file mode 100644
index 5164643..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ContextFinder.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.Properties;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-class ContextFinder {
-
- private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.bind.v2.ContextFactory";
- private static final String JAXB_CONTEXT_PROPERTY = JAXBContext.class.getName();
- private static final String JAXB_CONTEXT_FACTORY = JAXBContext.JAXB_CONTEXT_FACTORY;
-
- public static JAXBContext find(String contextPath, ClassLoader classLoader, Map properties) throws JAXBException {
- String className = null;
- // Patch for bug https://issues.apache.org/activemq/browse/SMX4-329
- if (contextPath == null || contextPath.length() == 0) {
- throw new JAXBException("Invalid contextPath (empty or null)");
- }
- String[] packages = contextPath.split(":");
- if (packages == null || packages.length == 0) {
- throw new JAXBException("Invalid contextPath (no packages)");
- }
- for (String pkg : packages) {
- String url = pkg.replace('.', '/') + "/jaxb.properties";
- className = loadClassNameFromProperties(url, classLoader);
- if (className != null) {
- break;
- }
- }
- if (className == null) {
- className = System.getProperty(JAXB_CONTEXT_PROPERTY);
- }
- if (className == null) {
- String url = "META-INF/services/" + JAXB_CONTEXT_PROPERTY;
- className = loadClassName(url, classLoader);
- }
- if (className == null) {
- className = PLATFORM_DEFAULT_FACTORY_CLASS;
- }
- Class spi = loadSpi(className, classLoader);
- try {
- Method m = spi.getMethod("createContext", new Class[] { String.class, ClassLoader.class, Map.class });
- return (JAXBContext) m.invoke(null, new Object[] { contextPath, classLoader, properties });
- } catch (NoSuchMethodException e) {
- // ignore
- } catch (Throwable t) {
- throw new JAXBException("Unable to create context", t);
- }
- // Fallback for JAXB 1.0 compatibility (at least JAXB TCK tests are using that feature)
- try {
- Method m = spi.getMethod("createContext", new Class[] { String.class, ClassLoader.class, });
- return (JAXBContext) m.invoke(null, new Object[] { contextPath, classLoader });
- } catch (Throwable t) {
- throw new JAXBException("Unable to create context", t);
- }
- }
-
-
- public static JAXBContext find(Class[] classes, Map properties) throws JAXBException {
- String className = null;
- for (Class cl : classes) {
- Package pkg = cl.getPackage();
- if (pkg != null) {
- String url = pkg.getName().replace('.', '/') + "/jaxb.properties";
- className = loadClassNameFromProperties(url, cl.getClassLoader());
- if (className != null) {
- break;
- }
- }
- }
- if (className == null) {
- className = System.getProperty(JAXB_CONTEXT_PROPERTY);
- }
- if (className == null) {
- String url = "META-INF/services/" + JAXB_CONTEXT_PROPERTY;
- className = loadClassName(url, Thread.currentThread().getContextClassLoader());
- }
- if (className == null) {
- className = PLATFORM_DEFAULT_FACTORY_CLASS;
- }
- Class spi = loadSpi(className, Thread.currentThread().getContextClassLoader());
- try {
- Method m = spi.getMethod("createContext", new Class[] { Class[].class, Map.class });
- return (JAXBContext) m.invoke(null, new Object[] { classes, properties });
- } catch (Throwable t) {
- throw new JAXBException("Unable to create context", t);
- }
- }
-
- private static String loadClassNameFromProperties(String url, ClassLoader classLoader) throws JAXBException {
- try {
- InputStream is;
- if (classLoader != null) {
- is = classLoader.getResourceAsStream(url);
- } else {
- is = ClassLoader.getSystemResourceAsStream(url);
- }
- if (is != null) {
- try {
- Properties props = new Properties();
- props.load(is);
- String className = props.getProperty(JAXB_CONTEXT_FACTORY);
- if (className == null) {
- throw new JAXBException("jaxb.properties file " + url + " should contain a " + JAXB_CONTEXT_FACTORY + " property");
- }
- return className.trim();
- } finally {
- is.close();
- }
- } else {
- return null;
- }
- } catch (IOException e) {
- throw new JAXBException(e);
- }
- }
-
- private static String loadClassName(String url, ClassLoader classLoader) throws JAXBException {
- try {
- InputStream is;
- if (classLoader != null) {
- is = classLoader.getResourceAsStream(url);
- } else {
- is = ClassLoader.getSystemResourceAsStream(url);
- }
- if (is != null) {
- try {
- BufferedReader r = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- return r.readLine().trim();
- } finally {
- is.close();
- }
- }
- return null;
- } catch (IOException e) {
- throw new JAXBException(e);
- }
- }
-
- private static Class loadSpi(String className, ClassLoader classLoader) throws JAXBException {
- Class spiClass;
- try {
- spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(JAXBContext.class);
- if (spiClass != null) {
- return spiClass;
- }
- } catch (Throwable t) {
- }
- try {
- if (classLoader != null) {
- spiClass = classLoader.loadClass(className);
- } else {
- spiClass = Class.forName(className);
- }
- } catch (ClassNotFoundException e) {
- throw new JAXBException("Provider " + className + " not found", e);
- }
- return spiClass;
- }
-
-
-}
-
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DataBindingException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DataBindingException.java
deleted file mode 100644
index a5484b7..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DataBindingException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class DataBindingException extends RuntimeException {
-
- public DataBindingException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public DataBindingException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverter.java
deleted file mode 100644
index e8dd3c6..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverter.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.util.Calendar;
-import java.math.BigInteger;
-import java.math.BigDecimal;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-public final class DatatypeConverter {
-
- private static DatatypeConverterInterface converter = null;
-
- private DatatypeConverter() {
- }
-
- public static void setDatatypeConverter(DatatypeConverterInterface converter) {
- if (converter == null) {
- throw new IllegalArgumentException("The DatatypeConverterInterface parameter must not be null");
- }
- if (DatatypeConverter.converter == null) {
- DatatypeConverter.converter = converter;
- }
- }
-
- public static String parseString(String lexicalXSDString) {
- return converter.parseString(lexicalXSDString);
- }
-
- public static BigInteger parseInteger(String lexicalXSDInteger) {
- return converter.parseInteger(lexicalXSDInteger);
- }
-
- public static int parseInt(String lexicalXSDInt) {
- return converter.parseInt(lexicalXSDInt);
- }
-
- public static long parseLong(String lexicalXSDLong) {
- return converter.parseLong(lexicalXSDLong);
- }
-
- public static short parseShort(String lexicalXSDShort) {
- return converter.parseShort(lexicalXSDShort);
- }
-
- public static BigDecimal parseDecimal(String lexicalXSDDecimal) {
- return converter.parseDecimal(lexicalXSDDecimal);
- }
-
- public static float parseFloat(String lexicalXSDFloat) {
- return converter.parseFloat(lexicalXSDFloat);
- }
-
- public static double parseDouble(String lexicalXSDDouble) {
- return converter.parseDouble(lexicalXSDDouble);
- }
-
- public static boolean parseBoolean(String lexicalXSDBoolean) {
- return converter.parseBoolean(lexicalXSDBoolean);
- }
-
- public static byte parseByte(String lexicalXSDByte) {
- return converter.parseByte(lexicalXSDByte);
- }
-
- public static QName parseQName(String lexicalXSDQName, NamespaceContext nsc) {
- return converter.parseQName(lexicalXSDQName, nsc);
- }
-
- public static Calendar parseDateTime(String lexicalXSDDateTime) {
- return converter.parseDateTime(lexicalXSDDateTime);
- }
-
- public static byte[] parseBase64Binary(String lexicalXSDBase64Binary) {
- return converter.parseBase64Binary(lexicalXSDBase64Binary);
- }
-
- public static byte[] parseHexBinary(String lexicalXSDHexBinary) {
- return converter.parseHexBinary(lexicalXSDHexBinary);
- }
-
- public static long parseUnsignedInt(String lexicalXSDUnsignedInt) {
- return converter.parseUnsignedInt(lexicalXSDUnsignedInt);
- }
-
- public static int parseUnsignedShort(String lexicalXSDUnsignedShort) {
- return converter.parseUnsignedShort(lexicalXSDUnsignedShort);
- }
-
- public static Calendar parseTime(String lexicalXSDTime) {
- return converter.parseTime(lexicalXSDTime);
- }
-
- public static Calendar parseDate(String lexicalXSDDate) {
- return converter.parseDate(lexicalXSDDate);
- }
-
- public static String parseAnySimpleType(String lexicalXSDAnySimpleType) {
- return converter.parseAnySimpleType(lexicalXSDAnySimpleType);
- }
-
- public static String printString(String val) {
- return converter.printString(val);
- }
-
- public static String printInteger(BigInteger val) {
- return converter.printInteger(val);
- }
-
- public static String printInt(int val) {
- return converter.printInt(val);
- }
-
- public static String printLong(long val) {
- return converter.printLong(val);
- }
-
- public static String printShort(short val) {
- return converter.printShort(val);
- }
-
- public static String printDecimal(BigDecimal val) {
- return converter.printDecimal(val);
- }
-
- public static String printFloat(float val) {
- return converter.printFloat(val);
- }
-
- public static String printDouble(double val) {
- return converter.printDouble(val);
- }
-
- public static String printBoolean(boolean val) {
- return converter.printBoolean(val);
- }
-
- public static String printByte(byte val) {
- return converter.printByte(val);
- }
-
- public static String printQName(QName val, NamespaceContext nsc) {
- return converter.printQName(val, nsc);
- }
-
- public static String printDateTime(Calendar val) {
- return converter.printDateTime(val);
- }
-
- public static String printBase64Binary(byte val[]) {
- return converter.printBase64Binary(val);
- }
-
- public static String printHexBinary(byte val[]) {
- return converter.printHexBinary(val);
- }
-
- public static String printUnsignedInt(long val) {
- return converter.printUnsignedInt(val);
- }
-
- public static String printUnsignedShort(int val) {
- return converter.printUnsignedShort(val);
- }
-
- public static String printTime(Calendar val) {
- return converter.printTime(val);
- }
-
- public static String printDate(Calendar val) {
- return converter.printDate(val);
- }
-
- public static String printAnySimpleType(String val) {
- return converter.printAnySimpleType(val);
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverterInterface.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
deleted file mode 100644
index d0a4a63..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.util.Calendar;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
-
-public interface DatatypeConverterInterface {
-
- String parseAnySimpleType(String lexicalXSDAnySimpleType);
-
- byte[] parseBase64Binary(String lexicalXSDBase64Binary);
-
- boolean parseBoolean(String lexicalXSDBoolean);
-
- byte parseByte(String lexicalXSDByte);
-
- Calendar parseDate(String lexicalXSDDate);
-
- Calendar parseDateTime(String lexicalXSDDateTime);
-
- BigDecimal parseDecimal(String lexicalXSDDecimal);
-
- double parseDouble(String lexicalXSDDouble);
-
- float parseFloat(String lexicalXSDFloat);
-
- byte[] parseHexBinary(String lexicalXSDHexBinary);
-
- int parseInt(String lexicalXSDInt);
-
- BigInteger parseInteger(String lexicalXSDInteger);
-
- long parseLong(String lexicalXSDLong);
-
- QName parseQName(String lexicalXSDQName, NamespaceContext nsc);
-
- short parseShort(String lexicalXSDShort);
-
- String parseString(String lexicalXSDString);
-
- Calendar parseTime(String lexicalXSDTime);
-
- long parseUnsignedInt(String lexicalXSDUnsignedInt);
-
- int parseUnsignedShort(String lexicalXSDUnsignedShort);
-
- String printAnySimpleType(String val);
-
- String printBase64Binary(byte[] val);
-
- String printBoolean(boolean val);
-
- String printByte(byte val);
-
- String printDate(Calendar val);
-
- String printDateTime(Calendar val);
-
- String printDecimal(BigDecimal val);
-
- String printDouble(double val);
-
- String printFloat(float val);
-
- String printHexBinary(byte[] val);
-
- String printInt(int val);
-
- String printInteger(BigInteger val);
-
- String printLong(long val);
-
- String printQName(QName val, NamespaceContext nsc);
-
- String printShort(short val);
-
- String printString(String val);
-
- String printTime(Calendar val);
-
- String printUnsignedInt(long val);
-
- String printUnsignedShort(int val);
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Element.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Element.java
deleted file mode 100644
index 1d9d263..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Element.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface Element {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXB.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXB.java
deleted file mode 100644
index da2fdd6..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXB.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URISyntaxException;
-import java.net.MalformedURLException;
-import java.beans.Introspector;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.namespace.QName;
-
-final public class JAXB {
-
- private JAXB() {
- }
-
- public static void marshal(Object object, File file) {
- if (file == null) {
- throw new IllegalStateException("No file is given");
- }
- marshal(object, new StreamResult(file));
- }
-
- public static void marshal(Object object, OutputStream os) {
- if (os == null) {
- throw new IllegalStateException("No output stream is given");
- }
- marshal(object, new StreamResult(os));
- }
-
- public static void marshal(Object object, Writer writer) {
- if (writer == null) {
- throw new IllegalStateException("No writer is given");
- }
- marshal(object, new StreamResult(writer));
- }
-
- public static void marshal(Object object, String str) {
- if (str == null) {
- throw new IllegalStateException("No string destination is given");
- }
- try {
- marshal(object, new URI(str));
- } catch (URISyntaxException e) {
- marshal(object, new File(str));
- }
- }
-
- public static void marshal(Object object, URI uri) {
- if (uri == null) {
- throw new IllegalStateException("No uri is given");
- }
- try {
- marshal(object, uri.toURL());
- } catch (IOException e) {
- throw new DataBindingException(e);
- }
- }
-
- public static void marshal(Object object, URL url) {
- if (url == null) {
- throw new IllegalStateException("No url is given");
- }
- try {
- URLConnection con = url.openConnection();
- con.setDoOutput(true);
- con.setDoInput(false);
- con.connect();
- marshal(object, new StreamResult(con.getOutputStream()));
- } catch (IOException e) {
- throw new DataBindingException(e);
- }
- }
-
- public static void marshal(Object object, Result result) {
- try {
- JAXBContext context;
- if (object instanceof JAXBElement) {
- context = getContext(((JAXBElement<?>) object).getDeclaredType());
- } else {
- Class<?> clazz = object.getClass();
- XmlRootElement r = clazz.getAnnotation(XmlRootElement.class);
- if (r == null) {
- // we need to infer the name
- object = new JAXBElement(new QName(Introspector.decapitalize(clazz.getSimpleName())),
- clazz, object);
- }
- context = getContext(clazz);
- }
- Marshaller m = context.createMarshaller();
- m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
- m.marshal(object, result);
- } catch (JAXBException e) {
- throw new DataBindingException(e);
- }
- }
-
- public static <T> T unmarshal(File file, Class<T> type) {
- if (file == null) {
- throw new IllegalStateException("No file is given");
- }
- return unmarshal(new StreamSource(file), type);
- }
-
- public static <T> T unmarshal(URL url, Class<T> type) {
- if (url == null) {
- throw new IllegalStateException("No url is given");
- }
- return unmarshal(new StreamSource(url.toExternalForm()), type);
- }
-
- public static <T> T unmarshal(URI uri, Class<T> type) {
- if (uri == null) {
- throw new IllegalStateException("No uri is given");
- }
- try {
- return unmarshal(uri.toURL(), type);
- } catch (MalformedURLException e) {
- throw new DataBindingException(e);
- }
- }
-
- public static <T> T unmarshal(String str, Class<T> type) {
- if (str == null) {
- throw new IllegalStateException("No string destination is given");
- }
- try {
- return unmarshal(new URI(str), type);
- } catch (URISyntaxException e) {
- return unmarshal(new File(str), type);
- }
- }
-
- public static <T> T unmarshal(InputStream is, Class<T> type) {
- if (is == null) {
- throw new IllegalStateException("No input stream is given");
- }
- return unmarshal(new StreamSource(is), type);
- }
-
- public static <T> T unmarshal(Reader reader, Class<T> type) {
- if (reader == null) {
- throw new IllegalStateException("No reader is given");
- }
- return unmarshal(new StreamSource(reader), type);
- }
-
- public static <T> T unmarshal(Source source, Class<T> type) {
- try {
- JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(source, type);
- return item.getValue();
- } catch (JAXBException e) {
- throw new DataBindingException(e);
- }
- }
-
- private static <T> JAXBContext getContext(Class<T> type) throws JAXBException {
- return JAXBContext.newInstance(type);
- }
-
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBContext.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBContext.java
deleted file mode 100644
index 849ba92..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBContext.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-
-import java.util.Map;
-import java.util.Collections;
-
-import org.w3c.dom.Node;
-
-public abstract class JAXBContext {
-
- public static final String JAXB_CONTEXT_FACTORY = "javax.xml.bind.context.factory";
-
- protected JAXBContext() {
- }
-
- public Binder<Node> createBinder() {
- throw new UnsupportedOperationException();
- }
-
- public <T> Binder<T> createBinder(Class<T> domType) {
- throw new UnsupportedOperationException();
- }
-
- public JAXBIntrospector createJAXBIntrospector() {
- throw new UnsupportedOperationException();
- }
-
- public abstract Marshaller createMarshaller() throws JAXBException;
-
- public abstract Unmarshaller createUnmarshaller() throws JAXBException;
-
- public abstract Validator createValidator() throws JAXBException;
-
- public void generateSchema(SchemaOutputResolver resolver) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- public static JAXBContext newInstance(Class... classesToBeBound) throws JAXBException {
- return newInstance(classesToBeBound, Collections.<String, Object>emptyMap());
- }
-
- public static JAXBContext newInstance(Class[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
- for (Class cl : classesToBeBound) {
- if (cl == null) {
- throw new IllegalArgumentException();
- }
- }
- return ContextFinder.find(classesToBeBound, properties);
- }
-
- public static JAXBContext newInstance(String contextPath) throws JAXBException {
- return newInstance(contextPath, Thread.currentThread().getContextClassLoader());
- }
-
- public static JAXBContext newInstance(String contextPath, ClassLoader classLoader) throws JAXBException {
- return newInstance(contextPath, classLoader, Collections.<String, Object>emptyMap());
- }
-
- public static JAXBContext newInstance(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws JAXBException {
- return ContextFinder.find(contextPath, classLoader, properties);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBElement.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBElement.java
deleted file mode 100644
index fdfcf2d..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBElement.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.Serializable;
-
-import javax.xml.namespace.QName;
-
-public class JAXBElement<T> implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- public final static class GlobalScope {
- }
-
- protected final QName name;
- protected final Class<T> declaredType;
- protected final Class scope;
- protected T value;
- protected boolean nil;
-
- public JAXBElement(QName name, Class<T> declaredType, Class scope, T value) {
- this.nil = false;
- if (declaredType == null || name == null) {
- throw new IllegalArgumentException();
- }
- this.declaredType = declaredType;
- if (scope == null) {
- scope = GlobalScope.class;
- }
- this.scope = scope;
- this.name = name;
- setValue(value);
- }
-
- public JAXBElement(QName name, Class<T> declaredType, T value) {
- this(name, declaredType, GlobalScope.class, value);
- }
-
- public Class<T> getDeclaredType() {
- return declaredType;
- }
-
- public QName getName() {
- return name;
- }
-
- public void setValue(T value) {
- this.value = value;
- }
-
- public T getValue() {
- return value;
- }
-
- public Class getScope() {
- return scope;
- }
-
- public boolean isNil() {
- return value == null || nil;
- }
-
- public void setNil(boolean nil) {
- this.nil = nil;
- }
-
- public boolean isGlobalScope() {
- return scope == GlobalScope.class;
- }
-
- public boolean isTypeSubstituted() {
- if (value == null) {
- return false;
- } else {
- return value.getClass() != declaredType;
- }
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBException.java
deleted file mode 100644
index 200837d..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-public class JAXBException extends Exception {
-
- private static final long serialVersionUID = 0x5dd94775L;
-
- private String errorCode;
- private Throwable linkedException;
-
- public JAXBException(String message) {
- this(message, null, null);
- }
-
- public JAXBException(String message, String errorCode) {
- this(message, errorCode, null);
- }
-
- public JAXBException(String message, String errorCode, Throwable cause) {
- super(message);
- this.errorCode = errorCode;
- this.linkedException = cause;
- }
-
- public JAXBException(String message, Throwable cause) {
- this(message, null, cause);
- }
-
- public JAXBException(Throwable cause) {
- this(null, null, cause);
- }
-
- public String getErrorCode() {
- return errorCode;
- }
-
- public Throwable getLinkedException() {
- return getCause();
- }
-
- public synchronized void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public String toString() {
- return linkedException != null ?
- super.toString() + "\n - with linked exception:\n[" + linkedException.toString() + "]" :
- super.toString();
- }
-
- @Override
- public Throwable getCause() {
- return linkedException;
- }
-
- public void printStackTrace() {
- super.printStackTrace();
- }
-
- public void printStackTrace(PrintStream ps) {
- super.printStackTrace(ps);
- }
-
- public void printStackTrace(PrintWriter pw) {
- super.printStackTrace(pw);
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBIntrospector.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBIntrospector.java
deleted file mode 100644
index 29323b8..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/JAXBIntrospector.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import javax.xml.namespace.QName;
-
-public abstract class JAXBIntrospector {
-
- public abstract QName getElementName(Object jaxbElement);
-
- public static Object getValue(Object jaxbElement) {
- if (jaxbElement instanceof JAXBElement) {
- return ((JAXBElement) jaxbElement).getValue();
- } else {
- return jaxbElement;
- }
- }
-
- public abstract boolean isElement(Object object);
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/MarshalException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/MarshalException.java
deleted file mode 100644
index 3f6377b..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/MarshalException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class MarshalException extends JAXBException {
-
- public MarshalException(String message) {
- super(message);
- }
-
- public MarshalException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public MarshalException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public MarshalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public MarshalException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Marshaller.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Marshaller.java
deleted file mode 100644
index 12b00b9..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Marshaller.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.OutputStream;
-import java.io.Writer;
-import java.io.File;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Result;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-
-public interface Marshaller {
-
- String JAXB_ENCODING = "jaxb.encoding";
- String JAXB_FORMATTED_OUTPUT = "jaxb.formatted.output";
- String JAXB_FRAGMENT = "jaxb.fragment";
- String JAXB_NO_NAMESPACE_SCHEMA_LOCATION = "jaxb.noNamespaceSchemaLocation";
- String JAXB_SCHEMA_LOCATION = "jaxb.schemaLocation";
-
- abstract class Listener {
- public void beforeMarshal(Object source) {
- }
- public void afterMarshal(Object source) {
- }
- }
-
- <A extends XmlAdapter> A getAdapter(Class<A> type);
-
- AttachmentMarshaller getAttachmentMarshaller();
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Listener getListener();
-
- Node getNode(Object contentTree) throws JAXBException;
-
- Object getProperty(String name) throws PropertyException;
-
- Schema getSchema();
-
- void marshal(Object jaxbElement, ContentHandler handler) throws JAXBException;
-
- void marshal(Object jaxbElement, File file) throws JAXBException;
-
- void marshal(Object jaxbElement, Node node) throws JAXBException;
-
- void marshal(Object jaxbElement, OutputStream os) throws JAXBException;
-
- void marshal(Object jaxbElement, Result result) throws JAXBException;
-
- void marshal(Object jaxbElement, Writer writer) throws JAXBException;
-
- void marshal(Object jaxbElement, XMLEventWriter writer) throws JAXBException;
-
- void marshal(Object jaxbElement, XMLStreamWriter writer) throws JAXBException;
-
- <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter);
-
- void setAdapter(XmlAdapter adapter);
-
- void setAttachmentMarshaller(AttachmentMarshaller am);
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setListener(Listener listener);
-
- void setProperty(String name, Object value) throws PropertyException;
-
- void setSchema(Schema schema);
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/NotIdentifiableEvent.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
deleted file mode 100644
index 7ab70c2..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface NotIdentifiableEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ParseConversionEvent.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ParseConversionEvent.java
deleted file mode 100644
index fc16ae4..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ParseConversionEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ParseConversionEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PrintConversionEvent.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PrintConversionEvent.java
deleted file mode 100644
index 4a9f94f..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PrintConversionEvent.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface PrintConversionEvent extends ValidationEvent {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PropertyException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PropertyException.java
deleted file mode 100644
index 23bc367..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/PropertyException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class PropertyException extends JAXBException {
-
- public PropertyException(String message) {
- super(message);
- }
-
- public PropertyException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public PropertyException(Throwable cause) {
- super(cause);
- }
-
- public PropertyException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public PropertyException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public PropertyException(String name, Object value) {
- super("name: " + name + ", value: " + value);
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/SchemaOutputResolver.java
deleted file mode 100644
index d74e563..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/SchemaOutputResolver.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.IOException;
-
-import javax.xml.transform.Result;
-
-public abstract class SchemaOutputResolver {
-
- public abstract Result createOutput(String namespaceUri, String suggestedFileName) throws IOException;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/TypeConstraintException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/TypeConstraintException.java
deleted file mode 100644
index 25aa4b8..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/TypeConstraintException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.PrintStream;
-
-public class TypeConstraintException extends RuntimeException {
-
- private String errorCode;
- private Throwable linkedException;
-
- public TypeConstraintException(String message) {
- this(message, null, null);
- }
-
- public TypeConstraintException(String message, String errorCode) {
- this(message, errorCode, null);
- }
-
- public TypeConstraintException(String message, String errorCode, Throwable cause) {
- super(message);
- this.errorCode = errorCode;
- this.linkedException = cause;
- }
-
- public TypeConstraintException(String message, Throwable cause) {
- this(message, null, cause);
- }
-
- public TypeConstraintException(Throwable cause) {
- this(null, null, cause);
- }
-
- public String getErrorCode() {
- return errorCode;
- }
-
- public Throwable getLinkedException() {
- // Do not use getCause() as the cause was never initialized in the constructor
- return linkedException;
- }
-
- public synchronized void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public String toString() {
- return linkedException != null ?
- super.toString() + "\n - with linked exception:\n[" + linkedException.toString() + "]" :
- super.toString();
- }
-
- public void printStackTrace() {
- printStackTrace(System.err);
- }
-
- public void printStackTrace(PrintStream ps) {
- if (this.linkedException != null) {
- this.linkedException.printStackTrace(ps);
- ps.println("--------------- linked to ------------------");
- }
- super.printStackTrace(ps);
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshalException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshalException.java
deleted file mode 100644
index d17cdb1..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshalException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class UnmarshalException extends JAXBException {
-
- public UnmarshalException(String message) {
- super(message);
- }
-
- public UnmarshalException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public UnmarshalException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public UnmarshalException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public UnmarshalException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Unmarshaller.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Unmarshaller.java
deleted file mode 100644
index 40a774a..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Unmarshaller.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Source;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-public interface Unmarshaller {
-
- abstract class Listener {
- public void beforeUnmarshal(Object target, Object parent) {
- }
- public void afterUnmarshal(Object target, Object parent) {
- }
- }
-
- <A extends XmlAdapter> A getAdapter(Class<A> type);
-
- AttachmentUnmarshaller getAttachmentUnmarshaller();
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Listener getListener();
-
- Object getProperty(String name) throws PropertyException;
-
- Schema getSchema();
-
- UnmarshallerHandler getUnmarshallerHandler();
-
- boolean isValidating() throws JAXBException;
-
- <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter);
-
- void setAdapter(XmlAdapter adapter);
-
- void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setListener(Listener listener);
-
- void setProperty(String name, Object value) throws PropertyException;
-
- void setSchema(Schema schema);
-
- void setValidating(boolean validating) throws JAXBException;
-
- Object unmarshal(File f) throws JAXBException;
-
- Object unmarshal(InputSource source) throws JAXBException;
-
- Object unmarshal(InputStream is) throws JAXBException;
-
- Object unmarshal(Node node) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(Node node, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(Reader reader) throws JAXBException;
-
- Object unmarshal(Source source) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(Source source, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(URL url) throws JAXBException;
-
- Object unmarshal(XMLEventReader reader) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> declaredType) throws JAXBException;
-
- Object unmarshal(XMLStreamReader reader) throws JAXBException;
-
- <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> declaredType) throws JAXBException;
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshallerHandler.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshallerHandler.java
deleted file mode 100644
index b4bb32b..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/UnmarshallerHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import org.xml.sax.ContentHandler;
-
-public interface UnmarshallerHandler extends ContentHandler {
-
- Object getResult() throws JAXBException, IllegalStateException;
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEvent.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEvent.java
deleted file mode 100644
index 64646df..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEvent.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ValidationEvent {
-
- int ERROR = 1;
- int FATAL_ERROR = 2;
- int WARNING = 0;
-
- Throwable getLinkedException();
-
- ValidationEventLocator getLocator();
-
- String getMessage();
-
- int getSeverity();
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventHandler.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventHandler.java
deleted file mode 100644
index 36a8388..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventHandler.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface ValidationEventHandler {
-
- boolean handleEvent(ValidationEvent event);
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventLocator.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventLocator.java
deleted file mode 100644
index a5fd082..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationEventLocator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.net.URL;
-
-import org.w3c.dom.Node;
-
-public interface ValidationEventLocator {
-
- int getColumnNumber();
-
- int getLineNumber();
-
- Node getNode();
-
- Object getObject();
-
- int getOffset();
-
- URL getURL();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationException.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationException.java
deleted file mode 100644
index 78b1a2b..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/ValidationException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public class ValidationException extends JAXBException {
-
- public ValidationException(String message) {
- super(message);
- }
-
- public ValidationException(String message, String errorCode) {
- super(message, errorCode);
- }
-
- public ValidationException(String message, String errorCode, Throwable cause) {
- super(message, errorCode, cause);
- }
-
- public ValidationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ValidationException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Validator.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Validator.java
deleted file mode 100644
index 94790bb..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/Validator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-public interface Validator {
-
- ValidationEventHandler getEventHandler() throws JAXBException;
-
- Object getProperty(String name) throws PropertyException;
-
- void setEventHandler(ValidationEventHandler handler) throws JAXBException;
-
- void setProperty(String name, Object value) throws PropertyException;
-
- boolean validate(Object subRoot) throws JAXBException;
-
- boolean validateRoot(Object rootObj) throws JAXBException;
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/DomHandler.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/DomHandler.java
deleted file mode 100644
index e5fbf90..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/DomHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.bind.ValidationEventHandler;
-
-public interface DomHandler<ElementT, ResultT extends Result> {
-
- ResultT createUnmarshaller(ValidationEventHandler errorHandler);
-
- ElementT getElement(ResultT rt);
-
- Source marshal(ElementT n, ValidationEventHandler errorHandler);
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
deleted file mode 100644
index 2794e14..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.Source;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.bind.ValidationEventHandler;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.DocumentFragment;
-
-public class W3CDomHandler implements DomHandler<Element, DOMResult> {
-
- private DocumentBuilder builder;
-
- public W3CDomHandler() {
- }
-
- public W3CDomHandler(DocumentBuilder builder) {
- if (builder == null) {
- throw new IllegalArgumentException();
- }
- this.builder = builder;
- }
-
- public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
- if (builder == null) {
- return new DOMResult();
- } else {
- return new DOMResult(builder.newDocument());
- }
- }
-
- public DocumentBuilder getBuilder() {
- return builder;
- }
-
- public Element getElement(DOMResult rt) {
- Node n = rt.getNode();
- if (n instanceof Document) {
- return ((Document)n).getDocumentElement();
- }
- if (n instanceof Element) {
- return (Element)n;
- }
- if (n instanceof DocumentFragment) {
- return (Element)n.getChildNodes().item(0);
- } else {
- throw new IllegalStateException(n.toString());
- }
- }
-
- public Source marshal(Element n, ValidationEventHandler errorHandler) {
- return new DOMSource(n);
- }
-
- public void setBuilder(DocumentBuilder builder) {
- this.builder = builder;
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
deleted file mode 100644
index 45d6bc0..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlAccessOrder {
-
- ALPHABETICAL,
- UNDEFINED
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessType.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
deleted file mode 100644
index a34a650..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlAccessType {
-
- FIELD,
- NONE,
- PROPERTY,
- PUBLIC_MEMBER
-
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
deleted file mode 100644
index d800634..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.TYPE})
-public @interface XmlAccessorOrder {
-
- XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
deleted file mode 100644
index 6662588..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Inherited
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.TYPE })
-public @interface XmlAccessorType {
-
- XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
deleted file mode 100644
index 41ab490..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAnyAttribute {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
deleted file mode 100644
index 3828a9e..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAnyElement {
-
- boolean lax() default false;
-
- Class<? extends DomHandler> value() default W3CDomHandler.class;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
deleted file mode 100644
index 23bd034..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER })
-public @interface XmlAttachmentRef {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttribute.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
deleted file mode 100644
index ed2fb7c..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlAttribute {
-
- String name() default "##default";
-
- boolean required() default false;
-
- String namespace() default "##default";
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElement.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElement.java
deleted file mode 100644
index e45cbad..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElement.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD })
-public @interface XmlElement {
-
- final class DEFAULT {
- }
-
- String name() default "##default";
-
- boolean nillable() default false;
-
- boolean required() default false;
-
- String namespace() default "##default";
-
- String defaultValue() default "\u0000";
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
deleted file mode 100644
index 783370b..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface XmlElementDecl {
-
- final class GLOBAL {
- }
-
- String name();
-
- Class scope() default GLOBAL.class;
-
- String namespace() default "##default";
-
- String substitutionHeadNamespace() default "##default";
-
- String substitutionHeadName() default "";
-
- String defaultValue() default "\u0000";
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
deleted file mode 100644
index ffdde6d..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementRef {
-
- final class DEFAULT {
- }
-
- String name() default "##default";
-
- String namespace() default "";
-
- Class type() default DEFAULT.class;
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
deleted file mode 100644
index 2e56e41..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementRefs {
-
- XmlElementRef[] value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
deleted file mode 100644
index a6a1a04..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElementWrapper {
-
- String name() default "##default";
-
- String namespace() default "##default";
-
- boolean nillable() default false;
-
- boolean required() default false;
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElements.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElements.java
deleted file mode 100644
index f213cb6..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlElements.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlElements {
-
- XmlElement[] value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnum.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnum.java
deleted file mode 100644
index 6700a99..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnum.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlEnum {
-
- Class<?> value() default String.class;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
deleted file mode 100644
index 62a97eb..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface XmlEnumValue {
-
- String value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlID.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlID.java
deleted file mode 100644
index 8a5bfdb..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlID.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlID {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlIDREF.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
deleted file mode 100644
index 3cd2c98..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlIDREF {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
deleted file mode 100644
index ded1639..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
-public @interface XmlInlineBinaryData {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlList.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlList.java
deleted file mode 100644
index d28b510..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlList.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-public @interface XmlList {
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMimeType.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
deleted file mode 100644
index f7f8ec3..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-public @interface XmlMimeType {
-
- String value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMixed.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMixed.java
deleted file mode 100644
index ac052fe..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlMixed.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlMixed {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNs.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNs.java
deleted file mode 100644
index c43f6f9..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNs.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {})
-public @interface XmlNs {
-
- String namespaceURI();
-
- String prefix();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNsForm.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
deleted file mode 100644
index 60e93f9..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-public enum XmlNsForm {
-
- UNQUALIFIED,
- QUALIFIED,
- UNSET
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRegistry.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
deleted file mode 100644
index 06733ec..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlRegistry {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRootElement.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
deleted file mode 100644
index 981043d..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlRootElement {
-
- String name() default "##default";
-
- String namespace() default "##default";
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchema.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchema.java
deleted file mode 100644
index 9541225..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchema.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PACKAGE)
-public @interface XmlSchema {
-
- XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
-
- XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
-
- String namespace() default "";
-
- XmlNs[] xmlns() default {};
-
- String location() default NO_LOCATION;
-
- static final String NO_LOCATION = "##generate";
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
deleted file mode 100644
index 0ab565a..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.PACKAGE})
-public @interface XmlSchemaType {
-
- final class DEFAULT {
- }
-
- String name();
-
- String namespace() default "http://www.w3.org/2001/XMLSchema";
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
deleted file mode 100644
index 0dc20e1..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PACKAGE)
-public @interface XmlSchemaTypes {
-
- XmlSchemaType[] value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java
deleted file mode 100644
index 8a2f1c9..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE})
-public @interface XmlSeeAlso {
-
- Class[] value();
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlTransient.java
deleted file mode 100644
index 74179a1..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlTransient.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
-public @interface XmlTransient {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlType.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlType.java
deleted file mode 100644
index 596fc96..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface XmlType {
-
- final class DEFAULT {
- }
-
- Class factoryClass() default DEFAULT.class;
-
- String factoryMethod() default "";
-
- String name() default "##default";
-
- String namespace() default "##default";
-
- String[] propOrder() default "";
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlValue.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlValue.java
deleted file mode 100644
index ee9a41d..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/XmlValue.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.FIELD, ElementType.METHOD})
-public @interface XmlValue {
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
deleted file mode 100644
index 4266ab6..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public class CollapsedStringAdapter extends XmlAdapter<String, String> {
-
- public String marshal(String v) {
- return v;
- }
-
- public String unmarshal(String v) {
- if(v == null) {
- return null;
- }
- int len = v.length();
- int s;
- for (s = 0; s < len && !isWhiteSpace(v.charAt(s)); s++);
- if (s == len) {
- return v;
- }
- StringBuffer result = new StringBuffer(len);
- if (s != 0) {
- for(int i = 0; i < s; i++) {
- result.append(v.charAt(i));
- }
- result.append(' ');
- }
- boolean inStripMode = true;
- for (int i = s + 1; i < len; i++) {
- char ch = v.charAt(i);
- boolean b = isWhiteSpace(ch);
- if (inStripMode && b) {
- continue;
- }
- inStripMode = b;
- result.append(inStripMode ? ' ' : ch);
- }
- len = result.length();
- if (len > 0 && result.charAt(len - 1) == ' ') {
- result.setLength(len - 1);
- }
- return result.toString();
- }
-
- protected static boolean isWhiteSpace(char ch) {
- if (ch > ' ') {
- return false;
- } else {
- return ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ';
- }
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
deleted file mode 100644
index a3359f1..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import javax.xml.bind.DatatypeConverter;
-
-public final class HexBinaryAdapter extends XmlAdapter<String, byte[]> {
-
- public String marshal(byte[] v) {
- return DatatypeConverter.printHexBinary(v);
- }
-
- public byte[] unmarshal(String v) {
- return DatatypeConverter.parseHexBinary(v);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
deleted file mode 100644
index f0071e9..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public final class NormalizedStringAdapter extends XmlAdapter<String, String> {
-
- public String marshal(String v) {
- return v;
- }
-
- public String unmarshal(String v) {
- if (v == null) {
- return null;
- }
- int i;
- for (i = v.length() - 1; i >= 0 && !isWhiteSpaceExceptSpace(v.charAt(i)); i--);
- if (i < 0) {
- return v;
- }
- char buf[] = v.toCharArray();
- buf[i--] = ' ';
- for(; i >= 0; i--) {
- if(isWhiteSpaceExceptSpace(buf[i])) {
- buf[i] = ' ';
- }
- }
- return new String(buf);
- }
-
- protected static boolean isWhiteSpaceExceptSpace(char ch) {
- if (ch >= ' ') {
- return false;
- } else {
- return ch == '\t' || ch == '\n' || ch == '\r';
- }
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
deleted file mode 100644
index 0a1c2fe..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-public abstract class XmlAdapter<ValueType, BoundType> {
-
- protected XmlAdapter() {
- }
-
- public abstract ValueType marshal(BoundType v) throws Exception;
-
- public abstract BoundType unmarshal(ValueType v) throws Exception;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
deleted file mode 100644
index cb8e530..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
-public @interface XmlJavaTypeAdapter {
-
- final class DEFAULT {
- }
-
- Class<? extends XmlAdapter> value();
-
- Class type() default DEFAULT.class;
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
deleted file mode 100644
index a3c85ce..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 javax.xml.bind.annotation.adapters;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(value = {ElementType.PACKAGE})
-public @interface XmlJavaTypeAdapters {
-
- XmlJavaTypeAdapter[] value();
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
deleted file mode 100644
index 6a768b3..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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 javax.xml.bind.attachment;
-
-import javax.activation.DataHandler;
-
-public abstract class AttachmentMarshaller {
-
- public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName);
-
- public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName);
-
- public abstract String addSwaRefAttachment(DataHandler data);
-
- public boolean isXOPPackage() {
- return false;
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
deleted file mode 100644
index d67426b..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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 javax.xml.bind.attachment;
-
-import javax.activation.DataHandler;
-
-public abstract class AttachmentUnmarshaller {
-
- public abstract byte[] getAttachmentAsByteArray(String cid);
-
- public abstract DataHandler getAttachmentAsDataHandler(String cid);
-
- public boolean isXOPPackage() {
- return false;
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
deleted file mode 100644
index a00dcb3..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.Result;
-import javax.xml.validation.Schema;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.ContentHandler;
-
-public abstract class AbstractMarshallerImpl implements Marshaller {
-
- static String aliases[] = {
- "UTF-8", "UTF8",
- "UTF-16", "Unicode",
- "UTF-16BE", "UnicodeBigUnmarked",
- "UTF-16LE", "UnicodeLittleUnmarked",
- "US-ASCII", "ASCII",
- "TIS-620", "TIS620",
- "ISO-10646-UCS-2", "Unicode",
- "EBCDIC-CP-US", "cp037",
- "EBCDIC-CP-CA", "cp037",
- "EBCDIC-CP-NL", "cp037",
- "EBCDIC-CP-WT", "cp037",
- "EBCDIC-CP-DK", "cp277",
- "EBCDIC-CP-NO", "cp277",
- "EBCDIC-CP-FI", "cp278",
- "EBCDIC-CP-SE", "cp278",
- "EBCDIC-CP-IT", "cp280",
- "EBCDIC-CP-ES", "cp284",
- "EBCDIC-CP-GB", "cp285",
- "EBCDIC-CP-FR", "cp297",
- "EBCDIC-CP-AR1", "cp420",
- "EBCDIC-CP-HE", "cp424",
- "EBCDIC-CP-BE", "cp500",
- "EBCDIC-CP-CH", "cp500",
- "EBCDIC-CP-ROECE", "cp870",
- "EBCDIC-CP-YU", "cp870",
- "EBCDIC-CP-IS", "cp871",
- "EBCDIC-CP-AR2", "cp918"
- };
-
- private ValidationEventHandler eventHandler = new DefaultValidationEventHandler();
- private String encoding = "UTF-8";
- private String schemaLocation;
- private String noNSSchemaLocation;
- private boolean formattedOutput;
- private boolean fragment;
-
- public void marshal(Object obj, File file) throws JAXBException {
- checkNotNull(obj, "obj", file, "file");
- try {
- OutputStream os = new BufferedOutputStream(new FileOutputStream(file));
- try {
- marshal(obj, new StreamResult(os));
- } finally {
- os.close();
- }
- } catch (IOException e) {
- throw new JAXBException(e);
- }
- }
-
- public final void marshal(Object obj, OutputStream os) throws JAXBException {
- checkNotNull(obj, "obj", os, "os");
- marshal(obj, new StreamResult(os));
- }
-
- public final void marshal(Object obj, Writer w) throws JAXBException {
- checkNotNull(obj, "obj", w, "writer");
- marshal(obj, new StreamResult(w));
- }
-
- public final void marshal(Object obj, ContentHandler handler) throws JAXBException {
- checkNotNull(obj, "obj", handler, "handler");
- marshal(obj, new SAXResult(handler));
- }
-
- public final void marshal(Object obj, Node node) throws JAXBException {
- checkNotNull(obj, "obj", node, "node");
- marshal(obj, new DOMResult(node));
- }
-
- public Node getNode(Object obj) throws JAXBException {
- checkNotNull(obj, "obj", "foo", "bar");
- throw new UnsupportedOperationException();
- }
-
- protected String getEncoding() {
- return encoding;
- }
-
- protected void setEncoding(String encoding) {
- this.encoding = encoding;
- }
-
- protected String getSchemaLocation() {
- return schemaLocation;
- }
-
- protected void setSchemaLocation(String location) {
- schemaLocation = location;
- }
-
- protected String getNoNSSchemaLocation() {
- return noNSSchemaLocation;
- }
-
- protected void setNoNSSchemaLocation(String location) {
- noNSSchemaLocation = location;
- }
-
- protected boolean isFormattedOutput() {
- return formattedOutput;
- }
-
- protected void setFormattedOutput(boolean v) {
- formattedOutput = v;
- }
-
- protected boolean isFragment() {
- return fragment;
- }
-
- protected void setFragment(boolean v) {
- fragment = v;
- }
-
- protected String getJavaEncoding(String encoding) throws UnsupportedEncodingException {
- try {
- "dummy".getBytes(encoding);
- return encoding;
- }
- catch (UnsupportedEncodingException e) {
- }
- for (int i = 0; i < aliases.length; i += 2) {
- if (encoding.equals(aliases[i])) {
- "dummy".getBytes(aliases[i + 1]);
- return aliases[i + 1];
- }
- }
- throw new UnsupportedEncodingException(encoding);
- }
-
- public void setProperty(String name, Object value) throws PropertyException {
- if (name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- if (JAXB_ENCODING.equals(name)) {
- checkString(name, value);
- setEncoding((String) value);
- } else if (JAXB_FORMATTED_OUTPUT.equals(name)) {
- checkBoolean(name, value);
- setFormattedOutput(((Boolean) value).booleanValue());
- } else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name)) {
- checkString(name, value);
- setNoNSSchemaLocation((String) value);
- } else if (JAXB_SCHEMA_LOCATION.equals(name)) {
- checkString(name, value);
- setSchemaLocation((String) value);
- } else if (JAXB_FRAGMENT.equals(name)) {
- checkBoolean(name, value);
- setFragment(((Boolean) value).booleanValue());
- } else {
- throw new PropertyException(name, value);
- }
- }
-
- public Object getProperty(String name) throws PropertyException {
- if (name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- if (JAXB_ENCODING.equals(name)) {
- return getEncoding();
- } else if (JAXB_FORMATTED_OUTPUT.equals(name)) {
- return isFormattedOutput() ? Boolean.TRUE : Boolean.FALSE;
- } else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name)) {
- return getNoNSSchemaLocation();
- } else if (JAXB_SCHEMA_LOCATION.equals(name)) {
- return getSchemaLocation();
- } else if (JAXB_FRAGMENT.equals(name)) {
- return isFragment() ? Boolean.TRUE : Boolean.FALSE;
- } else {
- throw new PropertyException(name);
- }
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return eventHandler;
- }
-
- public void setEventHandler(ValidationEventHandler handler) throws JAXBException {
- if (handler == null) {
- eventHandler = new DefaultValidationEventHandler();
- } else {
- eventHandler = handler;
- }
- }
-
- private void checkBoolean(String name, Object value) throws PropertyException {
- if (!(value instanceof Boolean)) {
- throw new PropertyException(name + " must be a boolean");
- }
- }
-
- private void checkString(String name, Object value) throws PropertyException {
- if (!(value instanceof String)) {
- throw new PropertyException(name + " must be a string");
- }
- }
-
- private void checkNotNull(Object o1, String o1Name, Object o2, String o2Name) {
- if (o1 == null) {
- throw new IllegalArgumentException(o1Name + " must not be null");
- }
- if (o2 == null) {
- throw new IllegalArgumentException(o2Name + " must not be null");
- }
- }
-
- public void marshal(Object obj, XMLEventWriter writer)
- throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException();
- }
-
- public Schema getSchema() {
- throw new UnsupportedOperationException();
- }
-
- public void setAdapter(XmlAdapter adapter) {
- if (adapter == null) {
- throw new IllegalArgumentException();
- }
- setAdapter((Class<XmlAdapter>) adapter.getClass(), adapter);
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- throw new UnsupportedOperationException();
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- throw new UnsupportedOperationException();
- }
-
- public void setAttachmentMarshaller(AttachmentMarshaller am) {
- throw new UnsupportedOperationException();
- }
-
- public AttachmentMarshaller getAttachmentMarshaller() {
- throw new UnsupportedOperationException();
- }
-
- public void setListener(javax.xml.bind.Marshaller.Listener listener) {
- throw new UnsupportedOperationException();
- }
-
- public javax.xml.bind.Marshaller.Listener getListener() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
deleted file mode 100644
index fe14154..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.validation.Schema;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-public abstract class AbstractUnmarshallerImpl implements Unmarshaller {
-
- protected boolean validating;
- private ValidationEventHandler eventHandler;
- private XMLReader reader;
-
- protected UnmarshalException createUnmarshalException(SAXException e) {
- Exception nested = e.getException();
- if (nested instanceof UnmarshalException) {
- return (UnmarshalException)nested;
- } else if(nested instanceof RuntimeException) {
- throw (RuntimeException)nested;
- } else if (nested != null) {
- return new UnmarshalException(nested);
- } else {
- return new UnmarshalException(e);
- }
- }
-
- protected XMLReader getXMLReader() throws JAXBException {
- if (reader == null) {
- try {
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- parserFactory.setNamespaceAware(true);
- parserFactory.setValidating(false);
- reader = parserFactory.newSAXParser().getXMLReader();
- } catch(ParserConfigurationException e) {
- throw new JAXBException(e);
- } catch(SAXException e) {
- throw new JAXBException(e);
- }
- }
- return reader;
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- throw new UnsupportedOperationException();
- }
-
- public AttachmentUnmarshaller getAttachmentUnmarshaller() {
- throw new UnsupportedOperationException();
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return eventHandler;
- }
-
- public Listener getListener() {
- throw new UnsupportedOperationException();
- }
-
- public Object getProperty(String name) throws PropertyException {
- if(name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- throw new PropertyException(name);
- }
-
- public Schema getSchema() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isValidating() throws JAXBException {
- return validating;
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- throw new UnsupportedOperationException();
- }
-
- public void setAdapter(XmlAdapter adapter) {
- if (adapter == null) {
- throw new IllegalArgumentException();
- }
- setAdapter((Class<XmlAdapter>) adapter.getClass(), adapter);
- }
-
- public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) {
- throw new UnsupportedOperationException();
- }
-
- public void setEventHandler(ValidationEventHandler handler) throws JAXBException {
- if (handler == null) {
- handler = new DefaultValidationEventHandler();
- }
- eventHandler = handler;
- }
-
- public void setListener(Listener listener) {
- throw new UnsupportedOperationException();
- }
-
- public void setProperty(String name, Object value) throws PropertyException {
- if(name == null) {
- throw new IllegalArgumentException("name must not be null");
- }
- throw new PropertyException(name, value);
- }
-
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException();
- }
-
- public void setValidating(boolean validating) throws JAXBException {
- this.validating = validating;
- }
-
- public final Object unmarshal(File file) throws JAXBException {
- if (file == null) {
- throw new IllegalArgumentException("file must not be null");
- }
- try
- {
- String path = file.getAbsolutePath();
- if (File.separatorChar != '/') {
- path = path.replace(File.separatorChar, '/');
- }
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- if (!path.endsWith("/") && file.isDirectory()) {
- path = path + "/";
- }
- return unmarshal(new URL("file", "", path));
- }
- catch(MalformedURLException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
- }
-
- public final Object unmarshal(InputSource source) throws JAXBException {
- if (source == null) {
- throw new IllegalArgumentException("source must not be null");
- }
- return unmarshal(getXMLReader(), source);
- }
-
- public final Object unmarshal(InputStream is) throws JAXBException {
- if (is == null) {
- throw new IllegalArgumentException("is must not be null");
- }
- return unmarshal(new InputSource(is));
- }
-
- public <T> JAXBElement<T> unmarshal(Node node, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public final Object unmarshal(Reader reader) throws JAXBException {
- if (reader == null) {
- throw new IllegalArgumentException("reader must not be null");
- }
- return unmarshal(new InputSource(reader));
- }
-
- public Object unmarshal(Source source) throws JAXBException {
- if (source == null) {
- throw new IllegalArgumentException("source must not be null");
- } else if (source instanceof SAXSource) {
- SAXSource saxSource = (SAXSource) source;
- XMLReader reader = saxSource.getXMLReader();
- if (reader == null) {
- reader = getXMLReader();
- }
- return unmarshal(reader, saxSource.getInputSource());
- } else if (source instanceof StreamSource) {
- StreamSource ss = (StreamSource) source;
- InputSource is = new InputSource();
- is.setSystemId(ss.getSystemId());
- is.setByteStream(ss.getInputStream());
- is.setCharacterStream(ss.getReader());
- return unmarshal(is);
- } else if (source instanceof DOMSource)
- return unmarshal(((DOMSource) source).getNode());
- else
- throw new IllegalArgumentException();
- }
-
- protected abstract Object unmarshal(XMLReader xmlreader, InputSource inputsource) throws JAXBException;
-
- public <T> JAXBElement<T> unmarshal(Source source, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public final Object unmarshal(URL url) throws JAXBException {
- if(url == null) {
- throw new IllegalArgumentException("url must not be null");
- }
- return unmarshal(new InputSource(url.toExternalForm()));
- }
-
- public Object unmarshal(XMLEventReader reader) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public Object unmarshal(XMLStreamReader reader) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-
- public <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> declaredType) throws JAXBException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
deleted file mode 100644
index d54d458..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.net.URL;
-
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.ValidationEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-import org.w3c.dom.Node;
-
-public class DefaultValidationEventHandler implements ValidationEventHandler {
-
- public boolean handleEvent(ValidationEvent event) {
- if (event == null) {
- throw new IllegalArgumentException();
- }
- String severity = null;
- boolean retVal = false;
- switch(event.getSeverity()) {
- case ValidationEvent.WARNING:
- severity = "[WARNING]: ";
- retVal = true;
- break;
-
- case ValidationEvent.ERROR:
- severity = "[ERROR]: ";
- retVal = false;
- break;
-
- case ValidationEvent.FATAL_ERROR:
- severity = "[FATAL_ERROR]: ";
- retVal = false;
- break;
- }
- String location = getLocation(event);
- System.out.println("DefaultValidationEventHandler " + severity + " " + event.getMessage() + "\n Location: " + location);
- return retVal;
- }
-
- private String getLocation(ValidationEvent event) {
- StringBuffer msg = new StringBuffer();
- ValidationEventLocator locator = event.getLocator();
- if (locator != null) {
- URL url = locator.getURL();
- Object obj = locator.getObject();
- Node node = locator.getNode();
- int line = locator.getLineNumber();
- if(url != null || line != -1) {
- msg.append("line ").append(line);
- if(url != null) {
- msg.append(" of ").append(url);
- }
- } else {
- if (obj != null) {
- msg.append(" obj: ").append(obj.toString());
- } else if(node != null) {
- msg.append(" node: ").append(node.toString());
- }
- }
- } else {
- msg.append("unavailable");
- }
- return msg.toString();
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
deleted file mode 100644
index 8a08cdd..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.NotIdentifiableEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class NotIdentifiableEventImpl extends ValidationEventImpl implements NotIdentifiableEvent {
-
- public NotIdentifiableEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public NotIdentifiableEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
deleted file mode 100644
index 5e88c93..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.ParseConversionEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class ParseConversionEventImpl extends ValidationEventImpl implements ParseConversionEvent {
-
- public ParseConversionEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public ParseConversionEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
deleted file mode 100644
index b0eb10f..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.PrintConversionEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class PrintConversionEventImpl extends ValidationEventImpl implements PrintConversionEvent {
-
- public PrintConversionEventImpl(int severity, String message, ValidationEventLocator locator) {
- super(severity, message, locator);
- }
-
- public PrintConversionEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- super(severity, message, locator, linkedException);
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
deleted file mode 100644
index ca5e8b1..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import javax.xml.bind.ValidationEvent;
-import javax.xml.bind.ValidationEventLocator;
-
-public class ValidationEventImpl implements ValidationEvent {
-
- private int severity;
- private String message;
- private Throwable linkedException;
- private ValidationEventLocator locator;
-
- public ValidationEventImpl(int severity, String message, ValidationEventLocator locator) {
- this(severity, message, locator, null);
- }
-
- public ValidationEventImpl(int severity, String message, ValidationEventLocator locator, Throwable linkedException) {
- setSeverity(severity);
- this.message = message;
- this.locator = locator;
- this.linkedException = linkedException;
- }
-
- public int getSeverity() {
- return severity;
- }
-
- public void setSeverity(int severity) {
- if (severity != 0 && severity != 1 && severity != 2) {
- throw new IllegalArgumentException("Illegal severity");
- }
- this.severity = severity;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public Throwable getLinkedException() {
- return linkedException;
- }
-
- public void setLinkedException(Throwable linkedException) {
- this.linkedException = linkedException;
- }
-
- public ValidationEventLocator getLocator() {
- return locator;
- }
-
- public void setLocator(ValidationEventLocator locator) {
- this.locator = locator;
- }
-
- public String toString() {
- String s;
- switch (getSeverity()) {
- case WARNING:
- s = "WARNING";
- break;
- case ERROR:
- s = "ERROR";
- break;
- case FATAL_ERROR:
- s = "FATAL_ERROR";
- break;
- default:
- s = String.valueOf(getSeverity());
- break;
- }
- return "[severity=" + s + ", message=" + getMessage() + ", locator=" + getLocator() + "]";
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
deleted file mode 100644
index b1ddf78..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * 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 javax.xml.bind.helpers;
-
-import java.net.URL;
-import java.net.MalformedURLException;
-
-import javax.xml.bind.ValidationEventLocator;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.SAXParseException;
-import org.xml.sax.Locator;
-
-public class ValidationEventLocatorImpl implements ValidationEventLocator {
-
- private URL url;
- private int offset = -1;
- private int lineNumber = -1;
- private int columnNumber = -1;
- private Object object;
- private Node node;
-
- public ValidationEventLocatorImpl() {
- }
-
- public ValidationEventLocatorImpl(Locator loc) {
- if (loc == null) {
- throw new IllegalArgumentException("loc must not be null");
- }
- url = toURL(loc.getSystemId());
- columnNumber = loc.getColumnNumber();
- lineNumber = loc.getLineNumber();
- }
-
- public ValidationEventLocatorImpl(SAXParseException e) {
- if (e == null) {
- throw new IllegalArgumentException("e must not be null");
- }
- url = toURL(e.getSystemId());
- columnNumber = e.getColumnNumber();
- lineNumber = e.getLineNumber();
- }
-
- public ValidationEventLocatorImpl(Node node) {
- if (node == null) {
- throw new IllegalArgumentException("node must not be null");
- }
- this.node = node;
- }
-
- public ValidationEventLocatorImpl(Object object) {
- if (object == null) {
- throw new IllegalArgumentException("object must not be null");
- }
- this.object = object;
- }
-
- private static URL toURL(String systemId) {
- try {
- return new URL(systemId);
- }
- catch (MalformedURLException e) {
- return null;
- }
- }
-
- public URL getURL() {
- return url;
- }
-
- public void setURL(URL url) {
- this.url = url;
- }
-
- public int getOffset() {
- return offset;
- }
-
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
- public int getLineNumber() {
- return lineNumber;
- }
-
- public void setLineNumber(int lineNumber) {
- this.lineNumber = lineNumber;
- }
-
- public int getColumnNumber() {
- return columnNumber;
- }
-
- public void setColumnNumber(int columnNumber) {
- this.columnNumber = columnNumber;
- }
-
- public Object getObject() {
- return object;
- }
-
- public void setObject(Object object) {
- this.object = object;
- }
-
- public Node getNode() {
- return node;
- }
-
- public void setNode(Node node) {
- this.node = node;
- }
-
- public String toString() {
- return "[node=" + getNode() + ", " +
- "object=" + getObject() + ", " +
- "url=" + getURL() + ", " +
- "line=" + String.valueOf(getLineNumber()) + "," +
- "col=" + String.valueOf(getColumnNumber()) + "," +
- "offset=" + String.valueOf(getOffset()) + "]";
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBResult.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBResult.java
deleted file mode 100644
index 1584b41..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBResult.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-public class JAXBResult extends SAXResult {
-
- private final UnmarshallerHandler unmarshallerHandler;
-
- public JAXBResult(JAXBContext context) throws JAXBException {
- if (context == null) {
- throw new JAXBException("context must not be null");
- }
- unmarshallerHandler = context.createUnmarshaller().getUnmarshallerHandler();
- super.setHandler(unmarshallerHandler);
- }
-
- public JAXBResult(Unmarshaller unmarshaller) throws JAXBException {
- if (unmarshaller == null) {
- throw new JAXBException("unmarshaller must not be null");
- }
- unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
- super.setHandler(unmarshallerHandler);
- }
-
- public Object getResult() throws JAXBException {
- return unmarshallerHandler.getResult();
- }
-
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBSource.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBSource.java
deleted file mode 100644
index abd6457..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/JAXBSource.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.DTDHandler;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.XMLFilterImpl;
-import org.xml.sax.ext.LexicalHandler;
-
-public class JAXBSource extends SAXSource {
-
- public JAXBSource(JAXBContext context, Object contentObject) throws JAXBException {
- if (context == null) {
- throw new JAXBException("context must not be null");
- }
- if (contentObject == null) {
- throw new JAXBException("contentObject must not be null");
- }
- setXMLReader(new Reader(context.createMarshaller(), contentObject));
- setInputSource(new InputSource());
- }
-
- public JAXBSource(final Marshaller marshaller, final Object contentObject) throws JAXBException {
- if (marshaller == null) {
- throw new JAXBException("marshaller must not be null");
- }
- if (contentObject == null) {
- throw new JAXBException("contentObject must not be null");
- }
- setXMLReader(new Reader(marshaller, contentObject));
- setInputSource(new InputSource());
- }
-
- private static class Reader implements XMLReader {
-
- private LexicalHandler lexicalHandler;
- private EntityResolver entityResolver;
- private DTDHandler dtdHandler;
- private XMLFilterImpl repeater;
- private ErrorHandler errorHandler;
- private final Marshaller marshaller;
- private final Object contentObject;
-
- public Reader(Marshaller marshaller, Object contentObject) {
- this.marshaller = marshaller;
- this.contentObject = contentObject;
- repeater = new XMLFilterImpl();
- }
-
- public boolean getFeature(String name) throws SAXNotRecognizedException {
- if (name.equals("http://xml.org/sax/features/namespaces")) {
- return true;
- }
- if (name.equals("http://xml.org/sax/features/namespace-prefixes")) {
- return false;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
- if (name.equals("http://xml.org/sax/features/namespaces") && value) {
- return;
- }
- if (name.equals("http://xml.org/sax/features/namespace-prefixes") && !value) {
- return;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public Object getProperty(String name) throws SAXNotRecognizedException {
- if("http://xml.org/sax/properties/lexical-handler".equals(name)) {
- return lexicalHandler;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setProperty(String name, Object value) throws SAXNotRecognizedException {
- if("http://xml.org/sax/properties/lexical-handler".equals(name)) {
- lexicalHandler = (LexicalHandler) value;
- return;
- }
- throw new SAXNotRecognizedException(name);
- }
-
- public void setEntityResolver(EntityResolver resolver) {
- entityResolver = resolver;
- }
-
- public EntityResolver getEntityResolver() {
- return entityResolver;
- }
-
- public void setDTDHandler(DTDHandler handler) {
- dtdHandler = handler;
- }
-
- public DTDHandler getDTDHandler() {
- return dtdHandler;
- }
-
- public void setContentHandler(ContentHandler handler) {
- repeater.setContentHandler(handler);
- }
-
- public ContentHandler getContentHandler() {
- return repeater.getContentHandler();
- }
-
- public void setErrorHandler(ErrorHandler handler) {
- errorHandler = handler;
- }
-
- public ErrorHandler getErrorHandler() {
- return errorHandler;
- }
-
- public void parse(InputSource input) throws SAXException {
- parse();
- }
-
- public void parse(String systemId) throws SAXException {
- parse();
- }
-
- public void parse() throws SAXException {
- try {
- marshaller.marshal(contentObject, repeater);
- } catch(JAXBException e) {
- SAXParseException se = new SAXParseException(e.getMessage(), null, null, -1, -1, e);
- if (errorHandler != null) {
- errorHandler.fatalError(se);
- }
- throw se;
- }
- }
-
- }
-}
diff --git a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/ValidationEventCollector.java b/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
deleted file mode 100644
index e4cc436..0000000
--- a/trunk/jaxb-api-2.1/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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 javax.xml.bind.util;
-
-import java.util.ArrayList;
-
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.ValidationEvent;
-
-public class ValidationEventCollector implements ValidationEventHandler {
-
- private ArrayList<ValidationEvent> events = new ArrayList<ValidationEvent>();
-
- public ValidationEvent[] getEvents() {
- return events.toArray(new ValidationEvent[events.size()]);
- }
-
- public boolean handleEvent(ValidationEvent event) {
- events.add(event);
- return event.getSeverity() != ValidationEvent.FATAL_ERROR;
- }
-
- public boolean hasEvents() {
- return !events.isEmpty();
- }
-
- public void reset() {
- events.clear();
- }
-}
diff --git a/trunk/jaxb-api-2.2/pom.xml b/trunk/jaxb-api-2.2/pom.xml
deleted file mode 100644
index 5ce9c4a..0000000
--- a/trunk/jaxb-api-2.2/pom.xml
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXB API 2.2</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.2.1</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.bind*;version=2.2.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>javax.xml.bind:jaxb-api</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.xml.bind:jaxb-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxb-api-2.2/src/main/java/javax/xml/bind/ContextFinder.java b/trunk/jaxb-api-2.2/src/main/java/javax/xml/bind/ContextFinder.java
deleted file mode 100644
index a0bd4ba..0000000
--- a/trunk/jaxb-api-2.2/src/main/java/javax/xml/bind/ContextFinder.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/**
- * 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 javax.xml.bind;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.Map;
-import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import static javax.xml.bind.JAXBContext.JAXB_CONTEXT_FACTORY;
-
-//import java.lang.reflect.InvocationTargetException;
-
-/**
- * This class is package private and therefore is not exposed as part of the
- * JAXB API.
- *
- * This code is designed to implement the JAXB 1.0 spec pluggability feature
- *
- * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
- * @see JAXBContext
- */
-class ContextFinder {
- private static final Logger logger;
- static {
- logger = Logger.getLogger("javax.xml.bind");
- try {
- if (AccessController.doPrivileged(new GetPropertyAction("jaxb.debug")) != null) {
- // disconnect the logger from a bigger framework (if any)
- // and take the matters into our own hands
- logger.setUseParentHandlers(false);
- logger.setLevel(Level.ALL);
- ConsoleHandler handler = new ConsoleHandler();
- handler.setLevel(Level.ALL);
- logger.addHandler(handler);
- } else {
- // don't change the setting of this logger
- // to honor what other frameworks
- // have done on configurations.
- }
- } catch(Throwable t) {
- // just to be extra safe. in particular System.getProperty may throw
- // SecurityException.
- }
- }
-
- /**
- * If the {@link InvocationTargetException} wraps an exception that shouldn't be wrapped,
- * throw the wrapped exception.
- */
- private static void handleInvocationTargetException(InvocationTargetException x) throws JAXBException {
- Throwable t = x.getTargetException();
- if( t != null ) {
- if( t instanceof JAXBException )
- // one of our exceptions, just re-throw
- throw (JAXBException)t;
- if( t instanceof RuntimeException )
- // avoid wrapping exceptions unnecessarily
- throw (RuntimeException)t;
- if( t instanceof Error )
- throw (Error)t;
- }
- }
-
-
- /**
- * Determine if two types (JAXBContext in this case) will generate a ClassCastException.
- *
- * For example, (targetType)originalType
- *
- * @param originalType
- * The Class object of the type being cast
- * @param targetType
- * The Class object of the type that is being cast to
- * @return JAXBException to be thrown.
- */
- private static JAXBException handleClassCastException(Class originalType, Class targetType) {
- final URL targetTypeURL = which(targetType);
-
- ClassLoader cl = originalType.getClassLoader() != null ? originalType.getClassLoader() : ClassLoader.getSystemClassLoader();
- return new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
- // we don't care where the impl class is, we want to know where JAXBContext lives in the impl
- // class' ClassLoader
- cl.getResource("javax/xml/bind/JAXBContext.class"),
- targetTypeURL));
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static JAXBContext newInstance( String contextPath,
- String className,
- ClassLoader classLoader,
- Map properties )
- throws JAXBException
- {
- try {
- Class spiClass = safeLoadClass(className,classLoader);
-
- /*
- * javax.xml.bind.context.factory points to a class which has a
- * static method called 'createContext' that
- * returns a javax.xml.JAXBContext.
- */
-
- Object context = null;
-
- // first check the method that takes Map as the third parameter.
- // this is added in 2.0.
- try {
- Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class,Map.class);
- // Throw an early exception instead of having an exception thrown in the createContext method
- if (m.getReturnType() != JAXBContext.class) {
- throw handleClassCastException(m.getReturnType(), JAXBContext.class);
- }
- // any failure in invoking this method would be considered fatal
- context = m.invoke(null,contextPath,classLoader,properties);
- } catch (NoSuchMethodException e) {
- // it's not an error for the provider not to have this method.
- }
-
- if(context==null) {
- // try the old method that doesn't take properties. compatible with 1.0.
- // it is an error for an implementation not to have both forms of the createContext method.
- Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class);
- // Throw an early exception instead of having an exception thrown in the createContext method
- if (m.getReturnType() != JAXBContext.class) {
- throw handleClassCastException(m.getReturnType(), JAXBContext.class);
- }
- // any failure in invoking this method would be considered fatal
- context = m.invoke(null,contextPath,classLoader);
- }
-
- if(!(context instanceof JAXBContext)) {
- // the cast would fail, so generate an exception with a nice message
- throw handleClassCastException(context.getClass(), JAXBContext.class);
- }
- return (JAXBContext)context;
- } catch (ClassNotFoundException x) {
- throw new JAXBException(
- Messages.format( Messages.PROVIDER_NOT_FOUND, className ),
- x);
- } catch (InvocationTargetException x) {
- handleInvocationTargetException(x);
- // for other exceptions, wrap the internal target exception
- // with a JAXBException
- Throwable e = x;
- if(x.getTargetException()!=null)
- e = x.getTargetException();
-
- throw new JAXBException( Messages.format( Messages.COULD_NOT_INSTANTIATE, className, e ), e );
- } catch (RuntimeException x) {
- // avoid wrapping RuntimeException to JAXBException,
- // because it indicates a bug in this code.
- throw x;
- } catch (Exception x) {
- // can't catch JAXBException because the method is hidden behind
- // reflection. Root element collisions detected in the call to
- // createContext() are reported as JAXBExceptions - just re-throw it
- // some other type of exception - just wrap it
- throw new JAXBException(
- Messages.format( Messages.COULD_NOT_INSTANTIATE, className, x ),
- x);
- }
- }
-
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static JAXBContext newInstance(
- Class[] classes,
- Map properties,
- String className) throws JAXBException {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Class spi;
- try {
- spi = safeLoadClass(className,cl);
- } catch (ClassNotFoundException e) {
- throw new JAXBException(e);
- }
-
- if(logger.isLoggable(Level.FINE)) {
- // extra check to avoid costly which operation if not logged
- logger.fine("loaded "+className+" from "+which(spi));
- }
-
- Method m;
- try {
- m = spi.getMethod("createContext", Class[].class, Map.class);
- } catch (NoSuchMethodException e) {
- throw new JAXBException(e);
- }
- // Fallback for JAXB 1.0 compatibility (at least JAXB TCK tests are using that feature)
- try {
- Object context = m.invoke(null, classes, properties);
- if(!(context instanceof JAXBContext)) {
- // the cast would fail, so generate an exception with a nice message
- throw handleClassCastException(context.getClass(), JAXBContext.class);
- }
- return (JAXBContext)context;
- } catch (IllegalAccessException e) {
- throw new JAXBException(e);
- } catch (InvocationTargetException e) {
- handleInvocationTargetException(e);
-
- Throwable x = e;
- if (e.getTargetException() != null)
- x = e.getTargetException();
-
- throw new JAXBException(x);
- }
- }
-
-
- static JAXBContext find(String factoryId, String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException {
-
- // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
-
- final String jaxbContextFQCN = JAXBContext.class.getName();
-
- // search context path for jaxb.properties first
- StringBuilder propFileName;
- StringTokenizer packages = new StringTokenizer( contextPath, ":" );
- String factoryClassName;
-
- if(!packages.hasMoreTokens())
- // no context is specified
- throw new JAXBException(Messages.format(Messages.NO_PACKAGE_IN_CONTEXTPATH));
-
-
- logger.fine("Searching jaxb.properties");
-
- while( packages.hasMoreTokens() ) {
- String packageName = packages.nextToken(":").replace('.','/');
- // com.acme.foo - > com/acme/foo/jaxb.properties
- propFileName = new StringBuilder().append(packageName).append("/jaxb.properties");
-
- Properties props = loadJAXBProperties( classLoader, propFileName.toString() );
- if (props != null) {
- if (props.containsKey(factoryId)) {
- factoryClassName = props.getProperty(factoryId);
- return newInstance( contextPath, factoryClassName, classLoader, properties );
- } else {
- throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryId));
- }
- }
- }
-
- logger.fine("Searching the system property");
-
- // search for a system property second (javax.xml.bind.JAXBContext)
- factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN));
- if( factoryClassName != null ) {
- return newInstance( contextPath, factoryClassName, classLoader, properties );
- }
-
- logger.fine("Searching META-INF/services");
-
- // search META-INF services next
- BufferedReader r;
- try {
- final StringBuilder resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN);
- final InputStream resourceStream =
- classLoader.getResourceAsStream(resource.toString());
-
- if (resourceStream != null) {
- r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
- factoryClassName = r.readLine().trim();
- r.close();
- return newInstance(contextPath, factoryClassName, classLoader, properties);
- } else {
- logger.fine("Unable to load:" + resource.toString());
- }
- } catch (UnsupportedEncodingException e) {
- // should never happen
- throw new JAXBException(e);
- } catch (IOException e) {
- throw new JAXBException(e);
- }
-
- // else no provider found
- logger.fine("Trying to create the platform default provider");
- return newInstance(contextPath, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader, properties);
- }
-
- // TODO: log each step in the look up process
- static JAXBContext find( Class[] classes, Map properties ) throws JAXBException {
-
- // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
-
- final String jaxbContextFQCN = JAXBContext.class.getName();
- String factoryClassName;
-
- // search for jaxb.properties in the class loader of each class first
- for (final Class c : classes) {
- // this classloader is used only to load jaxb.properties, so doing this should be safe.
- ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return c.getClassLoader();
- }
- });
- Package pkg = c.getPackage();
- if(pkg==null)
- continue; // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders
- String packageName = pkg.getName().replace('.', '/');
-
- // TODO: do we want to optimize away searching the same package? org.Foo, org.Bar, com.Baz
- // classes from the same package might come from different class loades, so it might be a bad idea
-
- // TODO: it's easier to look things up from the class
- // c.getResourceAsStream("jaxb.properties");
-
- // build the resource name and use the property loader code
- String resourceName = packageName+"/jaxb.properties";
- logger.fine("Trying to locate "+resourceName);
- Properties props = loadJAXBProperties(classLoader, resourceName);
- if (props == null) {
- logger.fine(" not found");
- } else {
- logger.fine(" found");
- if (props.containsKey(JAXB_CONTEXT_FACTORY)) {
- // trim() seems redundant, but adding to satisfy customer complaint
- factoryClassName = props.getProperty(JAXB_CONTEXT_FACTORY).trim();
- return newInstance(classes, properties, factoryClassName);
- } else {
- throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, JAXB_CONTEXT_FACTORY));
- }
- }
- }
-
- // search for a system property second (javax.xml.bind.JAXBContext)
- logger.fine("Checking system property "+jaxbContextFQCN);
- factoryClassName = AccessController.doPrivileged(new GetPropertyAction(jaxbContextFQCN));
- if( factoryClassName != null ) {
- logger.fine(" found "+factoryClassName);
- return newInstance( classes, properties, factoryClassName );
- }
- logger.fine(" not found");
-
- // search META-INF services next
- logger.fine("Checking META-INF/services");
- BufferedReader r;
- try {
- final String resource = new StringBuilder("META-INF/services/").append(jaxbContextFQCN).toString();
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- URL resourceURL;
- if(classLoader==null)
- resourceURL = ClassLoader.getSystemResource(resource);
- else
- resourceURL = classLoader.getResource(resource);
-
- if (resourceURL != null) {
- logger.fine("Reading "+resourceURL);
- r = new BufferedReader(new InputStreamReader(resourceURL.openStream(), "UTF-8"));
- factoryClassName = r.readLine().trim();
- return newInstance(classes, properties, factoryClassName);
- } else {
- logger.fine("Unable to find: " + resource);
- }
- } catch (UnsupportedEncodingException e) {
- // should never happen
- throw new JAXBException(e);
- } catch (IOException e) {
- throw new JAXBException(e);
- }
-
- // else no provider found
- logger.fine("Trying to create the platform default provider");
- return newInstance(classes, properties, PLATFORM_DEFAULT_FACTORY_CLASS);
- }
-
-
- private static Properties loadJAXBProperties( ClassLoader classLoader,
- String propFileName )
- throws JAXBException {
-
- Properties props = null;
-
- try {
- URL url;
- if(classLoader==null)
- url = ClassLoader.getSystemResource(propFileName);
- else
- url = classLoader.getResource( propFileName );
-
- if( url != null ) {
- logger.fine("loading props from "+url);
- props = new Properties();
- InputStream is = url.openStream();
- props.load( is );
- is.close();
- }
- } catch( IOException ioe ) {
- logger.log(Level.FINE,"Unable to load "+propFileName,ioe);
- throw new JAXBException( ioe.toString(), ioe );
- }
-
- return props;
- }
-
-
- /**
- * Search the given ClassLoader for an instance of the specified class and
- * return a string representation of the URL that points to the resource.
- *
- * @param clazz
- * The class to search for
- * @param loader
- * The ClassLoader to search. If this parameter is null, then the
- * system class loader will be searched
- * @return
- * the URL for the class or null if it wasn't found
- */
- static URL which(Class clazz, ClassLoader loader) {
-
- String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
-
- if(loader == null) {
- loader = ClassLoader.getSystemClassLoader();
- }
-
- return loader.getResource(classnameAsResource);
- }
-
- /**
- * Get the URL for the Class from it's ClassLoader.
- *
- * Convenience method for {@link #which(Class, ClassLoader)}.
- *
- * Equivalent to calling: which(clazz, clazz.getClassLoader())
- *
- * @param clazz
- * The class to search for
- * @return
- * the URL for the class or null if it wasn't found
- */
- static URL which(Class clazz) {
- return which(clazz, clazz.getClassLoader());
- }
-
- /**
- * When JAXB is in J2SE, rt.jar has to have a JAXB implementation.
- * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext
- * because if it has, it will take precedence over any file that applications have
- * in their jar files.
- *
- * <p>
- * When the user bundles his own JAXB implementation, we'd like to use it, and we
- * want the platform default to be used only when there's no other JAXB provider.
- *
- * <p>
- * For this reason, we have to hard-code the class name into the API.
- */
- private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
-
- /**
- * Loads the class, provided that the calling thread has an access to the class being loaded.
- */
- private static Class safeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
- // using Osig locator to load the spi class
- try {
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(JAXBContext.class);
- if (spiClass != null) {
- return spiClass;
- }
- } catch (Throwable t) {
- }
- logger.fine("Trying to load "+className);
- try {
- // make sure that the current thread has an access to the package of the given name.
- SecurityManager s = System.getSecurityManager();
- if (s != null) {
- int i = className.lastIndexOf('.');
- if (i != -1) {
- s.checkPackageAccess(className.substring(0,i));
- }
- }
-
- if (classLoader == null) {
- return Class.forName(className);
- } else {
- return classLoader.loadClass(className);
- }
- } catch (SecurityException se) {
- // anyone can access the platform default factory class without permission
- if (PLATFORM_DEFAULT_FACTORY_CLASS.equals(className)) {
- return Class.forName(className);
- }
- throw se;
- }
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/pom.xml b/trunk/jaxp-api-1.3/pom.xml
deleted file mode 100644
index bf58ff9..0000000
--- a/trunk/jaxp-api-1.3/pom.xml
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxp-api-1.3</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXP API 1.3</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.3.04</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <compilerArgument>-Xbootclasspath/p:${settings.localRepository}/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar</compilerArgument>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>
- javax.xml*;version=1.3;-split-package:=merge-first,
- org.w3c.dom*;version=1.0;-split-package:=merge-first,
- org.xml.sax*;version=2.0.2;-split-package:=merge-first,
- </Export-Package>
- <Import-Package>
- *
- </Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>${project.groupId}:${project.artifactId}</artifact>
- <excludes>
- <exclude>org/apache/servicemix/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/FactoryFinder.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/FactoryFinder.java
deleted file mode 100644
index 14f3b90..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/FactoryFinder.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.datatype;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
-
-/**
- * <p>Implement pluggabile Datatypes.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class FactoryFinder {
-
- /**
- * <p>Name of class to display in output messages.</p>
- */
- private static final String CLASS_NAME = "javax.xml.datatype.FactoryFinder";
-
- /**
- * <p>Debug flag to trace loading process.</p>
- */
- private static boolean debug = false;
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * <p>Check to see if debugging enabled by property.</p>
- *
- * <p>Use try/catch block to support applets, which throws
- * SecurityException out of this code.</p>
- *
- */
- static {
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception x) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- /**
- * <p>Output debugging messages.</p>
- *
- * @param msg <code>String</code> to print to <code>stderr</code>.
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println(
- CLASS_NAME
- + ":"
- + msg);
- }
- }
-
- /**
- * <p>Find the appropriate <code>ClassLoader</code> to use.</p>
- *
- * <p>The context ClassLoader is prefered.</p>
- *
- * @return <code>ClassLoader</code> to use.
- *
- * @throws ConfigurationError If a valid <code>ClassLoader</code> cannot be identified.
- */
- private static ClassLoader findClassLoader()
- throws ConfigurationError {
- ClassLoader classLoader;
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- classLoader = SecuritySupport.getContextClassLoader();
-
- if (debug) debugPrintln(
- "Using context class loader: "
- + classLoader);
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- if (debug) debugPrintln(
- "Using the class loader of FactoryFinder: "
- + classLoader);
- }
-
- return classLoader;
- }
-
- /**
- * <p>Create an instance of a class using the specified ClassLoader.</p>
- *
- * @param className Name of class to create.
- * @param classLoader ClassLoader to use to create named class.
- *
- * @return New instance of specified class created using the specified ClassLoader.
- *
- * @throws ConfigurationError If class could not be created.
- */
- private static Object newInstance(
- String className,
- ClassLoader classLoader)
- throws ConfigurationError {
-
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
-
- if (debug) {
- debugPrintln("Loaded " + className + " from " + which(spiClass));
- }
-
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * Package private so this code can be shared.
- *
- * @param factoryId Name of the factory to find, same as a property name
- * @param fallbackClassName Implementation class name, if nothing else is found. Use null to mean no fallback.
- *
- * @return Class Object of factory, never null
- *
- * @throws ConfigurationError If Class cannot be found.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError {
-
- ClassLoader classLoader = findClassLoader();
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (debug) debugPrintln("found " + systemProp + " in the system property " + factoryId);
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- ; // NOP, explicitly ignore SecurityException
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator + "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- File f = new File(configFile);
- firstTime = false;
- if (SecuritySupport.doesFileExist(f)) {
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) debugPrintln("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) debugPrintln("found in resource, value="
- + factoryClassName);
-
- return newInstance(factoryClassName, cl);
- }
-
- // No provider found
- return null;
- }
-
- /**
- * <p>Configuration Error.</p>
- */
- static class ConfigurationError extends Error {
-
- private static final long serialVersionUID = -3644413026244211347L;
-
- /**
- * <p>Exception that caused the error.</p>
- */
- private Exception exception;
-
- /**
- * <p>Construct a new instance with the specified detail string and
- * exception.</p>
- *
- * @param msg Detail message for this error.
- * @param x Exception that caused the error.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- /**
- * <p>Get the Exception that caused the error.</p>
- *
- * @return Exception that caused the error.
- */
- Exception getException() {
- return exception;
- }
- }
-
-
-
- /**
- * Returns the location where the given Class is loaded from.
- *
- * @param clazz Class to find load location.
- *
- * @return Location where class would be loaded from.
- */
- private static String which(Class clazz) {
- try {
- String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
-
- ClassLoader loader = clazz.getClassLoader();
-
- URL it;
-
- if (loader != null) {
- it = loader.getResource(classnameAsResource);
- } else {
- it = ClassLoader.getSystemResource(classnameAsResource);
- }
-
- if (it != null) {
- return it.toString();
- }
- } catch (Throwable t) {
- // work defensively.
- if (debug) {
- t.printStackTrace();
- }
- }
- return "unknown location";
- }
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/SecuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/SecuritySupport.java
deleted file mode 100644
index da82748..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/datatype/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.datatype;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/FactoryFinder.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/FactoryFinder.java
deleted file mode 100644
index 6345034..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/FactoryFinder.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.parsers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private.
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and later including
- * JVMs that perform early linking like the Microsoft JVM in IE 5. Note
- * however that it must be compiled on a JDK version 1.2 or later system
- * since it calls Thread#getContextClassLoader(). The code also runs both
- * as part of an unbundled jar file and when bundled as part of the JDK.
- */
-final class FactoryFinder {
-
- /** Temp debug code - this will be removed after we test everything
- */
- private static boolean debug = false;
- static Properties cacheProps= new Properties();
- static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (SecurityException se) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader and
- * optionally fall back to the current ClassLoader if not found.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param doFallback true if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- private static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
-
- try {
- Class providerClass;
- if (cl == null) {
- // If classloader is null Use the bootstrap ClassLoader.
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- cl = FactoryFinder.class.getClassLoader();
- if (cl != null) {
- providerClass = cl.loadClass(className);
- }
- else {
- providerClass = Class.forName(className);
- }
- } else {
- throw x;
- }
- }
- }
-
- Object instance = providerClass.newInstance();
- if (debug) dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError
- {
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- ClassLoader classLoader = SecuritySupport.getContextClassLoader();
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- }
-
- if (debug) dPrint("find factoryId =" + factoryId);
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if( systemProp!=null) {
- if (debug) dPrint("found system property, value=" + systemProp);
- return newInstance(systemProp, classLoader, true );
- }
- } catch (SecurityException se) {
- //if first option fails due to any reason we should try next option in the
- //look up algorithm.
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) dPrint("Read properties file "+f);
- //cacheProps.load( new FileInputStream(f));
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
-
- if(factoryClassName != null){
- if (debug) dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(factoryClassName, classLoader, true);
- }
- } catch(Exception ex ) {
- if( debug ) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader, true);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) dPrint("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) dPrint("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- static class ConfigurationError extends Error {
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/ScuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/ScuritySupport.java
deleted file mode 100644
index 95e92be..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/parsers/ScuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java,v 1.2.24.1 2005/03/29 23:25:08 jsuttor Exp $
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/FactoryFinder.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/FactoryFinder.java
deleted file mode 100644
index 7a89f11..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/FactoryFinder.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.transform;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private.
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and later including
- * JVMs that perform early linking like the Microsoft JVM in IE 5. Note
- * however that it must be compiled on a JDK version 1.2 or later system
- * since it calls Thread#getContextClassLoader(). The code also runs both
- * as part of an unbundled jar file and when bundled as part of the JDK.
- */
-final class FactoryFinder {
-
- /** Temp debug code - this will be removed after we test everything
- */
- private static boolean debug = false;
- static Properties cacheProps= new Properties();
- static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (SecurityException se) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader and
- * optionally fall back to the current ClassLoader if not found.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param doFallback true if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- private static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
-
- try {
- Class providerClass;
- if (cl == null) {
- // If classloader is null Use the bootstrap ClassLoader.
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- cl = FactoryFinder.class.getClassLoader();
- if (cl != null) {
- providerClass = cl.loadClass(className);
- }
- else {
- providerClass = Class.forName(className);
- }
- } else {
- throw x;
- }
- }
- }
-
- Object instance = providerClass.newInstance();
- if (debug) dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError
- {
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- ClassLoader classLoader = SecuritySupport.getContextClassLoader();
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- }
-
- if (debug) dPrint("find factoryId =" + factoryId);
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if( systemProp!=null) {
- if (debug) dPrint("found system property, value=" + systemProp);
- return newInstance(systemProp, classLoader, true );
- }
- } catch (SecurityException se) {
- //if first option fails due to any reason we should try next option in the
- //look up algorithm.
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) dPrint("Read properties file "+f);
- //cacheProps.load( new FileInputStream(f));
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
-
- if(factoryClassName != null){
- if (debug) dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(factoryClassName, classLoader, true);
- }
- } catch(Exception ex ) {
- if( debug ) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader, true);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) dPrint("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) dPrint("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- static class ConfigurationError extends Error {
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/SecuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/SecuritySupport.java
deleted file mode 100644
index 570dc5e..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/transform/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java,v 1.2.24.1 2005/03/29 23:32:22 jsuttor Exp $
-
-package javax.xml.transform;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SchemaFactoryFinder.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
deleted file mode 100644
index 65f981c..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * 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.
- */
-// $Id: SchemaFactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.validation;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-
-/**
- * Implementation of {@link SchemaFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class SchemaFactoryFinder {
-
- /** debug support code. */
- private static boolean debug = false;
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- static {
- // Use try/catch block to support applets
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception _) {
- debug = false;
- }
- }
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>SchemaFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource, {@link SchemaFactory}, and
- * {@link SchemaFactoryLoader} implementations during
- * the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public SchemaFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == SecuritySupport.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable _ ) {
- ; // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link SchemaFactory} object for the specified
- * schema language.</p>
- *
- * @param schemaLanguage
- * See {@link SchemaFactory Schema Language} table in <code>SchemaFactory</code>
- * for the list of available schema languages.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the <tt>schemaLanguage</tt> parameter is null.
- */
- public SchemaFactory newFactory(String schemaLanguage) {
- if(schemaLanguage==null) throw new NullPointerException();
- SchemaFactory f = _newFactory(schemaLanguage);
- if (debug) {
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + schemaLanguage);
- } else {
- debugPrintln("unable to find a factory for " + schemaLanguage);
- }
- }
- return f;
- }
-
- /**
- * <p>Lookup a <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.</p>
- *
- * @param schemaLanguage Schema language to lookup <code>SchemaFactory</code> for.
- *
- * @return <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.
- */
- private SchemaFactory _newFactory(String schemaLanguage) {
- SchemaFactory sf;
- String propertyName = SERVICE_CLASS.getName() + ":" + schemaLanguage;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(SERVICE_CLASS);
- if (spiClass != null) {
- return (SchemaFactory) spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // system property look up
- try {
- if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = SecuritySupport.getSystemProperty(propertyName);
- if (r != null) {
- if (debug) debugPrintln("The value is '"+r+"'");
- sf = createInstance(r);
- if(sf!=null) return sf;
- }
- else if (debug) {
- debugPrintln("The property is undefined.");
- }
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = SecuritySupport.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
- String factoryClassName = null ;
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(propertyName);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- sf = createInstance(factoryClassName);
- if(sf != null){
- return sf;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- /**
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = ss.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File( configFile );
- if( ss.doesFileExist(f)) {
- sf = loadFromProperty(
- propertyName,f.getAbsolutePath(), new FileInputStream(f));
- if(sf!=null) return sf;
- } else {
- debugPrintln("Tried to read "+ f.getAbsolutePath()+", but it doesn't exist.");
- }
- } catch(Throwable e) {
- if( debug ) {
- debugPrintln("failed to read $java.home/lib/jaxp.properties");
- e.printStackTrace();
- }
- }
- */
-
- // try META-INF/services files
- Iterator sitr = createServiceFileIterator();
- while(sitr.hasNext()) {
- URL resource = (URL)sitr.next();
- if (debug) debugPrintln("looking into " + resource);
- try {
- sf = loadFromServicesFile(schemaLanguage,resource.toExternalForm(),SecuritySupport.getURLInputStream(resource));
- if(sf!=null) return sf;
- } catch(IOException e) {
- if( debug ) {
- debugPrintln("failed to read "+resource);
- e.printStackTrace();
- }
- }
- }
-
- // platform default
- if (schemaLanguage.equals("http://www.w3.org/2001/XMLSchema")) {
- if (debug) debugPrintln("attempting to use the platform default XML Schema validator");
- return createInstance("org.apache.xerces.jaxp.validation.XMLSchemaFactory");
- }
-
- if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instanciated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- SchemaFactory createInstance( String className ) {
- try {
- if (debug) debugPrintln("instanciating "+className);
- Class clazz;
- if( classLoader!=null )
- clazz = classLoader.loadClass(className);
- else
- clazz = Class.forName(className);
- if(debug) debugPrintln("loaded it from "+which(clazz));
- Object o = clazz.newInstance();
-
- if( o instanceof SchemaFactory )
- return (SchemaFactory)o;
-
- if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
- } catch( Throwable t ) {
- debugPrintln("failed to instanciate "+className);
- if(debug) t.printStackTrace();
- }
- return null;
- }
-
- /** Iterator that lazily computes one value and returns it. */
- private static abstract class SingleIterator implements Iterator {
- private boolean seen = false;
-
- public final void remove() { throw new UnsupportedOperationException(); }
- public final boolean hasNext() { return !seen; }
- public final Object next() {
- if(seen) throw new NoSuchElementException();
- seen = true;
- return value();
- }
-
- protected abstract Object value();
- }
-
- /**
- * Returns an {@link Iterator} that enumerates all
- * the META-INF/services files that we care.
- */
- private Iterator createServiceFileIterator() {
- if (classLoader == null) {
- return new SingleIterator() {
- protected Object value() {
- ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
- //return (ClassLoader.getSystemResource( SERVICE_ID ));
- return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
- }
- };
- } else {
- try {
- //final Enumeration e = classLoader.getResources(SERVICE_ID);
- final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
- if(debug && !e.hasMoreElements()) {
- debugPrintln("no "+SERVICE_ID+" file was found");
- }
-
- // wrap it into an Iterator.
- return new Iterator() {
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return e.hasMoreElements();
- }
-
- public Object next() {
- return e.nextElement();
- }
- };
- } catch (IOException e) {
- if (debug) {
- debugPrintln("failed to enumerate resources "+SERVICE_ID);
- e.printStackTrace();
- }
- return new ArrayList().iterator(); // empty iterator
- }
- }
- }
-
- /** Searches for a SchemaFactory for a given schema language in a META-INF/services file. */
- private SchemaFactory loadFromServicesFile(String schemaLanguage, String resourceName, InputStream in) {
-
- if (debug) debugPrintln("Reading "+resourceName );
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(in, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(in), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- SchemaFactory resultFactory = null;
- // See spec for provider-configuration files: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider%20Configuration%20File
- while (true) {
- try {
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- break;
- }
- if (factoryClassName != null) {
- // Ignore comments in the provider-configuration file
- int hashIndex = factoryClassName.indexOf('#');
- if (hashIndex != -1) {
- factoryClassName = factoryClassName.substring(0, hashIndex);
- }
-
- // Ignore leading and trailing whitespace
- factoryClassName = factoryClassName.trim();
-
- // If there's no text left or if this was a blank line, go to the next one.
- if (factoryClassName.length() == 0) {
- continue;
- }
-
- try {
- // Found the right SchemaFactory if its isSchemaLanguageSupported(schemaLanguage) method returns true.
- SchemaFactory foundFactory = (SchemaFactory) createInstance(factoryClassName);
- if (foundFactory.isSchemaLanguageSupported(schemaLanguage)) {
- resultFactory = foundFactory;
- break;
- }
- }
- catch (Exception e) {}
- }
- else {
- break;
- }
- }
-
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
-
- return resultFactory;
- }
-
- private static final Class SERVICE_CLASS = SchemaFactory.class;
- private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
-
-
-
- private static String which( Class clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SecuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SecuritySupport.java
deleted file mode 100644
index fea9147..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/validation/SecuritySupport.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.validation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- static URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = ClassLoader.getSystemResource(name);
- } else {
- url = cl.getSystemResource(name);
- }
- return url;
- }
- });
- }
-
- static Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getSystemResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/SecuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/SecuritySupport.java
deleted file mode 100644
index c392de1..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/SecuritySupport.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.xpath;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- static URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = ClassLoader.getSystemResource(name);
- } else {
- url = cl.getSystemResource(name);
- }
- return url;
- }
- });
- }
-
- static Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getSystemResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/XPathFactoryFinder.java b/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
deleted file mode 100644
index f5e80a1..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * 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.
- */
-// $Id: XPathFactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.xpath;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-
-import javax.xml.validation.SchemaFactory;
-
-/**
- * Implementation of {@link XPathFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class XPathFactoryFinder {
-
- /** debug support code. */
- private static boolean debug = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- static {
- // Use try/catch block to support applets
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception _) {
- debug = false;
- }
- }
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>SchemaFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource, {@link SchemaFactory}, and
- * {@link SchemaFactoryLoader} implementations during
- * the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public XPathFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == SecuritySupport.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable _ ) {
- ; // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link XPathFactory} object for the specified
- * schema language.</p>
- *
- * @param uri
- * Identifies the underlying object model.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the parameter is null.
- */
- public XPathFactory newFactory(String uri) {
- if(uri==null) throw new NullPointerException();
- XPathFactory f = _newFactory(uri);
- if (debug) {
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
- } else {
- debugPrintln("unable to find a factory for " + uri);
- }
- }
- return f;
- }
-
- /**
- * <p>Lookup a {@link XPathFactory} for the given object model.</p>
- *
- * @param uri identifies the object model.
- *
- * @return {@link XPathFactory} for the given object model.
- */
- private XPathFactory _newFactory(String uri) {
- XPathFactory sf;
-
- String propertyName = SERVICE_CLASS.getName() + ":" + uri;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(SERVICE_CLASS);
- if (spiClass != null) {
- return (XPathFactory) spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // system property look up
- try {
- if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = SecuritySupport.getSystemProperty(propertyName);
- if(r!=null) {
- if (debug) debugPrintln("The value is '"+r+"'");
- sf = createInstance(r);
- if(sf!=null) return sf;
- }
- else if (debug) {
- debugPrintln("The property is undefined.");
- }
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = SecuritySupport.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
- String factoryClassName = null ;
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(propertyName);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- sf = createInstance(factoryClassName);
- if(sf != null){
- return sf;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // try META-INF/services files
- Iterator sitr = createServiceFileIterator();
- while(sitr.hasNext()) {
- URL resource = (URL)sitr.next();
- if (debug) debugPrintln("looking into " + resource);
- try {
- sf = loadFromServicesFile(uri, resource.toExternalForm(), SecuritySupport.getURLInputStream(resource));
- if(sf!=null) return sf;
- } catch(IOException e) {
- if( debug ) {
- debugPrintln("failed to read "+resource);
- e.printStackTrace();
- }
- }
- }
-
- // platform default
- if(uri.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
- if (debug) debugPrintln("attempting to use the platform default W3C DOM XPath lib");
- return createInstance("org.apache.xpath.jaxp.XPathFactoryImpl");
- }
-
- if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instanciated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- private XPathFactory createInstance( String className ) {
- try {
- if (debug) debugPrintln("instanciating "+className);
- Class clazz;
- if( classLoader!=null )
- clazz = classLoader.loadClass(className);
- else
- clazz = Class.forName(className);
- if(debug) debugPrintln("loaded it from "+which(clazz));
- Object o = clazz.newInstance();
-
- if( o instanceof XPathFactory )
- return (XPathFactory)o;
-
- if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
- } catch( Throwable t ) {
- if (debug) {
- debugPrintln("failed to instanciate "+className);
- t.printStackTrace();
- }
- }
- return null;
- }
-
- /** Iterator that lazily computes one value and returns it. */
- private static abstract class SingleIterator implements Iterator {
- private boolean seen = false;
-
- public final void remove() { throw new UnsupportedOperationException(); }
- public final boolean hasNext() { return !seen; }
- public final Object next() {
- if(seen) throw new NoSuchElementException();
- seen = true;
- return value();
- }
-
- protected abstract Object value();
- }
-
- /** Searches for a XPathFactory for a given uri in a META-INF/services file. */
- private XPathFactory loadFromServicesFile(String uri, String resourceName, InputStream in) {
-
- if (debug) debugPrintln("Reading " + resourceName );
-
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(in, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(in), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- XPathFactory resultFactory = null;
- // See spec for provider-configuration files: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider%20Configuration%20File
- while (true) {
- try {
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- break;
- }
- if (factoryClassName != null) {
- // Ignore comments in the provider-configuration file
- int hashIndex = factoryClassName.indexOf('#');
- if (hashIndex != -1) {
- factoryClassName = factoryClassName.substring(0, hashIndex);
- }
-
- // Ignore leading and trailing whitespace
- factoryClassName = factoryClassName.trim();
-
- // If there's no text left or if this was a blank line, go to the next one.
- if (factoryClassName.length() == 0) {
- continue;
- }
-
- try {
- // Found the right XPathFactory if its isObjectModelSupported(String uri) method returns true.
- XPathFactory foundFactory = (XPathFactory) createInstance(factoryClassName);
- if (foundFactory.isObjectModelSupported(uri)) {
- resultFactory = foundFactory;
- break;
- }
- }
- catch (Exception e) {}
- }
- else {
- break;
- }
- }
-
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
-
- return resultFactory;
- }
-
- /**
- * Returns an {@link Iterator} that enumerates all
- * the META-INF/services files that we care.
- */
- private Iterator createServiceFileIterator() {
- if (classLoader == null) {
- return new SingleIterator() {
- protected Object value() {
- ClassLoader classLoader = XPathFactoryFinder.class.getClassLoader();
- return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
- //return (ClassLoader.getSystemResource( SERVICE_ID ));
- }
- };
- } else {
- try {
- //final Enumeration e = classLoader.getResources(SERVICE_ID);
- final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
- if (debug && !e.hasMoreElements()) {
- debugPrintln("no "+SERVICE_ID+" file was found");
- }
-
- // wrap it into an Iterator.
- return new Iterator() {
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return e.hasMoreElements();
- }
-
- public Object next() {
- return e.nextElement();
- }
- };
- } catch (IOException e) {
- if (debug) {
- debugPrintln("failed to enumerate resources "+SERVICE_ID);
- e.printStackTrace();
- }
- return new ArrayList().iterator(); // empty iterator
- }
- }
- }
-
- private static final Class SERVICE_CLASS = XPathFactory.class;
- private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
-
-
-
- private static String which( Class clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/org/w3c/dom/html/HTMLDOMImplementation.java b/trunk/jaxp-api-1.3/src/main/java/org/w3c/dom/html/HTMLDOMImplementation.java
deleted file mode 100644
index 9828407..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/org/w3c/dom/html/HTMLDOMImplementation.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
- * details.
- */
-
-package org.w3c.dom.html;
-
-import org.w3c.dom.DOMImplementation;
-
-/**
- * The <code>HTMLDOMImplementation</code> interface extends the
- * <code>DOMImplementation</code> interface with a method for creating an
- * HTML document instance.
- * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
- * @since DOM Level 2
- */
-public interface HTMLDOMImplementation extends DOMImplementation {
- /**
- * Creates an <code>HTMLDocument</code> object with the minimal tree made
- * of the following elements: <code>HTML</code> , <code>HEAD</code> ,
- * <code>TITLE</code> , and <code>BODY</code> .
- * @param title The title of the document to be set as the content of the
- * <code>TITLE</code> element, through a child <code>Text</code> node.
- * @return A new <code>HTMLDocument</code> object.
- */
- public HTMLDocument createHTMLDocument(String title);
-
-}
-
diff --git a/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/SecuritySupport.java b/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/SecuritySupport.java
deleted file mode 100644
index 38767de..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/SecuritySupport.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.xml.sax.helpers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-}
diff --git a/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java b/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
deleted file mode 100644
index a6e5947..0000000
--- a/trunk/jaxp-api-1.3/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
+++ /dev/null
@@ -1,264 +0,0 @@
-// XMLReaderFactory.java - factory for creating a new reader.
-// http://www.saxproject.org
-// Written by David Megginson
-// and by David Brownell
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java 670295 2008-06-22 01:46:43Z mrglavas $
-
-package org.xml.sax.helpers;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Factory for creating an XML reader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains static methods for creating an XML reader
- * from an explicit class name, or based on runtime defaults:</p>
- *
- * <pre>
- * try {
- * XMLReader myReader = XMLReaderFactory.createXMLReader();
- * } catch (SAXException e) {
- * System.err.println(e.getMessage());
- * }
- * </pre>
- *
- * <p><strong>Note to Distributions bundled with parsers:</strong>
- * You should modify the implementation of the no-arguments
- * <em>createXMLReader</em> to handle cases where the external
- * configuration mechanisms aren't set up. That method should do its
- * best to return a parser when one is in the class path, even when
- * nothing bound its class name to <code>org.xml.sax.driver</code> so
- * those configuration mechanisms would see it.</p>
- *
- * @since SAX 2.0
- * @author David Megginson, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-final public class XMLReaderFactory
-{
- /**
- * Private constructor.
- *
- * <p>This constructor prevents the class from being instantiated.</p>
- */
- private XMLReaderFactory ()
- {
- }
-
- private static final String property = "org.xml.sax.driver";
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * Attempt to create an XMLReader from system defaults.
- * In environments which can support it, the name of the XMLReader
- * class is determined by trying each these options in order, and
- * using the first one which succeeds:</p> <ul>
- *
- * <li>If the system property <code>org.xml.sax.driver</code>
- * has a value, that is used as an XMLReader class name. </li>
- *
- * <li>The JAR "Services API" is used to look for a class name
- * in the <em>META-INF/services/org.xml.sax.driver</em> file in
- * jarfiles available to the runtime.</li>
- *
- * <li> SAX parser distributions are strongly encouraged to provide
- * a default XMLReader class name that will take effect only when
- * previous options (on this list) are not successful.</li>
- *
- * <li>Finally, if {@link ParserFactory#makeParser()} can
- * return a system default SAX1 parser, that parser is wrapped in
- * a {@link ParserAdapter}. (This is a migration aid for SAX1
- * environments, where the <code>org.xml.sax.parser</code> system
- * property will often be usable.) </li>
- *
- * </ul>
- *
- * <p> In environments such as small embedded systems, which can not
- * support that flexibility, other mechanisms to determine the default
- * may be used. </p>
- *
- * <p>Note that many Java environments allow system properties to be
- * initialized on a command line. This means that <em>in most cases</em>
- * setting a good value for that property ensures that calls to this
- * method will succeed, except when security policies intervene.
- * This will also maximize application portability to older SAX
- * environments, with less robust implementations of this method.
- * </p>
- *
- * @return A new XMLReader.
- * @exception org.xml.sax.SAXException If no default XMLReader class
- * can be identified and instantiated.
- * @see #createXMLReader(java.lang.String)
- */
- public static XMLReader createXMLReader ()
- throws SAXException
- {
- String className = null;
- ClassLoader loader = NewInstance.getClassLoader ();
-
- // 1. try the JVM-instance-wide system property
- try { className = SecuritySupport.getSystemProperty (property); }
- catch (Exception e) { /* normally fails for applets */ }
-
- // 2. if that fails, try META-INF/services/
- if (className == null || className.length() == 0) {
- String service = "META-INF/services/" + property;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class<? extends XMLReader> spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(XMLReader.class, property);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- InputStream is = null;
- className = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, service);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = XMLReaderFactory.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, service);
- }
- } else {
- // No Context ClassLoader or JDK 1.1 so try the current
- // ClassLoader
- cl = XMLReaderFactory.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, service);
- }
-
- if (is != null) {
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- className = rd.readLine();
- }
- catch (Exception x) {
- // No provider found
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
-
- // 3. Distro-specific fallback
- if (className == null) {
- // BEGIN DISTRIBUTION-SPECIFIC
-
- // EXAMPLE:
- // className = "com.example.sax.XmlReader";
- // or a $JAVA_HOME/jre/lib/*properties setting...
- className = "org.apache.xerces.parsers.SAXParser";
-
- // END DISTRIBUTION-SPECIFIC
- }
-
- // do we know the XMLReader implementation class yet?
- if (className != null)
- return loadClass (loader, className);
-
- // 4. panic -- adapt any SAX1 parser
- try {
- return new ParserAdapter (ParserFactory.makeParser ());
- } catch (Exception e) {
- throw new SAXException ("Can't create default XMLReader; "
- + "is system property org.xml.sax.driver set?");
- }
- }
-
-
- /**
- * Attempt to create an XML reader from a class name.
- *
- * <p>Given a class name, this method attempts to load
- * and instantiate the class as an XML reader.</p>
- *
- * <p>Note that this method will not be usable in environments where
- * the caller (perhaps an applet) is not permitted to load classes
- * dynamically.</p>
- *
- * @return A new XML reader.
- * @exception org.xml.sax.SAXException If the class cannot be
- * loaded, instantiated, and cast to XMLReader.
- * @see #createXMLReader()
- */
- public static XMLReader createXMLReader (String className)
- throws SAXException
- {
- return loadClass (NewInstance.getClassLoader (), className);
- }
-
- private static XMLReader loadClass (ClassLoader loader, String className)
- throws SAXException
- {
- try {
- return (XMLReader) NewInstance.newInstance (loader, className);
- } catch (ClassNotFoundException e1) {
- throw new SAXException("SAX2 driver class " + className +
- " not found", e1);
- } catch (IllegalAccessException e2) {
- throw new SAXException("SAX2 driver class " + className +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new SAXException("SAX2 driver class " + className +
- " loaded but cannot be instantiated (no empty public constructor?)",
- e3);
- } catch (ClassCastException e4) {
- throw new SAXException("SAX2 driver class " + className +
- " does not implement XMLReader", e4);
- }
- }
-}
diff --git a/trunk/jaxp-api-1.4/pom.xml b/trunk/jaxp-api-1.4/pom.xml
deleted file mode 100644
index eef582e..0000000
--- a/trunk/jaxp-api-1.4/pom.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxp-api-1.4</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXP API 1.4</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.2</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.4.01</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <inherited>true</inherited>
- <configuration>
- <compilerArgument>-Xbootclasspath/p:${settings.localRepository}/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar</compilerArgument>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>
- javax.xml.stream*;version=1.2;-split-package:=merge-first;-noimport:=true,
- javax.xml*;version=1.4;-split-package:=merge-first;-noimport:=true,
- org.w3c.dom*;version=1.0;-split-package:=merge-first;-noimport:=true,
- org.xml.sax*;version=2.0.2;-split-package:=merge-first;-noimport:=true,
- </Export-Package>
- <Import-Package>
- *
- </Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>xml-apis:xml-apis</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>${project.groupId}:${project.artifactId}</artifact>
- <excludes>
- <exclude>org/apache/servicemix/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>xml-apis:xml-apis</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/DatatypeFactory.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/DatatypeFactory.java
deleted file mode 100644
index a566901..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/DatatypeFactory.java
+++ /dev/null
@@ -1,1016 +0,0 @@
-/*
- * 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.
- */
-
-//$Id: DatatypeFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
-
-package javax.xml.datatype;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.GregorianCalendar;
-
-/**
- * <p>Factory that creates new <code>javax.xml.datatype</code> <code>Object</code>s that map XML to/from Java <code>Object</code>s.</p>
- *
- * <p id="DatatypeFactory.newInstance">{@link #newInstance()} is used to create a new <code>DatatypeFactory</code>.
- * The following implementation resolution mechanisms are used in the following order:</p>
- * <ol>
- * <li>
- * If the system property specified by {@link #DATATYPEFACTORY_PROPERTY}, "<code>javax.xml.datatype.DatatypeFactory</code>",
- * exists, a class with the name of the property's value is instantiated.
- * Any Exception thrown during the instantiation process is wrapped as a {@link javax.xml.datatype.DatatypeConfigurationException}.
- * </li>
- * <li>
- * If the file ${JAVA_HOME}/lib/jaxp.properties exists, it is loaded in a {@link java.util.Properties} <code>Object</code>.
- * The <code>Properties</code> <code>Object </code> is then queried for the property as documented in the prior step
- * and processed as documented in the prior step.
- * </li>
- * <li>
- * The services resolution mechanism is used, e.g. <code>META-INF/services/java.xml.datatype.DatatypeFactory</code>.
- * Any Exception thrown during the instantiation process is wrapped as a {@link javax.xml.datatype.DatatypeConfigurationException}.
- * </li>
- * <li>
- * The final mechanism is to attempt to instantiate the <code>Class</code> specified by
- * {@link #DATATYPEFACTORY_IMPLEMENTATION_CLASS}, "<code>javax.xml.datatype.DatatypeFactoryImpl</code>".
- * Any Exception thrown during the instantiation process is wrapped as a {@link javax.xml.datatype.DatatypeConfigurationException}.
- * </li>
- * </ol>
- *
- * @author <a href="mailto:Joseph.Fialli@Sun.COM">Joseph Fialli</a>
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
- * @since 1.5
- */
-public abstract class DatatypeFactory {
-
- /**
- * <p>Default property name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p>
- *
- * <p>Default value is <code>javax.xml.datatype.DatatypeFactory</code>.</p>
- */
- public static final String DATATYPEFACTORY_PROPERTY = "javax.xml.datatype.DatatypeFactory";
-
- /**
- * <p>Default implementation class name as defined in JSR 206: Java(TM) API for XML Processing (JAXP) 1.3.</p>
- *
- * <p>Default value is <code>org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl</code>.</p>
- */
- public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS = new String("com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl");
-
- /**
- * <p>Protected constructor to prevent instantiation outside of package.</p>
- *
- * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p>
- */
- protected DatatypeFactory() {}
-
- /**
- * <p>Obtain a new instance of a <code>DatatypeFactory</code>.</p>
- *
- * <p>The implementation resolution mechanisms are <a href="#DatatypeFactory.newInstance">defined</a> in this
- * <code>Class</code>'s documentation.</p>
- *
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @throws javax.xml.datatype.DatatypeConfigurationException If the implementation is not
- * available or cannot be instantiated.
- */
- public static DatatypeFactory newInstance()
- throws DatatypeConfigurationException {
- try {
- return (DatatypeFactory) FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- DATATYPEFACTORY_PROPERTY,
- /* The fallback implementation class name */
- DATATYPEFACTORY_IMPLEMENTATION_CLASS);
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new DatatypeConfigurationException(e.getMessage(), e.getException());
- }
- }
-
- /**
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @throws javax.xml.datatype.DatatypeConfigurationException If the implementation is not
- * available or cannot be instantiated.
- */
- public static DatatypeFactory newInstance(String factoryClassName,
- ClassLoader classLoader) throws DatatypeConfigurationException {
- if (factoryClassName == null) {
- throw new DatatypeConfigurationException("factoryClassName cannot be null.");
- }
- if (classLoader == null) {
- classLoader = SecuritySupport.getContextClassLoader();
- }
- try {
- return (DatatypeFactory) FactoryFinder.newInstance(factoryClassName, classLoader);
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new DatatypeConfigurationException(e.getMessage(), e.getException());
- }
- }
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as its string representation, "PnYnMnDTnHnMnS",
- * as defined in XML Schema 1.0 section 3.2.6.1.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set and available from the created {@link javax.xml.datatype.Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation <code>String</code> representation of a <code>Duration</code>.
- *
- * @return New <code>Duration</code> created from parsing the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If <code>lexicalRepresentation</code> is not a valid representation of a <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException if <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public abstract Duration newDuration(final String lexicalRepresentation);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as milliseconds.</p>
- *
- * <p>XML Schema Part 2: Datatypes, 3.2.6 duration, defines <code>duration</code> as:</p>
- * <blockquote>
- * duration represents a duration of time.
- * The value space of duration is a six-dimensional space where the coordinates designate the
- * Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively.
- * These components are ordered in their significance by their order of appearance i.e. as
- * year, month, day, hour, minute, and second.
- * </blockquote>
- * <p>All six values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link javax.xml.datatype.Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link javax.xml.datatype.XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link java.util.GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link javax.xml.datatype.Duration#getMonths()} and {@link javax.xml.datatype.Duration#getDays()} can be influenced.</p>
- *
- * @param durationInMilliSeconds Duration in milliseconds to create.
- *
- * @return New <code>Duration</code> representing <code>durationInMilliSeconds</code>.
- */
- public abstract Duration newDuration(final long durationInMilliSeconds);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @return New <code>Duration</code> created from the specified values.
- *
- * @throws IllegalArgumentException If values are not a valid representation of a <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public abstract Duration newDuration(
- final boolean isPositive,
- final BigInteger years,
- final BigInteger months,
- final BigInteger days,
- final BigInteger hours,
- final BigInteger minutes,
- final BigDecimal seconds);
-
- /**
- * <p>Obtain a new instance of a <code>Duration</code>
- * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param years of this <code>Duration</code>
- * @param months of this <code>Duration</code>
- * @param days of this <code>Duration</code>
- * @param hours of this <code>Duration</code>
- * @param minutes of this <code>Duration</code>
- * @param seconds of this <code>Duration</code>
- *
- * @return New <code>Duration</code> created from the specified values.
- *
- * @throws IllegalArgumentException If values are not a valid representation of a <code>Duration</code>.
- *
- * @see #newDuration(
- * boolean isPositive,
- * java.math.BigInteger years,
- * java.math.BigInteger months,
- * java.math.BigInteger days,
- * java.math.BigInteger hours,
- * java.math.BigInteger minutes,
- * java.math.BigDecimal seconds)
- */
- public Duration newDuration(
- final boolean isPositive,
- final int years,
- final int months,
- final int days,
- final int hours,
- final int minutes,
- final int seconds) {
-
- // years may not be set
- BigInteger realYears = (years != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) years) : null;
-
- // months may not be set
- BigInteger realMonths = (months != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) months) : null;
-
- // days may not be set
- BigInteger realDays = (days != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) days) : null;
-
- // hours may not be set
- BigInteger realHours = (hours != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) hours) : null;
-
- // minutes may not be set
- BigInteger realMinutes = (minutes != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) minutes) : null;
-
- // seconds may not be set
- BigDecimal realSeconds = (seconds != DatatypeConstants.FIELD_UNDEFINED) ? BigDecimal.valueOf((long) seconds) : null;
-
- return newDuration(
- isPositive,
- realYears,
- realMonths,
- realDays,
- realHours,
- realMinutes,
- realSeconds
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnDTnHnMnS</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set and available from the created {@link javax.xml.datatype.Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If the given string does not conform to the aforementioned specification.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationDayTime(final String lexicalRepresentation) {
- if (lexicalRepresentation == null) {
- throw new NullPointerException("The lexical representation cannot be null.");
- }
- // The lexical representation must match the pattern [^YM]*(T.*)?
- int pos = lexicalRepresentation.indexOf('T');
- int length = (pos >= 0) ? pos : lexicalRepresentation.length();
- for (int i = 0; i < length; ++i) {
- char c = lexicalRepresentation.charAt(i);
- if (c == 'Y' || c == 'M') {
- throw new IllegalArgumentException("Invalid dayTimeDuration value: " + lexicalRepresentation);
- }
- }
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>All four values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link javax.xml.datatype.Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link javax.xml.datatype.XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link java.util.GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link javax.xml.datatype.Duration#getDays()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the day, hour, minute and second are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created with the specified <code>durationInMilliseconds</code>.
- *
- * @see <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>
- */
- public Duration newDurationDayTime(final long durationInMilliseconds) {
- long _durationInMilliseconds = durationInMilliseconds;
- if (_durationInMilliseconds == 0) {
- return newDuration(true, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, 0, 0, 0, 0);
- }
- boolean tooLong = false;
- final boolean isPositive;
- if (_durationInMilliseconds < 0) {
- isPositive = false;
- if (_durationInMilliseconds == Long.MIN_VALUE) {
- _durationInMilliseconds++;
- tooLong = true;
- }
- _durationInMilliseconds *= -1;
- }
- else {
- isPositive = true;
- }
-
- long val = _durationInMilliseconds;
- int milliseconds = (int) (val % 60000L); // 60000 milliseconds per minute
- if (tooLong) {
- ++milliseconds;
- }
- if (milliseconds % 1000 == 0) {
- int seconds = milliseconds / 1000;
- val = val / 60000L;
- int minutes = (int) (val % 60L); // 60 minutes per hour
- val = val / 60L;
- int hours = (int) (val % 24L); // 24 hours per day
- long days = val / 24L;
- if (days <= ((long) Integer.MAX_VALUE)) {
- return newDuration(isPositive, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, (int) days, hours, minutes, seconds);
- }
- else {
- return newDuration(isPositive, null, null,
- BigInteger.valueOf(days), BigInteger.valueOf(hours),
- BigInteger.valueOf(minutes), BigDecimal.valueOf(milliseconds, 3));
- }
- }
-
- BigDecimal seconds = BigDecimal.valueOf(milliseconds, 3);
- val = val / 60000L;
- BigInteger minutes = BigInteger.valueOf(val % 60L); // 60 minutes per hour
- val = val / 60L;
- BigInteger hours = BigInteger.valueOf(val % 24L); // 24 hours per day
- val = val / 24L;
- BigInteger days = BigInteger.valueOf(val);
- return newDuration(isPositive, null, null, days, hours, minutes, seconds);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If any values would create an invalid <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final BigInteger day,
- final BigInteger hour,
- final BigInteger minute,
- final BigInteger second) {
-
- return newDuration(
- isPositive,
- null, // years
- null, // months
- day,
- hour,
- minute,
- (second != null)? new BigDecimal(second):null
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:dayTimeDuration</code> using the specified
- * <code>day</code>, <code>hour</code>, <code>minute</code> and <code>second</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-dayTimeDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:dayTimeDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:dayTimeDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only day, hour, minute, and second components.
- * This datatype resides in the namespace <code>http://www.w3.org/2003/11/xpath-datatypes</code>.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param day Day of <code>Duration</code>.
- * @param hour Hour of <code>Duration</code>.
- * @param minute Minute of <code>Duration</code>.
- * @param second Second of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created with the specified <code>day</code>, <code>hour</code>, <code>minute</code>
- * and <code>second</code>.
- *
- * @throws IllegalArgumentException If any values would create an invalid <code>Duration</code>.
- */
- public Duration newDurationDayTime(
- final boolean isPositive,
- final int day,
- final int hour,
- final int minute,
- final int second) {
- return newDuration(isPositive,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- day, hour, minute, second);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> by parsing its <code>String</code> representation,
- * "<em>PnYnM</em>", <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set and available from the created {@link javax.xml.datatype.Duration}</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * @param lexicalRepresentation Lexical representation of a duration.
- *
- * @return New <code>Duration</code> created using the specified <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> does not conform to the specification.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public Duration newDurationYearMonth(final String lexicalRepresentation) {
- if (lexicalRepresentation == null) {
- throw new NullPointerException("The lexical representation cannot be null.");
- }
- // The lexical representation must match the pattern [^DT]*.
- int length = lexicalRepresentation.length();
- for (int i = 0; i < length; ++i) {
- char c = lexicalRepresentation.charAt(i);
- if (c == 'D' || c == 'T') {
- throw new IllegalArgumentException("Invalid yearMonthDuration value: " + lexicalRepresentation);
- }
- }
- return newDuration(lexicalRepresentation);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified milliseconds as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The datatype <code>xdt:yearMonthDuration</code> is a subtype of <code>xs:duration</code>
- * whose lexical representation contains only year and month components.
- * This datatype resides in the namespace {@link javax.xml.XMLConstants#W3C_XPATH_DATATYPE_NS_URI}.</p>
- *
- * <p>Both values are set by computing their values from the specified milliseconds
- * and are available using the <code>get</code> methods of the created {@link javax.xml.datatype.Duration}.
- * The values conform to and are defined by:</p>
- * <ul>
- * <li>ISO 8601:2000(E) Section 5.5.3.2 Alternative format</li>
- * <li><a href="http://www.w3.org/TR/xmlschema-2/#isoformats">
- * W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats</a>
- * </li>
- * <li>{@link javax.xml.datatype.XMLGregorianCalendar} Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation</li>
- * </ul>
- *
- * <p>The default start instance is defined by {@link java.util.GregorianCalendar}'s use of the start of the epoch: i.e.,
- * {@link java.util.Calendar#YEAR} = 1970,
- * {@link java.util.Calendar#MONTH} = {@link java.util.Calendar#JANUARY},
- * {@link java.util.Calendar#DATE} = 1, etc.
- * This is important as there are variations in the Gregorian Calendar,
- * e.g. leap years have different days in the month = {@link java.util.Calendar#FEBRUARY}
- * so the result of {@link javax.xml.datatype.Duration#getMonths()} can be influenced.</p>
- *
- * <p>Any remaining milliseconds after determining the year and month are discarded.</p>
- *
- * @param durationInMilliseconds Milliseconds of <code>Duration</code> to create.
- *
- * @return New <code>Duration</code> created using the specified <code>durationInMilliseconds</code>.
- */
- public Duration newDurationYearMonth(final long durationInMilliseconds) {
-
- return newDuration(durationInMilliseconds);
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>The XML Schema specification states that values can be of an arbitrary size.
- * Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values.
- * An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limits
- * if implementation capacities are exceeded.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If any values would create an invalid <code>Duration</code>.
- * @throws UnsupportedOperationException If implementation cannot support requested values.
- */
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final BigInteger year,
- final BigInteger month) {
-
- return newDuration(
- isPositive,
- year,
- month,
- null, // days
- null, // hours
- null, // minutes
- null // seconds
- );
- }
-
- /**
- * <p>Create a <code>Duration</code> of type <code>xdt:yearMonthDuration</code> using the specified
- * <code>year</code> and <code>month</code> as defined in
- * <a href="http://www.w3.org/TR/xpath-datamodel#dt-yearMonthyDuration">
- * XQuery 1.0 and XPath 2.0 Data Model, xdt:yearMonthDuration</a>.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param isPositive Set to <code>false</code> to create a negative duration. When the length
- * of the duration is zero, this parameter will be ignored.
- * @param year Year of <code>Duration</code>.
- * @param month Month of <code>Duration</code>.
- *
- * @return New <code>Duration</code> created using the specified <code>year</code> and <code>month</code>.
- *
- * @throws IllegalArgumentException If any values would create an invalid <code>Duration</code>.
- */
- public Duration newDurationYearMonth(
- final boolean isPositive,
- final int year,
- final int month) {
- return newDuration(isPositive, year, month,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED,
- DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED);
- }
-
- /**
- * <p>Create a new instance of an <code>XMLGregorianCalendar</code>.</p>
- *
- * <p>All date/time datatype fields set to {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} or null.</p>
- *
- * @return New <code>XMLGregorianCalendar</code> with all date/time datatype fields set to
- * {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} or null.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar();
-
- /**
- * <p>Create a new XMLGregorianCalendar by parsing the String as a lexical representation.</p>
- *
- * <p>Parsing the lexical string representation is defined in
- * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">XML Schema 1.0 Part 2, Section 3.2.[7-14].1,
- * <em>Lexical Representation</em>.</a></p>
- *
- * <p>The string representation may not have any leading and trailing whitespaces.</p>
- *
- * <p>The parsing is done field by field so that
- * the following holds for any lexically correct String x:</p>
- * <pre>
- * newXMLGregorianCalendar(x).toXMLFormat().equals(x)
- * </pre>
- * <p>Except for the noted lexical/canonical representation mismatches
- * listed in <a href="http://www.w3.org/2001/05/xmlschema-errata#e2-45">
- * XML Schema 1.0 errata, Section 3.2.7.2</a>.</p>
- *
- * @param lexicalRepresentation Lexical representation of one the eight XML Schema date/time datatypes.
- *
- * @return <code>XMLGregorianCalendar</code> created from the <code>lexicalRepresentation</code>.
- *
- * @throws IllegalArgumentException If the <code>lexicalRepresentation</code> is not a valid <code>XMLGregorianCalendar</code>.
- * @throws NullPointerException If <code>lexicalRepresentation</code> is <code>null</code>.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(final String lexicalRepresentation);
-
- /**
- * <p>Create an <code>XMLGregorianCalendar</code> from a {@link java.util.GregorianCalendar}.</p>
- *
- * <table border="2" rules="all" cellpadding="2">
- * <thead>
- * <tr>
- * <th align="center" colspan="2">
- * Field by Field Conversion from
- * {@link java.util.GregorianCalendar} to an {@link javax.xml.datatype.XMLGregorianCalendar}
- * </th>
- * </tr>
- * <tr>
- * <th><code>java.util.GregorianCalendar</code> field</th>
- * <th><code>javax.xml.datatype.XMLGregorianCalendar</code> field</th>
- * </tr>
- * </thead>
- * <tbody>
- * <tr>
- * <td><code>ERA == GregorianCalendar.BC ? -YEAR : YEAR</code></td>
- * <td>{@link javax.xml.datatype.XMLGregorianCalendar#setYear(int year)}</td>
- * </tr>
- * <tr>
- * <td><code>MONTH + 1</code></td>
- * <td>{@link javax.xml.datatype.XMLGregorianCalendar#setMonth(int month)}</td>
- * </tr>
- * <tr>
- * <td><code>DAY_OF_MONTH</code></td>
- * <td>{@link javax.xml.datatype.XMLGregorianCalendar#setDay(int day)}</td>
- * </tr>
- * <tr>
- * <td><code>HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND</code></td>
- * <td>{@link javax.xml.datatype.XMLGregorianCalendar#setTime(int hour, int minute, int second, java.math.BigDecimal fractional)}</td>
- * </tr>
- * <tr>
- * <td>
- * <code>(ZONE_OFFSET + DST_OFFSET) / (60*1000)</code><br/>
- * <em>(in minutes)</em>
- * </td>
- * <td>{@link javax.xml.datatype.XMLGregorianCalendar#setTimezone(int offset)}<sup><em>*</em></sup>
- * </td>
- * </tr>
- * </tbody>
- * </table>
- * <p><em>*</em>conversion loss of information. It is not possible to represent
- * a <code>java.util.GregorianCalendar</code> daylight savings timezone id in the
- * XML Schema 1.0 date/time datatype representation.</p>
- *
- * <p>To compute the return value's <code>TimeZone</code> field,
- * <ul>
- * <li>when <code>this.getTimezone() != FIELD_UNDEFINED</code>,
- * create a <code>java.util.TimeZone</code> with a custom timezone id
- * using the <code>this.getTimezone()</code>.</li>
- * <li>else use the <code>GregorianCalendar</code> default timezone value
- * for the host is defined as specified by
- * <code>java.util.TimeZone.getDefault()</code>.</li></p>
- *
- * @param cal <code>java.util.GregorianCalendar</code> used to create <code>XMLGregorianCalendar</code>
- *
- * @return <code>XMLGregorianCalendar</code> created from <code>java.util.GregorianCalendar</code>
- *
- * @throws NullPointerException If <code>cal</code> is <code>null</code>.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(final GregorianCalendar cal);
-
- /**
- * <p>Constructor allowing for complete value spaces allowed by
- * W3C XML Schema 1.0 recommendation for xsd:dateTime and related
- * builtin datatypes. Note that <code>year</code> parameter supports
- * arbitrarily large numbers and fractionalSecond has infinite
- * precision.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param fractionalSecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- * @return <code>XMLGregorianCalendar</code> created from specified values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- */
- public abstract XMLGregorianCalendar newXMLGregorianCalendar(
- final BigInteger year,
- final int month,
- final int day,
- final int hour,
- final int minute,
- final int second,
- final BigDecimal fractionalSecond,
- final int timezone);
-
- /**
- * <p>Constructor of value spaces that a
- * <code>java.util.GregorianCalendar</code> instance would need to convert to an
- * <code>XMLGregorianCalendar</code> instance.</p>
- *
- * <p><code>XMLGregorianCalendar eon</code> and
- * <code>fractionalSecond</code> are set to <code>null</code></p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param hour of <code>XMLGregorianCalendar</code> to be created.
- * @param minute of <code>XMLGregorianCalendar</code> to be created.
- * @param second of <code>XMLGregorianCalendar</code> to be created.
- * @param millisecond of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone of <code>XMLGregorianCalendar</code> to be created.
- *
- * @return <code>XMLGregorianCalendar</code> created from specified values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendar(
- final int year,
- final int month,
- final int day,
- final int hour,
- final int minute,
- final int second,
- final int millisecond,
- final int timezone) {
-
- // year may be undefined
- BigInteger realYear = (year != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) year) : null;
-
- // millisecond may be undefined
- // millisecond must be >= 0 millisecond <= 1000
- BigDecimal realMillisecond = null; // undefined value
- if (millisecond != DatatypeConstants.FIELD_UNDEFINED) {
- if (millisecond < 0 || millisecond > 1000) {
- throw new IllegalArgumentException(
- "javax.xml.datatype.DatatypeFactory#newXMLGregorianCalendar("
- + "int year, int month, int day, int hour, int minute, int second, int millisecond, int timezone)"
- + "with invalid millisecond: " + millisecond
- );
- }
- realMillisecond = BigDecimal.valueOf((long) millisecond, 3);
- }
-
- return newXMLGregorianCalendar(
- realYear,
- month,
- day,
- hour,
- minute,
- second,
- realMillisecond,
- timezone
- );
- }
-
- /**
- * <p>Create a Java representation of XML Schema builtin datatype <code>date</code> or <code>g*</code>.</p>
- *
- * <p>For example, an instance of <code>gYear</code> can be created invoking this factory
- * with <code>month</code> and <code>day</code> parameters set to
- * {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED}.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param year of <code>XMLGregorianCalendar</code> to be created.
- * @param month of <code>XMLGregorianCalendar</code> to be created.
- * @param day of <code>XMLGregorianCalendar</code> to be created.
- * @param timezone offset in minutes. {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarDate(
- final int year,
- final int month,
- final int day,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- year,
- month,
- day,
- DatatypeConstants.FIELD_UNDEFINED, // hour
- DatatypeConstants.FIELD_UNDEFINED, // minute
- DatatypeConstants.FIELD_UNDEFINED, // second
- DatatypeConstants.FIELD_UNDEFINED, // millisecond
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype <code>time</code>.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param timezone offset in minutes. {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- *
- * @see javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- DatatypeConstants.FIELD_UNDEFINED, // Year
- DatatypeConstants.FIELD_UNDEFINED, // Month
- DatatypeConstants.FIELD_UNDEFINED, // Day
- hours,
- minutes,
- seconds,
- DatatypeConstants.FIELD_UNDEFINED, //Millisecond
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * <p>A <code>null</code> value indicates that field is not set.</p>
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param fractionalSecond value of <code>null</code> indicates that this optional field is not set.
- * @param timezone offset in minutes. {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final BigDecimal fractionalSecond,
- final int timezone) {
-
- return newXMLGregorianCalendar(
- null, // year
- DatatypeConstants.FIELD_UNDEFINED, // month
- DatatypeConstants.FIELD_UNDEFINED, // day
- hours,
- minutes,
- seconds,
- fractionalSecond,
- timezone);
- }
-
- /**
- * <p>Create a Java instance of XML Schema builtin datatype time.</p>
- *
- * <p>A {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} value indicates that field is not set.</p>
- *
- * @param hours number of hours
- * @param minutes number of minutes
- * @param seconds number of seconds
- * @param milliseconds number of milliseconds
- * @param timezone offset in minutes. {@link javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED} indicates optional field is not set.
- *
- * @return <code>XMLGregorianCalendar</code> created from parameter values.
- *
- * @see javax.xml.datatype.DatatypeConstants#FIELD_UNDEFINED
- *
- * @throws IllegalArgumentException If any individual parameter's value is outside the maximum value constraint for the field
- * as determined by the Date/Time Data Mapping table in {@link javax.xml.datatype.XMLGregorianCalendar}
- * or if the composite values constitute an invalid <code>XMLGregorianCalendar</code> instance
- * as determined by {@link javax.xml.datatype.XMLGregorianCalendar#isValid()}.
- */
- public XMLGregorianCalendar newXMLGregorianCalendarTime(
- final int hours,
- final int minutes,
- final int seconds,
- final int milliseconds,
- final int timezone) {
-
- // millisecond may be undefined
- // millisecond must be >= 0 millisecond <= 1000
- BigDecimal realMilliseconds = null; // undefined value
- if (milliseconds != DatatypeConstants.FIELD_UNDEFINED) {
- if (milliseconds < 0 || milliseconds > 1000) {
- throw new IllegalArgumentException(
- "javax.xml.datatype.DatatypeFactory#newXMLGregorianCalendarTime("
- + "int hours, int minutes, int seconds, int milliseconds, int timezone)"
- + "with invalid milliseconds: " + milliseconds
- );
- }
- realMilliseconds = BigDecimal.valueOf((long) milliseconds, 3);
- }
-
- return newXMLGregorianCalendarTime(
- hours,
- minutes,
- seconds,
- realMilliseconds,
- timezone
- );
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/FactoryFinder.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/FactoryFinder.java
deleted file mode 100644
index 9bdc4e4..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/FactoryFinder.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.datatype;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
-
-/**
- * <p>Implement pluggabile Datatypes.</p>
- *
- * <p>This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private for secure class loading.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class FactoryFinder {
-
- /**
- * <p>Name of class to display in output messages.</p>
- */
- private static final String CLASS_NAME = "javax.xml.datatype.FactoryFinder";
-
- /**
- * <p>Debug flag to trace loading process.</p>
- */
- private static boolean debug = false;
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * <p>Check to see if debugging enabled by property.</p>
- *
- * <p>Use try/catch block to support applets, which throws
- * SecurityException out of this code.</p>
- *
- */
- static {
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception x) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- /**
- * <p>Output debugging messages.</p>
- *
- * @param msg <code>String</code> to print to <code>stderr</code>.
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println(
- CLASS_NAME
- + ":"
- + msg);
- }
- }
-
- /**
- * <p>Find the appropriate <code>ClassLoader</code> to use.</p>
- *
- * <p>The context ClassLoader is prefered.</p>
- *
- * @return <code>ClassLoader</code> to use.
- *
- * @throws ConfigurationError If a valid <code>ClassLoader</code> cannot be identified.
- */
- private static ClassLoader findClassLoader()
- throws ConfigurationError {
- ClassLoader classLoader;
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- classLoader = SecuritySupport.getContextClassLoader();
-
- if (debug) debugPrintln(
- "Using context class loader: "
- + classLoader);
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- if (debug) debugPrintln(
- "Using the class loader of FactoryFinder: "
- + classLoader);
- }
-
- return classLoader;
- }
-
- /**
- * <p>Create an instance of a class using the specified ClassLoader.</p>
- *
- * @param className Name of class to create.
- * @param classLoader ClassLoader to use to create named class.
- *
- * @return New instance of specified class created using the specified ClassLoader.
- *
- * @throws ConfigurationError If class could not be created.
- */
- static Object newInstance(
- String className,
- ClassLoader classLoader)
- throws ConfigurationError {
-
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
-
- if (debug) {
- debugPrintln("Loaded " + className + " from " + which(spiClass));
- }
-
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * Package private so this code can be shared.
- *
- * @param factoryId Name of the factory to find, same as a property name
- * @param fallbackClassName Implementation class name, if nothing else is found. Use null to mean no fallback.
- *
- * @return Class Object of factory, never null
- *
- * @throws ConfigurationError If Class cannot be found.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError {
-
- ClassLoader classLoader = findClassLoader();
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (debug) debugPrintln("found " + systemProp + " in the system property " + factoryId);
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- ; // NOP, explicitly ignore SecurityException
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator + "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if (firstTime) {
- synchronized (cacheProps) {
- if (firstTime) {
- File f = new File(configFile);
- firstTime = false;
- if (SecuritySupport.doesFileExist(f)) {
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) debugPrintln("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) debugPrintln("found in resource, value="
- + factoryClassName);
-
- return newInstance(factoryClassName, cl);
- }
-
- // No provider found
- return null;
- }
-
- /**
- * <p>Configuration Error.</p>
- */
- static class ConfigurationError extends Error {
-
- private static final long serialVersionUID = -3644413026244211347L;
-
- /**
- * <p>Exception that caused the error.</p>
- */
- private Exception exception;
-
- /**
- * <p>Construct a new instance with the specified detail string and
- * exception.</p>
- *
- * @param msg Detail message for this error.
- * @param x Exception that caused the error.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- /**
- * <p>Get the Exception that caused the error.</p>
- *
- * @return Exception that caused the error.
- */
- Exception getException() {
- return exception;
- }
- }
-
-
-
- /**
- * Returns the location where the given Class is loaded from.
- *
- * @param clazz Class to find load location.
- *
- * @return Location where class would be loaded from.
- */
- private static String which(Class clazz) {
- try {
- String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
-
- ClassLoader loader = clazz.getClassLoader();
-
- URL it;
-
- if (loader != null) {
- it = loader.getResource(classnameAsResource);
- } else {
- it = ClassLoader.getSystemResource(classnameAsResource);
- }
-
- if (it != null) {
- return it.toString();
- }
- } catch (Throwable t) {
- // work defensively.
- if (debug) {
- t.printStackTrace();
- }
- }
- return "unknown location";
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/SecuritySupport.java
deleted file mode 100644
index da82748..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/datatype/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.datatype;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/DocumentBuilderFactory.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/DocumentBuilderFactory.java
deleted file mode 100644
index 6293ad8..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/DocumentBuilderFactory.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: DocumentBuilderFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
-
-package javax.xml.parsers;
-
-import javax.xml.validation.Schema;
-
-/**
- * Defines a factory API that enables applications to obtain a
- * parser that produces DOM object trees from XML documents.
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
- */
-
-public abstract class DocumentBuilderFactory {
-
- private boolean validating = false;
- private boolean namespaceAware = false;
- private boolean whitespace = false;
- private boolean expandEntityRef = true;
- private boolean ignoreComments = false;
- private boolean coalescing = false;
-
- protected DocumentBuilderFactory () {
- }
-
- /**
- * Obtain a new instance of a
- * <code>DocumentBuilderFactory</code>. This static method creates
- * a new factory instance.
- * This method uses the following ordered lookup procedure to determine
- * the <code>DocumentBuilderFactory</code> implementation class to
- * load:
- * <ul>
- * <li>
- * Use the <code>javax.xml.parsers.DocumentBuilderFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Use the Services API (as detailed in the JAR specification), if
- * available, to determine the classname. The Services API will look
- * for a classname in the file
- * <code>META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code>
- * in jars available to the runtime.
- * </li>
- * <li>
- * Platform default <code>DocumentBuilderFactory</code> instance.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a
- * <code>DocumentBuilderFactory</code> it can use the factory to
- * configure and obtain parser instances.
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <tt>System.err</tt> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems loading {@link DocumentBuilder}s, try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @exception FactoryConfigurationError if the implementation is not
- * available or cannot be instantiated.
- */
- public static DocumentBuilderFactory newInstance() {
- try {
- return (DocumentBuilderFactory) FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- "javax.xml.parsers.DocumentBuilderFactory",
- /* The fallback implementation class name */
- "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * @return New instance of a <code>DocumentBuilderFactory</code>
- *
- * @exception FactoryConfigurationError if the implementation is not
- * available or cannot be instantiated.
- */
- public static DocumentBuilderFactory newInstance(String factoryClassName,
- ClassLoader classLoader) {
- if (factoryClassName == null) {
- throw new FactoryConfigurationError("factoryClassName cannot be null.");
- }
- if (classLoader == null) {
- classLoader = SecuritySupport.getContextClassLoader();
- }
- try {
- return (DocumentBuilderFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
- * using the currently configured parameters.
- *
- * @exception ParserConfigurationException if a DocumentBuilder
- * cannot be created which satisfies the configuration requested.
- * @return A new instance of a DocumentBuilder.
- */
-
- public abstract DocumentBuilder newDocumentBuilder()
- throws ParserConfigurationException;
-
-
- /**
- * Specifies that the parser produced by this code will
- * provide support for XML namespaces. By default the value of this is set
- * to <code>false</code>
- *
- * @param awareness true if the parser produced will provide support
- * for XML namespaces; false otherwise.
- */
-
- public void setNamespaceAware(boolean awareness) {
- this.namespaceAware = awareness;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * validate documents as they are parsed. By default the value of this
- * is set to <code>false</code>.
- *
- * <p>
- * Note that "the validation" here means
- * <a href="http://www.w3.org/TR/REC-xml#proc-types">a validating
- * parser</a> as defined in the XML recommendation.
- * In other words, it essentially just controls the DTD validation.
- * (except the legacy two properties defined in JAXP 1.2.
- * See <a href="#validationCompatibility">here</a> for more details.)
- * </p>
- *
- * <p>
- * To use modern schema languages such as W3C XML Schema or
- * RELAX NG instead of DTD, you can configure your parser to be
- * a non-validating parser by leaving the {@link #setValidating(boolean)}
- * method <tt>false</tt>, then use the {@link #setSchema(Schema)}
- * method to associate a schema to a parser.
- * </p>
- *
- * @param validating true if the parser produced will validate documents
- * as they are parsed; false otherwise.
- */
-
- public void setValidating(boolean validating) {
- this.validating = validating;
- }
-
- /**
- * Specifies that the parsers created by this factory must eliminate
- * whitespace in element content (sometimes known loosely as
- * 'ignorable whitespace') when parsing XML documents (see XML Rec
- * 2.10). Note that only whitespace which is directly contained within
- * element content that has an element only content model (see XML
- * Rec 3.2.1) will be eliminated. Due to reliance on the content model
- * this setting requires the parser to be in validating mode. By default
- * the value of this is set to <code>false</code>.
- *
- * @param whitespace true if the parser created must eliminate whitespace
- * in the element content when parsing XML documents;
- * false otherwise.
- */
-
- public void setIgnoringElementContentWhitespace(boolean whitespace) {
- this.whitespace = whitespace;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * expand entity reference nodes. By default the value of this is set to
- * <code>true</code>
- *
- * @param expandEntityRef true if the parser produced will expand entity
- * reference nodes; false otherwise.
- */
-
- public void setExpandEntityReferences(boolean expandEntityRef) {
- this.expandEntityRef = expandEntityRef;
- }
-
- /**
- * <p>Specifies that the parser produced by this code will
- * ignore comments. By default the value of this is set to <code>false
- * </code>.</p>
- *
- * @param ignoreComments <code>boolean</code> value to ignore comments during processing
- */
-
- public void setIgnoringComments(boolean ignoreComments) {
- this.ignoreComments = ignoreComments;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * convert CDATA nodes to Text nodes and append it to the
- * adjacent (if any) text node. By default the value of this is set to
- * <code>false</code>
- *
- * @param coalescing true if the parser produced will convert CDATA nodes
- * to Text nodes and append it to the adjacent (if any)
- * text node; false otherwise.
- */
-
- public void setCoalescing(boolean coalescing) {
- this.coalescing = coalescing;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which are namespace aware.
- *
- * @return true if the factory is configured to produce parsers which
- * are namespace aware; false otherwise.
- */
-
- public boolean isNamespaceAware() {
- return namespaceAware;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which validate the XML content during parse.
- *
- * @return true if the factory is configured to produce parsers
- * which validate the XML content during parse; false otherwise.
- */
-
- public boolean isValidating() {
- return validating;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which ignore ignorable whitespace in element content.
- *
- * @return true if the factory is configured to produce parsers
- * which ignore ignorable whitespace in element content;
- * false otherwise.
- */
-
- public boolean isIgnoringElementContentWhitespace() {
- return whitespace;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which expand entity reference nodes.
- *
- * @return true if the factory is configured to produce parsers
- * which expand entity reference nodes; false otherwise.
- */
-
- public boolean isExpandEntityReferences() {
- return expandEntityRef;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which ignores comments.
- *
- * @return true if the factory is configured to produce parsers
- * which ignores comments; false otherwise.
- */
-
- public boolean isIgnoringComments() {
- return ignoreComments;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which converts CDATA nodes to Text nodes and appends it to
- * the adjacent (if any) Text node.
- *
- * @return true if the factory is configured to produce parsers
- * which converts CDATA nodes to Text nodes and appends it to
- * the adjacent (if any) Text node; false otherwise.
- */
-
- public boolean isCoalescing() {
- return coalescing;
- }
-
- /**
- * Allows the user to set specific attributes on the underlying
- * implementation.
- * @param name The name of the attribute.
- * @param value The value of the attribute.
- * @exception IllegalArgumentException thrown if the underlying
- * implementation doesn't recognize the attribute.
- */
- public abstract void setAttribute(String name, Object value)
- throws IllegalArgumentException;
-
- /**
- * Allows the user to retrieve specific attributes on the underlying
- * implementation.
- * @param name The name of the attribute.
- * @return value The value of the attribute.
- * @exception IllegalArgumentException thrown if the underlying
- * implementation doesn't recognize the attribute.
- */
- public abstract Object getAttribute(String name)
- throws IllegalArgumentException;
-
- /**
- * <p>Set a feature for this <code>DocumentBuilderFactory</code> and <code>DocumentBuilder</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
- * <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for an <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>
- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link DocumentBuilder#setErrorHandler(org.xml.sax.ErrorHandler errorHandler)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code> or the <code>DocumentBuilder</code>s
- * it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract void setFeature(String name, boolean value)
- throws ParserConfigurationException;
-
- /**
- * <p>Get the state of the named feature.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link ParserConfigurationException} is thrown if this <code>DocumentBuilderFactory</code> or the
- * <code>DocumentBuilder</code>s it creates cannot support the feature.
- * It is possible for an <code>DocumentBuilderFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return State of the named feature.
- *
- * @throws ParserConfigurationException if this <code>DocumentBuilderFactory</code>
- * or the <code>DocumentBuilder</code>s it creates cannot support this feature.
- */
- public abstract boolean getFeature(String name)
- throws ParserConfigurationException;
-
- /**
- * Gets the {@link Schema} object specified through
- * the {@link #setSchema(Schema schema)} method.
- *
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @return
- * the {@link Schema} object that was last set through
- * the {@link #setSchema(Schema)} method, or null
- * if the method was not invoked since a {@link DocumentBuilderFactory}
- * is created.
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
-
- }
-
- /**
- * <p>Set the {@link Schema} to be used by parsers created
- * from this factory.
- *
- * <p>
- * When a {@link Schema} is non-null, a parser will use a validator
- * created from it to validate documents before it passes information
- * down to the application.
- *
- * <p>When errors are found by the validator, the parser is responsible
- * to report them to the user-specified {@link org.xml.sax.ErrorHandler}
- * (or if the error handler is not set, ignore them or throw them), just
- * like any other errors found by the parser itself.
- * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
- * is set, it must receive those errors, and if not, they must be
- * treated according to the implementation specific
- * default error handling rules.
- *
- * <p>
- * A validator may modify the outcome of a parse (for example by
- * adding default values that were missing in documents), and a parser
- * is responsible to make sure that the application will receive
- * modified DOM trees.
- *
- * <p>
- * Initially, null is set as the {@link Schema}.
- *
- * <p>
- * This processing will take effect even if
- * the {@link #isValidating()} method returns <tt>false</tt>.
- *
- * <p>It is an error to use
- * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
- * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
- * property in conjunction with a {@link Schema} object.
- * Such configuration will cause a {@link ParserConfigurationException}
- * exception when the {@link #newDocumentBuilder()} is invoked.</p>
- *
- *
- * <h4>Note for implementors</h4>
- * <p>
- * A parser must be able to work with any {@link Schema}
- * implementation. However, parsers and schemas are allowed
- * to use implementation-specific custom mechanisms
- * as long as they yield the result described in the specification.
- *
- * @param schema <code>Schema</code> to use or <code>null</code> to remove a schema.
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Set state of XInclude processing.</p>
- *
- * <p>If XInclude markup is found in the document instance, should it be
- * processed as specified in <a href="http://www.w3.org/TR/xinclude/">
- * XML Inclusions (XInclude) Version 1.0</a>.</p>
- *
- * <p>XInclude processing defaults to <code>false</code>.</p>
- *
- * @param state Set XInclude processing to <code>true</code> or
- * <code>false</code>
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public void setXIncludeAware(final boolean state) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Get state of XInclude processing.</p>
- *
- * @return current state of XInclude processing
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/FactoryFinder.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/FactoryFinder.java
deleted file mode 100644
index b74d48d..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/FactoryFinder.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.parsers;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private.
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and later including
- * JVMs that perform early linking like the Microsoft JVM in IE 5. Note
- * however that it must be compiled on a JDK version 1.2 or later system
- * since it calls Thread#getContextClassLoader(). The code also runs both
- * as part of an unbundled jar file and when bundled as part of the JDK.
- */
-final class FactoryFinder {
-
- /** Temp debug code - this will be removed after we test everything
- */
- private static boolean debug = false;
- static Properties cacheProps= new Properties();
- static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (SecurityException se) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader and
- * optionally fall back to the current ClassLoader if not found.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param doFallback true if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
-
- try {
- Class providerClass;
- if (cl == null) {
- // If classloader is null Use the bootstrap ClassLoader.
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- cl = FactoryFinder.class.getClassLoader();
- if (cl != null) {
- providerClass = cl.loadClass(className);
- }
- else {
- providerClass = Class.forName(className);
- }
- } else {
- throw x;
- }
- }
- }
-
- Object instance = providerClass.newInstance();
- if (debug) dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError
- {
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- ClassLoader classLoader = SecuritySupport.getContextClassLoader();
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- }
-
- if (debug) dPrint("find factoryId =" + factoryId);
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if( systemProp!=null) {
- if (debug) dPrint("found system property, value=" + systemProp);
- return newInstance(systemProp, classLoader, true );
- }
- } catch (SecurityException se) {
- //if first option fails due to any reason we should try next option in the
- //look up algorithm.
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) dPrint("Read properties file "+f);
- //cacheProps.load( new FileInputStream(f));
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
-
- if(factoryClassName != null){
- if (debug) dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(factoryClassName, classLoader, true);
- }
- } catch(Exception ex ) {
- if( debug ) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader, true);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) dPrint("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) dPrint("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- static class ConfigurationError extends Error {
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SAXParserFactory.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SAXParserFactory.java
deleted file mode 100644
index e088a70..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SAXParserFactory.java
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SAXParserFactory.java 884950 2009-11-27 18:46:18Z mrglavas $
-
-package javax.xml.parsers;
-
-import javax.xml.validation.Schema;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-
-/**
- * Defines a factory API that enables applications to configure and
- * obtain a SAX based parser to parse XML documents.
- *
- * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
- * @version $Revision: 884950 $, $Date: 2009-11-27 13:46:18 -0500 (Fri, 27 Nov 2009) $
- */
-public abstract class SAXParserFactory {
-
- /**
- * <p>Should Parsers be validating?</p>
- */
- private boolean validating = false;
-
- /**
- * <p>Should Parsers be namespace aware?</p>
- */
- private boolean namespaceAware = false;
-
- /**
- * <p>Protected constructor to force use of {@link #newInstance()}.</p>
- */
- protected SAXParserFactory () {
-
- }
-
- /**
- * Obtain a new instance of a <code>SAXParserFactory</code>. This
- * static method creates a new factory instance
- * This method uses the following ordered lookup procedure to determine
- * the <code>SAXParserFactory</code> implementation class to
- * load:
- * <ul>
- * <li>
- * Use the <code>javax.xml.parsers.SAXParserFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Use the Services API (as detailed in the JAR specification), if
- * available, to determine the classname. The Services API will look
- * for a classname in the file
- * <code>META-INF/services/javax.xml.parsers.SAXParserFactory</code>
- * in jars available to the runtime.
- * </li>
- * <li>
- * Platform default <code>SAXParserFactory</code> instance.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a
- * <code>SAXParserFactory</code> it can use the factory to
- * configure and obtain parser instances.
- *
- *
- *
- * <h2>Tip for Trouble-shooting</h2>
- * <p>Setting the <code>jaxp.debug</code> system property will cause
- * this method to print a lot of debug messages
- * to <tt>System.err</tt> about what it is doing and where it is looking at.</p>
- *
- * <p> If you have problems loading {@link SAXParser}s, try:</p>
- * <pre>
- * java -Djaxp.debug=1 YourProgram ....
- * </pre>
- *
- *
- * @return A new instance of a SAXParserFactory.
- *
- * @exception FactoryConfigurationError if the implementation is
- * not available or cannot be instantiated.
- */
-
- public static SAXParserFactory newInstance() {
- try {
- return (SAXParserFactory) FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- "javax.xml.parsers.SAXParserFactory",
- /* The fallback implementation class name */
- "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * @return A new instance of a SAXParserFactory.
- *
- * @exception FactoryConfigurationError if the implementation is
- * not available or cannot be instantiated.
- */
- public static SAXParserFactory newInstance(String factoryClassName,
- ClassLoader classLoader) {
- if (factoryClassName == null) {
- throw new FactoryConfigurationError("factoryClassName cannot be null.");
- }
- if (classLoader == null) {
- classLoader = SecuritySupport.getContextClassLoader();
- }
- try {
- return (SAXParserFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * <p>Creates a new instance of a SAXParser using the currently
- * configured factory parameters.</p>
- *
- * @return A new instance of a SAXParser.
- *
- * @exception ParserConfigurationException if a parser cannot
- * be created which satisfies the requested configuration.
- * @exception SAXException for SAX errors.
- */
-
- public abstract SAXParser newSAXParser()
- throws ParserConfigurationException, SAXException;
-
-
- /**
- * Specifies that the parser produced by this code will
- * provide support for XML namespaces. By default the value of this is set
- * to <code>false</code>.
- *
- * @param awareness true if the parser produced by this code will
- * provide support for XML namespaces; false otherwise.
- */
-
- public void setNamespaceAware(boolean awareness) {
- this.namespaceAware = awareness;
- }
-
- /**
- * Specifies that the parser produced by this code will
- * validate documents as they are parsed. By default the value of this is
- * set to <code>false</code>.
- *
- * <p>
- * Note that "the validation" here means
- * <a href="http://www.w3.org/TR/REC-xml#proc-types">a validating
- * parser</a> as defined in the XML recommendation.
- * In other words, it essentially just controls the DTD validation.
- * (except the legacy two properties defined in JAXP 1.2.
- * See <a href="#validationCompatibility">here</a> for more details.)
- * </p>
- *
- * <p>
- * To use modern schema languages such as W3C XML Schema or
- * RELAX NG instead of DTD, you can configure your parser to be
- * a non-validating parser by leaving the {@link #setValidating(boolean)}
- * method <tt>false</tt>, then use the {@link #setSchema(Schema)}
- * method to associate a schema to a parser.
- * </p>
- *
- * @param validating true if the parser produced by this code will
- * validate documents as they are parsed; false otherwise.
- */
-
- public void setValidating(boolean validating) {
- this.validating = validating;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which are namespace aware.
- *
- * @return true if the factory is configured to produce
- * parsers which are namespace aware; false otherwise.
- */
-
- public boolean isNamespaceAware() {
- return namespaceAware;
- }
-
- /**
- * Indicates whether or not the factory is configured to produce
- * parsers which validate the XML content during parse.
- *
- * @return true if the factory is configured to produce parsers which validate
- * the XML content during parse; false otherwise.
- */
-
- public boolean isValidating() {
- return validating;
- }
-
- /**
- *
- * <p>Sets the particular feature in the underlying implementation of
- * org.xml.sax.XMLReader.
- * A list of the core features and properties can be found at
- * <a href="http://www.saxproject.org/">http://www.saxproject.org/</a></p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
- * Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link SAXParser} <code>parse</code> methods for handler specification.
- * </li>
- * <li>
- * When the feature is <code>false</code>, the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name The name of the feature to be set.
- * @param value The value of the feature to be set.
- *
- * @exception ParserConfigurationException if a parser cannot
- * be created which satisfies the requested configuration.
- * @exception SAXNotRecognizedException When the underlying XMLReader does
- * not recognize the property name.
- * @exception SAXNotSupportedException When the underlying XMLReader
- * recognizes the property name but doesn't support the
- * property.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- *
- * @see org.xml.sax.XMLReader#setFeature
- */
- public abstract void setFeature(String name, boolean value)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
- /**
- *
- * <p>Returns the particular property requested for in the underlying
- * implementation of org.xml.sax.XMLReader.</p>
- *
- * @param name The name of the property to be retrieved.
- *
- * @return Value of the requested property.
- *
- * @exception ParserConfigurationException if a parser cannot be created which satisfies the requested configuration.
- * @exception SAXNotRecognizedException When the underlying XMLReader does not recognize the property name.
- * @exception SAXNotSupportedException When the underlying XMLReader recognizes the property name but doesn't support the property.
- *
- * @see org.xml.sax.XMLReader#getProperty
- */
- public abstract boolean getFeature(String name)
- throws ParserConfigurationException, SAXNotRecognizedException,
- SAXNotSupportedException;
-
- /**
- * Gets the {@link Schema} object specified through
- * the {@link #setSchema(Schema schema)} method.
- *
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @return
- * the {@link Schema} object that was last set through
- * the {@link #setSchema(Schema)} method, or null
- * if the method was not invoked since a {@link SAXParserFactory}
- * is created.
- *
- * @since 1.5
- */
- public Schema getSchema() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Set the {@link Schema} to be used by parsers created
- * from this factory.</p>
- *
- * <p>When a {@link Schema} is non-null, a parser will use a validator
- * created from it to validate documents before it passes information
- * down to the application.</p>
- *
- * <p>When warnings/errors/fatal errors are found by the validator, the parser must
- * handle them as if those errors were found by the parser itself.
- * In other words, if the user-specified {@link org.xml.sax.ErrorHandler}
- * is set, it must receive those errors, and if not, they must be
- * treated according to the implementation specific
- * default error handling rules.
- *
- * <p>A validator may modify the SAX event stream (for example by
- * adding default values that were missing in documents), and a parser
- * is responsible to make sure that the application will receive
- * those modified event stream.</p>
- *
- * <p>Initially, <code>null</code> is set as the {@link Schema}.</p>
- *
- * <p>This processing will take effect even if
- * the {@link #isValidating()} method returns <code>false</code>.
- *
- * <p>It is an error to use
- * the <code>http://java.sun.com/xml/jaxp/properties/schemaSource</code>
- * property and/or the <code>http://java.sun.com/xml/jaxp/properties/schemaLanguage</code>
- * property in conjunction with a non-null {@link Schema} object.
- * Such configuration will cause a {@link SAXException}
- * exception when those properties are set on a {@link SAXParser}.</p>
- *
- * <h4>Note for implementors</h4>
- * <p>
- * A parser must be able to work with any {@link Schema}
- * implementation. However, parsers and schemas are allowed
- * to use implementation-specific custom mechanisms
- * as long as they yield the result described in the specification.
- * </p>
- *
- * @param schema <code>Schema</code> to use, <code>null</code> to remove a schema.
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public void setSchema(Schema schema) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Set state of XInclude processing.</p>
- *
- * <p>If XInclude markup is found in the document instance, should it be
- * processed as specified in <a href="http://www.w3.org/TR/xinclude/">
- * XML Inclusions (XInclude) Version 1.0</a>.</p>
- *
- * <p>XInclude processing defaults to <code>false</code>.</p>
- *
- * @param state Set XInclude processing to <code>true</code> or
- * <code>false</code>
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public void setXIncludeAware(final boolean state) {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-
- /**
- * <p>Get state of XInclude processing.</p>
- *
- * @return current state of XInclude processing
- *
- * @throws UnsupportedOperationException
- * For backward compatibility, when implementations for
- * earlier versions of JAXP is used, this exception will be
- * thrown.
- *
- * @since 1.5
- */
- public boolean isXIncludeAware() {
- throw new UnsupportedOperationException(
- "This parser does not support specification \""
- + this.getClass().getPackage().getSpecificationTitle()
- + "\" version \""
- + this.getClass().getPackage().getSpecificationVersion()
- + "\""
- );
- }
-}
-
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SecuritySupport.java
deleted file mode 100644
index ca5dc14..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/parsers/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java,v 1.2.24.1 2005/03/29 23:25:08 jsuttor Exp $
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/FactoryFinder.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/FactoryFinder.java
deleted file mode 100644
index dd938e0..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/FactoryFinder.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: FactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.transform;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in
- * sync. It is package private.
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and later including
- * JVMs that perform early linking like the Microsoft JVM in IE 5. Note
- * however that it must be compiled on a JDK version 1.2 or later system
- * since it calls Thread#getContextClassLoader(). The code also runs both
- * as part of an unbundled jar file and when bundled as part of the JDK.
- */
-final class FactoryFinder {
-
- /** Temp debug code - this will be removed after we test everything
- */
- private static boolean debug = false;
- static Properties cacheProps= new Properties();
- static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- // Define system property "jaxp.debug" to get output
- static {
- // Use try/catch block to support applets, which throws
- // SecurityException out of this code.
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (SecurityException se) {
- debug = false;
- }
- }
-
- private FactoryFinder() {}
-
- private static void dPrint(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * Create an instance of a class using the specified ClassLoader and
- * optionally fall back to the current ClassLoader if not found.
- *
- * @param className Name of the concrete class corresponding to the
- * service provider
- *
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
- *
- * @param doFallback true if the current ClassLoader should be tried as
- * a fallback if the class is not found using cl
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
-
- try {
- Class providerClass;
- if (cl == null) {
- // If classloader is null Use the bootstrap ClassLoader.
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- cl = FactoryFinder.class.getClassLoader();
- if (cl != null) {
- providerClass = cl.loadClass(className);
- }
- else {
- providerClass = Class.forName(className);
- }
- } else {
- throw x;
- }
- }
- }
-
- Object instance = providerClass.newInstance();
- if (debug) dPrint("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError
- {
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
-
- ClassLoader classLoader = SecuritySupport.getContextClassLoader();
-
- if (classLoader == null) {
- // if we have no Context ClassLoader
- // so use the current ClassLoader
- classLoader = FactoryFinder.class.getClassLoader();
- }
-
- if (debug) dPrint("find factoryId =" + factoryId);
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp = SecuritySupport.getSystemProperty(factoryId);
- if( systemProp!=null) {
- if (debug) dPrint("found system property, value=" + systemProp);
- return newInstance(systemProp, classLoader, true );
- }
- } catch (SecurityException se) {
- //if first option fails due to any reason we should try next option in the
- //look up algorithm.
- }
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = SecuritySupport.getSystemProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- String factoryClassName = null;
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) dPrint("Read properties file "+f);
- //cacheProps.load( new FileInputStream(f));
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(factoryId);
-
- if(factoryClassName != null){
- if (debug) dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(factoryClassName, classLoader, true);
- }
- } catch(Exception ex ) {
- if( debug ) ex.printStackTrace();
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (debug) dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, classLoader, true);
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
-
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
- } else {
- // No Context ClassLoader, try the current
- // ClassLoader
- cl = FactoryFinder.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, serviceId);
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (debug) dPrint("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- }
- catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (debug) dPrint("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- static class ConfigurationError extends Error {
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/SecuritySupport.java
deleted file mode 100644
index 570dc5e..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: SecuritySupport.java,v 1.2.24.1 2005/03/29 23:32:22 jsuttor Exp $
-
-package javax.xml.transform;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/TransformerFactory.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/TransformerFactory.java
deleted file mode 100644
index a086d6e..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/transform/TransformerFactory.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * 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.
- */
-
-// $Id: TransformerFactory.java 884963 2009-11-27 19:11:59Z mrglavas $
-
-package javax.xml.transform;
-
-/**
- * <p>A TransformerFactory instance can be used to create
- * {@link javax.xml.transform.Transformer} and
- * {@link javax.xml.transform.Templates} objects.</p>
- *
- * <p>The system property that determines which Factory implementation
- * to create is named <code>"javax.xml.transform.TransformerFactory"</code>.
- * This property names a concrete subclass of the
- * <code>TransformerFactory</code> abstract class. If the property is not
- * defined, a platform default is be used.</p>
- *
- * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
- */
-public abstract class TransformerFactory {
-
- /**
- * Default constructor is protected on purpose.
- */
- protected TransformerFactory() { }
-
-
- /**
- * <p>Get current state of canonicalization.</p>
- *
- * @return current state canonicalization control
- */
- /*
- public boolean getCanonicalization() {
- return canonicalState;
- }
- */
-
- /**
- * <p>Set canonicalization control to <code>true</code> or
- * </code>false</code>.</p>
- *
- * @param state of canonicalization
- */
- /*
- public void setCanonicalization(boolean state) {
- canonicalState = state;
- }
- */
-
- /**
- * Obtain a new instance of a <code>TransformerFactory</code>.
- * This static method creates a new factory instance
- * This method uses the following ordered lookup procedure to determine
- * the <code>TransformerFactory</code> implementation class to
- * load:
- * <ul>
- * <li>
- * Use the <code>javax.xml.transform.TransformerFactory</code> system
- * property.
- * </li>
- * <li>
- * Use the properties file "lib/jaxp.properties" in the JRE directory.
- * This configuration file is in standard <code>java.util.Properties
- * </code> format and contains the fully qualified name of the
- * implementation class with the key being the system property defined
- * above.
- *
- * The jaxp.properties file is read only once by the JAXP implementation
- * and it's values are then cached for future use. If the file does not exist
- * when the first attempt is made to read from it, no further attempts are
- * made to check for its existence. It is not possible to change the value
- * of any property in jaxp.properties after it has been read for the first time.
- * </li>
- * <li>
- * Use the Services API (as detailed in the JAR specification), if
- * available, to determine the classname. The Services API will look
- * for a classname in the file
- * <code>META-INF/services/javax.xml.transform.TransformerFactory</code>
- * in jars available to the runtime.
- * </li>
- * <li>
- * Platform default <code>TransformerFactory</code> instance.
- * </li>
- * </ul>
- *
- * Once an application has obtained a reference to a <code>
- * TransformerFactory</code> it can use the factory to configure
- * and obtain parser instances.
- *
- * @return new TransformerFactory instance, never null.
- *
- * @throws TransformerFactoryConfigurationError Thrown if the implementation
- * is not available or cannot be instantiated.
- */
- public static TransformerFactory newInstance()
- throws TransformerFactoryConfigurationError {
- try {
- return (TransformerFactory) FactoryFinder.find(
- /* The default property name according to the JAXP spec */
- "javax.xml.transform.TransformerFactory",
- /* The fallback implementation class name */
- "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new TransformerFactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * @return new TransformerFactory instance, never null.
- *
- * @throws TransformerFactoryConfigurationError Thrown if the implementation
- * is not available or cannot be instantiated.
- */
- public static TransformerFactory newInstance(String factoryClassName,
- ClassLoader classLoader) throws TransformerFactoryConfigurationError {
- if (factoryClassName == null) {
- throw new TransformerFactoryConfigurationError("factoryClassName cannot be null.");
- }
- if (classLoader == null) {
- classLoader = SecuritySupport.getContextClassLoader();
- }
- try {
- return (TransformerFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
- }
- catch (FactoryFinder.ConfigurationError e) {
- throw new TransformerFactoryConfigurationError(e.getException(), e.getMessage());
- }
- }
-
- /**
- * <p>Process the <code>Source</code> into a <code>Transformer</code>
- * <code>Object</code>. The <code>Source</code> is an XSLT document that
- * conforms to <a href="http://www.w3.org/TR/xslt">
- * XSL Transformations (XSLT) Version 1.0</a>. Care must
- * be taken not to use this <code>Transformer</code> in multiple
- * <code>Thread</code>s running concurrently.
- * Different <code>TransformerFactories</code> can be used concurrently by
- * different <code>Thread</code>s.</p>
- *
- * @param source <code>Source </code> of XSLT document used to create
- * <code>Transformer</code>.
- * Examples of XML <code>Source</code>s include
- * {@link javax.xml.transform.stream.StreamSource StreamSource},
- * {@link javax.xml.transform.sax.SAXSource SAXSource},
- * {@link javax.xml.transform.dom.DOMSource DOMSource} and
- * {@link javax.xml.transform.stax.StAXSource StAXSource}.
- *
- * @return A <code>Transformer</code> object that may be used to perform
- * a transformation in a single <code>Thread</code>, never
- * <code>null</code>.
- *
- * @throws TransformerConfigurationException Thrown if there are errors when
- * parsing the <code>Source</code> or it is not possible to create a
- * <code>Transformer</code> instance.
- *
- * @see <a href="http://www.w3.org/TR/xslt">
- * XSL Transformations (XSLT) Version 1.0</a>
- */
- public abstract Transformer newTransformer(Source source)
- throws TransformerConfigurationException;
-
- /**
- * <p>Create a new <code>Transformer</code> that performs a copy
- * of the <code>Source</code> to the <code>Result</code>.
- * i.e. the "<em>identity transform</em>".</p>
- *
- * @return A Transformer object that may be used to perform a transformation
- * in a single thread, never null.
- *
- * @exception TransformerConfigurationException Thrown if it is not
- * possible to create a <code>Transformer</code> instance.
- */
- public abstract Transformer newTransformer()
- throws TransformerConfigurationException;
-
- /**
- * Process the Source into a Templates object, which is a
- * a compiled representation of the source. This Templates object
- * may then be used concurrently across multiple threads. Creating
- * a Templates object allows the TransformerFactory to do detailed
- * performance optimization of transformation instructions, without
- * penalizing runtime transformation.
- *
- * @param source An object that holds a URL, input stream, etc.
- *
- * @return A Templates object capable of being used for transformation
- * purposes, never null.
- *
- * @exception TransformerConfigurationException May throw this during the
- * parse when it is constructing the Templates object and fails.
- */
- public abstract Templates newTemplates(Source source)
- throws TransformerConfigurationException;
-
- /**
- * <p>Get the stylesheet specification(s) associated with the
- * XML <code>Source</code> document via the
- * <a href="http://www.w3.org/TR/xml-stylesheet/">
- * xml-stylesheet processing instruction</a> that match the given criteria.
- * Note that it is possible to return several stylesheets, in which case
- * they are applied as if they were a list of imports or cascades in a
- * single stylesheet.</p>
- *
- * @param source The XML source document.
- * @param media The media attribute to be matched. May be null, in which
- * case the preferred templates will be used (i.e. alternate = no).
- * @param title The value of the title attribute to match. May be null.
- * @param charset The value of the charset attribute to match. May be null.
- *
- * @return A <code>Source</code> <code>Object</code> suitable for passing
- * to the <code>TransformerFactory</code>.
- *
- * @throws TransformerConfigurationException An <code>Exception</code>
- * is thrown if an error occurs during parsing of the
- * <code>source</code>.
- *
- * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
- * Associating Style Sheets with XML documents Version 1.0</a>
- */
- public abstract Source getAssociatedStylesheet(
- Source source,
- String media,
- String title,
- String charset)
- throws TransformerConfigurationException;
-
- /**
- * Set an object that is used by default during the transformation
- * to resolve URIs used in document(), xsl:import, or xsl:include.
- *
- * @param resolver An object that implements the URIResolver interface,
- * or null.
- */
- public abstract void setURIResolver(URIResolver resolver);
-
- /**
- * Get the object that is used by default during the transformation
- * to resolve URIs used in document(), xsl:import, or xsl:include.
- *
- * @return The URIResolver that was set with setURIResolver.
- */
- public abstract URIResolver getURIResolver();
-
- //======= CONFIGURATION METHODS =======
-
- /**
- * <p>Set a feature for this <code>TransformerFactory</code> and <code>Transformer</code>s
- * or <code>Template</code>s created by this factory.</p>
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * An {@link TransformerConfigurationException} is thrown if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * <p>All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature.
- * When the feature is:</p>
- * <ul>
- * <li>
- * <code>true</code>: the implementation will limit XML processing to conform to implementation limits
- * and behave in a secure fashion as defined by the implementation.
- * Examples include resolving user defined style sheets and functions.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link ErrorListener#fatalError(TransformerException exception)}.
- * See {@link #setErrorListener(ErrorListener listener)}.
- * </li>
- * <li>
- * <code>false</code>: the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * </li>
- * </ul>
- *
- * @param name Feature name.
- * @param value Is feature state <code>true</code> or <code>false</code>.
- *
- * @throws TransformerConfigurationException if this <code>TransformerFactory</code>
- * or the <code>Transformer</code>s or <code>Template</code>s it creates cannot support this feature.
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract void setFeature(String name, boolean value)
- throws TransformerConfigurationException;
-
- /**
- * Look up the value of a feature.
- *
- * <p>
- * Feature names are fully qualified {@link java.net.URI}s.
- * Implementations may define their own features.
- * <code>false</code> is returned if this <code>TransformerFactory</code> or the
- * <code>Transformer</code>s or <code>Template</code>s it creates cannot support the feature.
- * It is possible for an <code>TransformerFactory</code> to expose a feature value but be unable to change its state.
- * </p>
- *
- * @param name Feature name.
- *
- * @return The current state of the feature, <code>true</code> or <code>false</code>.
- *
- * @throws NullPointerException If the <code>name</code> parameter is null.
- */
- public abstract boolean getFeature(String name);
-
- /**
- * Allows the user to set specific attributes on the underlying
- * implementation. An attribute in this context is defined to
- * be an option that the implementation provides.
- * An <code>IllegalArgumentException</code> is thrown if the underlying
- * implementation doesn't recognize the attribute.
- *
- * @param name The name of the attribute.
- * @param value The value of the attribute.
- */
- public abstract void setAttribute(String name, Object value);
-
- /**
- * Allows the user to retrieve specific attributes on the underlying
- * implementation.
- * An <code>IllegalArgumentException</code> is thrown if the underlying
- * implementation doesn't recognize the attribute.
- *
- * @param name The name of the attribute.
- * @return value The value of the attribute.
- */
- public abstract Object getAttribute(String name);
-
- /**
- * Set the error event listener for the TransformerFactory, which
- * is used for the processing of transformation instructions,
- * and not for the transformation itself.
- * An <code>IllegalArgumentException</code> is thrown if the
- * <code>ErrorListener</code> listener is <code>null</code>.
- *
- * @param listener The new error listener.
- */
- public abstract void setErrorListener(ErrorListener listener);
-
- /**
- * Get the error event handler for the TransformerFactory.
- *
- * @return The current error handler, which should never be null.
- */
- public abstract ErrorListener getErrorListener();
-
-}
-
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SchemaFactoryFinder.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
deleted file mode 100644
index cb0d044..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- * 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.
- */
-// $Id: SchemaFactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.validation;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-import javax.xml.XMLConstants;
-
-/**
- * Implementation of {@link SchemaFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class SchemaFactoryFinder {
-
- /** debug support code. */
- private static boolean debug = false;
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- static {
- // Use try/catch block to support applets
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception _) {
- debug = false;
- }
- }
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>SchemaFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource, {@link SchemaFactory}, and
- * {@link SchemaFactoryLoader} implementations during
- * the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public SchemaFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == SecuritySupport.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable _ ) {
- ; // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link SchemaFactory} object for the specified
- * schema language.</p>
- *
- * @param schemaLanguage
- * See {@link SchemaFactory Schema Language} table in <code>SchemaFactory</code>
- * for the list of available schema languages.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the <tt>schemaLanguage</tt> parameter is null.
- */
- public SchemaFactory newFactory(String schemaLanguage) {
- if(schemaLanguage==null) throw new NullPointerException();
- SchemaFactory f = _newFactory(schemaLanguage);
- if (debug) {
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + schemaLanguage);
- } else {
- debugPrintln("unable to find a factory for " + schemaLanguage);
- }
- }
- return f;
- }
-
- /**
- * <p>Lookup a <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.</p>
- *
- * @param schemaLanguage Schema language to lookup <code>SchemaFactory</code> for.
- *
- * @return <code>SchemaFactory</code> for the given <code>schemaLanguage</code>.
- */
- private SchemaFactory _newFactory(String schemaLanguage) {
- SchemaFactory sf;
- String propertyName = SERVICE_CLASS.getName() + ":" + schemaLanguage;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(SERVICE_CLASS);
- if (spiClass != null) {
- return (SchemaFactory) spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // system property look up
- try {
- if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = SecuritySupport.getSystemProperty(propertyName);
- if (r != null) {
- if (debug) debugPrintln("The value is '"+r+"'");
- sf = createInstance(r);
- if(sf!=null) return sf;
- }
- else if (debug) {
- debugPrintln("The property is undefined.");
- }
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = SecuritySupport.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
- String factoryClassName = null ;
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(propertyName);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- sf = createInstance(factoryClassName);
- if(sf != null){
- return sf;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- /**
- // try to read from $java.home/lib/jaxp.properties
- try {
- String javah = ss.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
- File f = new File( configFile );
- if( ss.doesFileExist(f)) {
- sf = loadFromProperty(
- propertyName,f.getAbsolutePath(), new FileInputStream(f));
- if(sf!=null) return sf;
- } else {
- debugPrintln("Tried to read "+ f.getAbsolutePath()+", but it doesn't exist.");
- }
- } catch(Throwable e) {
- if( debug ) {
- debugPrintln("failed to read $java.home/lib/jaxp.properties");
- e.printStackTrace();
- }
- }
- */
-
- // try META-INF/services files
- Iterator sitr = createServiceFileIterator();
- while(sitr.hasNext()) {
- URL resource = (URL)sitr.next();
- if (debug) debugPrintln("looking into " + resource);
- try {
- sf = loadFromServicesFile(schemaLanguage,resource.toExternalForm(),SecuritySupport.getURLInputStream(resource));
- if(sf!=null) return sf;
- } catch(IOException e) {
- if( debug ) {
- debugPrintln("failed to read "+resource);
- e.printStackTrace();
- }
- }
- }
-
- // platform default
- if(schemaLanguage.equals("http://www.w3.org/2001/XMLSchema")) {
- if (debug) debugPrintln("attempting to use the platform default XML Schema 1.0 validator");
- return createInstance("com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory");
- }
-
- if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instanciated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- SchemaFactory createInstance( String className ) {
- try {
- if (debug) debugPrintln("instanciating "+className);
- Class clazz;
- if( classLoader!=null )
- clazz = classLoader.loadClass(className);
- else
- clazz = Class.forName(className);
- if(debug) debugPrintln("loaded it from "+which(clazz));
- Object o = clazz.newInstance();
-
- if( o instanceof SchemaFactory )
- return (SchemaFactory)o;
-
- if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
- } catch( Throwable t ) {
- debugPrintln("failed to instanciate "+className);
- if(debug) t.printStackTrace();
- }
- return null;
- }
-
- /** Iterator that lazily computes one value and returns it. */
- private static abstract class SingleIterator implements Iterator {
- private boolean seen = false;
-
- public final void remove() { throw new UnsupportedOperationException(); }
- public final boolean hasNext() { return !seen; }
- public final Object next() {
- if(seen) throw new NoSuchElementException();
- seen = true;
- return value();
- }
-
- protected abstract Object value();
- }
-
- /**
- * Returns an {@link Iterator} that enumerates all
- * the META-INF/services files that we care.
- */
- private Iterator createServiceFileIterator() {
- if (classLoader == null) {
- return new SingleIterator() {
- protected Object value() {
- ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
- //return (ClassLoader.getSystemResource( SERVICE_ID ));
- return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
- }
- };
- } else {
- try {
- //final Enumeration e = classLoader.getResources(SERVICE_ID);
- final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
- if(debug && !e.hasMoreElements()) {
- debugPrintln("no "+SERVICE_ID+" file was found");
- }
-
- // wrap it into an Iterator.
- return new Iterator() {
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return e.hasMoreElements();
- }
-
- public Object next() {
- return e.nextElement();
- }
- };
- } catch (IOException e) {
- if (debug) {
- debugPrintln("failed to enumerate resources "+SERVICE_ID);
- e.printStackTrace();
- }
- return new ArrayList().iterator(); // empty iterator
- }
- }
- }
-
- /** Searches for a SchemaFactory for a given schema language in a META-INF/services file. */
- private SchemaFactory loadFromServicesFile(String schemaLanguage, String resourceName, InputStream in) {
-
- if (debug) debugPrintln("Reading "+resourceName );
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(in, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(in), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- SchemaFactory resultFactory = null;
- // See spec for provider-configuration files: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider%20Configuration%20File
- while (true) {
- try {
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- break;
- }
- if (factoryClassName != null) {
- // Ignore comments in the provider-configuration file
- int hashIndex = factoryClassName.indexOf('#');
- if (hashIndex != -1) {
- factoryClassName = factoryClassName.substring(0, hashIndex);
- }
-
- // Ignore leading and trailing whitespace
- factoryClassName = factoryClassName.trim();
-
- // If there's no text left or if this was a blank line, go to the next one.
- if (factoryClassName.length() == 0) {
- continue;
- }
-
- try {
- // Found the right SchemaFactory if its isSchemaLanguageSupported(schemaLanguage) method returns true.
- SchemaFactory foundFactory = (SchemaFactory) createInstance(factoryClassName);
- if (foundFactory.isSchemaLanguageSupported(schemaLanguage)) {
- resultFactory = foundFactory;
- break;
- }
- }
- catch (Exception e) {}
- }
- else {
- break;
- }
- }
-
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
-
- return resultFactory;
- }
-
- private static final Class SERVICE_CLASS = SchemaFactory.class;
- private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
-
-
-
- private static String which( Class clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SecuritySupport.java
deleted file mode 100644
index fea9147..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/validation/SecuritySupport.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.validation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- static URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = ClassLoader.getSystemResource(name);
- } else {
- url = cl.getSystemResource(name);
- }
- return url;
- }
- });
- }
-
- static Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getSystemResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/SecuritySupport.java
deleted file mode 100644
index c392de1..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/SecuritySupport.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.xpath;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getURLInputStream(final URL url)
- throws IOException
- {
- try {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException {
- return url.openStream();
- }
- });
- } catch (PrivilegedActionException e) {
- throw (IOException)e.getException();
- }
- }
-
- static URL getResourceAsURL(final ClassLoader cl,
- final String name)
- {
- return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- URL url;
- if (cl == null) {
- url = ClassLoader.getSystemResource(name);
- } else {
- url = cl.getSystemResource(name);
- }
- return url;
- }
- });
- }
-
- static Enumeration getResources(final ClassLoader cl,
- final String name) throws IOException
- {
- try{
- return (Enumeration)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws IOException{
- Enumeration enumeration;
- if (cl == null) {
- enumeration = ClassLoader.getSystemResources(name);
- } else {
- enumeration = cl.getSystemResources(name);
- }
- return enumeration;
- }
- });
- }catch(PrivilegedActionException e){
- throw (IOException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-
- static boolean doesFileExist(final File f) {
- return ((Boolean)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return f.exists() ? Boolean.TRUE : Boolean.FALSE;
- }
- })).booleanValue();
- }
-
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/XPathFactoryFinder.java b/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
deleted file mode 100644
index f5e80a1..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * 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.
- */
-// $Id: XPathFactoryFinder.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.xpath;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Properties;
-
-import javax.xml.validation.SchemaFactory;
-
-/**
- * Implementation of {@link XPathFactory#newInstance(String)}.
- *
- * @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
- * @version $Revision: 446598 $, $Date: 2006-09-15 08:55:40 -0400 (Fri, 15 Sep 2006) $
- * @since 1.5
- */
-final class XPathFactoryFinder {
-
- /** debug support code. */
- private static boolean debug = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- static {
- // Use try/catch block to support applets
- try {
- String val = SecuritySupport.getSystemProperty("jaxp.debug");
- // Allow simply setting the prop to turn on debug
- debug = val != null && (! "false".equals(val));
- } catch (Exception _) {
- debug = false;
- }
- }
-
- /**
- * <p>Cache properties for performance.</p>
- */
- private static Properties cacheProps = new Properties();
-
- /**
- * <p>First time requires initialization overhead.</p>
- */
- private static boolean firstTime = true;
-
- /**
- * <p>Conditional debug printing.</p>
- *
- * @param msg to print
- */
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("JAXP: " + msg);
- }
- }
-
- /**
- * <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
- */
- private final ClassLoader classLoader;
-
- /**
- * <p>Constructor that specifies <code>ClassLoader</code> to use
- * to find <code>SchemaFactory</code>.</p>
- *
- * @param loader
- * to be used to load resource, {@link SchemaFactory}, and
- * {@link SchemaFactoryLoader} implementations during
- * the resolution process.
- * If this parameter is null, the default system class loader
- * will be used.
- */
- public XPathFactoryFinder(ClassLoader loader) {
- this.classLoader = loader;
- if( debug ) {
- debugDisplayClassLoader();
- }
- }
-
- private void debugDisplayClassLoader() {
- try {
- if( classLoader == SecuritySupport.getContextClassLoader() ) {
- debugPrintln("using thread context class loader ("+classLoader+") for search");
- return;
- }
- } catch( Throwable _ ) {
- ; // getContextClassLoader() undefined in JDK1.1
- }
-
- if( classLoader==ClassLoader.getSystemClassLoader() ) {
- debugPrintln("using system class loader ("+classLoader+") for search");
- return;
- }
-
- debugPrintln("using class loader ("+classLoader+") for search");
- }
-
- /**
- * <p>Creates a new {@link XPathFactory} object for the specified
- * schema language.</p>
- *
- * @param uri
- * Identifies the underlying object model.
- *
- * @return <code>null</code> if the callee fails to create one.
- *
- * @throws NullPointerException
- * If the parameter is null.
- */
- public XPathFactory newFactory(String uri) {
- if(uri==null) throw new NullPointerException();
- XPathFactory f = _newFactory(uri);
- if (debug) {
- if (f != null) {
- debugPrintln("factory '" + f.getClass().getName() + "' was found for " + uri);
- } else {
- debugPrintln("unable to find a factory for " + uri);
- }
- }
- return f;
- }
-
- /**
- * <p>Lookup a {@link XPathFactory} for the given object model.</p>
- *
- * @param uri identifies the object model.
- *
- * @return {@link XPathFactory} for the given object model.
- */
- private XPathFactory _newFactory(String uri) {
- XPathFactory sf;
-
- String propertyName = SERVICE_CLASS.getName() + ":" + uri;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(SERVICE_CLASS);
- if (spiClass != null) {
- return (XPathFactory) spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // system property look up
- try {
- if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
- String r = SecuritySupport.getSystemProperty(propertyName);
- if(r!=null) {
- if (debug) debugPrintln("The value is '"+r+"'");
- sf = createInstance(r);
- if(sf!=null) return sf;
- }
- else if (debug) {
- debugPrintln("The property is undefined.");
- }
- } catch( Throwable t ) {
- if( debug ) {
- debugPrintln("failed to look up system property '"+propertyName+"'" );
- t.printStackTrace();
- }
- }
-
- String javah = SecuritySupport.getSystemProperty( "java.home" );
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxp.properties";
-
- String factoryClassName = null ;
-
- // try to read from $java.home/lib/jaxp.properties
- try {
- if(firstTime){
- synchronized(cacheProps){
- if(firstTime){
- File f=new File( configFile );
- firstTime = false;
- if(SecuritySupport.doesFileExist(f)){
- if (debug) debugPrintln("Read properties file " + f);
- cacheProps.load(SecuritySupport.getFileInputStream(f));
- }
- }
- }
- }
- factoryClassName = cacheProps.getProperty(propertyName);
- if (debug) debugPrintln("found " + factoryClassName + " in $java.home/jaxp.properties");
-
- if (factoryClassName != null) {
- sf = createInstance(factoryClassName);
- if(sf != null){
- return sf;
- }
- }
- } catch (Exception ex) {
- if (debug) {
- ex.printStackTrace();
- }
- }
-
- // try META-INF/services files
- Iterator sitr = createServiceFileIterator();
- while(sitr.hasNext()) {
- URL resource = (URL)sitr.next();
- if (debug) debugPrintln("looking into " + resource);
- try {
- sf = loadFromServicesFile(uri, resource.toExternalForm(), SecuritySupport.getURLInputStream(resource));
- if(sf!=null) return sf;
- } catch(IOException e) {
- if( debug ) {
- debugPrintln("failed to read "+resource);
- e.printStackTrace();
- }
- }
- }
-
- // platform default
- if(uri.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) {
- if (debug) debugPrintln("attempting to use the platform default W3C DOM XPath lib");
- return createInstance("org.apache.xpath.jaxp.XPathFactoryImpl");
- }
-
- if (debug) debugPrintln("all things were tried, but none was found. bailing out.");
- return null;
- }
-
- /**
- * <p>Creates an instance of the specified and returns it.</p>
- *
- * @param className
- * fully qualified class name to be instanciated.
- *
- * @return null
- * if it fails. Error messages will be printed by this method.
- */
- private XPathFactory createInstance( String className ) {
- try {
- if (debug) debugPrintln("instanciating "+className);
- Class clazz;
- if( classLoader!=null )
- clazz = classLoader.loadClass(className);
- else
- clazz = Class.forName(className);
- if(debug) debugPrintln("loaded it from "+which(clazz));
- Object o = clazz.newInstance();
-
- if( o instanceof XPathFactory )
- return (XPathFactory)o;
-
- if (debug) debugPrintln(className+" is not assignable to "+SERVICE_CLASS.getName());
- } catch( Throwable t ) {
- if (debug) {
- debugPrintln("failed to instanciate "+className);
- t.printStackTrace();
- }
- }
- return null;
- }
-
- /** Iterator that lazily computes one value and returns it. */
- private static abstract class SingleIterator implements Iterator {
- private boolean seen = false;
-
- public final void remove() { throw new UnsupportedOperationException(); }
- public final boolean hasNext() { return !seen; }
- public final Object next() {
- if(seen) throw new NoSuchElementException();
- seen = true;
- return value();
- }
-
- protected abstract Object value();
- }
-
- /** Searches for a XPathFactory for a given uri in a META-INF/services file. */
- private XPathFactory loadFromServicesFile(String uri, String resourceName, InputStream in) {
-
- if (debug) debugPrintln("Reading " + resourceName );
-
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(in, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(in), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- XPathFactory resultFactory = null;
- // See spec for provider-configuration files: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider%20Configuration%20File
- while (true) {
- try {
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- break;
- }
- if (factoryClassName != null) {
- // Ignore comments in the provider-configuration file
- int hashIndex = factoryClassName.indexOf('#');
- if (hashIndex != -1) {
- factoryClassName = factoryClassName.substring(0, hashIndex);
- }
-
- // Ignore leading and trailing whitespace
- factoryClassName = factoryClassName.trim();
-
- // If there's no text left or if this was a blank line, go to the next one.
- if (factoryClassName.length() == 0) {
- continue;
- }
-
- try {
- // Found the right XPathFactory if its isObjectModelSupported(String uri) method returns true.
- XPathFactory foundFactory = (XPathFactory) createInstance(factoryClassName);
- if (foundFactory.isObjectModelSupported(uri)) {
- resultFactory = foundFactory;
- break;
- }
- }
- catch (Exception e) {}
- }
- else {
- break;
- }
- }
-
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
-
- return resultFactory;
- }
-
- /**
- * Returns an {@link Iterator} that enumerates all
- * the META-INF/services files that we care.
- */
- private Iterator createServiceFileIterator() {
- if (classLoader == null) {
- return new SingleIterator() {
- protected Object value() {
- ClassLoader classLoader = XPathFactoryFinder.class.getClassLoader();
- return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
- //return (ClassLoader.getSystemResource( SERVICE_ID ));
- }
- };
- } else {
- try {
- //final Enumeration e = classLoader.getResources(SERVICE_ID);
- final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
- if (debug && !e.hasMoreElements()) {
- debugPrintln("no "+SERVICE_ID+" file was found");
- }
-
- // wrap it into an Iterator.
- return new Iterator() {
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return e.hasMoreElements();
- }
-
- public Object next() {
- return e.nextElement();
- }
- };
- } catch (IOException e) {
- if (debug) {
- debugPrintln("failed to enumerate resources "+SERVICE_ID);
- e.printStackTrace();
- }
- return new ArrayList().iterator(); // empty iterator
- }
- }
- }
-
- private static final Class SERVICE_CLASS = XPathFactory.class;
- private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
-
-
-
- private static String which( Class clazz ) {
- return which( clazz.getName(), clazz.getClassLoader() );
- }
-
- /**
- * <p>Search the specified classloader for the given classname.</p>
- *
- * @param classname the fully qualified name of the class to search for
- * @param loader the classloader to search
- *
- * @return the source location of the resource, or null if it wasn't found
- */
- private static String which(String classname, ClassLoader loader) {
-
- String classnameAsResource = classname.replace('.', '/') + ".class";
-
- if( loader==null ) loader = ClassLoader.getSystemClassLoader();
-
- //URL it = loader.getResource(classnameAsResource);
- URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
- if (it != null) {
- return it.toString();
- } else {
- return null;
- }
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/SecuritySupport.java b/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/SecuritySupport.java
deleted file mode 100644
index 38767de..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/SecuritySupport.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.xml.sax.helpers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport {
-
- private SecuritySupport() {}
-
- static ClassLoader getContextClassLoader() {
- return (ClassLoader)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- static String getSystemProperty(final String propName) {
- return (String)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- return System.getProperty(propName);
- }
- });
- }
-
- static FileInputStream getFileInputStream(final File file)
- throws FileNotFoundException
- {
- try {
- return (FileInputStream)
- AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws FileNotFoundException {
- return new FileInputStream(file);
- }
- });
- } catch (PrivilegedActionException e) {
- throw (FileNotFoundException)e.getException();
- }
- }
-
- static InputStream getResourceAsStream(final ClassLoader cl,
- final String name)
- {
- return (InputStream)
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- InputStream ris;
- if (cl == null) {
- ris = ClassLoader.getSystemResourceAsStream(name);
- } else {
- ris = cl.getResourceAsStream(name);
- }
- return ris;
- }
- });
- }
-}
diff --git a/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java b/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
deleted file mode 100644
index 201bb06..0000000
--- a/trunk/jaxp-api-1.4/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
+++ /dev/null
@@ -1,264 +0,0 @@
-// XMLReaderFactory.java - factory for creating a new reader.
-// http://www.saxproject.org
-// Written by David Megginson
-// and by David Brownell
-// NO WARRANTY! This class is in the Public Domain.
-// $Id: XMLReaderFactory.java 670295 2008-06-22 01:46:43Z mrglavas $
-
-package org.xml.sax.helpers;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import org.xml.sax.XMLReader;
-import org.xml.sax.SAXException;
-
-
-/**
- * Factory for creating an XML reader.
- *
- * <blockquote>
- * <em>This module, both source code and documentation, is in the
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
- * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
- * for further information.
- * </blockquote>
- *
- * <p>This class contains static methods for creating an XML reader
- * from an explicit class name, or based on runtime defaults:</p>
- *
- * <pre>
- * try {
- * XMLReader myReader = XMLReaderFactory.createXMLReader();
- * } catch (SAXException e) {
- * System.err.println(e.getMessage());
- * }
- * </pre>
- *
- * <p><strong>Note to Distributions bundled with parsers:</strong>
- * You should modify the implementation of the no-arguments
- * <em>createXMLReader</em> to handle cases where the external
- * configuration mechanisms aren't set up. That method should do its
- * best to return a parser when one is in the class path, even when
- * nothing bound its class name to <code>org.xml.sax.driver</code> so
- * those configuration mechanisms would see it.</p>
- *
- * @since SAX 2.0
- * @author David Megginson, David Brownell
- * @version 2.0.1 (sax2r2)
- */
-final public class XMLReaderFactory
-{
- /**
- * Private constructor.
- *
- * <p>This constructor prevents the class from being instantiated.</p>
- */
- private XMLReaderFactory ()
- {
- }
-
- private static final String property = "org.xml.sax.driver";
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /**
- * Attempt to create an XMLReader from system defaults.
- * In environments which can support it, the name of the XMLReader
- * class is determined by trying each these options in order, and
- * using the first one which succeeds:</p> <ul>
- *
- * <li>If the system property <code>org.xml.sax.driver</code>
- * has a value, that is used as an XMLReader class name. </li>
- *
- * <li>The JAR "Services API" is used to look for a class name
- * in the <em>META-INF/services/org.xml.sax.driver</em> file in
- * jarfiles available to the runtime.</li>
- *
- * <li> SAX parser distributions are strongly encouraged to provide
- * a default XMLReader class name that will take effect only when
- * previous options (on this list) are not successful.</li>
- *
- * <li>Finally, if {@link ParserFactory#makeParser()} can
- * return a system default SAX1 parser, that parser is wrapped in
- * a {@link ParserAdapter}. (This is a migration aid for SAX1
- * environments, where the <code>org.xml.sax.parser</code> system
- * property will often be usable.) </li>
- *
- * </ul>
- *
- * <p> In environments such as small embedded systems, which can not
- * support that flexibility, other mechanisms to determine the default
- * may be used. </p>
- *
- * <p>Note that many Java environments allow system properties to be
- * initialized on a command line. This means that <em>in most cases</em>
- * setting a good value for that property ensures that calls to this
- * method will succeed, except when security policies intervene.
- * This will also maximize application portability to older SAX
- * environments, with less robust implementations of this method.
- * </p>
- *
- * @return A new XMLReader.
- * @exception org.xml.sax.SAXException If no default XMLReader class
- * can be identified and instantiated.
- * @see #createXMLReader(java.lang.String)
- */
- public static XMLReader createXMLReader ()
- throws SAXException
- {
- String className = null;
- ClassLoader loader = NewInstance.getClassLoader ();
-
- // 1. try the JVM-instance-wide system property
- try { className = SecuritySupport.getSystemProperty (property); }
- catch (Exception e) { /* normally fails for applets */ }
-
- // 2. if that fails, try META-INF/services/
- if (className == null || className.length() == 0) {
- String service = "META-INF/services/" + property;
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class<? extends XMLReader> spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(XMLReader.class, property);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- InputStream is = null;
- className = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = SecuritySupport.getContextClassLoader();
- if (cl != null) {
- is = SecuritySupport.getResourceAsStream(cl, service);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- cl = XMLReaderFactory.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, service);
- }
- } else {
- // No Context ClassLoader or JDK 1.1 so try the current
- // ClassLoader
- cl = XMLReaderFactory.class.getClassLoader();
- is = SecuritySupport.getResourceAsStream(cl, service);
- }
-
- if (is != null) {
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- className = rd.readLine();
- }
- catch (Exception x) {
- // No provider found
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
-
- // 3. Distro-specific fallback
- if (className == null) {
- // BEGIN DISTRIBUTION-SPECIFIC
-
- // EXAMPLE:
- // className = "com.example.sax.XmlReader";
- // or a $JAVA_HOME/jre/lib/*properties setting...
- className = "com.sun.org.apache.xerces.internal.parsers.SAXParser";
-
- // END DISTRIBUTION-SPECIFIC
- }
-
- // do we know the XMLReader implementation class yet?
- if (className != null)
- return loadClass (loader, className);
-
- // 4. panic -- adapt any SAX1 parser
- try {
- return new ParserAdapter (ParserFactory.makeParser ());
- } catch (Exception e) {
- throw new SAXException ("Can't create default XMLReader; "
- + "is system property org.xml.sax.driver set?");
- }
- }
-
-
- /**
- * Attempt to create an XML reader from a class name.
- *
- * <p>Given a class name, this method attempts to load
- * and instantiate the class as an XML reader.</p>
- *
- * <p>Note that this method will not be usable in environments where
- * the caller (perhaps an applet) is not permitted to load classes
- * dynamically.</p>
- *
- * @return A new XML reader.
- * @exception org.xml.sax.SAXException If the class cannot be
- * loaded, instantiated, and cast to XMLReader.
- * @see #createXMLReader()
- */
- public static XMLReader createXMLReader (String className)
- throws SAXException
- {
- return loadClass (NewInstance.getClassLoader (), className);
- }
-
- private static XMLReader loadClass (ClassLoader loader, String className)
- throws SAXException
- {
- try {
- return (XMLReader) NewInstance.newInstance (loader, className);
- } catch (ClassNotFoundException e1) {
- throw new SAXException("SAX2 driver class " + className +
- " not found", e1);
- } catch (IllegalAccessException e2) {
- throw new SAXException("SAX2 driver class " + className +
- " found but cannot be loaded", e2);
- } catch (InstantiationException e3) {
- throw new SAXException("SAX2 driver class " + className +
- " loaded but cannot be instantiated (no empty public constructor?)",
- e3);
- } catch (ClassCastException e4) {
- throw new SAXException("SAX2 driver class " + className +
- " does not implement XMLReader", e4);
- }
- }
-}
diff --git a/trunk/jaxws-api-2.0/pom.xml b/trunk/jaxws-api-2.0/pom.xml
deleted file mode 100644
index bf32600..0000000
--- a/trunk/jaxws-api-2.0/pom.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxws-api-2.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXWS API 2.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-jaxws-api</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-saaj-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-dom</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
- <version>1.1.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.ws*;version=2.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.axis2:axis2-jaxws-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.axis2:axis2-jaxws-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-jaxws-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxws-api-2.0/src/main/java/javax/xml/ws/spi/FactoryFinder.java b/trunk/jaxws-api-2.0/src/main/java/javax/xml/ws/spi/FactoryFinder.java
deleted file mode 100644
index 54cefca..0000000
--- a/trunk/jaxws-api-2.0/src/main/java/javax/xml/ws/spi/FactoryFinder.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * 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 javax.xml.ws.spi;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-/**
- * This code is designed to implement the pluggability
- * feature and is designed to both compile and run on JDK version 1.1 and
- * later. The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- * <p/>
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXRPC
- * API.
- */
-class FactoryFinder {
- /**
- * Set to true for debugging.
- */
- private static final boolean debug = false;
-
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("Factory Finder:" + msg);
- }
- }
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- *
- * @return the <code>ClassLoader</code>
- * @throws ConfigurationError if this class is unable to work with the
- * host JDK
- */
- private static ClassLoader findClassLoader()
- throws ConfigurationError {
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- ClassLoader cl = (ClassLoader)
- doPrivileged( new PrivilegedAction() {
- public Object run() {
-
- Method m = null;
-
- try {
-
- m = Thread.class.getMethod("getContextClassLoader", (Class []) null);
- } catch (NoSuchMethodException e) {
- // Assume that we are running JDK 1.1, use the current ClassLoader
- debugPrintln("assuming JDK 1.1");
- return FactoryFinder.class.getClassLoader();
- }
-
- try {
- return (ClassLoader) m.invoke(Thread.currentThread(), (Object []) null);
- } catch (IllegalAccessException e) {
- // assert(false)
- throw new ConfigurationError("Unexpected IllegalAccessException",
- e);
- } catch (InvocationTargetException e) {
- // assert(e.getTargetException() instanceof SecurityException)
- throw new ConfigurationError("Unexpected InvocationTargetException",
- e);
- }
- }
- }
- );
- return cl;
-
- }
-
- /**
- * Create an instance of a class using the specified
- * <code>ClassLoader</code>, or if that fails from the
- * <code>ClassLoader</code> that loaded this class.
- *
- * @param className the name of the class to instantiate
- * @param classLoader a <code>ClassLoader</code> to load the class from
- * @return a new <code>Object</code> that is an instance of the class of
- * the given name from the given class loader
- * @throws ConfigurationError if the class could not be found or
- * instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader)
- throws ConfigurationError {
-
- final ClassLoader iClassLoader = classLoader;
- final String iClassName = className;
-
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- Object obj =
- doPrivileged( new PrivilegedAction() {
- public Object run() {
- try {
- if (iClassLoader != null) {
- try {
- return iClassLoader.loadClass(iClassName).newInstance();
- } catch (ClassNotFoundException x) {
- // try again
- }
- }
- return Class.forName(iClassName).newInstance();
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " could not be instantiated: " + x,
- x);
- }
- }
- });
- return obj;
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- * @return Class object of factory, never null
- * @throws FactoryFinder.ConfigurationError
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError {
-
- final String iFactoryId = factoryId;
- final String iFallbackClassName = fallbackClassName;
-
- Object obj =
- doPrivileged( new PrivilegedAction() {
- public Object run() {
- debugPrintln("debug is on");
-
- ClassLoader classLoader = findClassLoader();
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(iFactoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, iFactoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp =
- System.getProperty(iFactoryId);
- if (systemProp != null) {
- debugPrintln("found system property " + systemProp);
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- // try to read from $java.home/lib/xml.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrpc.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(iFactoryId);
- debugPrintln("found java.home property " + factoryClassName);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- String serviceId = "META-INF/services/" + iFactoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is = null;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- debugPrintln("found " + serviceId);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- debugPrintln("loaded from services: " + factoryClassName);
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- if (iFallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + iFactoryId + " cannot be found", null);
- }
-
- debugPrintln("loaded from fallback value: " + iFallbackClassName);
- return newInstance(iFallbackClassName, classLoader);
- }
- });
- return obj;
- }
-
- private static Object doPrivileged(PrivilegedAction action) {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null) {
- return(action.run());
- } else {
- return java.security.AccessController.doPrivileged(action);
- }
- }
-
- static class ConfigurationError extends Error {
- // fixme: should this be refactored to use the jdk1.4 exception
- // wrapping?
-
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- *
- * @param msg the Message for this error
- * @param x an Exception that caused this failure, or null
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-}
diff --git a/trunk/jaxws-api-2.1/pom.xml b/trunk/jaxws-api-2.1/pom.xml
deleted file mode 100644
index 529df5a..0000000
--- a/trunk/jaxws-api-2.1/pom.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxws-api-2.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXWS API 2.1</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jaxws_2.1_spec</artifactId>
- <version>1.0</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-saaj_1.3_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax_1.0_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.1</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.ws*;version=2.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-jaxws_2.1_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-jaxws_2.1_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jaxws_2.1_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxws-api-2.1/src/main/java/javax/xml/ws/spi/FactoryFinder.java b/trunk/jaxws-api-2.1/src/main/java/javax/xml/ws/spi/FactoryFinder.java
deleted file mode 100644
index 54cefca..0000000
--- a/trunk/jaxws-api-2.1/src/main/java/javax/xml/ws/spi/FactoryFinder.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * 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 javax.xml.ws.spi;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-/**
- * This code is designed to implement the pluggability
- * feature and is designed to both compile and run on JDK version 1.1 and
- * later. The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- * <p/>
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXRPC
- * API.
- */
-class FactoryFinder {
- /**
- * Set to true for debugging.
- */
- private static final boolean debug = false;
-
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("Factory Finder:" + msg);
- }
- }
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- *
- * @return the <code>ClassLoader</code>
- * @throws ConfigurationError if this class is unable to work with the
- * host JDK
- */
- private static ClassLoader findClassLoader()
- throws ConfigurationError {
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- ClassLoader cl = (ClassLoader)
- doPrivileged( new PrivilegedAction() {
- public Object run() {
-
- Method m = null;
-
- try {
-
- m = Thread.class.getMethod("getContextClassLoader", (Class []) null);
- } catch (NoSuchMethodException e) {
- // Assume that we are running JDK 1.1, use the current ClassLoader
- debugPrintln("assuming JDK 1.1");
- return FactoryFinder.class.getClassLoader();
- }
-
- try {
- return (ClassLoader) m.invoke(Thread.currentThread(), (Object []) null);
- } catch (IllegalAccessException e) {
- // assert(false)
- throw new ConfigurationError("Unexpected IllegalAccessException",
- e);
- } catch (InvocationTargetException e) {
- // assert(e.getTargetException() instanceof SecurityException)
- throw new ConfigurationError("Unexpected InvocationTargetException",
- e);
- }
- }
- }
- );
- return cl;
-
- }
-
- /**
- * Create an instance of a class using the specified
- * <code>ClassLoader</code>, or if that fails from the
- * <code>ClassLoader</code> that loaded this class.
- *
- * @param className the name of the class to instantiate
- * @param classLoader a <code>ClassLoader</code> to load the class from
- * @return a new <code>Object</code> that is an instance of the class of
- * the given name from the given class loader
- * @throws ConfigurationError if the class could not be found or
- * instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader)
- throws ConfigurationError {
-
- final ClassLoader iClassLoader = classLoader;
- final String iClassName = className;
-
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- Object obj =
- doPrivileged( new PrivilegedAction() {
- public Object run() {
- try {
- if (iClassLoader != null) {
- try {
- return iClassLoader.loadClass(iClassName).newInstance();
- } catch (ClassNotFoundException x) {
- // try again
- }
- }
- return Class.forName(iClassName).newInstance();
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " could not be instantiated: " + x,
- x);
- }
- }
- });
- return obj;
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- * @return Class object of factory, never null
- * @throws FactoryFinder.ConfigurationError
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError {
-
- final String iFactoryId = factoryId;
- final String iFallbackClassName = fallbackClassName;
-
- Object obj =
- doPrivileged( new PrivilegedAction() {
- public Object run() {
- debugPrintln("debug is on");
-
- ClassLoader classLoader = findClassLoader();
-
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(iFactoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, iFactoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- // Use the system property first
- try {
- String systemProp =
- System.getProperty(iFactoryId);
- if (systemProp != null) {
- debugPrintln("found system property " + systemProp);
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- // try to read from $java.home/lib/xml.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrpc.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(iFactoryId);
- debugPrintln("found java.home property " + factoryClassName);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- String serviceId = "META-INF/services/" + iFactoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is = null;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- debugPrintln("found " + serviceId);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- debugPrintln("loaded from services: " + factoryClassName);
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- if (iFallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + iFactoryId + " cannot be found", null);
- }
-
- debugPrintln("loaded from fallback value: " + iFallbackClassName);
- return newInstance(iFallbackClassName, classLoader);
- }
- });
- return obj;
- }
-
- private static Object doPrivileged(PrivilegedAction action) {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null) {
- return(action.run());
- } else {
- return java.security.AccessController.doPrivileged(action);
- }
- }
-
- static class ConfigurationError extends Error {
- // fixme: should this be refactored to use the jdk1.4 exception
- // wrapping?
-
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- *
- * @param msg the Message for this error
- * @param x an Exception that caused this failure, or null
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-}
diff --git a/trunk/jaxws-api-2.2/pom.xml b/trunk/jaxws-api-2.2/pom.xml
deleted file mode 100644
index 30d732c..0000000
--- a/trunk/jaxws-api-2.2/pom.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxws-api-2.2</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JAXWS API 2.2</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jaxws_2.2_spec</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-saaj_1.3_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax_1.0_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.ws*;version=2.2;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>!org.apache.geronimo.osgi*, *</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-jaxws_2.2_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-jaxws_2.2_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jaxws_2.2_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java b/trunk/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java
deleted file mode 100644
index a6ad195..0000000
--- a/trunk/jaxws-api-2.2/src/main/java/javax/xml/ws/spi/FactoryFinder.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * 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 javax.xml.ws.spi;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-import org.apache.geronimo.osgi.locator.ProviderLocator;
-
-/**
- * This code is designed to implement the pluggability
- * feature and is designed to both compile and run on JDK version 1.1 and
- * later. The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- * <p/>
- * This class is duplicated for each subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXRPC
- * API.
- */
-class FactoryFinder {
- /**
- * Set to true for debugging.
- */
- private static final boolean debug = false;
-
- private static void debugPrintln(String msg) {
- if (debug) {
- System.err.println("Factory Finder:" + msg);
- }
- }
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- *
- * @return the <code>ClassLoader</code>
- * @throws ConfigurationError if this class is unable to work with the
- * host JDK
- */
- private static ClassLoader findClassLoader()
- throws ConfigurationError {
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- ClassLoader cl = (ClassLoader)
- doPrivileged( new PrivilegedAction<Object>() {
- public Object run() {
-
- Method m = null;
-
- try {
-
- m = Thread.class.getMethod("getContextClassLoader", (Class []) null);
- } catch (NoSuchMethodException e) {
- // Assume that we are running JDK 1.1, use the current ClassLoader
- debugPrintln("assuming JDK 1.1");
- return FactoryFinder.class.getClassLoader();
- }
-
- try {
- return (ClassLoader) m.invoke(Thread.currentThread(), (Object []) null);
- } catch (IllegalAccessException e) {
- // assert(false)
- throw new ConfigurationError("Unexpected IllegalAccessException",
- e);
- } catch (InvocationTargetException e) {
- // assert(e.getTargetException() instanceof SecurityException)
- throw new ConfigurationError("Unexpected InvocationTargetException",
- e);
- }
- }
- }
- );
- return cl;
-
- }
-
- /**
- * Create an instance of a class using the specified
- * <code>ClassLoader</code>, or if that fails from the
- * <code>ClassLoader</code> that loaded this class.
- *
- * @param className the name of the class to instantiate
- * @param classLoader a <code>ClassLoader</code> to load the class from
- * @return a new <code>Object</code> that is an instance of the class of
- * the given name from the given class loader
- * @throws ConfigurationError if the class could not be found or
- * instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader)
- throws ConfigurationError {
-
- final ClassLoader iClassLoader = classLoader;
- final String iClassName = className;
-
- // REVIEW This doPriv block may be unnecessary because this method is private and
- // the caller already has a doPriv. I added the doPriv in case someone changes the
- // visibility of this method to non-private.
- Object obj =
- doPrivileged( new PrivilegedAction<Object>() {
- public Object run() {
- try {
- return ProviderLocator.loadClass(iClassName, FactoryFinder.class, iClassLoader).newInstance();
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + iClassName + " could not be instantiated: " + x,
- x);
- }
- }
- });
- return obj;
- }
-
- /**
- * Finds the implementation Class object in the specified order. Main
- * entry point.
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- * @return Class object of factory, never null
- * @throws FactoryFinder.ConfigurationError
- * Package private so this code can be shared.
- */
- static Object find(String factoryId, String fallbackClassName)
- throws ConfigurationError {
-
- final String iFactoryId = factoryId;
- final String iFallbackClassName = fallbackClassName;
-
- Object obj =
- doPrivileged( new PrivilegedAction<Object>() {
- public Object run() {
- debugPrintln("debug is on");
-
- // Section 6.2.1 of the jaxws spec gives lookup order as
- // 1. META-INF/services definition
- // 2. ${java.home}/lib/jaxws.properties file
- // 3. System property
- // 4. The default implementation class
-
- ClassLoader classLoader = findClassLoader();
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = null;
- if (FactoryFinder.class.getClassLoader() != null) {
- factoryClass = FactoryFinder.class.getClassLoader().loadClass(iFactoryId);
- } else {
- factoryClass = Class.forName(iFactoryId);
- }
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, iFactoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- if (debug) e.printStackTrace();
- }
-
- try {
- // check the META-INF/services definitions, and return it if
- // we find something.
- Object service = ProviderLocator.getService(iFactoryId, FactoryFinder.class, classLoader);
- if (service != null) {
- return service;
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- try {
- String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxrpc.properties", iFactoryId);
- if (factoryClassName != null) {
- debugPrintln("found java.home property " + factoryClassName);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- if (debug) ex.printStackTrace();
- }
-
- // Use the system property first
- try {
- String systemProp =
- System.getProperty(iFactoryId);
- if (systemProp != null) {
- debugPrintln("found system property " + systemProp);
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (iFallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + iFactoryId + " cannot be found", null);
- }
-
- debugPrintln("loaded from fallback value: " + iFallbackClassName);
- return newInstance(iFallbackClassName, classLoader);
- }
- });
- return obj;
- }
-
- private static <T> T doPrivileged(PrivilegedAction<T> action) {
- SecurityManager sm = System.getSecurityManager();
- if (sm == null) {
- return action.run();
- } else {
- return java.security.AccessController.doPrivileged(action);
- }
- }
-
- static class ConfigurationError extends Error {
- // fixme: should this be refactored to use the jdk1.4 exception
- // wrapping?
-
- private Exception exception;
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- *
- * @param msg the Message for this error
- * @param x an Exception that caused this failure, or null
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- }
-
- Exception getException() {
- return exception;
- }
- }
-}
diff --git a/trunk/jbi-api-1.0/pom.xml b/trunk/jbi-api-1.0/pom.xml
deleted file mode 100644
index f4d5a34..0000000
--- a/trunk/jbi-api-1.0/pom.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jbi-api-1.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JBI API 1.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- <version>1.0.2</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.jbi*;version=1.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/JBIException.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/JBIException.java
deleted file mode 100644
index 7427a7d..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/JBIException.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 javax.jbi;
-
-/**
- * JBIException is the top-level exception thrown by all JBI system components.
- */
-public class JBIException extends Exception {
-
- /**
- * Creates a new instance of JBIException with an exception message.
- * @param aMessage String describing this exception.
- */
- public JBIException(String aMessage) {
- super(aMessage);
- }
-
- /**
- * Creates a new instance of JBIException with the specified message and cause.
- * @param aMessage String describing this exception.
- * @param aCause Throwable which represents an underlying problem (or null).
- */
- public JBIException(String aMessage, Throwable aCause) {
- super(aMessage, aCause);
- }
-
- /**
- * Creates a new instance of JBIException with the specified cause.
- * @param aCause Throwable which represents an underlying problem (or null).
- */
- public JBIException(Throwable aCause) {
- super(aCause);
- }
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Bootstrap.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Bootstrap.java
deleted file mode 100644
index 8fd5630..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Bootstrap.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import javax.jbi.JBIException;
-
-import javax.management.ObjectName;
-
-/**
- * This interface is implemented by a JBI Component to provide any
- * special processing required at install/uninstall time. The methods
- * defined here are called by the JBI implementation during the installation
- * (or uninstallation) of the component that, among other things, supplies
- * an implementation of this interface.
- *
- * Initialization/cleanup tasks such as creation/deletion of directories,
- * files, and database tables can be done by the onInstall() and onUninstall()
- * methods, respectively. This also allows the component to terminate the
- * installation or uninstallation in the event of an error.
- *
- * After calling onInstall() or onUninstall(), regardless of outcome, the JBI
- * implementation must call the cleanUp() method afterwards. Similarly, if
- * init(InstallationContext) fails with an exception, the JBI implementation
- * must call the cleanUp() method.
- *
- * Component implementors should note that there is no guarantee that the same
- * instance of its Bootstrap implementation will be used during both install
- * and uninstall operations on the component. Data that need to be retained
- * between installation-time and uninstallation-time must be persisted in such
- * as fashion that a separate instance of the bootstrap class can find them,
- * despite component or system shutdown.
- *
- * @author JSR208 Exert Group
- */
-public interface Bootstrap {
-
- /**
- * Initializes the installation environment for a component. This method is
- * expected to save any information from the installation context that may
- * be needed by other methods.
- *
- * If the component needs to register an optional installer configuration MBean,
- * it MUST do so during execution of this method, or the getExtensionMBean()
- * method.
- *
- * This method must be called after the installation root (available through
- * the installContext parameter) is prepared.
-
- * @param installContext the context containing information from the install
- * command and from the component installation ZIP file;
- * this must be non-null.
- * @throws JBIException when there is an error requiring that the installation
- * be terminated
- */
- void init(InstallationContext installContext) throws JBIException;
-
- /**
- * Cleans up any resources allocated by the bootstrap implementation,
- * including performing deregistration of the extension MBean, if applicable.
- *
- * This method must be called after the onInstall() or onUninstall() method
- * is called, whether it succeeds or fails. It must be called after init() is
- * called, if init() fails by throwing an exception.
- *
- * @throws JBIException if the bootstrap cannot clean up allocated resources
- */
- void cleanUp() throws JBIException;
-
- /**
- * Obtains the ObjectName of the optional installer configuration MBean. If
- * none is provided by this component, this method must return null.
- *
- * This method must be called before onInstall() (or onUninstall()) is called
- * by the JBI implementation.
- *
- * @return ObjectName of the optional installer configuration MBean; returns null
- * if there is no such MBean
- */
- ObjectName getExtensionMBeanName();
-
- /**
- * Called at the beginning of installation of a component to perform any special
- * installation tasks required by the component.
- *
- * This method must not be called if the init() method failed with an exception.
- *
- * @throws JBIException when there is an error requiring that the installation be
- * terminated
- */
- void onInstall() throws JBIException;
-
- /**
- * Called at the beginning of uninstallation of a component to perform any special
- * uninstallation tasks required by the component.
- *
- * This method must not be called if the init() method failed with an exception.
- *
- * @throws JBIException when there is an error requiring that the uninstallation be
- * terminated.
- */
- void onUninstall() throws JBIException;
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Component.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Component.java
deleted file mode 100644
index d46a4cd..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/Component.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.servicedesc.ServiceEndpoint;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-
-/**
- * This interface, implemented by component implementations, allows
- * the JBI implementation to query the component for various types
- * of information. This includes:
- * <ul>
- * <li>The component's life cycle control interface.</li>
- * <li>The component's service unit manager, for handling deployments.</li>
- * <li>A method for querying service metadata describing services
- * provided by this component.</li>
- * <li>"Policy" methods that are called by the JBI implementation to
- * query if proposed matches of this component to a provider (or
- * consumer) are acceptable, according to this component's policies.</li>
- * <li>Endpoint reference (EPR) resolution. Some components will provide
- * the ability to resolve EPRs (typically binding components). This
- * ability to resolve EPRs is used by JBI to facilitate resolution of
- * EPRs received by service consumers.</li>
- *
- * The name of the class that implements this interface for a component is
- * specified in the installation descriptor for that component.
- *
- * @author JSR208 Exert Group
- */
-public interface Component {
-
- /**
- * Get the life cycle control interface for this component. This interface
- * allows the JBI implementation to control the running state of this component.
- *
- * This method must be called before any other methods of this interface are
- * called. In addition, the JBI implementation must call the init() method of
- * the component life cycle returned by this method before calling any other
- * methods on this interface, or the component life cycle interface.
- *
- * @return the life cycle control interface for this component; must be non-null.
- */
- ComponentLifeCycle getLifeCycle();
-
- /**
- * Get the Service Unit manager for this component. If this component does not
- * support deployments, it must return null.
- *
- * @return the ServiceUnitManager for this component, or null if there is none.
- */
- ServiceUnitManager getServiceUnitManager();
-
- /**
- * Retrieves a DOM representation containing metadata which describes the service
- * provided by this component, through the given endpoint. The result can use WSDL
- * 1.1 or WSDL 2.0.
- *
- * @param endpoint the service endpoint.
- * @return the description for the specified service endpoint.
- */
- Document getServiceDescription(ServiceEndpoint endpoint);
-
- /**
- * This method is called by JBI to check if this component, in the role of provider
- * of the service indicated by the given exchange, can actually perform the operation
- * desired.
- *
- * @param endpoint the endpoint to be used by the consumer; must be non-null.
- * @param exchange the proposed message exchange to be performed; must be non-null.
- * @return true if this provider component can interact with the described consumer
- * to perform the given exchange.
- */
- boolean isExchangeWithConsumerOkay(ServiceEndpoint endpoint, MessageExchange exchange);
-
- /**
- * This method is called by JBI to check if this component, in the role of consumer
- * of the service indicated by the given exchange, can actually interact with the
- * provider properly. The provider is described by the given endpoint and the service
- * description supplied by that endpoint.
- *
- * @param endpoint the endpoint to be used by the provider; must be non-null.
- * @param exchange the proposed message exchange to be performed; must be non-null.
- * @return true if this consumer component can interact with the described provider
- * to perform the given exchange.
- */
- boolean isExchangeWithProviderOkay(ServiceEndpoint endpoint, MessageExchange exchange);
-
- /**
- * Resolve the given endpoint reference. This is called by JBI when it is attempting to
- * resolve the given EPR on behalf of a component.
- *
- * If this component returns a non-null result, it must conform to the following:
- * <ul>
- * <li>This component implements the ServiceEndpoint returned.</li>
- * <li>The result must not be registered or activated with the JBI implementation.</li>
- * </ul>
- *
- * Dynamically resolved endpoints are distinct from static ones; they must not be activated
- * (see {@link javax.jbi.component.ComponentContext#activateEndpoint(javax.xml.namespace.QName, String)}),
- * nor registered (see {@link ComponentContext}) by components. They can only be used to address
- * message exchanges; the JBI implementation must deliver such exchanges to the component that
- * resolved the endpoint reference (see
- * {@link javax.jbi.component.ComponentContext#resolveEndpointReference(org.w3c.dom.DocumentFragment)}).
- *
- * @param epr the endpoint reference, in some XML dialect understood by the appropriate component
- * (usually a binding); must be non-null.
- * @return the service endpoint for the EPR; null if the EPR cannot be resolved by this component.
- */
- ServiceEndpoint resolveEndpointReference(DocumentFragment epr);
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentContext.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentContext.java
deleted file mode 100644
index 2f85f81..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentContext.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import java.util.MissingResourceException;
-import java.util.logging.Logger;
-
-import javax.jbi.JBIException;
-import javax.jbi.messaging.DeliveryChannel;
-import javax.jbi.messaging.MessagingException;
-import javax.jbi.servicedesc.ServiceEndpoint;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-
-/**
- * This interface provides access to data needed by a JBI component
- * about the JBI environment in which it is installed, as well providing
- * the means to allow the component to inform the JBI environment about
- * services provided by this component. This interface provides methods
- * for the following functions:
- * <ul>
- * <li>Get the <bold>DeliveryChannel</bold> for this component. This is
- * required to allow the component to send and receive message
- * exchanges.</li>
- * <li><bold>Activate</bold> (and deactivate) service endpoints provided
- * by this component.</li>
- * <li><bold>Register</bold> (and deregister) external endpoints provided
- * by this component.</li>
- * <li><bold>Query</bold> available endpoints (internal and external).</li>
- * <li><bold>Query</bold> various data about the component, as installed
- * in the JBI environment (name, workspace root, install root, initial
- * JNDI context, MBean Server, Transaction Manager).</li>
- * <li><bold>Loggers</bold>. Obtain the component's logger and subloggers.</li>
- * <li><bold>MBean name creator</bold>. Access a utility for creating
- * custom MBean names.</li>
- * <li><bold>EPR Resolver</bold>. Ask JBI to resolve an endpoint reference
- * (EPR), converting it into a service endpoint.</li>
- *
- * Note: The term "NMR" (meaning Normalized Message Router) is used here to refer
- * to the messaging system of the JBI implementation. This term is used as a
- * synonym for the JBI implementation, and refers only to the logical message
- * routing functions of a JBI implementation. It is not meant to require that
- * JBI implementations literally have a subsystem named "NMR".
- *
- * @author JSR208 Expert Group
- */
-public interface ComponentContext {
-
- /**
- * Activates the named endpoint with the NMR. Activation indicates to the NMR
- * that this component is ready to process requests sent to the named endpoint.
- *
- * Note that the JBI implementation may call this component's
- * {@link Component#getServiceDescription(ServiceEndpoint)} method before returning
- * from this method call; the component's implementation must be ready to supply
- * service description metadata before the result of this activation call (a
- * ServiceEndpoint) is known.
- *
- * @param serviceName qualified name of the service the endpoint exposes; must
- * be non-null.
- * @param endpointName the name of the endpoint to be activated; must be non-null
- * and non-empty.
- * @return a reference to the activated endpoint; must be non-null.
- * @throws JBIException if the endpoint cannot be activated.
- */
- ServiceEndpoint activateEndpoint(QName serviceName, String endpointName) throws JBIException;
-
-
- /**
- * Deactivates the given endpoint with the NMR. Deactivation indicates to the NMR
- * that this component will no longer process requests sent to the named endpoint.
- *
- * @param endpoint reference to the endpoint to be deactivated; must be non-null.
- * @throws JBIException if the endpoint cannot be deactivated.
- */
- void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException;
-
- /**
- * Registers the given external endpoint with the NMR. This indicates to the NMR that
- * the given endpoint is used as a proxy for external service consumers to access an
- * internal service of the same service name (but a different endpoint name).
- *
- * @param externalEndpoint the external endpoint to be registered, must be non-null.
- * @throws JBIException if an external endpoint with the same name is already registered,
- * by this or another component.
- */
- void registerExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException;
-
- /**
- * Deregisters the given external endpoint with the NMR. This indicates to the NMR that
- * the given external endpoint can no longer be used as a proxy for external service
- * consumers to access an internal service of the same service name.
- *
- * @param externalEndpoint the external endpoint to be deregistered; must be non-null.
- * @throws JBIException if the given external endpoint was not previously registered.
- */
- void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint) throws JBIException;
-
- /**
- * Resolve the given endpoint reference into a service endpoint. This is called by the
- * component when it has an EPR that it wants to resolve into a service endpoint.
- *
- * Note that the service endpoint returned refers to a dynamic endpoint; the endpoint
- * will exist only as long as this component retains a strong reference to the object
- * returned by this method. The endpoint may not be included in the list of "activated"
- * endpoints.
- *
- * @param epr endpoint reference as an XML fragment; must be non-null.
- * @return the service endpoint corresponding to the given endpoint reference; null if
- * the reference cannot be resolved.
- */
- ServiceEndpoint resolveEndpointReference(DocumentFragment epr);
-
- /**
- * Get the unique component name of this component, ass assigned by the identification
- * section of this component's installation descriptor.
- *
- * @return the component name; must be non-null and non-empty.
- */
- String getComponentName();
-
- /**
- * Get a channel for this component to use to communicate with the Normalized Message
- * Router. This channel must be used by the component to send and receive message
- * exchanges.
- *
- * @return the delivery channel for this component; must be non-null.
- * @throws MessagingException if a channel has already been opened, but not yet closed.
- */
- DeliveryChannel getDeliveryChannel() throws MessagingException;
-
- /**
- * Get the service endpoint for the named activated endpoint, if any.
- *
- * @param service qualified-name of the endpoint's service; must be non-null.
- * @param name name of the endpoint; must be non-null.
- * @return the named endpoint, or null if the named endpoint is not activated.
- */
- ServiceEndpoint getEndpoint(QName service, String name);
-
- /**
- * Retrieve the service description metadata for the specified endpoint.
- *
- * Note that the result can use either the WSDL 1.1 or WSDL 2.0 description language.
- *
- * @param endpoint endpoint reference; must be non-null.
- * @return metadata describing endpoint, or null if metadata is unavailable.
- * @throws JBIException invalid endpoint reference.
- */
- Document getEndpointDescriptor(ServiceEndpoint endpoint) throws JBIException;
-
- /**
- * Queries the NMR for active endpoints that implement the given interface. This
- * will return the endpoints for all services and endpoints that implement the
- * named interface (portType in WSDL 1.1). This method does NOT include external
- * endpoints (those registered using {@link #registerExternalEndpoint(ServiceEndpoint)}).
- *
- * @param interfaceName qualified name of interface/portType that is implemented
- * by the endpoint; if null then all activated endpoints in
- * the JBI environment must be returned.
- * @return an array of available endpoints for the specified interface name; must
- * be non-null; may be empty.
- */
- ServiceEndpoint[] getEndpoints(QName interfaceName);
-
- /**
- * Queries the NMR for active endpoints belonging to the given service. This
- * method does NOT include external endpoints (those registered using
- * {@link #registerExternalEndpoint(ServiceEndpoint)}).
- *
- * @param serviceName qualified name of the service that the endpoints are part
- * of; must be non-null.
- * @return an array of available endpoints for the specified service name; must
- * be non-null; may be empty.
- */
- ServiceEndpoint[] getEndpointsForService(QName serviceName);
-
- /**
- * Queries the NMR for external endpoints that implement the given interface name.
- * This methods returns only registered external endpoints (see
- * {@link #registerExternalEndpoint(ServiceEndpoint)}).
- *
- * @param interfaceName qualified name of interface implemented by the endpoints;
- * must be non-null.
- * @return an array of available external endpoints for the specified interface name;
- * must be non-null; may be empty.
- */
- ServiceEndpoint[] getExternalEndpoints(QName interfaceName);
-
- /**
- * Queries the NMR for external endpoints that are part of the given service.
- *
- * @param serviceName qualified name of service that contains the endpoints;
- * must be non-null.
- * @return an array of available external endpoints for the specified service name;
- * must be non-null; may be empty.
- */
- ServiceEndpoint[] getExternalEndpointsForService(QName serviceName);
-
- /**
- * Get the installation root directory path for this component.
- *
- * This method MUST return the file path formatted for the underlying platform.
- *
- * @return the installation root directory path, in platform-specific form;
- * must be non-null and non-empty.
- */
- String getInstallRoot();
-
- /**
- * Get a logger instance from JBI. Loggers supplied by JBI are guaranteed to have
- * unique names such that they avoid name collisions with loggers from other
- * components created using this method. The suffix parameter allows for the
- * creation of subloggers as needed. The JBI specification says nothing about
- * the exact names to be used, only that they must be unique across components
- * and the JBI implementation itself.
- *
- * @param suffix for creating subloggers; use an empty string for the base component
- * logger; must be non-null.
- * @param resourceBundleName name of ResourceBundle to be used for localizing messages
- * for the logger. May be null if none of the messages require
- * localization. The resource, if non-null, must be loadable
- * using the component's class loader as the initiating loader.
- * @return a standard logger, named uniquely for this component (plus the given suffix,
- * if applicable); must be non-null.
- * @throws java.util.MissingResourceException if the ResourceBundleName is non-null and no
- * corresponding resource can be found.
- * @throws JBIException if the resourceBundleName has changed from a previous invocation
- * by this component of this method with the same suffix.
- */
- Logger getLogger(String suffix, String resourceBundleName) throws MissingResourceException, JBIException;
-
- /**
- * Get a reference to the MBeanNames creator for use in creating custom MBean names.
- *
- * @return reference to the MBeanNames creator; must be non-null.
- */
- javax.jbi.management.MBeanNames getMBeanNames();
-
- /**
- * Get the JMX MBean server used to register all MBeans in the JBI environment.
- *
- * @return a reference to the MBean server; must be non-null.
- */
- javax.management.MBeanServer getMBeanServer();
-
- /**
- * Get the JNDI naming context for this component. This context is a standard JNDI
- * InitialContext but its content will vary based on the environment in which the JBI
- * implementation is running.
- *
- * @return the JNDI naming context; must be non-null.
- */
- javax.naming.InitialContext getNamingContext();
-
- /**
- * Get the TransactionManager for this implementation. The instance returned is an
- * implementation of the standard JTA interface. If none is available, this method
- * returns null.
- *
- * The object returned by this method is untyped, to allow this interface to be compiled
- * in environments that do not support JTA. If not null, the object returned must be of
- * type javax.transaction.TransactionManager.
- *
- * This downcast is necessary because JBI is used in environments that do not support
- * JTA (i.e., J2SE). Explicit use of JTA types would cause compilation failures in
- * such environments.
- *
- * @return A TransactionManager instance, or null if none is available in the
- * execution environment.
- */
- Object getTransactionManager();
-
- /**
- * Get the root directory path for this component's private workspace.
- *
- * This method MUST return the file path formatted for the underlying platform.
- *
- * The returned value must indicate a valid file path that the component may use
- * to write files to, and read files from.
- *
- * @return the private workspace root path, in platform-specific form;
- * must be non-null and non-empty.
- */
- String getWorkspaceRoot();
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentLifeCycle.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentLifeCycle.java
deleted file mode 100644
index c98a736..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ComponentLifeCycle.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import javax.jbi.JBIException;
-import javax.management.ObjectName;
-
-/**
- * This interface must be implemented by a JBI component to provide initialization,
- * start, stop, and shutdown life cycle processing. These methods comprise the life
- * cycle contract between the JBI implementation and the component. The life cycle
- * of a component begins with a call to the init() method on an instance of the
- * component's implementation of this interface, and ends with the first call to the
- * shutDown() method on that instance. Between these two calls, there can be any
- * number of stop() and start() calls.
- *
- * The JBI implementation must track the running state of a component, and ensure
- * that life cycle state changes are always legal. For example, if the management
- * interface for controlling a component's life cycle ({@link
- * javax.jbi.management.ComponentLifeCycleMBean}) is used to start a component that
- * was just installed (and thus in the <i>Shutdown</i> state), the implementation
- * must invoke this component's {@link #init(ComponentContext)} method before
- * invoking its {@link #start()} method.
- *
- * @author JSR208 Expert Group
- */
-public interface ComponentLifeCycle {
-
- /**
- * Get the JMX object name for the extension MBean for this component; if there
- * is none, return null.
- *
- * @return the JMX object name of the additional MBean or null if there is no
- * additional MBean.
- */
- ObjectName getExtensionMBeanName();
-
- /**
- * Initialize the component. This performs initialization required by the component
- * but does not make it ready to process messages. This method is called once for
- * each life cycle of the component.
- *
- * If the component needs to register an additional MBean to extend its life cycle,
- * or provide other component management tasks, it should be registered during this
- * call.
- *
- * @param context the component's context, providing access to component data provided
- * by the JBI environment; must be non-null.
- * @throws JBIException if the component is unable to initialize.
- */
- void init(ComponentContext context) throws JBIException;
-
- /**
- * Shut down the component. This performs clean-up, releasing all run-time resources
- * used by the component. Once this method has been called, {@link #init(ComponentContext)}
- * must be called before the component can be started again with a call to {@link #start()}.
- *
- * @throws JBIException if the component is unable to shut down.
- */
- void shutDown() throws JBIException;
-
- /**
- * Start the component. This makes the component ready to process messages. This method
- * is called after {@link #init(ComponentContext)}, both when the component is being
- * started for the first time and when the component is being restarted after a previous
- * call to {@link #shutDown()}. If {@link #stop()} was called previously but {@link #shutDown()}
- * was not, {@link #start()} can be called again without another call to
- * {@link #init(ComponentContext)}.
- *
- * @throws JBIException if the component is unable to start.
- */
- void start() throws JBIException;
-
- /**
- * Stop the component. This makes the component stop accepting messages for processing.
- * After a call to this method, {@link #start()} may be called again without first
- * calling {@link #init(ComponentContext)}.
- *
- * @throws JBIException if the component is unable to stop.
- */
- void stop() throws JBIException;
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/InstallationContext.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/InstallationContext.java
deleted file mode 100644
index 2ba9ac3..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/InstallationContext.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import org.w3c.dom.DocumentFragment;
-
-/**
- * This context contains information necessary for a JBI component to perform
- * its installation/uninstallation processing.
- */
-public interface InstallationContext {
-
- /**
- * Get the name of the class that implements the {@link Component}
- * interface for this component. This must be the component class name
- * given in the component's installation descriptor.
- *
- * @return the {@link Component} implementation class name, which
- * must be non-null and non-empty.
- */
- String getComponentClassName();
-
- /**
- * Get a list of elements that comprise the class path for this component.
- * Each element represents either a directory (containing class files) or
- * a library file. All elements are reachable from the install root. These
- * elements represent class path items that the component's execution-time
- * component class loader uses, in search order. All path elements must use
- * the file separator character appropriate to the system (i.e.,
- * <code>File.separator</code>).
- *
- * @return a list of String objects, each of which contains a class path
- * elements. The list must contain at least one class path element.
- */
- java.util.List getClassPathElements();
-
- /**
- * Get the unique name assigned to this component. This name must be assigned
- * from the component's installation descriptor identification section.
- *
- * @return the unique component name, which must be non-null and non-empty.
- */
- String getComponentName();
-
- /**
- * Get the JBI context for this component. The following methods are valid
- * to use on the context:
- * <ul>
- * <li>{@link ComponentContext#getLogger(String, String)}</li>
- * <li>{@link ComponentContext#getMBeanNames()}</li>
- * <li>{@link ComponentContext#getMBeanServer()}</li>
- * <li>{@link ComponentContext#getNamingContext()}</li>
- * <li>{@link ComponentContext#getTransactionManager()}</li>
- * </ul>
- *
- * All other methods on the returned context must throw a IllegalStateException
- * exception if invoked.
- *
- * @return the JBI context for this component, which must be non-null.
- */
- ComponentContext getContext();
-
- /**
- * Get the installation root directory full path name for this component.
- * This path name must be formatted for the platform the JBI environment
- * is running on.
- *
- * @return the installation root directory name, which must be non-null
- * and non-empty.
- */
- String getInstallRoot();
-
- /**
- * Return a DOM document fragment representing the installation descriptor
- * (jbi.xml) extension data for the component, if any.
- *
- * The Installation Descriptor Extension data are located at the end of the
- * <component> element of the installation descriptor.
- *
- * @return a DOM document fragment containing the installation descriptor
- * (jbi.xml) extension data, or null if none is present in the descriptor.
- */
- DocumentFragment getInstallationDescriptorExtension();
-
- /**
- * Returns <code>true</code> if this context was created in order to install a
- * component into the JBI environment. Returns false if this context was created
- * to uninstall a previously installed component.
- *
- * This method is provided to allow Bootstrap implementations to tailor their
- * behaviour according to use case. For example, the
- * {@link Bootstrap#init(InstallationContext)} method implementation may create
- * different types of extension MBeans, depending on the use case specified by
- * this method.
- *
- * @return <code>true</code> if this context was created in order to install a
- * component into the JBI environment; otherwise the context was created
- * to uninstall an existing component.
- */
- boolean isInstall();
-
- /**
- * Set the list of elements that comprise the class path for this component. Each
- * element represents either a directory (containing class files) or a library file.
- * Elements are reached from the install root. These elements represent class path
- * items that the component's execution-time component class loader uses, in search
- * order. All file paths are relative to the install root of the component.
- *
- * This method allows the component's bootstrap to alter the execution-time class
- * path specified by the component's installation descriptor. The component
- * configuration determined during installation can affect the class path needed by
- * the component at execution-time. All path elements must use the file separator
- * character appropriate to the system (i.e., <code>File.separator</code>).
- *
- * @param classPathElements a list of String objects, each of which contains a class
- * path elements; the list must be non-null and contain at least one class path
- * element.
- * @throws java.lang.IllegalArgumentException if the class path elements is null, empty,
- * or if an individual element is ill-formed.
- */
- void setClassPathElements(java.util.List classPathElements);
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ServiceUnitManager.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ServiceUnitManager.java
deleted file mode 100644
index 91637ce..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/component/ServiceUnitManager.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * 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 javax.jbi.component;
-
-import javax.jbi.management.DeploymentException;
-
-/**
- * This interface defines component-supplied methods for managing service
- * unit deployments, and is implemented by the component. The JBI
- * implementation queries the component for the implementation of this
- * interface using the {@link Component#getServiceUnitManager()} method.
- *
- * @author JSR208 Expert Group
- */
-public interface ServiceUnitManager {
-
- /**
- * Deploy a Service Unit to the component. This is called by the JBI
- * implementation in order to deploy the given artifact to the implementing
- * component.
- *
- * Upon successful deployment, a non-empty result string must be returned,
- * that starts with the JBI-defined component-task-result element. For example:
- * <pre>
- * <component-task-result>
- * <component-name>BC1</component-name>
- * <component-task-result-details
- * xmlns="http://java.sun.com/xml/ns/jbi/management-message">
- * <task-result-details>
- * <task-id>deploy</task-id>
- * <task-result>SUCCESS</task-result>
- * </task-result-details>
- * </component-task-result-details>
- * </component-task-result>
- * </pre>
- * A failed deployment of the service unit must be reported using the
- * <code>component-task-result</code> element as well; the
- * <code>task-result</code> must be set to FAILED.
- *
- * @param serviceUnitName name of the service unit being deployed; must be
- * non-null and non-empty and unique among service units already
- * deployed to the component.
- * @param serviceUnitRootPath path of the service unit artifact root, in
- * platform specific format; must be non-null and non-empty.
- * @return a deployment status message, which is an XML string that conforms
- * to the schema given in the <i>MBean Status and Result Strings</i>
- * section of the <i><b>Management</b></i> chapter of the JBI
- * specification; must be non-null and non-empty.
- * @exception DeploymentException if the deployment operation is
- * unsuccessful.
- */
- String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException;
-
- /**
- * Initialize the given deployed service unit. This is the first phase of
- * a two-phase start, where the component must prepare to receive service
- * requests related to the deployment (if any).
- * <p>
- * The serviceUnitRootPath parameter is provided to facilitate restart of
- * the component. This allows simple components to rely entirely on JBI's
- * ability to persist deployment information, avoiding the need for the
- * component to provide its own persistence mechanism.
- *
- * @param serviceUnitName name of the service unit being initialized; must
- * be non-null, non-empty, and match the name of a previously
- * deployed (but not yet undeployed) service unit.
- * @param serviceUnitRootPath path of the service unit artifact root, in
- * platform specific format; must be non-null and non-empty.
- * @exception DeploymentException if the service unit is not deployed, or
- * if it is in an incorrect state.
- */
- void init(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException;
-
- /**
- * Start the deployed service unit. This is the second phase of a two-phase
- * start, where the component can now initiate service requests related to
- * the deployment.
- *
- * @param serviceUnitName the name of the service unit being started; must
- * be non-null, non-empty, and match the name of a previously
- * deployed (but not yet undeployed) service unit.
- * @exception DeploymentException if the service unit is not deployed, or
- * if it is in an incorrect state.
- */
- void start(String serviceUnitName) throws DeploymentException;
-
- /**
- * Stop the deployed service unit. This causes the component to cease
- * generating service requests related to the given service unit. This
- * returns the service unit to a state equivalent to after
- * {@link #init(String, String)} was called.
- *
- * @param serviceUnitName name of the service unit being stopped; must
- * be non-null, non-empty, and match the name of a previously
- * deployed (but not yet undeployed) service unit.
- * @exception DeploymentException if the service unit is not deployed, or
- * if it is in an incorrect state.
- */
- void stop(String serviceUnitName) throws DeploymentException;
-
- /**
- * Shut down the deployment. This causes the deployment to return to the
- * to the state it was in after {@link #deploy(String, String)}, and before
- * {@link #init(String, String)}.
- *
- * @param serviceUnitName name of the service unit being shut down; must
- * be non-null, non-empty, and match the name of a previously
- * deployed (but not yet undeployed) service unit.
- * @exception DeploymentException if the service unit is not deployed, or
- * if it is in an incorrect state.
- */
- void shutDown(String serviceUnitName) throws DeploymentException;
-
- /**
- * Undeploy a service unit from the component. The service unit must be
- * shut down to undeploy it.
- *
- * @param serviceUnitName name of the service unit being undeployed; must
- * be non-null, non-empty, and match the name of a previously
- * deployed (but not yet undeployed) service unit.
- * @param serviceUnitRootPath path of the service unit artifact root, in
- * platform specific format; must be non-null and non-empty.
- * @return deployment status message, which is an XML string that conforms
- * to the <code>component-task-result</code> type from
- * the schema given in the <i>MBean Status and Result Strings</i>
- * section of the <i><b>Management</b></i> chapter of the JBI
- * specification; must be non-null and non-empty.
- * @exception DeploymentException if undeployment operation is unsuccessful,
- * or if the service unit is in an incorrect state.
- */
- String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException;
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/AdminServiceMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/AdminServiceMBean.java
deleted file mode 100644
index d4728d3..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/AdminServiceMBean.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.management.ObjectName;
-
-/**
- * This interface defines a set of administrative methods allowing a JMX-based
- * administrative tool to perform a variety of administrative tasks.
- * <ul>
- * <li>Find component lifecycle MBean names for:
- * <ul>
- * <li>Individual components, by name</li>
- * <li>All binding components</li>
- * <li>All service engines</li>
- * </ul>
- * </li>
- * <li>Find lifecyle MBeans names for implementation-defined services:
- * <ul>
- * <li>Individual implementation services, by name</li>
- * <li>All implementation services</li>
- * </ul>
- * </li>
- * <li>Query whether an individual component is a binding or engine</li>
- * <li>Query implementation information (version etc.)</li>
- * </ul>
- *
- * @author JSR208 Expert Group
- */
-public interface AdminServiceMBean {
-
- /**
- * Get a list of {@link ComponentLifeCycleMBean}s for all binding components
- * currently installed in the JBI system.
- *
- * @return array of JMX object names of component life cycle MBeans for all
- * installed binding components; must be non-null; may be empty
- */
- ObjectName[] getBindingComponents();
-
- /**
- * Find the {@link ComponentLifeCycleMBean} of a JBI Installable Component
- * by its unique name.
- *
- * @param name the name of the engine or binding component; must be non-
- * null and non-empty
- * @return the JMX object name of the component's life cycle MBean, or
- * <code>null</code> if there is no such component with the given
- * <code>name</code>
- */
- ObjectName getComponentByName(String name);
-
- /**
- * Get a list of {@link ComponentLifeCycleMBean}s for all service engines
- * currently installed in the JBI system.
- *
- * @return array of JMX object names of component life cycle MBeans for all
- * installed service engines; must be non-null; may be empty
- */
- ObjectName[] getEngineComponents();
-
- /**
- * Return current version and other info about this JBI implementation. The
- * contents of the returned string are implementation dependent.
- *
- * @return information string about the JBI implementation, including
- * version information; must be non-null and non-empty
- */
- String getSystemInfo();
-
- /**
- * Lookup a system service {@link LifeCycleMBean} by name. System services
- * are implementation-defined services which can administered through JMX,
- * and have a life cycle.
- * <p>
- * System services are not related to service engines.
- *
- * @param serviceName name of the system service; must be non-null and non-
- * empty; values are implementation-dependent
- * @return JMX object name of the system service's LifeCycleMBean, or
- * <code>null</code> if there is no system service with the given
- * <code>name</code>.
- */
- ObjectName getSystemService(String serviceName);
-
- /**
- * Looks up all JBI system services {@link LifeCycleMBean}'s currently
- * installed. System services are implementation-defined services which can
- * administered through JMX. System services are not related to service
- * engines.
- *
- * @return array of LifecycleMBean JMX object names of system services
- * currently installed in the JBI implementation; must be non-null;
- * may be empty
- */
- ObjectName[] getSystemServices();
-
- /**
- * Check if a given JBI component is a Binding Component.
- *
- * @param componentName the unique name of the component; must be non-null
- * and non-empty
- * @return <code>true</code> if the component is a binding component;
- * <code>false</code> if the component is a service engine or if
- * there is no component with the given <code>componentName</code>
- * installed in the JBI system
- */
- boolean isBinding(String componentName);
-
- /**
- * Check if a given JBI component is a Service Engine.
- *
- * @param componentName the unique name of the component; must be non-null
- * and non-empty
- * @return <code>true</code> if the component is a service engine;
- * <code>false</code> if the component is a binding component, or if
- * there is no component with the given <code>componentName</code>
- * installed in the JBI system
- */
- boolean isEngine(String componentName);
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/ComponentLifeCycleMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/ComponentLifeCycleMBean.java
deleted file mode 100644
index 28088ee..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/ComponentLifeCycleMBean.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.management.ObjectName;
-
-/**
- * ComponentLifeCycleMBean defines the standard life cycle controls for
- * JBI Installable Components.
- * <ul>
- * <li>Initialize the component, preparing it to receive service requests.</li>
- * <li>Start the component, allowing it to initiate service requests.</li>
- * <li>Stop the component from initiating any more service requests.</li>
- * <li>Shut down the component, returning it to the uninitialized state
- * where it cannot receive service requests.</li>
- * <li>Query the JMX object name of the extension MBean for the component.</li>
- * </ul>
- *
- * @author JSR208 Expert Group
- */
-public interface ComponentLifeCycleMBean extends LifeCycleMBean {
-
- /**
- * Get the JMX ObjectName for the life cycle extension MBean for this
- * component. If there is none, return <code>null</code>.
- * Note that this MBean may serve as a container for multiple MBeans,
- * as required by the component implementation.
- *
- * @return ObjectName the JMX object name of the additional MBean
- * or <code>null</code> if there is no additional MBean.
- * @exception javax.jbi.JBIException if there is a failure getting component
- * information for the component to which this life cycle
- * applies.
- */
- ObjectName getExtensionMBeanName() throws javax.jbi.JBIException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentException.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentException.java
deleted file mode 100644
index 3a38f5a..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentException.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-/**
- * DeploymentException is an exception thrown by the Deployment Service and
- * the Service Unit Manager.
- *
- * @author JSR208 Expert Group
- */
-public class DeploymentException extends javax.jbi.JBIException {
-
- /**
- * Creates a new instance of DeploymentException with an exception detail
- * message.
- *
- * @param aMessage the detail message for this exception.
- */
- public DeploymentException(String aMessage) {
- super(aMessage);
- }
-
- /**
- * Creates a new instance of DeploymentException with and exception detail
- * message and a cause.
- *
- * @param aMessage the detail message for this exception.
- * @param aCause <code>Error</code> or <code>Exception</code> which
- * represents the cause of the problem (<code>null</code> if none,
- * or if the cause is not known).
- */
- public DeploymentException(String aMessage, Throwable aCause) {
- super(aMessage, aCause);
- }
-
- /**
- * Creates a new instance of DeploymentException with the specified cause.
- *
- * @param aCause <code>Error</code> or <code>Exception</code> which
- * represents the cause of the problem (<code>null</code> if none,
- * or if the cause is not known).
- */
- public DeploymentException(Throwable aCause) {
- super(aCause);
- }
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentServiceMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentServiceMBean.java
deleted file mode 100644
index 4ca67f4..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/DeploymentServiceMBean.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-/**
- * The deployment service MBean allows administrative tools to manage
- * service assembly deployments. The tasks supported are:
- * <ul>
- * <li>Deploying a service assembly.</li>
- * <li>Undeploying a previously deployed service assembly.</li>
- * <li>Querying deployed service assemblies:
- * <ul>
- * <li>For all components in the system.</li>
- * <li>For a particular component.</li>
- * </ul>
- * </li>
- * <li>Control the state of deployed service assemblies:
- * <ul>
- * <li>Start the service units that contained in the SA.</li>
- * <li>Stop the service units that contained in the SA. </li>
- * <li>Shut down the service units that contained in the SA.</li>
- * </ul>
- * </li>
- * <li>Query the service units deployed to a particular component.</li>
- * <li>Check if a service unit is deployed to a particular component.</li>
- * <li>Query the deployment descriptor for a particular service assembly.</li>
- * </ul>
- *
- * @author JSR208 Expert Group
- */
-public interface DeploymentServiceMBean {
-
- /**
- * The service assembly is started. This means that the assembly's offered
- * services can accept message exchanges, and it can send exchanges to
- * consume services.
- */
- String STARTED = "Started";
-
- /**
- * The service assembly has been deployed, or shutdown
- */
- String SHUTDOWN = "Shutdown";
-
- /**
- * The service assembly is stopped. This means that the assembly's offered
- * services can accept message exchanges, but it will not send any.
- */
- String STOPPED = "Stopped";
-
- /**
- * Deploys the given Service Assembly to the JBI environment.
- * <p>
- * Note that the implementation must not automatically start the service
- * assembly after deployment; it must wait for the {@link #start(String)}
- * method to be invoked by the administrative tool.
- *
- * @param saZipURL String containing the location URL of the
- * Service Assembly ZIP file; must be non-null, non-empty, and a
- * legal URL
- * @return Result/Status of the current deployment; must conform to
- * JBI management result/status XML schema; must be non-null and
- * non-empty
- * @exception Exception if complete deployment fails
- */
- String deploy(String saZipURL) throws Exception;
-
- /**
- * Undeploys the given Service Assembly from the JBI environment.
- *
- * @param saName name of the Service Assembly that is to be
- * undeployed; must be non-null and non-empty
- * @return Result/Status of the current undeployment; must conform to
- * JBI management result/status XML schema; must be non-null and
- * non-empty
- * @exception Exception if compelete undeployment fails
- */
- String undeploy(String saName) throws Exception;
-
- /**
- * Returns an array of service unit names that are currently deployed to
- * the named component.
- *
- * @param componentName the name of the component to query; must be
- * non-null and non-empty
- * @return array of service unit names deployed in the named component;
- * must be non-null; may be empty
- * @exception Exception if a processing error occurs
- */
- String[] getDeployedServiceUnitList(String componentName) throws Exception;
-
- /**
- * Returns a list of Service Assemblies deployed to the JBI environment.
- *
- * @return list of Service Assembly names; must be non-null; may be
- * empty
- * @exception Exception if a processing error occurs
- */
- String[] getDeployedServiceAssemblies() throws Exception;
-
- /**
- * Returns the deployment descriptor of the Service Assembly that was
- * deployed to the JBI enviroment, serialized to a <code>String</code>.
- *
- * @param saName name of the service assembly to be queried;
- * must be non-null and non-empty
- * @return descriptor of the Assembly Unit; must be non-null
- * @exception Exception if a processing error occurs
- */
- String getServiceAssemblyDescriptor(String saName) throws Exception;
-
- /**
- * Returns an array of Service Assembly names, where each assembly contains
- * Service Units for the given component.
- *
- * @param componentName name of the component to query; must be non-null
- * and non-empty
- * @return array of of Service Assembly names, where each assembly contains
- * a Service Unit for the named component; must be non-null; may
- * be empty
- * @exception Exception if a processing error occurs
- */
- String[] getDeployedServiceAssembliesForComponent(String componentName) throws Exception;
-
- /**
- * Returns an array of component names, where for each the given assembly
- * contains a service unit for the component.
- *
- * @param saName the service assembly to be queried; must be
- * non-null and non-empty
- * @return array of component names, where for each name the given assembly
- * contains a service unit from the given service assembly; must
- * be non-null; may be empty
- * @exception Exception if a processing error occurs
- */
- String[] getComponentsForDeployedServiceAssembly(String saName) throws Exception;
-
- /**
- * Queries if the named Service Unit is currently deployed to the named
- * component.
- *
- * @param componentName name of the component to query; must be non-null
- * and non-empty
- * @param suName name of the subject service unit; must be non-null
- * and non-empty
- * @return <code>true</code> if the named service unit is currently deployed
- * to the named component
- */
- boolean isDeployedServiceUnit(String componentName, String suName) throws Exception;
-
- /**
- * Returns <code>true</code> if the the given component accepts the
- * deployment of service units. This is used by admin tools to
- * determine which components can be named in service assembly
- * deployment descriptors.
- *
- * @param componentName name of the component; must be non-null and
- * non-empty
- * @return <code>true</code> if the named component accepts deployments;
- * <code>false</code> if the named component does not accept
- * deployments or it does not exist
- *
- */
- boolean canDeployToComponent(String componentName);
-
- /**
- * Start the service assembly. This puts the assembly into the {@link
- * #STARTED} state.
- *
- * @param serviceAssemblyName name of the assembly to be started; must be
- * non-null and non-empty
- * @return result / status string giving the results of starting (and
- * possibly initializing) each service unit in the assembly; must
- * be non-null and non-empty
- * @exception Exception if there is no such assembly
- * @exception Exception if the assembly fails to start
- *
- */
- String start(String serviceAssemblyName) throws Exception;
-
- /**
- * Stop the service assembly. This puts the assembly into the {@link
- * #STOPPED} state.
- *
- * @param serviceAssemblyName name of the assembly to be stopped; must be
- * non-null and non-empty
- * @return result / status string giving the results of stopping each
- * service unit in the assembly; must be non-null and non-empty
- * @exception Exception if there is no such assembly
- * @exception Exception if the assembly fails to stop
- */
- String stop(String serviceAssemblyName) throws Exception;
-
- /**
- * Shut down the service assembly. This puts the assembly back into the
- * {@link #SHUTDOWN} state.
- *
- * @param serviceAssemblyName name of the assembly to be shut down; must be
- * non-null and non-empty
- * @return result / status string giving the results of shutting down
- * each service unit in the assembly; must be non-null and non-empty
- * @exception Exception if there is no such assembly
- * @exception Exception if the assembly fails to shut down
- */
- String shutDown(String serviceAssemblyName) throws Exception;
-
- /**
- * Get the running state of a service assembly. The possible result values
- * of this query are enumerated by the following set of constants:
- * {@link #SHUTDOWN}, {@link #STOPPED}, {@link #STARTED}.
- *
- * @param serviceAssemblyName name of the assembly to query; must be
- * non-null and non-empty
- * @return the state of the service assembly, as a string value; must be one
- * of the enumerated string values provided by this interface:
- * {@link #SHUTDOWN}, {@link #STOPPED}, or {@link #STARTED}
- * @exception Exception if there is no such assembly
- */
- String getState(String serviceAssemblyName) throws Exception;
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallationServiceMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallationServiceMBean.java
deleted file mode 100644
index 23d3d93..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallationServiceMBean.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.management.ObjectName;
-
-/**
- * The installation service MBean allows administrative tools to manage
- * component and shared library installations. The tasks supported are:
- * <ul>
- * <li>Installing (and uninstalling) a shared library</li>
- * <li>Creating (loading) and destroying (unloading) a component installer
- * MBean.</li>
- * <li>Finding an existing component installer MBean.
- * </ul>
- *
- * Installing and uninstalling components is accomplished using
- * {@link InstallerMBean}s, loaded by this MBean. An individual installer MBean
- * is needed for each component installation / uninstallation. This is to support
- * the more complex installation process that some components require.
- *
- * @author JSR208 Expert Group
- */
-public interface InstallationServiceMBean {
-
- /**
- * Load the installer for a new component for the given component
- * installation package.
- *
- * @param installZipURL URL locating a ZIP file containing the
- * JBI Installation package to be installed; must be non-null,
- * non-empty, and a legal URL
- * @return the JMX ObjectName of the InstallerMBean loaded from
- * installZipURL; must be non-null
- */
- ObjectName loadNewInstaller(String installZipURL);
-
- /**
- * Load the InstallerMBean for a previously installed component.
- * <p>
- * The "component name" refers to the
- * <code><identification><name></code> element value from the
- * component's installation package (see {@link #loadNewInstaller(String)}).
- *
- * @param aComponentName the component name identifying the installer to
- * load; must be non-null and non-empty
- * @return the JMX ObjectName of the InstallerMBean loaded from an existing
- * installation context; <code>null</code> if the installer MBean
- * doesn't exist
- */
- ObjectName loadInstaller(String aComponentName);
-
- /**
- * Unload an InstallerMBean previously loaded for a component.
- *
- * @param aComponentName the component name identifying the installer to
- * unload; must be non-null and non-empty
- * @param isToBeDeleted <code>true</code> if the component is to be deleted
- * as well
- * @return true if the operation was successful, otherwise false
- */
- boolean unloadInstaller(String aComponentName, boolean isToBeDeleted);
-
- /**
- * Install a shared library installation package.
- * <p>
- * The return value is the unique name for the shared-library, as found
- * in the the value of the installation descriptor's
- * <code><identification><name></code> element.
- *
- * @param aSharedLibURI URL locating a zip file containing a shared library
- * installation package; must be non-null, non-empty, and a legal
- * URL
- * @return the unique name of the shared library loaded from slZipURL; must
- * be non-null and non-empty
- */
- String installSharedLibrary(String aSharedLibURI);
-
- /**
- * Uninstall a previously installed shared library.
- *
- * @param aSharedLibName the name of the shared name space to uninstall; must be
- * non-null and non-empty
- * @return true if the uninstall was successful
- */
- boolean uninstallSharedLibrary(String aSharedLibName);
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallerMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallerMBean.java
deleted file mode 100644
index d5d4305..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/InstallerMBean.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.management.ObjectName;
-
-/**
- * The InstallerMBean defines standard installation and uninstallation controls
- * for components. InstallerMBeans are created by the
- * {@link InstallationServiceMBean}. The InstallerMBean offers controls to
- * allow an administrative tool to:
- * <ul>
- * <li>Install the component from the installation package.</li>
- * <li>Uninstall the component.</li>
- * <li>Check the installation status of the component.</li>
- * <li>Get the file path to the component's installation root directory.</li>
- * </ul>
- *
- * @author JSR208 Expert Group
- */
-public interface InstallerMBean {
-
- /**
- * Get the installation root directory path for this component.
- *
- * @return the full installation path of this component; this must be in
- * absolute path name form, in platform-specific format; must be
- * non-null and non-empty
- */
- String getInstallRoot();
-
- /**
- * Install a component.
- * <p>
- * Note that the implementation must leave the component in its
- * installed, shutdown state. Automatic starting of components during
- * installation by implementations is not allowed.
- *
- * @return JMX ObjectName representing the LifeCycleMBean for the installed
- * component, or <code>null</code> if the installation did not
- * complete
- * @exception javax.jbi.JBIException if the installation fails
- */
- ObjectName install() throws javax.jbi.JBIException;
-
- /**
- * Determine whether or not the component is installed.
- *
- * @return <code>true</code> if this component is currently installed,
- * otherwise <code>false</code>
- */
- boolean isInstalled();
-
- /**
- * Uninstall the component. This completely removes the component from the
- * JBI system.
- *
- * @exception javax.jbi.JBIException if the uninstallation fails
- */
- void uninstall() throws javax.jbi.JBIException;
-
- /**
- * Get the installer configuration MBean name for this component.
- *
- * @return the MBean object name of the Installer Configuration MBean;
- * <code>null</code> if none is provided by this component
- * @exception javax.jbi.JBIException if the component is not in the
- * appropriate state (after install() but before life cycle
- * initialization), or if any error occurs during processing
- */
- ObjectName getInstallerConfigurationMBean() throws javax.jbi.JBIException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/LifeCycleMBean.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/LifeCycleMBean.java
deleted file mode 100644
index acdb715..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/LifeCycleMBean.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.jbi.JBIException;
-
-/**
- * LifeCycleMBean is a base interface that defines standard life cycle controls
- * for JBI implementation services (which are implementation-specific), and JBI
- * components (bindings and engines).
- *
- * @author JSR208 Expert Group
- */
-public interface LifeCycleMBean {
-
- /** Value returned by {@link #getCurrentState()} for a shutdown component. */
- String SHUTDOWN = "Shutdown";
-
- /** Value returned by {@link #getCurrentState()} for a stopped component. */
- String STOPPED = "Stopped";
-
- /** Value returned by {@link #getCurrentState()} for a running component. */
- String STARTED = "Started";
-
- /** Value returned by {@link #getCurrentState()} for a component in an unknown state. */
- String UNKNOWN = "Unknown";
-
- /**
- * Start the item.
- *
- * @exception javax.jbi.JBIException if the item fails to start.
- */
- void start() throws JBIException;
-
- /**
- * Stop the item. This suspends current messaging activities.
- *
- * @exception javax.jbi.JBIException if the item fails to stop.
- */
- void stop() throws JBIException;
-
- /**
- * Shut down the item. This releases resources and returns the item
- * to an uninitialized state.
- *
- * @exception javax.jbi.JBIException if the item fails to shut down.
- */
- void shutDown() throws JBIException;
-
- /**
- * Get the current state of this managed compononent.
- *
- * @return the current state of this managed component (must be one of the
- * string constants defined by this interface)
- */
- String getCurrentState();
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/MBeanNames.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/MBeanNames.java
deleted file mode 100644
index e6055ff..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/management/MBeanNames.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 javax.jbi.management;
-
-import javax.management.ObjectName;
-
-/**
- * This interface provides methods to create JMX object names for component-
- * supplied MBeans. This ensures that component-supplied MBeans follow the
- * JBI implementation-determined naming convention.
- *
- * Components obtain instances of this name creator using {@link
- * javax.jbi.component.ComponentContext#getMBeanNames()}.
- *
- * @author JSR208 Expert Group
- */
-public interface MBeanNames {
-
- /** The custom name that must be used for bootstrap extensions */
- String BOOTSTRAP_EXTENSION = "BootstrapExtension";
-
- /** The custom name that must be used for component life cycle extensions */
- String COMPONENT_LIFE_CYCLE_EXTENSION = "LifeCycleExtension";
-
- /**
- * Formulate and return an MBean ObjectName for a custom control
- * of this name creator's JBI component.
- * <p>
- * This is used by components to create JMX names for their own JMX
- * controls, allowing the JBI implementation to prefix the created name
- * to fit within the implementation's own naming scheme.
- * <p>
- * Standard extensions must use the following custom name constants:
- * <ul>
- * <li>Bootstrap (installer) extension: {@link #BOOTSTRAP_EXTENSION}.</li>
- * <li>Component life cycle extension:
- * {@link #COMPONENT_LIFE_CYCLE_EXTENSION}.
- * </li>
- * </ul>
- * All other custom component MBeans must use custom names that do not
- * collide with the standard extension names.
- *
- * @param customName the name of the custom control; must be non-null and
- * non-empty; must be legal for use in a JMX object name
- * @return the JMX ObjectName of the MBean, or <code>null</code> if
- * the <code>customName</code> is invalid
- */
- ObjectName createCustomComponentMBeanName(String customName);
-
- /**
- * Retrieve the default JMX Domain Name for MBeans registered in
- * this instance of the JBI implementation.
- *
- * @return the JMX domain name for this instance of the JBI implemention;
- * must be non-null and non-empty
- */
- String getJmxDomainName();
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/DeliveryChannel.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/DeliveryChannel.java
deleted file mode 100644
index 77bab93..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/DeliveryChannel.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-import javax.jbi.servicedesc.ServiceEndpoint;
-
-import javax.xml.namespace.QName;
-
-/**
- * Bi-directional communication channel used to interact with the Normalized
- * Message Service.
- *
- * @author JSR208 Expert Group
- */
-public interface DeliveryChannel
-{
- /**
- * Closes the delivery channel, halting all message traffic.
- *
- * @throws MessagingException fatal error while closing channel.
- */
- void close() throws MessagingException;
-
- /**
- * Create a message exchange factory. This factory will create exchange
- * instances with all appropriate properties set to null.
- *
- * @return a message exchange factory
- */
- MessageExchangeFactory createExchangeFactory();
-
- /**
- * Create a message exchange factory for the given interface name.
- *
- * @param interfaceName name of the interface for which all exchanges
- * created by the returned factory will be set
- * @return an exchange factory that will create exchanges for the given
- * interface; must be non-null
- */
- MessageExchangeFactory createExchangeFactory(QName interfaceName);
-
- /**
- * Create a message exchange factory for the given service name.
- *
- * @param serviceName name of the service for which all exchanges
- * created by the returned factory will be set
- * @return an exchange factory that will create exchanges for the given
- * service; must be non-null
- */
- MessageExchangeFactory createExchangeFactoryForService(QName serviceName);
-
- /**
- * Create a message exchange factory for the given endpoint.
- *
- * @param endpoint endpoint for which all exchanges created by the
- * returned factory will be set for
- * @return an exchange factory that will create exchanges for the
- * given endpoint
- */
- MessageExchangeFactory createExchangeFactory(ServiceEndpoint endpoint);
-
- /**
- * Blocking call used to service a MessageExchange instance which has
- * been initiated by another component. This method supports concurrent
- * invocation for multi-threaded environments.
- *
- * @return mesage exchange instance
- * @throws MessagingException failed to accept
- */
- MessageExchange accept() throws MessagingException;
-
- /**
- * Identical to accept(), but returns after specified interval even if
- * a message exchange is unavailable.
- *
- * @param timeout time to wait in milliseconds
- * @return mesage exchange instance or null if timeout is reached
- * @throws MessagingException failed to accept
- */
- MessageExchange accept(long timeout) throws MessagingException;
-
- /**
- * Routes a MessageExchange instance through the Normalized Message Service
- * to the appropriate servicing component. This method supports concurrent
- * invocation for multi-threaded environments.
- *
- * @param exchange message exchange to send
- * @throws MessagingException unable to send exchange
- */
- void send(MessageExchange exchange) throws MessagingException;
-
- /**
- * Routes a MessageExchange instance through the Normalized Message Service
- * to the appropriate servicing component, blocking until the exchange is
- * returned. This method supports concurrent invocation for multi-threaded
- * environments.
- *
- * @param exchange message exchange to send
- * @return true if the exchange has been processed and returned by the
- * servicing component, false otherwise.
- * @throws MessagingException unable to send exchange
- */
- boolean sendSync(MessageExchange exchange) throws MessagingException;
-
- /**
- * Routes a MessageExchange instance through the Normalized Message Service
- * to the appropriate servicing component, blocking until the specified
- * timeout is reached. This method supports concurrent invocation for
- * multi-threaded environments.
- *
- * @param exchange message exchange to send
- * @param timeout time to wait in milliseconds
- * @return true if the exchange has been processed and returned by the
- * servicing component, false in the case of timeout.
- * @throws MessagingException unable to send exchange
- */
- boolean sendSync(MessageExchange exchange, long timeout) throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/ExchangeStatus.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/ExchangeStatus.java
deleted file mode 100644
index 49ace7a..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/ExchangeStatus.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Typesafe enumeration containing status values for a message exchange.
- *
- * @author JSR208 Expert Group
- */
-public final class ExchangeStatus {
-
- /**
- * Indicates that an ME has not been processed to completion.
- */
- public static final ExchangeStatus ACTIVE = new ExchangeStatus("Active");
-
- /**
- * Indicates that an ME has terminated abnormally within the JBI environment.
- */
- public static final ExchangeStatus ERROR = new ExchangeStatus("Error");
-
- /**
- * Indicates that an ME has been processed to completion.
- */
- public static final ExchangeStatus DONE = new ExchangeStatus("Done");
-
- /** String representation of status. */
- private String mStatus;
-
- /**
- * Private constructor used to create a new ExchangeStatus type.
- *
- * @param status value
- */
- private ExchangeStatus(String status) {
- mStatus = status;
- }
-
- /**
- * Returns string value of enumerated type.
- *
- * @return String representation of status value.
- */
- public String toString() {
- return mStatus;
- }
-
- /**
- * Returns instance of ExchangeStatus that corresponds to given string.
- *
- * @param status string value of status
- * @return ExchangeStatus
- * @throws java.lang.IllegalArgumentException if string can't be translated
- */
- public static ExchangeStatus valueOf(String status) {
- ExchangeStatus instance;
-
- //
- // Convert symbolic name to object reference.
- //
- if (status.equals(DONE.toString())) {
- instance = DONE;
- } else if (status.equals(ERROR.toString())) {
- instance = ERROR;
- } else if (status.equals(ACTIVE.toString())) {
- instance = ACTIVE;
-
- } else {
- //
- // Someone has a problem.
- //
- throw new java.lang.IllegalArgumentException(status);
- }
-
- return instance;
- }
-
- /**
- * Returns hash code value for this object.
- *
- * @return hash code value
- */
- public int hashCode() {
- return mStatus.hashCode();
- }
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/Fault.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/Fault.java
deleted file mode 100644
index 1f8729f..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/Fault.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Models WSDL fault messages.
- *
- * @author JSR208 Expert Group
- */
-public interface Fault extends NormalizedMessage {
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOnly.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOnly.java
deleted file mode 100644
index 7ef2978..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOnly.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Supports operations used to process an In Only MEP to completion.
- *
- * @author JSR208 Expert Group
- */
-public interface InOnly extends MessageExchange {
-
- /**
- * Retrieves the <i>in</i> normalized message from this exchange.
- *
- * @return in message
- */
- NormalizedMessage getInMessage();
-
- /**
- * Sets the <i>in</i> normalized message for this exchange.
- *
- * @param msg in message
- * @throws MessagingException unable to set in message
- */
- void setInMessage(NormalizedMessage msg) throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOptionalOut.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOptionalOut.java
deleted file mode 100644
index 8dcfc08..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOptionalOut.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Supports operations used to process an In Optional Out MEP to completion.
- *
- * @author JSR208 Expert Group
- */
-public interface InOptionalOut extends MessageExchange {
-
- /**
- * Retrieves the <i>in</i> normalized message from this exchange.
- *
- * @return in message
- */
- NormalizedMessage getInMessage();
-
- /**
- * Retrieves the <i>out</i> normalized message from this exchange.
- *
- * @return out message
- */
- NormalizedMessage getOutMessage();
- /**
- * Sets the <i>in</i> normalized message for this exchange.
- *
- * @param msg in message
- * @throws MessagingException unable to set in message
- */
- void setInMessage(NormalizedMessage msg) throws MessagingException;
-
- /**
- * Sets the <i>out</i> normalized message for this exchange.
- *
- * @param msg out message
- * @throws MessagingException unable to set out message
- */
- void setOutMessage(NormalizedMessage msg) throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOut.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOut.java
deleted file mode 100644
index 34f5a19..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/InOut.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Supports operations used to process an In Out MEP to completion.
- *
- * @author JSR208 Expert Group
- */
-public interface InOut extends MessageExchange {
-
- /**
- * Retrieves the <i>in</i> normalized message from this exchange.
- *
- * @return in message
- */
- NormalizedMessage getInMessage();
-
- /**
- * Retrieves the <i>out</i> normalized message from this exchange.
- *
- * @return out message
- */
- NormalizedMessage getOutMessage();
- /**
- * Sets the <i>in</i> normalized message for this exchange.
- *
- * @param msg in message
- * @throws MessagingException unable to set in message
- */
- void setInMessage(NormalizedMessage msg) throws MessagingException;
-
- /**
- * Sets the <i>out</i> normalized message for this exchange.
- *
- * @param msg out message
- * @throws MessagingException unable to set out message
- */
- void setOutMessage(NormalizedMessage msg) throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchange.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchange.java
deleted file mode 100644
index ef441b7..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchange.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-import java.net.URI;
-
-import javax.jbi.servicedesc.ServiceEndpoint;
-
-import javax.xml.namespace.QName;
-
-/**
- * MessageExchange represents a container for normalized messages which
- * are described by an exchange pattern. The exchange pattern defines the
- * names, sequence, and cardinality of messages in an exchange.
- *
- * @author JSR208 Expert Group
- */
-public interface MessageExchange {
-
- /**
- * JTA transaction context property name.
- */
- String JTA_TRANSACTION_PROPERTY_NAME = "javax.jbi.transaction.jta";
-
- /**
- * Returns the URI of the pattern for this exchange.
- *
- * @return pattern URI for this exchange
- */
- URI getPattern();
-
- /**
- * Returns the unique identifier assigned by the NMS for this exchange.
- *
- * @return unique id for this exchange
- */
- String getExchangeId();
-
- /**
- * Returns the processing status of the exchange.
- *
- * @return status of the exchange
- */
- ExchangeStatus getStatus();
-
- /**
- * Sets the processing status of the exchange.
- *
- * @param status exchange status
- * @throws MessagingException failed to set status, possibly due to
- * an invalid state transition.
- */
- void setStatus(ExchangeStatus status) throws MessagingException;
-
- /**
- * Used to specify the source of a failure status. Invoking this method
- * automatically adjusts the status of the ME to {@link ExchangeStatus#ERROR}.
- *
- * @param error error cause
- */
- void setError(Exception error);
-
- /**
- * Retrieves the Exception describing the exchanges error status.
- *
- * @return exception associated with this exchange
- */
- Exception getError();
-
- /**
- * Retrieves the fault message for this exchange, if one exists. A fault/message
- * reference is unnecessary, since an exchange can carry at most one fault, and
- * it is always the final message in an exchange.
- *
- * @return fault associated with the exchange, or null if not present
- */
- Fault getFault();
-
- /**
- * Specifies the fault message for this exchange, if one exists. A fault/message
- * reference is unnecessary, since an exchange can carry at most one fault, and
- * it is always the final message in an exchange.
- *
- * @param fault fault
- * @throws MessagingException operation not permitted in the current exchange state
- */
- void setFault(Fault fault) throws MessagingException;
-
- /**
- * Creates a normalized message based on the specified message reference. The pattern
- * governing this exchange must contain a definition for the reference name supplied.
- *
- * @return a new normalized message
- * @throws MessagingException failed to create message
- */
- NormalizedMessage createMessage() throws MessagingException;
-
- /**
- * Generic factory method for Fault objects.
- *
- * @return a new fault
- * @throws MessagingException failed to create fault
- */
- Fault createFault() throws MessagingException;
-
- /**
- * Retrieves a normalized message based on the specified message reference.
- *
- * @param name message reference
- * @return message with the specified reference name
- */
- NormalizedMessage getMessage(String name);
-
- /**
- * Sets a normalized message with the specified message reference. The pattern
- * governing this exchange must contain a definition for the reference name
- * supplied.
- *
- * @param msg normalized message
- * @param name message reference
- * @throws MessagingException operation not permitted in the current exchange state
- */
- void setMessage(NormalizedMessage msg, String name) throws MessagingException;
-
- /**
- * Retrieves the specified property from the exchange.
- *
- * @param name property name
- * @return property value
- */
- Object getProperty(String name);
-
- /**
- * Specifies a property for the exchange.
- *
- * @param name property name
- * @param obj property value
- */
- void setProperty(String name, Object obj);
-
- /**
- * Specifies the endpoint used by this exchange.
- *
- * @param endpoint endpoint address
- */
- void setEndpoint(ServiceEndpoint endpoint);
-
- /**
- * Specifies the service used by this exchange.
- *
- * @param service service address
- */
- void setService(QName service);
-
- /**
- * Specifies the interface name used by this exchange.
- *
- * @param interfaceName interface name
- */
- void setInterfaceName(QName interfaceName);
-
- /**
- * Specifies the operation used by this exchange.
- *
- * @param name operation name
- */
- void setOperation(QName name);
-
- /**
- * Retrieves the endpoint used by this exchange.
- *
- * @return endpoint address for this message exchange
- */
- ServiceEndpoint getEndpoint();
-
- /**
- * Retrieves the interface name used by this exchange.
- *
- * @return interface used for this message exchange
- */
- QName getInterfaceName();
-
- /**
- * Retrieves the service used by this exchange.
- *
- * @return service address for this message exchange
- */
- QName getService();
-
- /**
- * Retrieves the operation used by this exchange.
- *
- * @return operation name for this message exchange
- */
- QName getOperation();
-
- /**
- * Queries the existence of a transaction context.
- *
- * @return boolean transactional state of the exchange
- */
- boolean isTransacted();
-
- /**
- * Queries the role that the caller plays in the exchange.
- *
- * @return Role expected of caller.
- */
- Role getRole();
-
- /**
- * Returns the name of all properties for this exchange.
- *
- * @return a set of all the property names, as Strings.
- */
- java.util.Set getPropertyNames();
-
- /**
- * Typesafe enum containing the roles a component can play in a service.
- *
- */
- public static final class Role {
-
- /**
- * Service provider.
- */
- public static final Role PROVIDER = new Role();
-
- /**
- * Service Consumer.
- */
- public static final Role CONSUMER = new Role();
-
- /**
- * Prevent direct instantiation.
- */
- private Role() {
- }
- }
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchangeFactory.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchangeFactory.java
deleted file mode 100644
index 3e938a3..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessageExchangeFactory.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-/**
- * A message exchange factory is used used to create new instances of
- * MessageExchange. Service consumers use these factories to create
- * message exchanges when initiating a new service request. Message
- * exchange factories are created using the
- * {@link javax.jbi.component.ComponentContext} given to the component
- * during its initialization (see
- * {@link javax.jbi.component.ComponentLifeCycle}). There are a variety
- * of ways to creating such factories, each of which creates a context
- * that is used to provide some of the default properties of
- * MessageExchange instances created by the factory instances. For example,
- * a factory can be created for a particular endpoint, ensuring that all exchanges
- * created by the factory have that endpoint set as the default endpoint property
- * of the exchange. This allows components to retain factories as a way of aligning
- * internal processing context with the context contained in the factory, ensuring
- * that the exchanges created consistently reflect that context.
- */
-public interface MessageExchangeFactory {
-
- /**
- * Creates a new MessageExchange instance used to initiate a service
- * invocation. JBI defines a set of four basic message exchange types,
- * corresponding to the predefined in-* WSDL 2.0 Message Exchange Patterns.
- *
- * @param serviceName name of the service to be invoked
- * @param operationName name of the operation to be invoked
- * @return new message exchange, initialized for invoking the given service and operation
- * @throws MessagingException if the given service or operation are not registered
- * with the NMR or the factory was created for a particular
- * interface, and the given serviceName does not implement
- * that interface.
- */
- MessageExchange createExchange(QName serviceName, QName operationName) throws MessagingException;
-
- /**
- * Creates a new MessageExchange instance used to initiate a service invocation.
- * JBI defines a set of eight fundamental message exchange types which are created
- * using binding and engine delivery channels. This base method is provided for
- * extensibility, to satisfy the need for vendor-specific message exchange patterns.
- * The registration and administration of these patterns is not addressed by JBI.
- *
- * @param pattern message exchange pattern
- * @return new message exchange
- * @throws MessagingException specified pattern is not registered to a message exchange type
- */
- MessageExchange createExchange(URI pattern) throws MessagingException;
-
- /**
- * Convenience method that creates an In-Only message exchange.
- *
- * @return new In-Only message exchange
- * @throws MessagingException failed to create exchange
- */
- InOnly createInOnlyExchange() throws MessagingException;
-
- /**
- * Convenience method that creates an In-Optional-Out message exchange.
- *
- * @return new In-Optional-Out message exchange
- * @throws MessagingException failed to create exchange
- */
- InOptionalOut createInOptionalOutExchange() throws MessagingException;
-
- /**
- * Convenience method that creates an In-Out message exchange.
- *
- * @return new In-Out message exchange
- * @throws MessagingException failed to create exchange
- */
- InOut createInOutExchange() throws MessagingException;
-
- /**
- * Convenience method that creates an Robust-In-Only message exchange.
- *
- * @return new Robust-In-Only message exchange
- * @throws MessagingException failed to create exchange
- */
- RobustInOnly createRobustInOnlyExchange() throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessagingException.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessagingException.java
deleted file mode 100644
index 044d139..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/MessagingException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Generic exception used to report messaging related errors
- * in the Normalized Message Service.
- *
- * @author JSR208 Expert Group
- */
-public class MessagingException extends javax.jbi.JBIException {
-
- /**
- * Create a new MessagingException.
- *
- * @param msg error detail
- */
- public MessagingException(String msg) {
- super(msg);
- }
-
- /**
- * Create a new MessagingException with the specified cause and error text.
- *
- * @param msg error detail
- * @param cause underlying error
- */
- public MessagingException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- /**
- * Create a new MessagingException with the specified cause.
- *
- * @param cause underlying error
- */
- public MessagingException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/NormalizedMessage.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/NormalizedMessage.java
deleted file mode 100644
index ede90a5..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/NormalizedMessage.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-import java.util.Set;
-
-import javax.activation.DataHandler;
-import javax.security.auth.Subject;
-import javax.xml.transform.Source;
-
-/**
- * Represents a JBI Normalized Message.
- *
- * @author JSR208 Expert Group
- */
-public interface NormalizedMessage {
-
- /**
- * Add an attachment to the message.
- *
- * @param id unique identifier for the attachment
- * @param content attachment content
- * @throws MessagingException failed to add attachment
- */
- void addAttachment(String id, DataHandler content) throws MessagingException;
-
- /**
- * Retrieve the content of the message.
- *
- * @return message content
- */
- Source getContent();
-
- /**
- * Retrieve attachment with the specified identifier.
- *
- * @param id unique identifier for attachment
- * @return DataHandler representing attachment content, or null if an attachment
- * with the specified identifier is not found
- */
- DataHandler getAttachment(String id);
-
- /**
- * Returns a list of identifiers for each attachment to the message.
- *
- * @return iterator over String attachment identifiers
- */
- Set getAttachmentNames();
-
- /**
- * Removes attachment with the specified unique identifier.
- *
- * @param id attachment identifier
- * @throws MessagingException failed to remove attachment
- */
- void removeAttachment(String id) throws MessagingException;
-
- /**
- * Set the content of the message.
- *
- * @param content message content
- * @throws MessagingException failed to set content
- */
- void setContent(Source content) throws MessagingException;
-
- /**
- * Set a property on the message.
- *
- * @param name property name
- * @param value property value
- */
- void setProperty(String name, Object value);
-
- /**
- * Set the security Subject for the message.
- *
- * @param subject Subject to associated with message.
- */
- void setSecuritySubject(Subject subject);
-
- /**
- * Retrieve a list of property names for the message.
- *
- * @return list of property names
- */
- Set getPropertyNames();
-
- /**
- * Retrieve a property from the message.
- *
- * @param name property name
- * @return property value, or null if the property does not exist
- */
- Object getProperty(String name);
-
- /**
- * Retrieve the security Subject from the message.
- *
- * @return security Subject associated with message, or null.
- */
- Subject getSecuritySubject();
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/RobustInOnly.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/RobustInOnly.java
deleted file mode 100644
index e7a925c..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/messaging/RobustInOnly.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 javax.jbi.messaging;
-
-/**
- * Supports operations used to process an Robust In Only MEP to completion.
- *
- * @author JSR208 Expert Group
- */
-public interface RobustInOnly extends MessageExchange {
-
- /**
- * Retrieves the <i>in</i> normalized message from this exchange.
- *
- * @return in message
- */
- NormalizedMessage getInMessage();
-
- /**
- * Sets the <i>in</i> normalized message for this exchange.
- *
- * @param msg in message
- * @throws MessagingException unable to set in message
- */
- void setInMessage(NormalizedMessage msg) throws MessagingException;
-
-}
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/package.html b/trunk/jbi-api-1.0/src/main/java/javax/jbi/package.html
deleted file mode 100644
index c97de60..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/package.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- 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.
--->
-<html>
-<head>
-</head>
-<body>
-
-Java Business Integration APIs/SPIs
-
-</body>
-</html>
diff --git a/trunk/jbi-api-1.0/src/main/java/javax/jbi/servicedesc/ServiceEndpoint.java b/trunk/jbi-api-1.0/src/main/java/javax/jbi/servicedesc/ServiceEndpoint.java
deleted file mode 100644
index 4d53053..0000000
--- a/trunk/jbi-api-1.0/src/main/java/javax/jbi/servicedesc/ServiceEndpoint.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 javax.jbi.servicedesc;
-
-import javax.xml.namespace.QName;
-
-/**
- * Reference to an endpoint, used to refer to an endpoint as well as
- * query information about the endpoint. An endpoint is an addressable
- * entity in the JBI system, used for accessing the provider of a
- * specific service.
- *
- * @author JSR208 Expert Group
- */
-public interface ServiceEndpoint {
-
- /**
- * Get a reference to this endpoint, using an endpoint reference
- * vocabulary that is known to the provider.
- *
- * @param operationName the name of the operation to be performed by a
- * consumer of the generated endpoint reference. Set
- * to null if this is not applicable.
- * @return endpoint reference as an XML fragment; null if the provider
- * does not support such references.
- */
- org.w3c.dom.DocumentFragment getAsReference(QName operationName);
-
- /**
- * Returns the name of this endpoint.
- *
- * @return the endpoint name
- */
- String getEndpointName();
-
- /**
- * Get the qualified names of all the interfaces implemented by this
- * service endpoint.
- *
- * @return array of all interfaces implemented by this service endpoint;
- * must be non-null and non-empty.
- */
- javax.xml.namespace.QName[] getInterfaces();
-
- /**
- * Returns the service name of this endpoint.
- *
- * @return the qualified service name.
- */
- javax.xml.namespace.QName getServiceName();
-}
diff --git a/trunk/jcr-api-2.0/pom.xml b/trunk/jcr-api-2.0/pom.xml
deleted file mode 100644
index 06ec4ec..0000000
--- a/trunk/jcr-api-2.0/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jcr-api-2.0</artifactId>
- <version>2.1.0</version>
- <packaging>bundle</packaging>
- <name>Apache ServiceMix :: Specs :: JCR API 2.0</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.jcr</groupId>
- <artifactId>jcr</artifactId>
- <version>2.0</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.jcr*;version=2.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/trunk/jsr250-1.0/pom.xml b/trunk/jsr250-1.0/pom.xml
deleted file mode 100644
index 7e043d0..0000000
--- a/trunk/jsr250-1.0/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr250-1.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-250 1.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-annotation_1.0_spec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.annotation*;version=1.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-annotation_1.0_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-annotation_1.0_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-annotation_1.0_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr303-api-1.0.0/pom.xml b/trunk/jsr303-api-1.0.0/pom.xml
deleted file mode 100644
index 9241095..0000000
--- a/trunk/jsr303-api-1.0.0/pom.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr303-api-1.0.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-303 API 1.0.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>1.0.0.GA</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.validation*;version=1.0.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.validation:validation-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.validation:validation-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>process-classes</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr303-api-1.0.0/src/main/java/javax/validation/Validation.java b/trunk/jsr303-api-1.0.0/src/main/java/javax/validation/Validation.java
deleted file mode 100644
index 20a3efd..0000000
--- a/trunk/jsr303-api-1.0.0/src/main/java/javax/validation/Validation.java
+++ /dev/null
@@ -1,433 +0,0 @@
-// $Id: Validation.java 17620 2009-10-04 19:19:28Z hardy.ferentschik $
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed 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 javax.validation;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-import javax.validation.bootstrap.GenericBootstrap;
-import javax.validation.bootstrap.ProviderSpecificBootstrap;
-import javax.validation.spi.BootstrapState;
-import javax.validation.spi.ValidationProvider;
-
-/**
- * This class is the entry point for Bean Validation. There are three ways
- * to bootstrap it:
- * <ul>
- * <li>
- * The easiest approach is to build the default <code>ValidatorFactory</code>.
- * <pre>{@code ValidatorFactory factory = Validation.buildDefaultValidatorFactory();}</pre>
- * In this case, the default validation provider resolver
- * will be used to locate available providers.
- * The chosen provider is defined as followed:
- * <ul>
- * <li>if the XML configuration defines a provider, this provider is used</li>
- * <li>if the XML configuration does not define a provider or if no XML configuration
- * is present the first provider returned by the
- * <code>ValidationProviderResolver</code> instance is used.</li>
- * </ul>
- * </li>
- * <li>
- * The second bootstrap approach allows to choose a custom
- * <code>ValidationProviderResolver</code>. The chosen
- * <code>ValidationProvider</code> is then determined in the same way
- * as in the default bootstrapping case (see above).
- * <pre>{@code
- * Configuration<?> configuration = Validation
- * .byDefaultProvider()
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();}
- * </pre>
- * </li>
- * <li>
- * The third approach allows you to specify explicitly and in
- * a type safe fashion the expected provider.
- * <p/>
- * Optionally you can choose a custom <code>ValidationProviderResolver</code>.
- * <pre>{@code
- * ACMEConfiguration configuration = Validation
- * .byProvider(ACMEProvider.class)
- * .providerResolver( new MyResolverStrategy() ) // optionally set the provider resolver
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();}
- * </pre>
- * </li>
- * </ul>
- * Note:<br/>
- * <ul>
- * <li>
- * The <code>ValidatorFactory</code> object built by the bootstrap process should be cached
- * and shared amongst <code>Validator</code> consumers.
- * </li>
- * <li>
- * This class is thread-safe.
- * </li>
- * </ul>
- *
- * @author Emmanuel Bernard
- * @author Hardy Ferentschik
- */
-public class Validation {
-
- /**
- * Build and return a <code>ValidatorFactory</code> instance based on the
- * default Bean Validation provider and following the XML configuration.
- * <p/>
- * The provider list is resolved using the default validation provider resolver
- * logic.
- * <p/> The code is semantically equivalent to
- * <code>Validation.byDefaultProvider().configure().buildValidatorFactory()</code>
- *
- * @return <code>ValidatorFactory</code> instance.
- *
- * @throws ValidationException if the ValidatorFactory cannot be built
- */
- public static ValidatorFactory buildDefaultValidatorFactory() {
- return byDefaultProvider().configure().buildValidatorFactory();
- }
-
- /**
- * Build a <code>Configuration</code>. The provider list is resolved
- * using the strategy provided to the bootstrap state.
- * <pre>
- * Configuration<?> configuration = Validation
- * .byDefaultProvider()
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * ValidatorFactory factory = configuration.buildValidatorFactory();
- * </pre>
- * The provider can be specified in the XML configuration. If the XML
- * configuration does not exsist or if no provider is specified,
- * the first available provider will be returned.
- *
- * @return instance building a generic <code>Configuration</code>
- * compliant with the bootstrap state provided.
- */
- public static GenericBootstrap byDefaultProvider() {
- return new GenericBootstrapImpl();
- }
-
- /**
- * Build a <code>Configuration</code> for a particular provider implementation.
- * Optionally overrides the provider resolution strategy used to determine the provider.
- * <p/>
- * Used by applications targeting a specific provider programmatically.
- * <p/>
- * <pre>
- * ACMEConfiguration configuration =
- * Validation.byProvider(ACMEProvider.class)
- * .providerResolver( new MyResolverStrategy() )
- * .configure();
- * </pre>,
- * where <code>ACMEConfiguration</code> is the
- * <code>Configuration</code> sub interface uniquely identifying the
- * ACME Bean Validation provider. and <code>ACMEProvider</code> is the
- * <code>ValidationProvider</code> implementation of the ACME provider.
- *
- * @param providerType the <code>ValidationProvider</code> implementation type
- *
- * @return instance building a provider specific <code>Configuration</code>
- * sub interface implementation.
- */
- public static <T extends Configuration<T>, U extends ValidationProvider<T>>
- ProviderSpecificBootstrap<T> byProvider(Class<U> providerType) {
- return new ProviderSpecificBootstrapImpl<T, U>( providerType );
- }
-
- //private class, not exposed
- private static class ProviderSpecificBootstrapImpl<T extends Configuration<T>, U extends ValidationProvider<T>>
- implements ProviderSpecificBootstrap<T> {
-
- private final Class<U> validationProviderClass;
- private ValidationProviderResolver resolver;
-
- public ProviderSpecificBootstrapImpl(Class<U> validationProviderClass) {
- this.validationProviderClass = validationProviderClass;
- }
-
- /**
- * Optionally define the provider resolver implementation used.
- * If not defined, use the default ValidationProviderResolver
- *
- * @param resolver ValidationProviderResolver implementation used
- *
- * @return self
- */
- public ProviderSpecificBootstrap<T> providerResolver(ValidationProviderResolver resolver) {
- this.resolver = resolver;
- return this;
- }
-
- /**
- * Determine the provider implementation suitable for byProvider(Class)
- * and delegate the creation of this specific Configuration subclass to the provider.
- *
- * @return a Configuration sub interface implementation
- */
- public T configure() {
- if ( validationProviderClass == null ) {
- throw new ValidationException(
- "builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism"
- );
- }
- //used mostly as a BootstrapState
- GenericBootstrapImpl state = new GenericBootstrapImpl();
- if ( resolver == null ) {
- resolver = state.getDefaultValidationProviderResolver();
- }
- else {
- //stay null if no resolver is defined
- state.providerResolver( resolver );
- }
-
- List<ValidationProvider<?>> resolvers;
- try {
- resolvers = resolver.getValidationProviders();
- }
- catch ( RuntimeException re ) {
- throw new ValidationException( "Unable to get available provider resolvers.", re );
- }
-
- for ( ValidationProvider provider : resolvers ) {
- if ( validationProviderClass.isAssignableFrom( provider.getClass() ) ) {
- ValidationProvider<T> specificProvider = validationProviderClass.cast( provider );
- return specificProvider.createSpecializedConfiguration( state );
-
- }
- }
- throw new ValidationException( "Unable to find provider: " + validationProviderClass );
- }
- }
-
- //private class, not exposed
- private static class GenericBootstrapImpl implements GenericBootstrap, BootstrapState {
-
- private ValidationProviderResolver resolver;
- private ValidationProviderResolver defaultResolver;
-
- public GenericBootstrap providerResolver(ValidationProviderResolver resolver) {
- this.resolver = resolver;
- return this;
- }
-
- public ValidationProviderResolver getValidationProviderResolver() {
- return resolver;
- }
-
- public ValidationProviderResolver getDefaultValidationProviderResolver() {
- if ( defaultResolver == null ) {
- defaultResolver = new DefaultValidationProviderResolver();
- }
- return defaultResolver;
- }
-
- public Configuration<?> configure() {
- ValidationProviderResolver resolver = this.resolver == null ?
- getDefaultValidationProviderResolver() :
- this.resolver;
-
- List<ValidationProvider<?>> resolvers;
- try {
- resolvers = resolver.getValidationProviders();
- }
- catch ( RuntimeException re ) {
- throw new ValidationException( "Unable to get available provider resolvers.", re );
- }
-
- if ( resolvers.size() == 0 ) {
- //FIXME looks like an assertion error almost
- throw new ValidationException( "Unable to find a default provider" );
- }
-
- Configuration<?> config;
- try {
- config = resolver.getValidationProviders().get( 0 ).createGenericConfiguration( this );
- }
- catch ( RuntimeException re ) {
- throw new ValidationException( "Unable to instantiate Configuration.", re );
- }
-
- return config;
- }
- }
-
- /**
- * Find <code>ValidationProvider</code> according to the default <code>ValidationProviderResolver</code> defined in the
- * Bean Validation specification. This implementation uses the current classloader or the classloader which has loaded
- * the current class if the current class loader is unavailable. The classloader is used to retrieve the Service Provider files.
- * <p>
- * This class implements the Service Provider pattern described <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider">here</a>.
- * Since we cannot rely on Java 6 we have to reimplement the <code>Service</code> functionality.
- * </p>
- *
- * @author Emmanuel Bernard
- * @author Hardy Ferentschik
- */
- private static class DefaultValidationProviderResolver implements ValidationProviderResolver {
-
- //cache per classloader for an appropriate discovery
- //keep them in a weak hashmap to avoid memory leaks and allow proper hot redeployment
- //TODO use a WeakConcurrentHashMap
- //FIXME The List<VP> does keep a strong reference to the key ClassLoader, use the same model as JPA CachingPersistenceProviderResolver
- private static final Map<ClassLoader, List<ValidationProvider<?>>> providersPerClassloader =
- new WeakHashMap<ClassLoader, List<ValidationProvider<?>>>();
-
- private static final String SERVICES_FILE = "META-INF/services/" + ValidationProvider.class.getName();
-
- public List<ValidationProvider<?>> getValidationProviders() {
- ClassLoader classloader = GetClassLoader.fromContext();
- if ( classloader == null ) {
- classloader = GetClassLoader.fromClass( DefaultValidationProviderResolver.class );
- }
-
- List<ValidationProvider<?>> providers;
- synchronized ( providersPerClassloader ) {
- providers = providersPerClassloader.get( classloader );
- }
-
- if ( providers == null ) {
- providers = new ArrayList<ValidationProvider<?>>();
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class<? extends ValidationProvider> providerClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(ValidationProvider.class);
- if (providerClass != null) {
- providers.add(providerClass.newInstance());
- }
- } catch (Throwable e) {
- // Do nothing here
- }
- String name = null;
- try {
- Enumeration<URL> providerDefinitions = classloader.getResources( SERVICES_FILE );
- while ( providerDefinitions.hasMoreElements() ) {
- URL url = providerDefinitions.nextElement();
- InputStream stream = url.openStream();
- try {
- BufferedReader reader = new BufferedReader( new InputStreamReader( stream ), 100 );
- name = reader.readLine();
- while ( name != null ) {
- name = name.trim();
- if ( !name.startsWith( "#" ) ) {
- final Class<?> providerClass = loadClass(
- name,
- DefaultValidationProviderResolver.class
- );
-
- providers.add(
- ( ValidationProvider ) providerClass.newInstance()
- );
- }
- name = reader.readLine();
- }
- }
- finally {
- stream.close();
- }
- }
- }
- catch ( IOException e ) {
- throw new ValidationException( "Unable to read " + SERVICES_FILE, e );
- }
- catch ( ClassNotFoundException e ) {
- //TODO is it better to not fail the whole loading because of a black sheep?
- throw new ValidationException( "Unable to load Bean Validation provider " + name, e );
- }
- catch ( IllegalAccessException e ) {
- throw new ValidationException( "Unable to instanciate Bean Validation provider" + name, e );
- }
- catch ( InstantiationException e ) {
- throw new ValidationException( "Unable to instanciate Bean Validation provider" + name, e );
- }
-
- synchronized ( providersPerClassloader ) {
- providersPerClassloader.put( classloader, providers );
- }
- }
-
- return providers;
- }
-
- private static Class<?> loadClass(String name, Class<?> caller) throws ClassNotFoundException {
- try {
- //try context classloader, if fails try caller classloader
- ClassLoader loader = GetClassLoader.fromContext();
- if ( loader != null ) {
- return loader.loadClass( name );
- }
- }
- catch ( ClassNotFoundException e ) {
- //trying caller classloader
- if ( caller == null ) {
- throw e;
- }
- }
- return Class.forName( name, true, GetClassLoader.fromClass( caller ) );
- }
- }
-
- private static class GetClassLoader implements PrivilegedAction<ClassLoader> {
- private final Class<?> clazz;
-
- public static ClassLoader fromContext() {
- final GetClassLoader action = new GetClassLoader( null );
- if ( System.getSecurityManager() != null ) {
- return AccessController.doPrivileged( action );
- }
- else {
- return action.run();
- }
- }
-
- public static ClassLoader fromClass(Class<?> clazz) {
- if ( clazz == null ) {
- throw new IllegalArgumentException( "Class is null" );
- }
- final GetClassLoader action = new GetClassLoader( clazz );
- if ( System.getSecurityManager() != null ) {
- return AccessController.doPrivileged( action );
- }
- else {
- return action.run();
- }
- }
-
- private GetClassLoader(Class<?> clazz) {
- this.clazz = clazz;
- }
-
- public ClassLoader run() {
- if ( clazz != null ) {
- return clazz.getClassLoader();
- }
- else {
- return Thread.currentThread().getContextClassLoader();
- }
- }
- }
-}
-
diff --git a/trunk/jsr311-api-0.8/pom.xml b/trunk/jsr311-api-0.8/pom.xml
deleted file mode 100644
index 877bffd..0000000
--- a/trunk/jsr311-api-0.8/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr311-api-0.8</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-311 API 0.8</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>0.8</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.ws.rs*;version=0.8;-split-package:=merge-first</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first;-noimport:=true</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.ws.rs:jsr311-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.ws.rs:jsr311-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr311-api-0.8/src/main/java/javax/ws/rs/ext/FactoryFinder.java b/trunk/jsr311-api-0.8/src/main/java/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index 46a72a9..0000000
--- a/trunk/jsr311-api-0.8/src/main/java/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * 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 javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-class FactoryFinder {
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @exception ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <P>
- * This method is package private so that this code can be shared.
- *
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @exception ClassNotFoundException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new ClassNotFoundException(x.toString(), x);
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is = null;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-}
diff --git a/trunk/jsr311-api-1.0/pom.xml b/trunk/jsr311-api-1.0/pom.xml
deleted file mode 100644
index fb5dfeb..0000000
--- a/trunk/jsr311-api-1.0/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr311-api-1.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-311 API 1.0</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.ws.rs*;version=1.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.ws.rs:jsr311-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.ws.rs:jsr311-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr311-api-1.0/src/main/java/javax/ws/rs/ext/FactoryFinder.java b/trunk/jsr311-api-1.0/src/main/java/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index ec878db..0000000
--- a/trunk/jsr311-api-1.0/src/main/java/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * FactoryFinder.java
- *
- * Created on November 16, 2007, 3:14 PM
- *
- */
-package javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-class FactoryFinder {
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @exception ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <P>
- * This method is package private so that this code can be shared.
- *
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @exception WebServiceException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new ClassNotFoundException(x.toString(), x);
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-}
diff --git a/trunk/jsr311-api-1.1.1/pom.xml b/trunk/jsr311-api-1.1.1/pom.xml
deleted file mode 100644
index fd31b45..0000000
--- a/trunk/jsr311-api-1.1.1/pom.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr311-api-1.1.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-311 API 1.1.1</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <!-- temporarily add java.net repo until JAX-RS 1.1.1 API is on the central repo -->
- <repository>
- <id>java.net.2</id>
- <name>Java Net 2 Repository</name>
- <url>http://download.java.net/maven/2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.ws.rs*;version=1.1.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.ws.rs:jsr311-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.ws.rs:jsr311-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr311-api-1.1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java b/trunk/jsr311-api-1.1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index c82a1aa..0000000
--- a/trunk/jsr311-api-1.1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-public class FactoryFinder {
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @throws ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <p/>
- * This method is package private so that this code can be shared.
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- * @throws WebServiceException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new ClassNotFoundException(x.toString(), x);
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-
-}
diff --git a/trunk/jsr311-api-1.1/pom.xml b/trunk/jsr311-api-1.1/pom.xml
deleted file mode 100644
index 3454e5c..0000000
--- a/trunk/jsr311-api-1.1/pom.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr311-api-1.1</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-311 API 1.1</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <!-- temporarily add java.net repo until JAX-RS 1.1 API is in central repo -->
- <repository>
- <id>java.net.2</id>
- <name>Java Net 2 Repository</name>
- <url>http://download.java.net/maven/2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.ws.rs*;version=1.1;-split-package:=merge-first</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first;-noimport:=true</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.ws.rs:jsr311-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.ws.rs:jsr311-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/jsr311-api-1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java b/trunk/jsr311-api-1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index ec878db..0000000
--- a/trunk/jsr311-api-1.1/src/main/java/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * FactoryFinder.java
- *
- * Created on November 16, 2007, 3:14 PM
- *
- */
-package javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-class FactoryFinder {
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @exception ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <P>
- * This method is package private so that this code can be shared.
- *
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @exception WebServiceException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new ClassNotFoundException(x.toString(), x);
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-}
diff --git a/trunk/jsr339-api-m10/pom.xml b/trunk/jsr339-api-m10/pom.xml
deleted file mode 100644
index e2b1c8c..0000000
--- a/trunk/jsr339-api-m10/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.jsr339-api-m10</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: JSR-339 API M10</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0-m10</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.ws.rs*;version=2.0.0.m10;-split-package:=merge-first</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first;-noimport:=true</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>javax.ws.rs:javax.ws.rs-api</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>javax.ws.rs:javax.ws.rs-api</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
\ No newline at end of file
diff --git a/trunk/jsr339-api-m10/src/main/java/javax/ws/rs/ext/FactoryFinder.java b/trunk/jsr339-api-m10/src/main/java/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index c82a1aa..0000000
--- a/trunk/jsr339-api-m10/src/main/java/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-public class FactoryFinder {
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @throws ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- spiClass = classLoader.loadClass(className);
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <p/>
- * This method is package private so that this code can be shared.
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- * @throws WebServiceException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- Class factoryClass = FactoryFinder.class.getClassLoader().loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- ClassLoader classLoader;
- try {
- classLoader = Thread.currentThread().getContextClassLoader();
- } catch (Exception x) {
- throw new ClassNotFoundException(x.toString(), x);
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-
-}
diff --git a/trunk/locator/pom.xml b/trunk/locator/pom.xml
deleted file mode 100644
index 9b14187..0000000
--- a/trunk/locator/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <packaging>jar</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Locator</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java b/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
deleted file mode 100644
index 9e61f8b..0000000
--- a/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/Activator.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- * 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.servicemix.specs.locator;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.SynchronousBundleListener;
-
-public class Activator implements BundleActivator, SynchronousBundleListener {
-
- private static boolean debug = false;
-
- private ConcurrentMap<Long, Map<String, Callable<Class>>> factories = new ConcurrentHashMap<Long, Map<String, Callable<Class>>>();
-
- private BundleContext bundleContext;
-
- static {
- try {
- String prop = System.getProperty("org.apache.servicemix.specs.debug");
- debug = prop != null && !"false".equals(prop);
- } catch (Throwable t) { }
- }
-
- /**
- * <p>Output debugging messages.</p>
- *
- * @param msg <code>String</code> to print to <code>stderr</code>.
- */
- protected void debugPrintln(String msg) {
- if (debug) {
- System.err.println("Spec(" + bundleContext.getBundle().getBundleId() + "): " + msg);
- }
- }
-
- public synchronized void start(BundleContext bundleContext) throws Exception {
- this.bundleContext = bundleContext;
- debugPrintln("activating");
- debugPrintln("adding bundle listener");
- bundleContext.addBundleListener(this);
- debugPrintln("checking existing bundles");
- for (Bundle bundle : bundleContext.getBundles()) {
- if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING ||
- bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STOPPING) {
- register(bundle);
- }
- }
- debugPrintln("activated");
- }
-
- public synchronized void stop(BundleContext bundleContext) throws Exception {
- debugPrintln("deactivating");
- bundleContext.removeBundleListener(this);
- while (!factories.isEmpty()) {
- unregister(factories.keySet().iterator().next());
- }
- debugPrintln("deactivated");
- this.bundleContext = null;
- }
-
- public void bundleChanged(BundleEvent event) {
- if (event.getType() == BundleEvent.RESOLVED) {
- register(event.getBundle());
- } else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) {
- unregister(event.getBundle().getBundleId());
- }
- }
-
- protected void register(final Bundle bundle) {
- debugPrintln("checking bundle " + bundle.getBundleId());
- Map<String, Callable<Class>> map = factories.get(bundle.getBundleId());
- Enumeration e = bundle.findEntries("META-INF/services/", "*", false);
- if (e != null) {
- while (e.hasMoreElements()) {
- final URL u = (URL) e.nextElement();
- final String url = u.toString();
- if (url.endsWith("/")) {
- continue;
- }
- final String factoryId = url.substring(url.lastIndexOf("/") + 1);
- if (map == null) {
- map = new HashMap<String, Callable<Class>>();
- factories.put(bundle.getBundleId(), map);
- }
- map.put(factoryId, new BundleFactoryLoader(factoryId, u, bundle));
- }
- }
- if (map != null) {
- for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
- debugPrintln("registering service for key " + entry.getKey() + " with value " + entry.getValue());
- OsgiLocator.register(entry.getKey(), entry.getValue());
- }
- }
- }
-
- protected void unregister(long bundleId) {
- Map<String, Callable<Class>> map = factories.remove(bundleId);
- if (map != null) {
- for (Map.Entry<String, Callable<Class>> entry : map.entrySet()) {
- debugPrintln("unregistering service for key " + entry.getKey() + " with value " + entry.getValue());
- OsgiLocator.unregister(entry.getKey(), entry.getValue());
- }
- }
- }
-
- private class BundleFactoryLoader implements Callable<Class> {
- private final String factoryId;
- private final URL u;
- private final Bundle bundle;
- private volatile Class<?> clazz;
-
- public BundleFactoryLoader(String factoryId, URL u, Bundle bundle) {
- this.factoryId = factoryId;
- this.u = u;
- this.bundle = bundle;
- }
-
- public Class call() throws Exception {
- try {
- debugPrintln("loading factory for key: " + factoryId);
-
- if (clazz == null){
- synchronized (this) {
- if (clazz == null){
- debugPrintln("creating factory for key: " + factoryId);
- BufferedReader br = new BufferedReader(new InputStreamReader(u.openStream(), "UTF-8"));
- String factoryClassName = br.readLine();
- br.close();
- debugPrintln("factory implementation: " + factoryClassName);
- clazz = bundle.loadClass(factoryClassName);
- }
- }
- }
- return clazz;
- } catch (Exception e) {
- debugPrintln("exception caught while creating factory: " + e);
- throw e;
- } catch (Error e) {
- debugPrintln("error caught while creating factory: " + e);
- throw e;
- }
- }
-
- @Override
- public String toString() {
- return u.toString();
- }
-
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof BundleFactoryLoader) {
- return u.equals(((BundleFactoryLoader) obj).u);
- } else {
- return false;
- }
- }
- }
-}
diff --git a/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java b/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
deleted file mode 100644
index d38dfef..0000000
--- a/trunk/locator/src/main/java/org/apache/servicemix/specs/locator/OsgiLocator.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/**
- * 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.servicemix.specs.locator;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-public class OsgiLocator {
-
- public static final long DEFAULT_TIMEOUT = 0l;
- public static final String TIMEOUT = "org.apache.servicemix.specs.timeout";
-
- private static Map<String, List<Callable<Class>>> factories;
-
- private static ReadWriteLock lock = new ReentrantReadWriteLock();
-
- private OsgiLocator() {
- }
-
- public static void unregister(String id, Callable<Class> factory) {
- lock.writeLock().lock();
- try {
- if (factories != null) {
- List<Callable<Class>> l = factories.get(id);
- if (l != null) {
- l.remove(factory);
- }
- }
- } finally {
- lock.writeLock().unlock();
- }
- }
-
- public static void register(String id, Callable<Class> factory) {
- lock.writeLock().lock();
- try {
- if (factories == null) {
- factories = new HashMap<String, List<Callable<Class>>>();
- }
- List<Callable<Class>> l = factories.get(id);
- if (l == null) {
- l = new ArrayList<Callable<Class>>();
- factories.put(id, l);
- }
- l.add(0, factory);
- synchronized (lock) {
- lock.notifyAll();
- }
- } finally {
- lock.writeLock().unlock();
- }
- }
-
-
- public static <T> Class<? extends T> locate(Class<T> factoryId) {
- return locate(factoryId, factoryId.getName());
- }
-
- private static long getTimeout() {
- long timeout = DEFAULT_TIMEOUT;
- try {
- String prop = System.getProperty(TIMEOUT);
- if (prop != null) {
- timeout = Long.parseLong(prop);
- }
- } catch (Throwable t) { }
- return timeout;
- }
-
- public static <T> Class<? extends T> locate(Class<T> factoryClass, String factoryId) {
- long timeout = getTimeout();
- if (timeout <= 0) {
- return doLocate(factoryClass, factoryId);
- }
- long t0 = System.currentTimeMillis();
- long t1 = t0;
- while (t1 - t0 < timeout) {
- Class<? extends T> impl = doLocate(factoryClass, factoryId);
- if (impl != null) {
- return impl;
- }
- synchronized (lock) {
- try {
- lock.wait(timeout - (t1 - t0));
- } catch (InterruptedException e) {
- return null;
- }
- }
- t1 = System.currentTimeMillis();
- }
- return null;
- }
-
- private static <T> Class<? extends T> doLocate(Class<T> factoryClass, String factoryId) {
- lock.readLock().lock();
- try {
- if (factories != null) {
- List<Callable<Class>> l = factories.get(factoryId);
- if (l != null && !l.isEmpty()) {
- // look up the System property first
- String factoryClassName = System.getProperty(factoryId);
- try {
- for (Callable<Class> i : l) {
- Class c = null;
- try {
- c = i.call();
- } catch (Exception ex) {
- // do nothing here
- }
- if (c != null && factoryClass == c.getClassLoader().loadClass(factoryClass.getName())
- && (factoryClassName == null || c.getName().equals(factoryClassName)))
- {
- return c;
- }
- }
- } catch (Exception ex) {
- // do nothing here
- }
- }
- }
- return null;
- } finally {
- lock.readLock().unlock();
- }
- }
-
- public static <T> List<Class<? extends T>> locateAll(Class<T> factoryId) {
- return locateAll(factoryId, factoryId.getName());
- }
-
- public static <T> List<Class<? extends T>> locateAll(Class<T> factoryClass, String factoryId) {
- lock.readLock().lock();
- try {
- List<Class<? extends T>> classes = new ArrayList<Class<? extends T>>();
- if (factories != null) {
- List<Callable<Class>> l = factories.get(factoryId);
- if (l != null) {
- for (Callable<Class> i : l) {
- try {
- Class c = i.call();
- if (c != null && factoryClass.isAssignableFrom(c)) {
- classes.add(c);
- }
- } catch (Exception e) {
- }
- }
- }
- }
- return classes;
- } finally {
- lock.readLock().unlock();
- }
- }
-
-}
diff --git a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable.java b/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable.java
deleted file mode 100644
index 9b5d8c0..0000000
--- a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.servicemix.specs.locator;
-
-import java.util.concurrent.Callable;
-
-public class MockCallable implements Callable<Class> {
-
- public Class call() throws Exception {
- return this.getClass();
- }
-
-}
diff --git a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable2.java b/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable2.java
deleted file mode 100644
index 301ab14..0000000
--- a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/MockCallable2.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.servicemix.specs.locator;
-
-import java.util.concurrent.Callable;
-
-public class MockCallable2 implements Callable<Class> {
-
- public Class call() throws Exception {
- return this.getClass();
- }
-
-}
diff --git a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/OsgiLocatorTest.java b/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/OsgiLocatorTest.java
deleted file mode 100644
index a416834..0000000
--- a/trunk/locator/src/test/java/org/apache/servicemix/specs/locator/OsgiLocatorTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * 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.servicemix.specs.locator;
-
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class OsgiLocatorTest extends Assert {
-
- @BeforeClass
- public static void setup() {
- OsgiLocator.register("Factory", new MockCallable());
- OsgiLocator.register("Factory", new MockCallable2());
- }
-
- @Test
- public void testLocatorWithSystemProperty() {
- System.setProperty(OsgiLocator.TIMEOUT, "0");
- System.setProperty("Factory", "org.apache.servicemix.specs.locator.MockCallable");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable.class.getName(), clazz.getName());
-
- System.setProperty("Factory", "org.apache.servicemix.specs.locator");
- clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNull("Did not expect to find a class", clazz);
- }
-
- @Test
- public void testLocatorWithoutSystemProperty() {
- System.setProperty(OsgiLocator.TIMEOUT, "0");
- System.clearProperty("Factory");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable2.class.getName(), clazz.getName());
- }
-
- @Test
- public void testLocatorWithSystemPropertyAndTimeout() {
- long timeout = 1000;
- System.setProperty(OsgiLocator.TIMEOUT, Long.toString(timeout));
- System.setProperty("Factory", "org.apache.servicemix.specs.locator.MockCallable");
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class.", MockCallable.class.getName(), clazz.getName());
-
- System.setProperty("Factory", "org.apache.servicemix.specs.locator");
- long t0 = System.currentTimeMillis();
- clazz = OsgiLocator.locate(Object.class, "Factory");
- long t1 = System.currentTimeMillis();
- assertNull("Did not expect to find a class", clazz);
- assertTrue("Timeout issue", (t1 - t0) > timeout / 2);
- }
-
- @Test
- public void testLocatorWithoutSystemPropertyAndTimeout() {
- long timeout = 1000;
- System.setProperty(OsgiLocator.TIMEOUT, Long.toString(timeout));
- System.clearProperty("Factory");
- long t0 = System.currentTimeMillis();
- Class clazz = OsgiLocator.locate(Object.class, "Factory");
- long t1 = System.currentTimeMillis();
- assertNotNull("Expected to find a class", clazz);
- assertEquals("Got the wrong class", MockCallable2.class.getName(), clazz.getName());
- assertTrue("Timeout issue", (t1 - t0) < timeout / 2);
- }
-
-}
diff --git a/trunk/pom.xml b/trunk/pom.xml
deleted file mode 100644
index 10e9cf4..0000000
--- a/trunk/pom.xml
+++ /dev/null
@@ -1,378 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix</groupId>
- <artifactId>servicemix-pom</artifactId>
- <relativePath>../servicemix-pom/pom.xml</relativePath>
- <version>5</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <packaging>pom</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs</name>
- <inceptionYear>2007</inceptionYear>
-
- <modules>
- <module>locator</module>
- <module>activator</module>
- <module>saaj-api-1.3</module>
- <module>stax-api-1.0</module>
- <module>stax-api-1.2</module>
- <module>jain-sip-api-1.2</module>
- <module>jaxb-api-2.0</module>
- <module>jaxb-api-2.1</module>
- <module>jaxb-api-2.2</module>
- <module>jaxp-api-1.3</module>
- <module>jaxp-api-1.4</module>
- <module>jaxws-api-2.0</module>
- <module>jaxws-api-2.1</module>
- <module>jaxws-api-2.2</module>
- <module>jbi-api-1.0</module>
- <module>scripting-api-1.0</module>
- <module>jsr250-1.0</module>
- <module>jsr311-api-0.8</module>
- <module>jsr311-api-1.0</module>
- <module>jsr311-api-1.1</module>
- <module>jsr311-api-1.1.1</module>
- <module>jsr339-api-m10</module>
- <module>javamail-api-1.4</module>
- <module>activation-api-1.1</module>
- <module>java-persistence-api-1.1.1</module>
- <module>java-persistence-api-2.0</module>
- <module>jsr303-api-1.0.0</module>
- <module>jcr-api-2.0</module>
- <module>assembly</module>
- </modules>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/servicemix/smx4/specs/tags/specs-2.1.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/servicemix/smx4/specs/tags/specs-2.1.0</developerConnection>
- <url>http://svn.apache.org/viewvc/servicemix/smx4/specs/tags/specs-2.1.0</url>
- </scm>
-
- <issueManagement>
- <system>jira</system>
- <url>http://issues.apache.org/jira/browse/SMX4</url>
- </issueManagement>
-
- <prerequisites>
- <maven>2.0.7</maven>
- </prerequisites>
-
- <properties>
- <osgi.version>4.2.0</osgi.version>
- </properties>
-
- <repositories>
- <!-- Default repository -->
- <repository>
- <id>central</id>
- <name>Default maven repo</name>
- <url>http://repo1.maven.org/maven2</url>
- </repository>
- <!-- ServiceMix repo -->
- <repository>
- <id>servicemix</id>
- <name>Apache ServiceMix Repository</name>
- <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <!-- ServiceMix repo -->
- <pluginRepository>
- <id>servicemix</id>
- <name>Apache ServiceMix Repository</name>
- <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
- </pluginRepository>
- <!-- JApiDiff-->
- <pluginRepository>
- <id>japidiff</id>
- <name>JApiDiff Repository</name>
- <url>http://japidiff.googlecode.com/svn/m2-repo</url>
- </pluginRepository>
- </pluginRepositories>
-
- <dependencies>
- <!-- adding the OSGi JAR everywhere to ensure javadoc can get built -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${osgi.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.servicemix.legal</groupId>
- <artifactId>legal</artifactId>
- <version>1.0</version>
- <type>xml</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <build>
- <defaultGoal>install</defaultGoal>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.1</version>
- </plugin>
- <!--
- Adding some extra config to what has already been defined in org.apache:apache-7:pom
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <preparationGoals>clean install</preparationGoals>
- <arguments>-Prelease,deploy</arguments>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.1.0</version>
- <extensions>true</extensions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <maxmem>256M</maxmem>
- <fork>${compiler.fork}</fork>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-idea-plugin</artifactId>
- <version>2.1</version>
- <configuration>
- <downloadSources>true</downloadSources>
- <downloadJavadocs>true</downloadJavadocs>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.1</version>
- </plugin>
- <plugin>
- <groupId>com.google.code.japidiff</groupId>
- <artifactId>maven-japidiff-plugin</artifactId>
- <version>1.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.4</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <id>copy-legal</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.servicemix.legal</groupId>
- <artifactId>legal</artifactId>
- <version>1.0</version>
- <type>xml</type>
- <outputDirectory>target/legal/</outputDirectory>
- </artifactItem>
- </artifactItems>
- <stripVersion>true</stripVersion>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-remote-resources-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <goals>
- <goal>process</goal>
- </goals>
- <configuration>
- <resourceBundles>
- <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
- </resourceBundles>
- <supplementalModels>
- <supplementalModel>target/legal/legal.xml</supplementalModel>
- </supplementalModels>
- <properties>
- <addLicense>true</addLicense>
- <addArtifact>true</addArtifact>
- <projectName>Apache ServiceMix</projectName>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <breakiterator>true</breakiterator>
- <quiet>true</quiet>
- <verbose>false</verbose>
- <source>1.5</source>
- <linksource>true</linksource>
- <links>
- <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
- <link>http://download.oracle.com/javaee/5/api/</link>
- <link>http://www.osgi.org/javadoc/r4/</link>
- </links>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- </plugins>
- </reporting>
-
- <profiles>
- <profile>
- <id>fastinstall</id>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
- </profile>
- <profile>
- <id>rat</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>rat-maven-plugin</artifactId>
- <version>1.0-alpha-3</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <reportFile>${project.build.directory}/${project.build.finalName}.rat</reportFile>
- <excludes>
- <exclude>**/target/**/*</exclude>
- <!-- IDEA files -->
- <exclude>**/*.iml</exclude>
- <exclude>**/*.ipr</exclude>
- <exclude>**/*.iws</exclude>
- <!-- Eclipse files -->
- <exclude>**/.*</exclude>
- <exclude>**/eclipse-classes/**/*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <!-- We want to deploy the artifact to a staging location for perusal -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.3</version>
- <inherited>true</inherited>
- <configuration>
- <altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
- <updateReleaseInfo>true</updateReleaseInfo>
- </configuration>
- </plugin>
- <!-- We want to sign the artifact, the POM, and all attached artifacts -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <version>1.0-alpha-4</version>
- <executions>
- <execution>
- <goals>
- <goal>sign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>deploy</id>
- <build>
- <defaultGoal>deploy</defaultGoal>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/saaj-api-1.3/pom.xml b/trunk/saaj-api-1.3/pom.xml
deleted file mode 100644
index 8ae78a2..0000000
--- a/trunk/saaj-api-1.3/pom.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.saaj-api-1.3</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: SAAJ API 1.3</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-saaj_1.3_spec</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.soap*;version=1.3;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-saaj_1.3_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- <include>${project.groupId}:${project.artifactId}</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-saaj_1.3_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-saaj_1.3_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java b/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
deleted file mode 100644
index ac9e9f5..0000000
--- a/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * 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 javax.xml.soap;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Properties;
-
-/**
- * This class is used to locate factory classes for javax.xml.soap. It has package scope since it is
- * not part of JAXM and should not be accessed from other packages.
- */
-class FactoryFinder {
- /**
- * instantiates an object go the given classname.
- *
- * @param factoryClassName
- * @return a factory object
- * @throws SOAPException
- */
- private static Object newInstance(String factoryClassName) throws SOAPException {
- ClassLoader classloader = null;
- try {
- classloader = Thread.currentThread().getContextClassLoader();
- } catch (Exception exception) {
- throw new SOAPException(exception.toString(), exception);
- }
-
- try {
- Class factory = null;
- if (classloader == null) {
- factory = Class.forName(factoryClassName);
- } else {
- try {
- factory = classloader.loadClass(factoryClassName);
- } catch (ClassNotFoundException cnfe) {
- }
- }
- if (factory == null) {
- classloader = FactoryFinder.class.getClassLoader();
- factory = classloader.loadClass(factoryClassName);
- }
- return factory.newInstance();
- } catch (ClassNotFoundException classnotfoundexception) {
- throw new SOAPException(
- "Provider " + factoryClassName + " not found",
- classnotfoundexception);
- } catch (Exception exception) {
- throw new SOAPException(
- "Provider " + factoryClassName +
- " could not be instantiated: " +
- exception,
- exception);
- }
- }
-
- /**
- * Instantiates a factory object given the factory's property name and the default class name.
- *
- * @param factoryPropertyName
- * @param defaultFactoryClassName
- * @return a factory object
- * @throws SOAPException
- */
- static Object find(Class factory,
- String defaultFactoryClassName) throws SOAPException {
- return find(factory.getName(), factory, defaultFactoryClassName);
- }
- /**
- * Instantiates a factory object given the factory's property name and the default class name.
- *
- * @param factoryPropertyName
- * @param defaultFactoryClassName
- * @return a factory object
- * @throws SOAPException
- */
- static Object find(String factoryPropertyName,
- String defaultFactoryClassName) throws SOAPException {
- return find(factoryPropertyName, null, defaultFactoryClassName);
- }
- /**
- * Instantiates a factory object given the factory's property name and the default class name.
- *
- * @param factoryPropertyName
- * @param defaultFactoryClassName
- * @return a factory object
- * @throws SOAPException
- */
- static Object find(String factoryPropertyName,
- Class factoryClass,
- String defaultFactoryClassName) throws SOAPException {
- try {
- // If we are deployed into an OSGi environment, leverage it
- if (factoryClass == null) {
- String factoryClassName = factoryPropertyName;
- if (factoryPropertyName.equals("javax.xml.soap.MetaFactory")) {
- //this is an exception that the factoryPropertyName isn't
- //the actual factory class name, there is no class
- //javax.xml.soap.MetaFactory at all
- factoryClassName = "javax.xml.soap.SAAJMetaFactory";
- }
- ClassLoader cl = FactoryFinder.class.getClassLoader();
- if (cl == null) {
- cl = Thread.currentThread().getContextClassLoader();
- }
- factoryClass = cl.loadClass(factoryClassName);
- }
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryPropertyName);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- try {
- String factoryClassName = System.getProperty(factoryPropertyName);
- if (factoryClassName != null) {
- return newInstance(factoryClassName);
- }
- } catch (SecurityException securityexception) {
- }
-
- try {
- String propertiesFileName = System.getProperty("java.home")
- + File.separator + "lib"
- + File.separator + "jaxm.properties";
- File file = new File(propertiesFileName);
- if (file.exists()) {
- FileInputStream fileInput = new FileInputStream(file);
- Properties properties = new Properties();
- properties.load(fileInput);
- fileInput.close();
- String factoryClassName = properties.getProperty(
- factoryPropertyName);
- return newInstance(factoryClassName);
- }
- } catch (Exception exception1) {
- }
-
- String factoryResource = "META-INF/services/" + factoryPropertyName;
-
- try {
- InputStream inputstream = getResource(factoryResource);
- if (inputstream != null) {
- BufferedReader bufferedreader = new BufferedReader(
- new InputStreamReader(inputstream, "UTF-8"));
- String factoryClassName = bufferedreader.readLine();
- bufferedreader.close();
- if ((factoryClassName != null) && !"".equals(factoryClassName)) {
- try {
- return newInstance(factoryClassName);
- } catch (Exception e) {
- throw new SOAPException(
- "Provider for " + factoryPropertyName + " cannot be found",
- null);
- }
- }
- }
- } catch (Exception exception2) {
- }
-
- if (defaultFactoryClassName == null) {
- throw new SOAPException(
- "Provider for " + factoryPropertyName + " cannot be found",
- null);
- } else {
- return newInstance(defaultFactoryClassName);
- }
- }
-
- /**
- * Returns an input stream for the specified resource.
- * <p/>
- * <p>This method will firstly try <code>ClassLoader.getSystemResourceAsStream()</code> then the
- * class loader of the current thread with <code>getResourceAsStream()</code> and finally
- * attempt <code>getResourceAsStream()</code> on <code>FactoryFinder.class.getClassLoader()</code>.
- *
- * @param factoryResource the resource name
- * @return an InputStream that can be used to read that resource, or <code>null</code> if the
- * resource could not be resolved
- */
- private static InputStream getResource(String factoryResource) {
- ClassLoader classloader = null;
- try {
- classloader = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException securityexception) {
- }
-
- InputStream inputstream;
- if (classloader == null) {
- inputstream =
- ClassLoader.getSystemResourceAsStream(factoryResource);
- } else {
- inputstream = classloader.getResourceAsStream(factoryResource);
- }
-
- if (inputstream == null) {
- inputstream =
- FactoryFinder.class.getClassLoader().getResourceAsStream(
- factoryResource);
- }
- return inputstream;
- }
-}
diff --git a/trunk/scripting-api-1.0/pom.xml b/trunk/scripting-api-1.0/pom.xml
deleted file mode 100644
index 992726d..0000000
--- a/trunk/scripting-api-1.0/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.scripting-api-1.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Scripting API 1.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- <version>2.0.5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.script*;version=1.0;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.livetribe:livetribe-jsr223</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.livetribe:livetribe-jsr223</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.livetribe</groupId>
- <artifactId>livetribe-jsr223</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/scripting-api-1.0/src/main/java/javax/script/ScriptEngineManager.java b/trunk/scripting-api-1.0/src/main/java/javax/script/ScriptEngineManager.java
deleted file mode 100644
index a4df037..0000000
--- a/trunk/scripting-api-1.0/src/main/java/javax/script/ScriptEngineManager.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * 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 javax.script;
-
-import java.io.*;
-import java.lang.annotation.AnnotationFormatError;
-import java.net.URL;
-import java.util.*;
-
-public class ScriptEngineManager {
-
- private final Set engineSpis = new HashSet();
- private final Map<String, ScriptEngineFactory> byName = new HashMap<String, ScriptEngineFactory>();
- private final Map<String, ScriptEngineFactory> registeredByName = new HashMap();
- private final Map<String, ScriptEngineFactory> byExtension = new HashMap<String, ScriptEngineFactory>();
- private final Map<String, ScriptEngineFactory> registeredByExtension = new HashMap<String, ScriptEngineFactory>();
- private final Map<String, ScriptEngineFactory> byMimeType = new HashMap<String, ScriptEngineFactory>();
- private final Map<String, ScriptEngineFactory> registeredByMimeType = new HashMap<String, ScriptEngineFactory>();
- private Bindings globalScope;
-
- public ScriptEngineManager() {
- this(Thread.currentThread().getContextClassLoader());
- }
-
- public ScriptEngineManager(ClassLoader classLoader) {
- try
- {
- for (Enumeration factoryResources = classLoader.getResources("META-INF/services/javax.script.ScriptEngineFactory");
- factoryResources.hasMoreElements();) {
- URL url = (URL) factoryResources.nextElement();
- for (String className : getClassNames(url)) {
- try {
- Class factoryClass = classLoader.loadClass(className);
- Object object = factoryClass.newInstance();
- if (object instanceof ScriptEngineFactory) {
- ScriptEngineFactory factory = (ScriptEngineFactory) object;
- for (String name : factory.getNames()) {
- byName.put(name, factory);
- }
- for (String extension : factory.getExtensions()) {
- byExtension.put(extension, factory);
- }
- for (String mimeType : factory.getMimeTypes()) {
- byMimeType.put(mimeType, factory);
- }
- engineSpis.add(factory);
- }
- } catch(ClassNotFoundException doNothing) {
- } catch(IllegalAccessException doNothing) {
- } catch(InstantiationException doNothing) {
- } catch(LinkageError doNothing) {
- } catch(AnnotationFormatError doNothing) {
- }
- }
- }
- } catch(IOException doNothing) {
- }
- }
-
- public Bindings getGlobalScope() {
- return globalScope;
- }
-
- public void setGlobalScope(Bindings globalScope) {
- this.globalScope = globalScope;
- }
-
- public void put(String key, Object value) {
- if (globalScope != null) {
- globalScope.put(key, value);
- }
- }
-
- public Object get(String key) {
- if (globalScope != null) {
- return globalScope.get(key);
- } else {
- return null;
- }
- }
-
- public ScriptEngine getEngineByName(String shortName) {
- ScriptEngineFactory factory = null;
- List<Class<? extends ScriptEngineFactory>> factoryClasses = org.apache.servicemix.specs.locator.OsgiLocator.locateAll(javax.script.ScriptEngineFactory.class);
- for (Class<? extends ScriptEngineFactory> factoryClass : factoryClasses) {
- try {
- ScriptEngineFactory f = factoryClass.newInstance();
- if (f.getNames().contains(shortName)) {
- factory = f;
- break;
- }
- } catch (Throwable doNothing) {
- }
- }
- if (factory == null) {
- factory = registeredByName.get(shortName);
- }
- if (factory == null) {
- factory = byName.get(shortName);
- }
- if (factory == null) {
- return null;
- } else {
- ScriptEngine engine = factory.getScriptEngine();
- engine.setBindings(globalScope, ScriptContext.GLOBAL_SCOPE);
- return engine;
- }
- }
-
- public ScriptEngine getEngineByExtension(String extension) {
- ScriptEngineFactory factory = null;
- List<Class<? extends ScriptEngineFactory>> factoryClasses = org.apache.servicemix.specs.locator.OsgiLocator.locateAll(javax.script.ScriptEngineFactory.class);
- for (Class<? extends ScriptEngineFactory> factoryClass : factoryClasses) {
- try {
- ScriptEngineFactory f = factoryClass.newInstance();
- if (f.getExtensions().contains(extension)) {
- factory = f;
- break;
- }
- } catch (Throwable doNothing) {
- }
- }
- if (factory == null) {
- factory = registeredByExtension.get(extension);
- }
- if (factory == null) {
- factory = byExtension.get(extension);
- }
- if (factory == null) {
- return null;
- } else {
- ScriptEngine engine = factory.getScriptEngine();
- engine.setBindings(globalScope, ScriptContext.GLOBAL_SCOPE);
- return engine;
- }
- }
-
- public ScriptEngine getEngineByMimeType(String mimeType) {
- ScriptEngineFactory factory = null;
- List<Class<? extends ScriptEngineFactory>> factoryClasses = org.apache.servicemix.specs.locator.OsgiLocator.locateAll(javax.script.ScriptEngineFactory.class);
- for (Class<? extends ScriptEngineFactory> factoryClass : factoryClasses) {
- try {
- ScriptEngineFactory f = factoryClass.newInstance();
- if (f.getMimeTypes().contains(mimeType)) {
- factory = f;
- break;
- }
- } catch (Throwable doNothing) {
- }
- }
- if (factory == null) {
- factory = registeredByMimeType.get(mimeType);
- }
- if(factory == null) {
- factory = byMimeType.get(mimeType);
- }
- if (factory == null) {
- return null;
- } else {
- ScriptEngine engine = factory.getScriptEngine();
- engine.setBindings(globalScope, ScriptContext.GLOBAL_SCOPE);
- return engine;
- }
- }
-
- public List<ScriptEngineFactory> getEngineFactories() {
- List<ScriptEngineFactory> factories = new ArrayList();
- List<Class<? extends ScriptEngineFactory>> factoryClasses = org.apache.servicemix.specs.locator.OsgiLocator.locateAll(javax.script.ScriptEngineFactory.class);
- for (Class<? extends ScriptEngineFactory> factoryClass : factoryClasses) {
- try {
- factories.add((ScriptEngineFactory) factoryClass.newInstance());
- } catch (Throwable doNothing) {
- }
- }
- factories.addAll(engineSpis);
- return factories;
- }
-
- public void registerEngineName(String name, ScriptEngineFactory factory) {
- registeredByName.put(name, factory);
- }
-
- public void registerEngineMimeType(String type, ScriptEngineFactory factory) {
- registeredByMimeType.put(type, factory);
- }
-
- public void registerEngineExtension(String extension, ScriptEngineFactory factory) {
- registeredByExtension.put(extension, factory);
- }
-
- private Iterable<String> getClassNames(URL url) {
- Stack<String> stack = new Stack<String>();
- try {
- BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream()));
- String line;
- while ((line = r.readLine()) != null) {
- int comment = line.indexOf('#');
- if (comment != -1) {
- line = line.substring(0, comment);
- }
- stack.push(line.trim());
- }
- } catch(IOException doNothing) {
- }
- return stack;
- }
-
-}
\ No newline at end of file
diff --git a/trunk/stax-api-1.0/pom.xml b/trunk/stax-api-1.0/pom.xml
deleted file mode 100644
index cc3a7bd..0000000
--- a/trunk/stax-api-1.0/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Stax API 1.0</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.stream*;version=1.0.1;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/FactoryLocator.java b/trunk/stax-api-1.0/src/main/java/javax/xml/stream/FactoryLocator.java
deleted file mode 100644
index cd61b8d..0000000
--- a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/FactoryLocator.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * 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 javax.xml.stream;
-
-import java.io.InputStream;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.util.Arrays;
-import java.util.Properties;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-/*
- * Here is the beef on the finding the Factory Class
- *
- * 1. Use the javax.xml.stream.XMLInputFactory system property. 2. Use the
- * properties file "lib/stax.properties" in the JRE directory. This
- * configuration file is in standard java.util.Properties format and contains
- * the fully qualified name of the implementation class with the key being the
- * system property defined above. 3. Use the Services API (as detailed in the
- * JAR specification), if available, to determine the classname. The Services
- * API will look for a classname in the file
- * META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the
- * runtime. Platform default XMLInputFactory instance.
- *
- * If the user provided a classloader we'll use that...if not, we'll assume the
- * classloader of this class.
- */
-
-class FactoryLocator {
- static Object locate(String factoryId) throws FactoryConfigurationError {
- return locate(factoryId, null);
- }
-
- static Object locate(String factoryId, String[] altClassName)
- throws FactoryConfigurationError {
- return locate(factoryId, altClassName,
- Thread.currentThread().getContextClassLoader());
- }
-
- static Object locate(String factoryId, String[] altClassName,
- ClassLoader classLoader) throws FactoryConfigurationError {
- try {
- // If we are deployed into an OSGi environment, leverage it
- ClassLoader cl = FactoryLocator.class.getClassLoader();
- if (cl == null) {
- cl = ClassLoader.getSystemClassLoader();
- }
- Class factoryClass = cl.loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- try {
- String prop = System.getProperty(factoryId);
- if (prop != null) {
- return loadFactory(prop, classLoader);
- }
- } catch (Exception e) {
- }
-
- try {
- String configFile = System.getProperty("java.home")
- + File.separator + "lib" + File.separator
- + "stax.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return loadFactory(factoryClassName, classLoader);
- }
- } catch (Exception e) {
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- try {
- InputStream is = null;
-
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(
- is, "UTF-8"));
- String factoryClassName = br.readLine();
- br.close();
-
- if (factoryClassName != null && !"".equals(factoryClassName)) {
- return loadFactory(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
- if (altClassName == null) {
- throw new FactoryConfigurationError("Unable to locate factory for "
- + factoryId + ".", null);
- }
- return loadFactory(altClassName, classLoader);
- }
-
- private static Object loadFactory(String[] classNames, ClassLoader classLoader)
- throws FactoryConfigurationError {
- for (String className : classNames) {
- try {
- Class factoryClass = classLoader == null ? Class.forName(className)
- : classLoader.loadClass(className);
-
- return factoryClass.newInstance();
- } catch (Exception x) {
- }
- }
- throw new FactoryConfigurationError("Requested factory "
- + Arrays.asList(classNames).toString()
- + " could not be instantiated");
- }
-
- private static Object loadFactory(String className, ClassLoader classLoader)
- throws FactoryConfigurationError {
- try {
- Class factoryClass = classLoader == null ? Class.forName(className)
- : classLoader.loadClass(className);
-
- return factoryClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw new FactoryConfigurationError("Requested factory "
- + className + " cannot be located. Classloader ="
- + classLoader.toString(), x);
- } catch (Exception x) {
- throw new FactoryConfigurationError("Requested factory "
- + className + " could not be instantiated: " + x, x);
- }
- }
-}
diff --git a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLEventFactory.java b/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLEventFactory.java
deleted file mode 100644
index 61ebacc..0000000
--- a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLEventFactory.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.Comment;
-import javax.xml.stream.events.DTD;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.EntityDeclaration;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.EndDocument;
-import javax.xml.stream.events.EntityReference;
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.events.StartElement;
-
-public abstract class XMLEventFactory {
-
- protected XMLEventFactory() {
- }
-
- public static XMLEventFactory newInstance()
- throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory",
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" });
- }
-
- public static XMLEventFactory newInstance(String factoryId,
- ClassLoader classLoader) throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" },
- classLoader);
- }
-
- public abstract void setLocation(Location location);
-
- public abstract Attribute createAttribute(QName name, String value);
-
- public abstract Attribute createAttribute(String localName, String value);
-
- public abstract Attribute createAttribute(String prefix,
- String namespaceURI, String localName, String value);
-
- public abstract Namespace createNamespace(String namespaceUri);
-
- public abstract Namespace createNamespace(String prefix, String namespaceUri);
-
- public abstract StartElement createStartElement(QName name,
- Iterator attributes, Iterator namespaces);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName, Iterator attributes,
- Iterator namespaces);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName, Iterator attributes,
- Iterator namespaces, NamespaceContext context);
-
- public abstract EndElement createEndElement(QName name, Iterator namespaces);
-
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri, String localName);
-
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri, String localName, Iterator namespaces);
-
- public abstract Characters createCharacters(String content);
-
- public abstract Characters createCData(String content);
-
- public abstract Characters createSpace(String content);
-
- public abstract Characters createIgnorableSpace(String content);
-
- public abstract StartDocument createStartDocument();
-
- public abstract StartDocument createStartDocument(String encoding);
-
- public abstract StartDocument createStartDocument(String encoding,
- String version);
-
- public abstract StartDocument createStartDocument(String encoding,
- String version, boolean standalone);
-
- public abstract EndDocument createEndDocument();
-
- public abstract EntityReference createEntityReference(String name,
- EntityDeclaration declaration);
-
- public abstract Comment createComment(String text);
-
- public abstract ProcessingInstruction createProcessingInstruction(
- String target, String data);
-
- public abstract DTD createDTD(String dtd);
-}
diff --git a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLInputFactory.java b/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLInputFactory.java
deleted file mode 100644
index e0e123c..0000000
--- a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLInputFactory.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-import javax.xml.stream.util.XMLEventAllocator;
-
-public abstract class XMLInputFactory {
- public static final java.lang.String ALLOCATOR = "javax.xml.stream.allocator";
- public static final java.lang.String IS_COALESCING = "javax.xml.stream.isCoalescing";
- public static final java.lang.String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
- public static final java.lang.String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
- public static final java.lang.String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
- public static final java.lang.String IS_VALIDATING = "javax.xml.stream.isValidating";
- public static final java.lang.String REPORTER = "javax.xml.stream.reporter";
- public static final java.lang.String RESOLVER = "javax.xml.stream.resolver";
- public static final java.lang.String SUPPORT_DTD = "javax.xml.stream.supportDTD";
-
- protected XMLInputFactory() {
- }
-
- public static XMLInputFactory newInstance()
- throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" });
- }
-
- public static XMLInputFactory newInstance(java.lang.String factoryId,
- java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" },
- classLoader);
- }
-
- public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- javax.xml.transform.Source source) throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.io.InputStream stream) throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.io.InputStream stream, java.lang.String encoding)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.lang.String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.lang.String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.lang.String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- javax.xml.transform.Source source) throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.io.InputStream stream) throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.io.InputStream stream, java.lang.String encoding)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.lang.String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createFilteredReader(
- XMLStreamReader reader, StreamFilter filter)
- throws XMLStreamException;
-
- public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
- EventFilter filter) throws XMLStreamException;
-
- public abstract XMLResolver getXMLResolver();
-
- public abstract void setXMLResolver(XMLResolver resolver);
-
- public abstract XMLReporter getXMLReporter();
-
- public abstract void setXMLReporter(XMLReporter reporter);
-
- public abstract void setProperty(java.lang.String name,
- java.lang.Object value) throws java.lang.IllegalArgumentException;
-
- public abstract java.lang.Object getProperty(java.lang.String name)
- throws java.lang.IllegalArgumentException;
-
- public abstract boolean isPropertySupported(java.lang.String name);
-
- public abstract void setEventAllocator(XMLEventAllocator allocator);
-
- public abstract XMLEventAllocator getEventAllocator();
-}
diff --git a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLOutputFactory.java b/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLOutputFactory.java
deleted file mode 100644
index e8a27ff..0000000
--- a/trunk/stax-api-1.0/src/main/java/javax/xml/stream/XMLOutputFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-public abstract class XMLOutputFactory {
- public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
-
- protected XMLOutputFactory() { }
-
- public static XMLOutputFactory newInstance()
- throws FactoryConfigurationError {
- return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" });
- }
-
- public static XMLInputFactory newInstance(String factoryId,
- java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
- return (XMLInputFactory) FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" },
- classLoader);
- }
-
- public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream)
- throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- java.io.OutputStream stream) throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- java.io.OutputStream stream, String encoding)
- throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- javax.xml.transform.Result result) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- javax.xml.transform.Result result) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- java.io.OutputStream stream) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- java.io.OutputStream stream, String encoding)
- throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(java.io.Writer stream)
- throws XMLStreamException;
-
- public abstract void setProperty(String name, Object value)
- throws IllegalArgumentException;
-
- public abstract Object getProperty(String name)
- throws IllegalArgumentException;
-
- public abstract boolean isPropertySupported(String name);
-}
diff --git a/trunk/stax-api-1.2/pom.xml b/trunk/stax-api-1.2/pom.xml
deleted file mode 100644
index 0e725b2..0000000
--- a/trunk/stax-api-1.2/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <!--
-
- 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.
- -->
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>specs</artifactId>
- <version>2.1.0</version>
- </parent>
-
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.stax-api-1.2</artifactId>
- <packaging>bundle</packaging>
- <version>2.1.0</version>
- <name>Apache ServiceMix :: Specs :: Stax API 1.2</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.2_spec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
- <Bundle-Description>${project.description}</Bundle-Description>
- <Export-Package>javax.xml.stream*;version=1.2;-split-package:=merge-first;-noimport:=true</Export-Package>
- <Import-Package>javax.xml.namespace;version=!,*</Import-Package>
- <Private-Package>org.apache.servicemix.specs.locator;-split-package:=merge-first</Private-Package>
- <Bundle-Activator>org.apache.servicemix.specs.locator.Activator</Bundle-Activator>
- <Implementation-Title>Apache ServiceMix</Implementation-Title>
- <Implementation-Version>${project.version}</Implementation-Version>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <artifactSet>
- <includes>
- <include>org.apache.geronimo.specs:geronimo-stax-api_1.2_spec</include>
- <include>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</include>
- </includes>
- </artifactSet>
- <filters>
- <filter>
- <artifact>org.apache.geronimo.specs:geronimo-stax-api_1.2_spec</artifact>
- <excludes>
- <exclude>javax/**</exclude>
- </excludes>
- </filter>
- <filter>
- <artifact>org.apache.servicemix.specs:org.apache.servicemix.specs.locator</artifact>
- <excludes>
- <exclude>org/**</exclude>
- </excludes>
- </filter>
- </filters>
- <createSourcesJar>${createSourcesJar}</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>deploy</id>
- <properties>
- <createSourcesJar>true</createSourcesJar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack-sources</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.2_spec</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.servicemix.specs</groupId>
- <artifactId>org.apache.servicemix.specs.locator</artifactId>
- <classifier>sources</classifier>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${project.build.directory}/sources</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <minmemory>128m</minmemory>
- <maxmemory>512m</maxmemory>
- <sourcepath>${project.build.directory}/sources</sourcepath>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
diff --git a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java b/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
deleted file mode 100644
index cd61b8d..0000000
--- a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/FactoryLocator.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/**
- * 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 javax.xml.stream;
-
-import java.io.InputStream;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.util.Arrays;
-import java.util.Properties;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-/*
- * Here is the beef on the finding the Factory Class
- *
- * 1. Use the javax.xml.stream.XMLInputFactory system property. 2. Use the
- * properties file "lib/stax.properties" in the JRE directory. This
- * configuration file is in standard java.util.Properties format and contains
- * the fully qualified name of the implementation class with the key being the
- * system property defined above. 3. Use the Services API (as detailed in the
- * JAR specification), if available, to determine the classname. The Services
- * API will look for a classname in the file
- * META-INF/services/javax.xml.stream.XMLInputFactory in jars available to the
- * runtime. Platform default XMLInputFactory instance.
- *
- * If the user provided a classloader we'll use that...if not, we'll assume the
- * classloader of this class.
- */
-
-class FactoryLocator {
- static Object locate(String factoryId) throws FactoryConfigurationError {
- return locate(factoryId, null);
- }
-
- static Object locate(String factoryId, String[] altClassName)
- throws FactoryConfigurationError {
- return locate(factoryId, altClassName,
- Thread.currentThread().getContextClassLoader());
- }
-
- static Object locate(String factoryId, String[] altClassName,
- ClassLoader classLoader) throws FactoryConfigurationError {
- try {
- // If we are deployed into an OSGi environment, leverage it
- ClassLoader cl = FactoryLocator.class.getClassLoader();
- if (cl == null) {
- cl = ClassLoader.getSystemClassLoader();
- }
- Class factoryClass = cl.loadClass(factoryId);
- Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass, factoryId);
- if (spiClass != null) {
- return spiClass.newInstance();
- }
- } catch (Throwable e) {
- }
-
- try {
- String prop = System.getProperty(factoryId);
- if (prop != null) {
- return loadFactory(prop, classLoader);
- }
- } catch (Exception e) {
- }
-
- try {
- String configFile = System.getProperty("java.home")
- + File.separator + "lib" + File.separator
- + "stax.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return loadFactory(factoryClassName, classLoader);
- }
- } catch (Exception e) {
- }
-
- String serviceId = "META-INF/services/" + factoryId;
- try {
- InputStream is = null;
-
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader br = new BufferedReader(new InputStreamReader(
- is, "UTF-8"));
- String factoryClassName = br.readLine();
- br.close();
-
- if (factoryClassName != null && !"".equals(factoryClassName)) {
- return loadFactory(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
- if (altClassName == null) {
- throw new FactoryConfigurationError("Unable to locate factory for "
- + factoryId + ".", null);
- }
- return loadFactory(altClassName, classLoader);
- }
-
- private static Object loadFactory(String[] classNames, ClassLoader classLoader)
- throws FactoryConfigurationError {
- for (String className : classNames) {
- try {
- Class factoryClass = classLoader == null ? Class.forName(className)
- : classLoader.loadClass(className);
-
- return factoryClass.newInstance();
- } catch (Exception x) {
- }
- }
- throw new FactoryConfigurationError("Requested factory "
- + Arrays.asList(classNames).toString()
- + " could not be instantiated");
- }
-
- private static Object loadFactory(String className, ClassLoader classLoader)
- throws FactoryConfigurationError {
- try {
- Class factoryClass = classLoader == null ? Class.forName(className)
- : classLoader.loadClass(className);
-
- return factoryClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw new FactoryConfigurationError("Requested factory "
- + className + " cannot be located. Classloader ="
- + classLoader.toString(), x);
- } catch (Exception x) {
- throw new FactoryConfigurationError("Requested factory "
- + className + " could not be instantiated: " + x, x);
- }
- }
-}
diff --git a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java b/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
deleted file mode 100644
index b68c953..0000000
--- a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLEventFactory.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.events.ProcessingInstruction;
-import javax.xml.namespace.QName;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.Comment;
-import javax.xml.stream.events.DTD;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.EntityDeclaration;
-import javax.xml.stream.events.Namespace;
-import javax.xml.stream.events.Attribute;
-import javax.xml.stream.events.EndDocument;
-import javax.xml.stream.events.EntityReference;
-import javax.xml.stream.events.StartDocument;
-import javax.xml.stream.events.StartElement;
-
-public abstract class XMLEventFactory {
-
- protected XMLEventFactory() {
- }
-
- public static XMLEventFactory newInstance() throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory",
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" });
- }
-
- public static XMLEventFactory newFactory() throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate("javax.xml.stream.XMLEventFactory",
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" });
- }
-
- /**
- * Create a new XMLEventFactory
- *
- * @deprecated to maintain API consistency. All newInstance methods are
- * replaced with corresponding newFactory methods. The replacement
- * newFactory(String factoryId, ClassLoader classLoader)
- * method defines no changes in behavior from this method.
- */
- public static XMLEventFactory newInstance(String factoryId,
- ClassLoader classLoader) throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" },
- classLoader);
- }
-
-
- public static XMLEventFactory newFactory(String factoryId,
- ClassLoader classLoader) throws FactoryConfigurationError {
- return (XMLEventFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.events.XMLEventFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLEventFactoryImpl" },
- classLoader);
- }
-
- public abstract void setLocation(Location location);
-
- public abstract Attribute createAttribute(QName name, String value);
-
- public abstract Attribute createAttribute(String localName, String value);
-
- public abstract Attribute createAttribute(String prefix,
- String namespaceURI, String localName, String value);
-
- public abstract Namespace createNamespace(String namespaceUri);
-
- public abstract Namespace createNamespace(String prefix, String namespaceUri);
-
- public abstract StartElement createStartElement(QName name,
- Iterator attributes, Iterator namespaces);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName, Iterator attributes,
- Iterator namespaces);
-
- public abstract StartElement createStartElement(String prefix,
- String namespaceUri, String localName, Iterator attributes,
- Iterator namespaces, NamespaceContext context);
-
- public abstract EndElement createEndElement(QName name, Iterator namespaces);
-
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri, String localName);
-
- public abstract EndElement createEndElement(String prefix,
- String namespaceUri, String localName, Iterator namespaces);
-
- public abstract Characters createCharacters(String content);
-
- public abstract Characters createCData(String content);
-
- public abstract Characters createSpace(String content);
-
- public abstract Characters createIgnorableSpace(String content);
-
- public abstract StartDocument createStartDocument();
-
- public abstract StartDocument createStartDocument(String encoding);
-
- public abstract StartDocument createStartDocument(String encoding,
- String version);
-
- public abstract StartDocument createStartDocument(String encoding,
- String version, boolean standalone);
-
- public abstract EndDocument createEndDocument();
-
- public abstract EntityReference createEntityReference(String name,
- EntityDeclaration declaration);
-
- public abstract Comment createComment(String text);
-
- public abstract ProcessingInstruction createProcessingInstruction(
- String target, String data);
-
- public abstract DTD createDTD(String dtd);
-}
\ No newline at end of file
diff --git a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java b/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
deleted file mode 100644
index f4348ea..0000000
--- a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLInputFactory.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-import javax.xml.stream.util.XMLEventAllocator;
-
-public abstract class XMLInputFactory {
- public static final java.lang.String ALLOCATOR = "javax.xml.stream.allocator";
- public static final java.lang.String IS_COALESCING = "javax.xml.stream.isCoalescing";
- public static final java.lang.String IS_NAMESPACE_AWARE = "javax.xml.stream.isNamespaceAware";
- public static final java.lang.String IS_REPLACING_ENTITY_REFERENCES = "javax.xml.stream.isReplacingEntityReferences";
- public static final java.lang.String IS_SUPPORTING_EXTERNAL_ENTITIES = "javax.xml.stream.isSupportingExternalEntities";
- public static final java.lang.String IS_VALIDATING = "javax.xml.stream.isValidating";
- public static final java.lang.String REPORTER = "javax.xml.stream.reporter";
- public static final java.lang.String RESOLVER = "javax.xml.stream.resolver";
- public static final java.lang.String SUPPORT_DTD = "javax.xml.stream.supportDTD";
-
- protected XMLInputFactory() {
- }
-
- public static XMLInputFactory newInstance()
- throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" });
- }
-
- public static XMLInputFactory newFactory()
- throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate("javax.xml.stream.XMLInputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" });
- }
-
-
- /**
- * Create a new XMLInputFactory
- *
- * @deprecated to maintain API consistency. All newInstance methods are
- * replaced with corresponding newFactory methods. The replacement
- * newFactory(String factoryId, ClassLoader classLoader)
- * method defines no changes in behavior from this method.
- */
- public static XMLInputFactory newInstance(java.lang.String factoryId,
- java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" },
- classLoader);
- }
-
-
- public static XMLInputFactory newFactory(java.lang.String factoryId,
- java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
- // We'll assume the XMLInputFactory from the RI as a backup.
- return (XMLInputFactory)FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLInputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl" },
- classLoader);
- }
-
- public abstract XMLStreamReader createXMLStreamReader(java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- javax.xml.transform.Source source) throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.io.InputStream stream) throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.io.InputStream stream, java.lang.String encoding)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.lang.String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createXMLStreamReader(
- java.lang.String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.lang.String systemId, java.io.Reader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(XMLStreamReader reader)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- javax.xml.transform.Source source) throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.io.InputStream stream) throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.io.InputStream stream, java.lang.String encoding)
- throws XMLStreamException;
-
- public abstract XMLEventReader createXMLEventReader(
- java.lang.String systemId, java.io.InputStream stream)
- throws XMLStreamException;
-
- public abstract XMLStreamReader createFilteredReader(
- XMLStreamReader reader, StreamFilter filter)
- throws XMLStreamException;
-
- public abstract XMLEventReader createFilteredReader(XMLEventReader reader,
- EventFilter filter) throws XMLStreamException;
-
- public abstract XMLResolver getXMLResolver();
-
- public abstract void setXMLResolver(XMLResolver resolver);
-
- public abstract XMLReporter getXMLReporter();
-
- public abstract void setXMLReporter(XMLReporter reporter);
-
- public abstract void setProperty(java.lang.String name,
- java.lang.Object value) throws java.lang.IllegalArgumentException;
-
- public abstract java.lang.Object getProperty(java.lang.String name)
- throws java.lang.IllegalArgumentException;
-
- public abstract boolean isPropertySupported(java.lang.String name);
-
- public abstract void setEventAllocator(XMLEventAllocator allocator);
-
- public abstract XMLEventAllocator getEventAllocator();
-}
\ No newline at end of file
diff --git a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java b/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
deleted file mode 100644
index 8d4753f..0000000
--- a/trunk/stax-api-1.2/src/main/java/javax/xml/stream/XMLOutputFactory.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- **
- ** 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 javax.xml.stream;
-
-public abstract class XMLOutputFactory {
- public static final String IS_REPAIRING_NAMESPACES = "javax.xml.stream.isRepairingNamespaces";
-
- protected XMLOutputFactory() { }
-
- public static XMLOutputFactory newInstance() throws FactoryConfigurationError {
- return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" });
- }
-
- /**
- * Create a new XMLOutputFactory
- *
- * @deprecated This method has been deprecated because
- * it returns an instance of XMLInputFactory, which is of the
- * wrong class. Use the new method
- * newFactory(java.lang.String factoryId,java.lang.ClassLoader classLoader)
- * instead.
- */
- public static XMLInputFactory newInstance(String factoryId,
- java.lang.ClassLoader classLoader) throws FactoryConfigurationError {
- return (XMLInputFactory) FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" }, classLoader);
-
- }
-
-
- /**
- * Create a new XMLOutputFactory
- *
- * This is the replacement for the deprecated newInstance() method
- */
- public static XMLOutputFactory newFactory() throws FactoryConfigurationError {
- return (XMLOutputFactory) FactoryLocator.locate("javax.xml.stream.XMLOutputFactory",
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" });
- }
-
- /**
- * Create a new XMLOutputFactory
- *
- * This is the replacement for the deprecated newInstance() method
- */
- public static XMLOutputFactory newFactory(String factoryId, ClassLoader classLoader)
- throws FactoryConfigurationError {
- // essentially the same thing as deprecated newInstance(), but the correct return type.
- return (XMLOutputFactory) FactoryLocator.locate(factoryId,
- new String[] { "com.sun.xml.internal.stream.XMLOutputFactoryImpl", "com.ibm.xml.xlxp.api.stax.XMLOutputFactoryImpl" }, classLoader);
- }
-
- public abstract XMLStreamWriter createXMLStreamWriter(java.io.Writer stream)
- throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- java.io.OutputStream stream) throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- java.io.OutputStream stream, String encoding)
- throws XMLStreamException;
-
- public abstract XMLStreamWriter createXMLStreamWriter(
- javax.xml.transform.Result result) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- javax.xml.transform.Result result) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- java.io.OutputStream stream) throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(
- java.io.OutputStream stream, String encoding)
- throws XMLStreamException;
-
- public abstract XMLEventWriter createXMLEventWriter(java.io.Writer stream)
- throws XMLStreamException;
-
- public abstract void setProperty(String name, Object value)
- throws IllegalArgumentException;
-
- public abstract Object getProperty(String name)
- throws IllegalArgumentException;
-
- public abstract boolean isPropertySupported(String name);
-}
\ No newline at end of file