Skip to content

Commit

Permalink
Merge pull request #24003 from arjantijms/jdk17_mp
Browse files Browse the repository at this point in the history
Jdk17 mp
  • Loading branch information
arjantijms authored Jun 19, 2022
2 parents e9fe278 + 484345d commit 96a8fbe
Show file tree
Hide file tree
Showing 118 changed files with 2,372 additions and 1,368 deletions.
4 changes: 2 additions & 2 deletions appserver/batch/glassfish-batch-connector/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation.
Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -48,9 +49,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.concurrent</groupId>
<groupId>org.omnifaces</groupId>
<artifactId>concurrent-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.hk2</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@
import com.sun.enterprise.config.serverbeans.ResourcePool;
import com.sun.enterprise.config.serverbeans.ResourceRef;
import com.sun.enterprise.config.serverbeans.Server;
import com.sun.enterprise.deployment.*;
import com.sun.enterprise.deployment.Application;
import com.sun.enterprise.deployment.ApplicationClientDescriptor;
import com.sun.enterprise.deployment.BundleDescriptor;
import com.sun.enterprise.deployment.ConnectorDescriptor;
import com.sun.enterprise.deployment.EjbBundleDescriptor;
import com.sun.enterprise.deployment.EjbDescriptor;
import com.sun.enterprise.deployment.EjbSessionDescriptor;
import com.sun.enterprise.deployment.WebBundleDescriptor;
import com.sun.enterprise.deployment.WebComponentDescriptor;
import com.sun.enterprise.deployment.archivist.Archivist;
import com.sun.enterprise.deployment.archivist.ArchivistFactory;
import com.sun.enterprise.deployment.core.*;
import com.sun.enterprise.deployment.io.DeploymentDescriptorFile;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Constructor;
Expand Down
6 changes: 6 additions & 0 deletions appserver/common/container-common/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -109,6 +110,11 @@
<groupId>org.glassfish.ha</groupId>
<artifactId>ha-api</artifactId>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>concurrent-extras</artifactId>
</dependency>

</dependencies>

<build>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
package com.sun.enterprise.container.common.impl;

import com.sun.enterprise.container.common.spi.util.ComponentEnvManager;
import com.sun.enterprise.deployment.*;
import com.sun.enterprise.deployment.Application;
import com.sun.enterprise.deployment.ApplicationClientDescriptor;
import com.sun.enterprise.deployment.BundleDescriptor;
import com.sun.enterprise.deployment.EjbDescriptor;
import com.sun.enterprise.deployment.WebBundleDescriptor;
import com.sun.enterprise.deployment.core.*;
import com.sun.logging.LogDomains;
import org.glassfish.api.invocation.ComponentInvocation;
import static org.glassfish.api.invocation.ComponentInvocation.ComponentInvocationType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import org.glassfish.internal.data.ApplicationInfo;
import org.glassfish.internal.data.ApplicationRegistry;

import com.sun.enterprise.deployment.*;


import jakarta.inject.Inject;
import org.jvnet.hk2.annotations.Service;
import org.glassfish.hk2.api.PostConstruct;
Expand All @@ -34,6 +31,11 @@
import javax.naming.NamingException;

import com.sun.enterprise.container.common.spi.util.ComponentEnvManager;
import com.sun.enterprise.deployment.Application;
import com.sun.enterprise.deployment.BundleDescriptor;
import com.sun.enterprise.deployment.EjbDescriptor;
import com.sun.enterprise.deployment.JndiNameEnvironment;
import com.sun.enterprise.deployment.core.*;
import com.sun.enterprise.container.common.spi.ManagedBeanManager;
import com.sun.logging.LogDomains;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation.
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -16,20 +17,24 @@

package org.glassfish.javaee.services;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
import java.io.Serializable;

import javax.naming.Context;
import javax.naming.NamingException;

import org.glassfish.api.naming.NamingObjectProxy;
import com.sun.enterprise.deployment.ResourceDescriptor;
import org.glassfish.hk2.api.PerLookup;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.internal.api.Globals;
import org.glassfish.resourcebase.resources.api.ResourceDeployer;
import org.glassfish.resourcebase.resources.util.ResourceManagerFactory;
import org.jvnet.hk2.annotations.Service;
import org.omnifaces.concurrent.services.JndiLookupNotifier;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
import com.sun.enterprise.deployment.core.ResourceDescriptor;

import jakarta.inject.Inject;
import javax.naming.Context;
import javax.naming.NamingException;
import java.io.Serializable;

/**
* Created with IntelliJ IDEA.
Expand All @@ -47,6 +52,7 @@ public class CommonResourceProxy implements NamingObjectProxy.InitializationNami
protected ResourceDescriptor desc;
protected String actualResourceName;

@Override
public synchronized Object create(Context ic) throws NamingException {
if (actualResourceName == null) {

Expand All @@ -68,7 +74,13 @@ public synchronized Object create(Context ic) throws NamingException {
throw ne;
}
}
return ic.lookup(actualResourceName);

Object resource = ic.lookup(actualResourceName);
if (resource instanceof JndiLookupNotifier) {
((JndiLookupNotifier) resource).notifyJndiLookup();
}

return resource;
}

protected ResourceDeployer getResourceDeployer(Object resource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
package org.glassfish.javaee.services;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
import com.sun.enterprise.deployment.ResourceDescriptor;
import com.sun.enterprise.deployment.core.ResourceDescriptor;

import org.glassfish.hk2.api.PerLookup;
import org.glassfish.internal.api.Globals;
import org.jvnet.hk2.annotations.Service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,14 +17,17 @@

package org.glassfish.concurrent.config;

import org.jvnet.hk2.config.*;
import java.beans.PropertyVetoException;

import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;

import com.sun.enterprise.config.serverbeans.BindableResource;
import com.sun.enterprise.config.serverbeans.Resource;

import jakarta.validation.constraints.Min;
import jakarta.validation.Payload;
import java.beans.PropertyVetoException;
import jakarta.validation.constraints.Min;

/**
* Concurrency managed executor service resource base definition
Expand Down Expand Up @@ -184,4 +187,19 @@ public interface ManagedExecutorServiceBase extends ConfigBeanProxy,
* @param value allowed object is {@link String }
*/
void setThreadLifetimeSeconds(String value) throws PropertyVetoException;

/**
* Gets the value of the context property.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "", dataType = String.class)
String getContext();

/**
* Sets the value of the context property.
*
* @param value allowed object is {@link String }
*/
void setContext(String value) throws PropertyVetoException;
}
4 changes: 2 additions & 2 deletions appserver/concurrent/concurrent-impl/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation.
Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -33,9 +34,8 @@

<dependencies>
<dependency>
<groupId>org.glassfish.main.concurrent</groupId>
<groupId>org.omnifaces</groupId>
<artifactId>concurrent-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.admin</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -17,32 +17,48 @@

package org.glassfish.concurrent.admin;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
import com.sun.enterprise.config.serverbeans.Resource;
import com.sun.enterprise.config.serverbeans.Resources;
import com.sun.enterprise.config.serverbeans.ServerTags;
import com.sun.enterprise.util.LocalStringManagerImpl;
import static org.glassfish.resources.admin.cli.ResourceConstants.CONTEXT_INFO;
import static org.glassfish.resources.admin.cli.ResourceConstants.CONTEXT_INFO_DEFAULT_VALUE;
import static org.glassfish.resources.admin.cli.ResourceConstants.CONTEXT_INFO_ENABLED;
import static org.glassfish.resources.admin.cli.ResourceConstants.CORE_POOL_SIZE;
import static org.glassfish.resources.admin.cli.ResourceConstants.ENABLED;
import static org.glassfish.resources.admin.cli.ResourceConstants.HUNG_AFTER_SECONDS;
import static org.glassfish.resources.admin.cli.ResourceConstants.HUNG_LOGGER_INITIAL_DELAY_SECONDS;
import static org.glassfish.resources.admin.cli.ResourceConstants.HUNG_LOGGER_INTERVAL_SECONDS;
import static org.glassfish.resources.admin.cli.ResourceConstants.HUNG_LOGGER_PRINT_ONCE;
import static org.glassfish.resources.admin.cli.ResourceConstants.JNDI_NAME;
import static org.glassfish.resources.admin.cli.ResourceConstants.KEEP_ALIVE_SECONDS;
import static org.glassfish.resources.admin.cli.ResourceConstants.LONG_RUNNING_TASKS;
import static org.glassfish.resources.admin.cli.ResourceConstants.SYSTEM_ALL_REQ;
import static org.glassfish.resources.admin.cli.ResourceConstants.THREAD_LIFETIME_SECONDS;
import static org.glassfish.resources.admin.cli.ResourceConstants.THREAD_PRIORITY;

import java.beans.PropertyVetoException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.glassfish.api.admin.ServerEnvironment;
import org.glassfish.concurrent.config.ManagedExecutorServiceBase;
import org.glassfish.concurrent.config.ManagedExecutorService;
import org.glassfish.concurrent.config.ManagedExecutorServiceBase;
import org.glassfish.concurrent.config.ManagedScheduledExecutorService;
import org.glassfish.resources.admin.cli.ResourceManager;
import org.glassfish.resourcebase.resources.admin.cli.ResourceUtil;
import org.glassfish.resourcebase.resources.api.ResourceStatus;
import org.glassfish.resourcebase.resources.util.BindableResourcesHelper;
import org.glassfish.resources.admin.cli.ResourceManager;
import org.jvnet.hk2.config.ConfigSupport;
import org.jvnet.hk2.config.SingleConfigCode;
import org.jvnet.hk2.config.TransactionFailure;
import org.jvnet.hk2.config.types.Property;

import com.sun.appserv.connectors.internal.api.ConnectorsUtil;
import com.sun.enterprise.config.serverbeans.Resource;
import com.sun.enterprise.config.serverbeans.Resources;
import com.sun.enterprise.config.serverbeans.ServerTags;
import com.sun.enterprise.util.LocalStringManagerImpl;

import jakarta.inject.Inject;
import jakarta.resource.ResourceException;
import java.beans.PropertyVetoException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import static org.glassfish.resources.admin.cli.ResourceConstants.*;

/**
*
Expand Down Expand Up @@ -79,8 +95,10 @@ public abstract class ManagedExecutorServiceBaseManager implements ResourceManag
@Inject
protected BindableResourcesHelper resourcesHelper;

@Override
public abstract String getResourceType();

@Override
public ResourceStatus create(Resources resources, HashMap attributes, final Properties properties,
String target) throws Exception {

Expand All @@ -94,6 +112,7 @@ public ResourceStatus create(Resources resources, HashMap attributes, final Prop
try {
ConfigSupport.apply(new SingleConfigCode<Resources>() {

@Override
public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
return createResource(param, properties);
}
Expand Down Expand Up @@ -176,9 +195,6 @@ protected void setAttributesOnConfigBean(ManagedExecutorServiceBase managedExecu
managedExecutorService.setContextInfo(contextInfo);
managedExecutorService.setThreadPriority(threadPriority);
managedExecutorService.setHungAfterSeconds(hungAfterSeconds);
managedExecutorService.setHungLoggerPrintOnce(hungLoggerPrintOnce);
managedExecutorService.setHungLoggerInitialDelaySeconds(hungLoggerInitialDelaySeconds);
managedExecutorService.setHungLoggerIntervalSeconds(hungLoggerIntervalSeconds);
managedExecutorService.setCorePoolSize(corePoolSize);
managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
Expand All @@ -196,6 +212,7 @@ protected void setAttributesOnConfigBean(ManagedExecutorServiceBase managedExecu
}
}

@Override
public Resource createConfigBean(final Resources resources, HashMap attributes, final Properties properties, boolean validate) throws Exception{
setAttributes(attributes, null);
ResourceStatus status = null;
Expand Down Expand Up @@ -279,6 +296,7 @@ public ResourceStatus delete (final Resources resources, final String jndiName,

// delete managed executor service
if (ConfigSupport.apply(new SingleConfigCode<Resources>() {
@Override
public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
ManagedExecutorServiceBase resource = null;
if (getResourceType().equals(ServerTags.MANAGED_EXECUTOR_SERVICE)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -39,9 +39,6 @@ public class ManagedExecutorServiceConfig extends BaseConfig {
public ManagedExecutorServiceConfig(ManagedExecutorService config) {
super(config.getJndiName(), config.getContextInfo(), config.getContextInfoEnabled());
hungAfterSeconds = parseInt(config.getHungAfterSeconds(), 0);
hungLoggerPrintOnce = Boolean.valueOf(config.getHungLoggerPrintOnce());
hungLoggerInitialDelaySeconds = parseLong(config.getHungLoggerInitialDelaySeconds(), 60);
hungLoggerIntervalSeconds = parseLong(config.getHungLoggerIntervalSeconds(), 60);
longRunningTasks = Boolean.valueOf(config.getLongRunningTasks());
threadPriority = parseInt(config.getThreadPriority(), Thread.NORM_PRIORITY);
corePoolSize = parseInt(config.getCorePoolSize(), 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -37,9 +37,6 @@ public class ManagedScheduledExecutorServiceConfig extends BaseConfig {
public ManagedScheduledExecutorServiceConfig(ManagedScheduledExecutorService config) {
super(config.getJndiName(), config.getContextInfo(), config.getContextInfoEnabled());
hungAfterSeconds = parseInt(config.getHungAfterSeconds(), 0);
hungLoggerPrintOnce = Boolean.valueOf(config.getHungLoggerPrintOnce());
hungLoggerInitialDelaySeconds = parseLong(config.getHungLoggerInitialDelaySeconds(), 60);
hungLoggerIntervalSeconds = parseLong(config.getHungLoggerIntervalSeconds(), 60);
longRunningTasks = Boolean.valueOf(config.getLongRunningTasks());
threadPriority = parseInt(config.getThreadPriority(), Thread.NORM_PRIORITY);
corePoolSize = parseInt(config.getCorePoolSize(), 0);
Expand Down
Loading

0 comments on commit 96a8fbe

Please sign in to comment.