Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Changes log
===========

- 3.0 Milestone 2 (??-??-2026)
- Breaking changes
- Removed the OSGi support: the `Activator`, the `osgi.core` dependency and the bundle
packaging (Maven artifacts are now plain JARs, without `Bundle-*` manifest headers).
`XmlFactoryProvider` of the Jackson extension now relies on the plain `ServiceLoader`.
OSGi users should stay on 2.x.
- Bugs fixed
- Slf4j bridge reports wrong line number and caller class in log4j. Issue #233.
- When GET is an allowed method of a server resource, HEAD is now also listed (e.g. in the Allow header of a 405 response). Issue #266.
Expand Down
10 changes: 0 additions & 10 deletions org.restlet.ext.crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.crypto</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - Crypto extension</name>
<description>Support for cryptography.</description>

Expand All @@ -27,13 +26,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.freemarker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.freemarker</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - FreeMarker extension</name>
<description>Integration with FreeMarker.</description>

Expand All @@ -32,13 +31,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.gson</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - GSON extension</name>
<description>Support for GSON representations.</description>

Expand All @@ -37,13 +36,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.jaas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.jaas</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - JAAS extension</name>
<description>Support for JAAS based security.</description>

Expand All @@ -27,13 +26,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.jackson</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - Jackson extension</name>
<description>Integration with Jackson.</description>

Expand Down Expand Up @@ -82,13 +81,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,80 +10,26 @@

import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLOutputFactory;
import org.codehaus.stax2.osgi.Stax2InputFactoryProvider;
import org.codehaus.stax2.osgi.Stax2OutputFactoryProvider;
import org.restlet.engine.Edition;

/**
* Provides {@link javax.xml.stream.XMLInputFactory} and {@link javax.xml.stream.XMLOutputFactory}
* in an OSGI context.
*
* <p>In a non-OSGI context, the factories are retrieved with java service loader.
* Provides {@link javax.xml.stream.XMLInputFactory} and {@link javax.xml.stream.XMLOutputFactory}.
* The factories are retrieved with the Java service loader.
*
* @author Manuel Boillod
*/
public class XmlFactoryProvider {

/**
* Allow explicitly setting the Stax2InputFactory instance in OSGI context. In a no-OSGI
* context, the factory is retrieved with a java service loader.
*
* <p>Note: Stax2 implementation is provided by woodstox library, which is a dependency of
* Jackson.
*/
public static Stax2InputFactoryProvider inputFactoryProvider = null;

/**
* Allow explicitly setting the Stax2OutputFactoryProvider instance in OSGI context. In a
* no-OSGI context, the factory is retrieved with a java service loader.
*
* <p>Note: Stax2 implementation is provided by woodstox library, which is a dependency of
* Jackson.
*/
public static Stax2OutputFactoryProvider outputFactoryProvider = null;

/**
* Returns an instance of {@link javax.xml.stream.XMLInputFactory} according to the classpath.
*/
public static XMLInputFactory newInputFactory() {
if (inputFactoryProvider == null) {
if (Edition.ANDROID.isCurrentEdition()) {
inputFactoryProvider =
(Stax2InputFactoryProvider)
newProvider("com.ctc.wstx.osgi.InputFactoryProviderImpl");
} else {
return XMLInputFactory.newFactory();
}
}
return inputFactoryProvider.createInputFactory();
return XMLInputFactory.newFactory();
}

/**
* Returns an instance of {@link javax.xml.stream.XMLInputFactory} according to the classpath.
* Returns an instance of {@link javax.xml.stream.XMLOutputFactory} according to the classpath.
*/
public static XMLOutputFactory newOutputFactory() {
if (outputFactoryProvider == null) {
if (Edition.ANDROID.isCurrentEdition()) {
outputFactoryProvider =
(Stax2OutputFactoryProvider)
newProvider("com.ctc.wstx.osgi.OutputFactoryProviderImpl");
} else {
return XMLOutputFactory.newFactory();
}
}

return outputFactoryProvider.createOutputFactory();
}

/**
* Instantiates a Woodstox provider by name. The OSGi package of Woodstox isn't exported by its
* Java module, which would prevent a direct reference.
*/
private static Object newProvider(String className) {
try {
return Class.forName(className).getDeclaredConstructor().newInstance();
} catch (ReflectiveOperationException e) {
throw new IllegalStateException("Unable to instantiate " + className, e);
}
return XMLOutputFactory.newFactory();
}
}
10 changes: 0 additions & 10 deletions org.restlet.ext.json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.json</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - JSON extension</name>
<description>Support for JSON representations.</description>

Expand All @@ -32,13 +31,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</parent>

<artifactId>org.restlet.ext.openapi</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - OpenAPI extension</name>
<description>Support for the OpenAPI specification.</description>

Expand Down Expand Up @@ -123,13 +122,4 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.slf4j</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - SLF4J extension</name>
<description>Support for the SLF4J logging bridge.</description>

Expand All @@ -32,13 +31,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.spring</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - Spring extension</name>
<description>Integration with Spring Framework.</description>

Expand Down Expand Up @@ -42,13 +41,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.thymeleaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.thymeleaf</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - Thymeleaf extension</name>
<description>Integration with Thymeleaf.</description>

Expand All @@ -32,13 +31,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.velocity</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - Velocity extension</name>
<description>Integration with Apache Velocity.</description>

Expand All @@ -36,13 +35,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
10 changes: 0 additions & 10 deletions org.restlet.ext.xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</parent>

<artifactId>org.restlet.ext.xml</artifactId>
<packaging>bundle</packaging>
<name>Restlet Framework - XML extension</name>
<description>Support for the XML documents.</description>

Expand All @@ -27,13 +26,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Loading
Loading