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

Add support for GlassFish 7.0.7, 7.0.8, and 7.0.9 #6542

Merged
merged 1 commit into from
Oct 15, 2023
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

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion enterprise/glassfish.common/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.

javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.8
javac.source=11
javac.target=11

test.config.stableBTD.includes=**/*Test.class
test.config.stableBTD.excludes=\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ STR_703_SERVER_NAME=GlassFish Server 7.0.3
STR_704_SERVER_NAME=GlassFish Server 7.0.4
STR_705_SERVER_NAME=GlassFish Server 7.0.5
STR_706_SERVER_NAME=GlassFish Server 7.0.6
STR_707_SERVER_NAME=GlassFish Server 7.0.7
STR_708_SERVER_NAME=GlassFish Server 7.0.8
STR_709_SERVER_NAME=GlassFish Server 7.0.9

# CommonServerSupport.java
MSG_FLAKEY_NETWORK=<html>Network communication problem<br/>Could not establish \
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion enterprise/glassfish.eecommon/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
is.autoload=true
javac.source=1.8
javac.source=11
javac.target=11
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base=1.59.0

Expand Down
3 changes: 2 additions & 1 deletion enterprise/glassfish.javaee/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.8
javac.source=11
javac.target=11

test.config.stableBTD.includes=**/*Test.class
test.config.stableBTD.excludes=\
Expand Down
3 changes: 2 additions & 1 deletion enterprise/glassfish.tooling/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
javac.source=1.8
javac.source=11
javac.target=11
javac.compilerargs=-Xlint -Xlint:-serial
Original file line number Diff line number Diff line change
Expand Up @@ -57,52 +57,17 @@ public abstract class AdminFactory {
*/
static AdminFactory getInstance(final GlassFishVersion version)
throws CommandException {
switch (version) {
// Use HTTP interface for any GlassFish older than 3.
case GF_1:
throw new CommandException(
CommandException.UNSUPPORTED_VERSION);
case GF_2:
case GF_2_1:
case GF_2_1_1:
return AdminFactoryHttp.getInstance();
// Use REST interface for GlassFish 3 and 4.
case GF_3:
case GF_3_0_1:
case GF_3_1:
case GF_3_1_1:
case GF_3_1_2:
case GF_3_1_2_2:
case GF_3_1_2_3:
case GF_3_1_2_4:
case GF_3_1_2_5:
case GF_4:
case GF_4_0_1:
case GF_4_1:
case GF_4_1_1:
case GF_4_1_2:
case GF_5:
case GF_5_0_1:
case GF_5_1_0:
case GF_6:
case GF_6_1_0:
case GF_6_2_0:
case GF_6_2_1:
case GF_6_2_2:
case GF_6_2_3:
case GF_6_2_4:
case GF_6_2_5:
case GF_7_0_0:
case GF_7_0_1:
case GF_7_0_2:
case GF_7_0_3:
case GF_7_0_4:
case GF_7_0_5:
case GF_7_0_6:
return AdminFactoryRest.getInstance();
// Anything else is not unknown.
default:
throw new CommandException(CommandException.UNKNOWN_VERSION);
// Use REST interface for GlassFish 3 and newer.
if (GlassFishVersion.ge(version, GlassFishVersion.GF_3)) {
return AdminFactoryRest.getInstance();
}
// Use HTTP interface for any GlassFish older than 3.
else if (GlassFishVersion.ge(version, GlassFishVersion.GF_2)) {
return AdminFactoryHttp.getInstance();
}
// Anything else is not unknown.
else {
throw new CommandException(CommandException.UNKNOWN_VERSION);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ public enum GlassFishVersion {
/** GlassFish 7.0.5 */
GF_7_0_5 ((short) 7, (short) 0, (short) 5, (short) 0, GlassFishVersion.GF_7_0_5_STR),
/** GlassFish 7.0.6 */
GF_7_0_6 ((short) 7, (short) 0, (short) 6, (short) 0, GlassFishVersion.GF_7_0_6_STR);
GF_7_0_6 ((short) 7, (short) 0, (short) 6, (short) 0, GlassFishVersion.GF_7_0_6_STR),
/** GlassFish 7.0.7 */
GF_7_0_7 ((short) 7, (short) 0, (short) 7, (short) 0, GlassFishVersion.GF_7_0_7_STR),
/** GlassFish 7.0.8 */
GF_7_0_8 ((short) 7, (short) 0, (short) 8, (short) 0, GlassFishVersion.GF_7_0_8_STR),
/** GlassFish 7.0.9 */
GF_7_0_9 ((short) 7, (short) 0, (short) 9, (short) 0, GlassFishVersion.GF_7_0_9_STR);
////////////////////////////////////////////////////////////////////////////
// Class attributes //
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -295,6 +301,21 @@ public enum GlassFishVersion {
static final String GF_7_0_6_STR = "7.0.6";
/** Additional {@code String} representations of GF_7_0_6 value. */
static final String GF_7_0_6_STR_NEXT[] = {"7.0.6", "7.0.6.0"};

/** A {@code String} representation of GF_7_0_7 value. */
static final String GF_7_0_7_STR = "7.0.7";
/** Additional {@code String} representations of GF_7_0_6 value. */
static final String GF_7_0_7_STR_NEXT[] = {"7.0.7", "7.0.7.0"};

/** A {@code String} representation of GF_7_0_8 value. */
static final String GF_7_0_8_STR = "7.0.8";
/** Additional {@code String} representations of GF_7_0_8 value. */
static final String GF_7_0_8_STR_NEXT[] = {"7.0.8", "7.0.8.0"};

/** A {@code String} representation of GF_7_0_9 value. */
static final String GF_7_0_9_STR = "7.0.9";
/** Additional {@code String} representations of GF_7_0_9 value. */
static final String GF_7_0_9_STR_NEXT[] = {"7.0.9", "7.0.9.0"};

/**
* Stored <code>String</code> values for backward <code>String</code>
Expand Down Expand Up @@ -339,6 +360,9 @@ public enum GlassFishVersion {
initStringValuesMapFromArray(GF_7_0_4, GF_7_0_4_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_5, GF_7_0_5_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_6, GF_7_0_6_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_7, GF_7_0_7_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_8, GF_7_0_8_STR_NEXT);
initStringValuesMapFromArray(GF_7_0_9, GF_7_0_9_STR_NEXT);
}

////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -604,5 +628,21 @@ public String toFullString() {
sb.append(Integer.toString(build));
return sb.toString();
}

/**
* Convert <code>GlassFishVersion</code> value to <code>int</code>
* containing all version numbers.
* <p/>
* @return A <code>String</code> representation of the value of this object
* containing all version numbers.
*/
public int toFullInteger() {
StringBuilder sb = new StringBuilder(8);
sb.append(Integer.toString(major));
sb.append(Integer.toString(minor));
sb.append(Integer.toString(update));
sb.append(Integer.toString(build));
return Integer.parseInt(sb.toString());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package org.netbeans.modules.glassfish.tooling.server.config;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.netbeans.modules.glassfish.tooling.data.GlassFishServer;
import org.netbeans.modules.glassfish.tooling.data.GlassFishVersion;

Expand All @@ -44,7 +44,7 @@ public class ConfigBuilderProvider {
////////////////////////////////////////////////////////////////////////////
// Class attributes //
////////////////////////////////////////////////////////////////////////////

/** Library builder default configuration file. */
private static final URL CONFIG_V3
= ConfigBuilderProvider.class.getResource("GlassFishV3.xml");
Expand Down Expand Up @@ -148,6 +148,21 @@ public class ConfigBuilderProvider {
private static final Config.Next CONFIG_V7_0_6
= new Config.Next(GlassFishVersion.GF_7_0_6,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_1.xml"));

/** Library builder configuration since GlassFish 7.0.7. */
private static final Config.Next CONFIG_V7_0_7
= new Config.Next(GlassFishVersion.GF_7_0_7,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_1.xml"));

/** Library builder configuration since GlassFish 7.0.8. */
private static final Config.Next CONFIG_V7_0_8
= new Config.Next(GlassFishVersion.GF_7_0_8,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_1.xml"));

/** Library builder configuration since GlassFish 7.0.9. */
private static final Config.Next CONFIG_V7_0_9
= new Config.Next(GlassFishVersion.GF_7_0_9,
ConfigBuilderProvider.class.getResource("GlassFishV7_0_9.xml"));

/** Library builder configuration for GlassFish cloud. */
private static final Config config
Expand All @@ -157,11 +172,12 @@ public class ConfigBuilderProvider {
CONFIG_V6_2_3, CONFIG_V6_2_4, CONFIG_V6_2_5,
CONFIG_V7_0_0, CONFIG_V7_0_1, CONFIG_V7_0_2,
CONFIG_V7_0_3, CONFIG_V7_0_4, CONFIG_V7_0_5,
CONFIG_V7_0_6);
CONFIG_V7_0_6, CONFIG_V7_0_7, CONFIG_V7_0_8,
CONFIG_V7_0_9);

/** Builders array for each server instance. */
private static final Map<GlassFishServer, ConfigBuilder> builders
= new HashMap<>();
private static final ConcurrentMap<GlassFishServer, ConfigBuilder> builders
= new ConcurrentHashMap<>(32);

////////////////////////////////////////////////////////////////////////////
// Static methods //
Expand Down Expand Up @@ -192,19 +208,11 @@ public static ConfigBuilder getBuilder(final GlassFishServer server) {
throw new ServerConfigException(
"GlassFish server entity shall not be null");
}
ConfigBuilder builder;
synchronized (builders) {
builder = builders.get(server);
if (builder != null) {
return builder;
}
String serverHome = server.getServerHome();
builder = new ConfigBuilder(config, serverHome, serverHome, serverHome);
builders.put(server, builder);
}
return builder;
String serverHome = server.getServerHome();
return builders.computeIfAbsent(server, key ->
new ConfigBuilder(config, serverHome, serverHome, serverHome));
}


/**
* Remove configuration builder instance for given GlassFish server entity
Expand All @@ -220,9 +228,7 @@ public static void destroyBuilder(final GlassFishServer server) {
throw new ServerConfigException(
"GlassFish server entity shall not be null");
}
synchronized (builders) {
builders.remove(server);
}
builders.remove(server);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->
<server>
<tools lib="lib">
<asadmin jar="client/appserver-cli.jar"/>
</tools>
<java version="21">
<platform version="11"/>
<platform version="12"/>
<platform version="13"/>
<platform version="14"/>
<platform version="15"/>
<platform version="16"/>
<platform version="17"/>
<platform version="18"/>
<platform version="19"/>
<platform version="20"/>
<platform version="21"/>
</java>
<javaee version="10.0.0">
<profile version="10.0.0" type="web"/>
<profile version="10.0.0" type="full" check="full"/>
<module type="war"/>
<module type="car" check="full"/>
<module type="ear" check="full"/>
<module type="ejb" check="full"/>
<module type="rar" check="full"/>
<check name="full">
<file path="appclient-server-core.jar"/>
</check>
</javaee>
<library id="Java EE">
<classpath>
<fileset dir="modules">
<include name="jakarta\..+\.jar"/>
<include name="jakarta.enterprise.cdi-api.jar"/>
<include name="jakarta.validation-api.jar"/>
<include name="jaxb-osgi.jar"/>
<include name="webservices-osgi.jar"/>
<include name="weld-osgi-bundle.jar"/>
</fileset>
<fileset dir="modules/endorsed">
<include name=".+\.jar"/>
</fileset>
</classpath>
<javadocs>
<lookup path="docs/jakartaee10-doc-api.jar"/>
</javadocs>
<sources>
</sources>
</library>
<library id="Jersey 3">
<classpath>
<fileset dir="modules">
<include name="jackson.+\.jar"/>
<include name="jersey.+\.jar"/>
<include name="jettison.*\.jar"/>
</fileset>
</classpath>
<javadocs>
<link url="https://repo1.maven.org/maven2/org/glassfish/jersey/jersey-documentation/3.1.3/jersey-documentation-3.1.3-docbook.zip"/>
</javadocs>
<sources>
</sources>
</library>
<library id="JAX-RS">
<classpath>
<fileset dir="modules">
<include name="jakarta.ws.rs-api.jar"/>
</fileset>
</classpath>
<javadocs>
</javadocs>
<sources>
</sources>
</library>
</server>
Loading