Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APIM] Add changes to provide support for building the API manager product with JDK 17 #4023

Open
wants to merge 5 commits into
base: 4.9.x-JDK17
Choose a base branch
from
Open
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
28 changes: 16 additions & 12 deletions core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
<artifactId>org.wso2.carbon.utils</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.artifact.repository</artifactId>
<exclusions>
<exclusion>
<groupId>org.wso2.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</exclusion>
<exclusion>
<groupId>org.wso2.eclipse.osgi</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</exclusion>
<exclusion>
Expand All @@ -68,7 +68,7 @@
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.osgi</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.jsp.jasper</artifactId>
</exclusion>
<exclusion>
Expand All @@ -90,39 +90,39 @@
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.osgi</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.director</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.metadata</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.metadata.repository</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.repository</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.simpleconfigurator</artifactId>
</dependency>
<dependency>
Expand Down Expand Up @@ -162,6 +162,10 @@
<Export-Package>
org.wso2.carbon.feature.mgt.core.*
</Export-Package>
<!-- TODO this is wrong. Just trying out -->
<Provide-Capability>
osgi.service;objectClass=org.eclipse.equinox.p2.core.IProvisioningAgentProvider
</Provide-Capability>
</instructions>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@
<artifactId>org.wso2.carbon.feature.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.metadata</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.repository</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

<dependencies>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.equinox</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.equinox.p2.engine</artifactId>
</dependency>
</dependencies>
Expand Down
17 changes: 8 additions & 9 deletions core/javax.cache/src/main/java/javax/cache/CacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

package javax.cache;

import javax.transaction.UserTransaction;

/**
* A CacheManager is used for looking up Caches and controls their lifecycle. It represents a collection of caches.
* <p/>
Expand Down Expand Up @@ -127,13 +125,14 @@ public interface CacheManager {
*/
boolean removeCache(String cacheName);

/**
* This method will return a UserTransaction.
*
* @return the UserTransaction.
* @throws UnsupportedOperationException if JTA is not supported
*/
UserTransaction getUserTransaction();
// TODO javax.transaction package is no longer available. Need to find a way to add this back
// /**
// * This method will return a UserTransaction.
// *
// * @return the UserTransaction.
// * @throws UnsupportedOperationException if JTA is not supported
// */
// UserTransaction getUserTransaction();

/**
* Indicates whether a optional feature is supported by this CacheManager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@
*/
package org.wso2.carbon.caching.impl;

import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;

import javax.cache.Cache;
import javax.cache.CacheBuilder;
import javax.cache.CacheException;
import javax.cache.CacheManager;
import javax.cache.OptionalFeature;
import javax.cache.Status;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.cache.Cache;
import javax.cache.CacheBuilder;
import javax.cache.CacheException;
import javax.cache.CacheManager;
import javax.cache.OptionalFeature;
import javax.cache.Status;

import static org.wso2.carbon.caching.impl.CachingConstants.ILLEGAL_STATE_EXCEPTION_MESSAGE;

/**
Expand Down Expand Up @@ -202,13 +203,13 @@ boolean removeLocalCaches() {
return this.caches.isEmpty();
}

@Override
public javax.transaction.UserTransaction getUserTransaction() {
Util.checkAccess(ownerTenantDomain, ownerTenantId);
checkStatusStarted();
touch();
return null; //To change body of implemented methods use File | Settings | File Templates.
}
// @Override
// public javax.transaction.UserTransaction getUserTransaction() {
// Util.checkAccess(ownerTenantDomain, ownerTenantId);
// checkStatusStarted();
// touch();
// return null; //To change body of implemented methods use File | Settings | File Templates.
// }

@Override
public boolean isSupported(OptionalFeature optionalFeature) {
Expand Down
2 changes: 1 addition & 1 deletion core/org.wso2.carbon.application.deployer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.osgi</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
Expand Down
7 changes: 5 additions & 2 deletions core/org.wso2.carbon.base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>

<extensions>true</extensions>
<configuration>
<instructions>
Expand All @@ -48,7 +47,7 @@
org.wso2.carbon.base.*; version="1.0.0"
</Export-Package>
<Import-Package>
javax.activation.*;version="[0.0.0, 1.0.0)",
javax.activation.*;version="[1.0.0, 2.0.0)",
javax.servlet; version="${imp.pkg.version.javax.servlet}",
javax.servlet.http; version="${imp.pkg.version.javax.servlet}",
org.wso2.securevault.*,
Expand All @@ -59,6 +58,9 @@
<Import-Package>
*;resolution:=optional
</Import-Package>
<Provide-Capability>
osgi.service;objectClass=org.wso2.carbon.base.api.ServerConfigurationService
</Provide-Capability>
</instructions>
</configuration>
</plugin>
Expand Down Expand Up @@ -118,6 +120,7 @@
<groupId>org.eclipse.equinox</groupId>
<artifactId>javax.servlet</artifactId>
</dependency>

<dependency>
<groupId>org.wso2.orbit.xerces</groupId>
<artifactId>xercesImpl</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.xerces.impl.Constants;
import org.apache.xerces.util.SecurityManager;
import org.osgi.service.component.annotations.Component;
import org.w3c.dom.Element;
import org.wso2.carbon.base.api.ServerConfigurationService;
import org.wso2.carbon.securevault.SecretManagerInitializer;
Expand Down Expand Up @@ -55,6 +56,7 @@
* This class stores the configuration of the Carbon Server.
*/
@SuppressWarnings("unused")
//@Component(service = ServerConfigurationService.class)
public class ServerConfiguration implements ServerConfigurationService {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wso2.carbon.base.api;

import org.osgi.service.component.annotations.Component;
import org.w3c.dom.Element;

public interface ServerConfigurationService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.wso2.carbon.base.CarbonBaseConstants;
import org.wso2.carbon.base.CarbonBaseUtils;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.base.ServerConfigurationException;
import org.wso2.carbon.base.api.ServerConfigurationService;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.ServletException;
import java.io.*;

/**
* Activator of the {@link org.wso2.carbon.base} bundle
Expand All @@ -52,7 +55,6 @@ public void start(BundleContext bundleContext) throws Exception {
System.setProperty("portOffset", portOffset);
//register carbon server confg as an OSGi service
registration = bundleContext.registerService(ServerConfigurationService.class.getName(), carbonServerConfiguration, null);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@

package org.wso2.carbon.bootstrap;

import sun.security.util.SecurityConstants;

import java.security.AccessControlContext;
import java.security.AccessControlException;
import java.security.Policy;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -32,7 +27,11 @@
*/
public class CarbonSecurityManager extends SecurityManager {

private List<String> deniedProperties = new ArrayList<String>();
private List<String> deniedProperties = new ArrayList<>();

//TODO check this later sun.security.util is not exported
public static final RuntimePermission MODIFY_THREADGROUP_PERMISSION =
new RuntimePermission("modifyThreadGroup");

public CarbonSecurityManager() {
super();
Expand Down Expand Up @@ -86,7 +85,7 @@ public void checkAccess(ThreadGroup g) {
throw new NullPointerException("thread group can't be null");
}

checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION);
checkPermission(MODIFY_THREADGROUP_PERMISSION);
}

/**
Expand All @@ -100,7 +99,7 @@ public void checkAccess(Thread t) {
throw new NullPointerException("thread can't be null");
}

checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION);
checkPermission(MODIFY_THREADGROUP_PERMISSION);
}


Expand Down
1 change: 0 additions & 1 deletion core/org.wso2.carbon.coordination.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
Expand Down
2 changes: 1 addition & 1 deletion core/org.wso2.carbon.core.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</Export-Package>
<Import-Package>
!org.wso2.carbon.core.common.*,
javax.activation.*;version="[0.0.0, 1.0.0)"
javax.activation.*;version="[1.0.0, 2.0.0)"
</Import-Package>
</instructions>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion core/org.wso2.carbon.core.services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.eclipse.osgi</groupId>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
Expand Down
Loading