Skip to content

Commit

Permalink
[#1802] Switch samples-internal from javax to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Jun 21, 2023
1 parent 0f5d4da commit 918c2fb
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions samples/samples-internal/initializers-fragment1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<configuration>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
org.osgi.framework;version="[1.10,2)",
*
</Import-Package>
<Private-Package>
Expand Down Expand Up @@ -71,7 +71,7 @@
<artifactId>osgi.core</artifactId>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package org.ops4j.pax.web.samples.initializers;

import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;

public class Initializer1 implements ServletContainerInitializer {

Expand Down
4 changes: 2 additions & 2 deletions samples/samples-internal/initializers-fragment2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<configuration>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
org.osgi.framework;version="[1.10,2)",
*
</Import-Package>
<Private-Package>
Expand Down Expand Up @@ -71,7 +71,7 @@
<artifactId>osgi.core</artifactId>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package org.ops4j.pax.web.samples.initializers;

import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;

public class Initializer2 implements ServletContainerInitializer {

Expand Down
4 changes: 2 additions & 2 deletions samples/samples-internal/initializers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<configuration>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
org.osgi.framework;version="[1.10,2)",
*
</Import-Package>
<Private-Package>
Expand All @@ -67,7 +67,7 @@
<artifactId>osgi.core</artifactId>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package org.ops4j.pax.web.samples.initializers;

import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import jakarta.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;

public class Initializer implements ServletContainerInitializer {

Expand Down
4 changes: 2 additions & 2 deletions samples/samples-internal/pax-web-spi-fragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<configuration>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
org.osgi.framework;version="[1.10,2)",
*
</Import-Package>
<Export-Package>
Expand Down Expand Up @@ -77,7 +77,7 @@
<artifactId>osgi.core</artifactId>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import javax.servlet.ServletContainerInitializer;
import jakarta.servlet.ServletContainerInitializer;

import org.apache.xbean.osgi.bundle.util.BundleResourceHelper;
import org.ops4j.pax.web.utils.ClassPathUtil;
Expand All @@ -53,7 +53,7 @@ public static void useXBeanFinder() throws IOException {
Set<Bundle> wiredBundles = ClassPathUtil.getBundlesInClassSpace(bundle, new LinkedHashSet<>(), false);
// should be:
// wiredBundles: java.util.Set = {java.util.LinkedHashSet@4061} size = 8
// 0 = {org.apache.felix.framework.BundleImpl@4064} "javax.servlet-api [17]"
// 0 = {org.apache.felix.framework.BundleImpl@4064} "jakarta.servlet-api [17]"
// 1 = {org.apache.felix.framework.BundleImpl@4065} "org.ops4j.pax.web.pax-web-api [18]"
// 2 = {org.apache.felix.framework.BundleImpl@4066} "org.apache.xbean.bundleutils [21]"
// 3 = {org.apache.felix.framework.BundleImpl@4067} "org.ops4j.pax.logging.pax-logging-api [15]"
Expand Down Expand Up @@ -95,7 +95,7 @@ public static List<Class<? extends ServletContainerInitializer>> findInitializer
List<Class<? extends ServletContainerInitializer>> initializers = new LinkedList<>();

BundleWiring wiring = b.adapt(BundleWiring.class);
List<URL> urls = wiring.findEntries("/META-INF/services", "javax.servlet.ServletContainerInitializer", 0);
List<URL> urls = wiring.findEntries("/META-INF/services", "jakarta.servlet.ServletContainerInitializer", 0);
for (URL url : urls) {
LOG.info("Wiring entry: {}", url);
String className = readService(url);
Expand All @@ -113,7 +113,7 @@ public static List<Class<? extends ServletContainerInitializer>> findInitializer
public static List<Class<? extends ServletContainerInitializer>> findInitializersUsingBundle(Bundle b) throws Exception {
List<Class<? extends ServletContainerInitializer>> initializers = new LinkedList<>();

Enumeration<URL> urls = b.findEntries("/META-INF/services", "javax.servlet.ServletContainerInitializer", false);
Enumeration<URL> urls = b.findEntries("/META-INF/services", "jakarta.servlet.ServletContainerInitializer", false);
if (urls != null) {
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
Expand Down

0 comments on commit 918c2fb

Please sign in to comment.