You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2020/10/15 16:54:57 UTC
[netbeans] branch master updated: [NETBEANS-4880] Remove Derby
integration from Payara Server modules (#2425)
This is an automated email from the ASF dual-hosted git repository.
lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 0aeb67a [NETBEANS-4880] Remove Derby integration from Payara Server modules (#2425)
0aeb67a is described below
commit 0aeb67a1b9c7a36c3a25bca02f11fc5d886297f9
Author: Gaurav Gupta <ga...@payara.fish>
AuthorDate: Thu Oct 15 22:24:48 2020 +0530
[NETBEANS-4880] Remove Derby integration from Payara Server modules (#2425)
* FISH-591 Remove Derby integration from Payara Server modules
* NETBEANS-4880 Fixes sig failure
* NETBEANS-4880 module spec version increment
---
enterprise/glassfish.javaee/nbproject/project.xml | 7 +-
.../modules/glassfish/javaee/Hk2JaxWsStack.java | 5 +-
.../modules/glassfish/javaee/db/DbUtil.java | 2 +-
enterprise/payara.common/manifest.mf | 2 +-
.../org-netbeans-modules-payara-common.sig | 30 +-
enterprise/payara.common/nbproject/project.xml | 8 -
.../modules/payara/common/PayaraInstance.java | 1 -
.../payara/common/RegisteredDerbyServerImpl.java | 60 ----
.../netbeans/modules/payara/common/StartTask.java | 7 -
.../common/registration/AutomaticRegistration.java | 1 -
.../modules/payara/common/ui/Bundle.properties | 3 -
.../modules/payara/common/ui/InstancePanel.form | 18 +-
.../modules/payara/common/ui/InstancePanel.java | 52 +--
.../modules/payara/common/ui/VmCustomizer.java | 13 -
.../common/wizards/ServerWizardIterator.java | 9 -
.../netbeans/modules/payara/spi/PayaraModule.java | 1 -
.../modules/payara/spi/RegisterDatabase.java | 170 ----------
.../modules/payara/spi/RegisteredDerbyServer.java | 31 --
.../org-netbeans-modules-payara-eecommon.sig | 2 +-
.../modules/payara/eecommon/api/DomainEditor.java | 21 +-
enterprise/payara.jakartaee/nbproject/project.xml | 59 ++--
.../jakartaee/AbstractHk2ConfigurationFactory.java | 20 +-
.../jakartaee/ApplicationScopedResourcesUtils.java | 151 ---------
.../modules/payara/jakartaee/Hk2Configuration.java | 21 +-
.../payara/jakartaee/Hk2JavaEEPlatformImpl.java | 2 +
.../modules/payara/jakartaee/Hk2JaxRpcStack.java | 153 ---------
.../modules/payara/jakartaee/Hk2JaxWsStack.java | 239 -------------
.../jakartaee/Hk2MessageDestinationManager.java | 18 +-
.../modules/payara/jakartaee/Hk2StartServer.java | 2 +-
.../jakartaee/JavaEEServerModuleFactory.java | 12 -
.../payara/jakartaee/SunMessageDestination.java | 89 -----
.../payara/jakartaee/Three1Configuration.java | 175 ----------
.../jakartaee/Three1ModuleConfigFactory.java | 41 ---
.../payara/jakartaee/db/DataSourcesReader.java | 4 +-
.../modules/payara/jakartaee/db/DbUtil.java | 250 --------------
.../modules/payara/jakartaee/db/DriverMaps.java | 366 --------------------
.../payara/jakartaee/db/Hk2DatasourceManager.java | 60 ++--
.../payara/jakartaee/db/JDBCConnectionPool.java | 310 -----------------
.../modules/payara/jakartaee/db/JDBCResource.java | 375 ---------------------
.../payara/jakartaee/db/JndiNameResolver.java | 28 --
.../payara/jakartaee/db/ResourcesHelper.java | 28 +-
.../modules/payara/jakartaee/db/SunDatasource.java | 140 --------
.../modules/payara/jakartaee/db/VendorNameMgr.java | 203 -----------
.../modules/payara/jakartaee/ui/Bundle.properties | 19 --
.../payara/jakartaee/ui/DebugPortQuery.form | 94 ------
.../payara/jakartaee/ui/DebugPortQuery.java | 126 -------
.../jakartaee/test/ServerResourceProperties.java | 32 +-
.../modules/payara/jakartaee/test/ServerTest.java | 5 +-
.../payara/jakartaee/db/SunDatasourceTest.java | 125 -------
enterprise/payara.tooling/manifest.mf | 3 +-
.../org-netbeans-modules-payara-tooling.sig | 7 +-
.../modules/payara/tooling/server/ServerTasks.java | 4 +-
.../modules/payara/tooling/utils/ServerUtils.java | 18 +-
53 files changed, 156 insertions(+), 3466 deletions(-)
diff --git a/enterprise/glassfish.javaee/nbproject/project.xml b/enterprise/glassfish.javaee/nbproject/project.xml
index 0f1c557..63d81a5 100644
--- a/enterprise/glassfish.javaee/nbproject/project.xml
+++ b/enterprise/glassfish.javaee/nbproject/project.xml
@@ -409,7 +409,12 @@
</test-dependency>
</test-type>
</test-dependencies>
- <public-packages/>
+ <friend-packages>
+ <friend>org.netbeans.modules.payara.jakartaee</friend>
+ <package>org.netbeans.modules.glassfish.javaee</package>
+ <package>org.netbeans.modules.glassfish.javaee.db</package>
+ <package>org.netbeans.modules.glassfish.javaee.ui</package>
+ </friend-packages>
</data>
</configuration>
</project>
diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java
index 756f6b8..5693d1e 100644
--- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java
+++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Hk2JaxWsStack.java
@@ -29,6 +29,7 @@ import java.util.Set;
import java.util.regex.Pattern;
import org.netbeans.api.j2ee.core.Profile;
+import org.netbeans.modules.j2ee.deployment.plugins.spi.J2eePlatformImpl;
import org.netbeans.modules.javaee.specs.support.api.JaxWs;
import org.netbeans.modules.websvc.wsstack.api.WSStack.Feature;
import org.netbeans.modules.websvc.wsstack.api.WSStack.Tool;
@@ -55,9 +56,9 @@ public class Hk2JaxWsStack implements WSStackImplementation<JaxWs> {
private String gfRootStr;
private JaxWs jaxWs;
- private Hk2JavaEEPlatformImpl platform;
+ private J2eePlatformImpl platform;
- public Hk2JaxWsStack(String gfRootStr, Hk2JavaEEPlatformImpl platform ) {
+ public Hk2JaxWsStack(String gfRootStr, J2eePlatformImpl platform ) {
this.gfRootStr = gfRootStr;
jaxWs = new JaxWs(getUriDescriptor());
this.platform = platform;
diff --git a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java
index 1a3004b..ac5c78a 100644
--- a/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java
+++ b/enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/DbUtil.java
@@ -65,7 +65,7 @@ public class DbUtil {
"datadirect_db2", "datadirect_informix", "datadirect_sybase"
};
- static Map<String, String> normalizePoolMap(Map<String, String> poolValues) {
+ public static Map<String, String> normalizePoolMap(Map<String, String> poolValues) {
String driverClassName = poolValues.get("dsClassName"); //NOI18N
String resType = poolValues.get("resType"); //NOI18N
String url = ""; //NOI18N
diff --git a/enterprise/payara.common/manifest.mf b/enterprise/payara.common/manifest.mf
index 9ccf2fe..477f3df 100644
--- a/enterprise/payara.common/manifest.mf
+++ b/enterprise/payara.common/manifest.mf
@@ -4,6 +4,6 @@ OpenIDE-Module: org.netbeans.modules.payara.common/0
OpenIDE-Module-Install: org/netbeans/modules/payara/common/Installer.class
OpenIDE-Module-Layer: org/netbeans/modules/payara/common/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/payara/common/Bundle.properties
-OpenIDE-Module-Specification-Version: 2.5
+OpenIDE-Module-Specification-Version: 2.5.1
OpenIDE-Module-Provides: org.netbeans.modules.payara.common
diff --git a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
index 3ca9188..3edf6a7 100644
--- a/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
+++ b/enterprise/payara.common/nbproject/org-netbeans-modules-payara-common.sig
@@ -1,5 +1,5 @@
#Signature file v4.1
-#Version 2.4
+#Version 2.5.1
CLSS public abstract java.awt.Component
cons protected init()
@@ -1483,13 +1483,6 @@ meth public java.lang.String getLocalizedMessage()
supr java.lang.Exception
hfds args,messageName
-CLSS public org.netbeans.modules.payara.common.RegisteredDerbyServerImpl
-cons public init()
-intf org.netbeans.modules.payara.spi.RegisteredDerbyServer
-meth public void initialize(java.lang.String)
-meth public void start()
-supr java.lang.Object
-
CLSS public org.netbeans.modules.payara.common.RestartTask
cons public !varargs init(org.netbeans.modules.payara.common.CommonServerSupport,org.netbeans.modules.payara.tooling.TaskStateListener[])
meth public org.netbeans.modules.payara.tooling.TaskState call()
@@ -1745,7 +1738,6 @@ fld protected boolean jdbcDriverDeploymentFlag
fld protected boolean loopbackFlag
fld protected boolean preserverSessionsFlag
fld protected boolean showPasswordFlag
-fld protected boolean startDerbyFlag
fld protected final org.netbeans.modules.payara.common.PayaraInstance instance
fld protected java.util.Set<? extends java.net.InetAddress> ips
fld protected javax.swing.JCheckBox commetSupport
@@ -1754,7 +1746,6 @@ fld protected javax.swing.JCheckBox httpMonitor
fld protected javax.swing.JCheckBox jdbcDriverDeployment
fld protected javax.swing.JCheckBox localIpCB
fld protected javax.swing.JCheckBox preserveSessions
-fld protected javax.swing.JCheckBox startDerby
fld protected javax.swing.JComboBox hostLocalField
fld protected javax.swing.JLabel dasPortLabel
fld protected javax.swing.JLabel domainLabel
@@ -1809,11 +1800,10 @@ meth protected boolean getHttpMonitorProperty()
meth protected boolean getJdbcDriverDeploymentProperty()
meth protected boolean getLoopbackProperty()
meth protected boolean getPreserveSessionsProperty()
-meth protected boolean getStartDerbyProperty()
-meth protected void store(boolean,boolean,boolean,boolean,boolean,boolean,boolean,org.netbeans.modules.payara.common.PayaraInstance)
+meth protected void store(boolean,boolean,boolean,boolean,boolean,boolean,org.netbeans.modules.payara.common.PayaraInstance)
meth protected void storeBooleanProperty(java.lang.String,boolean,org.netbeans.modules.payara.common.PayaraInstance)
supr java.lang.Object
-hfds cometSupportProperty,hotDeployProperty,httpMonitorProperty,jdbcDriverDeploymentProperty,loopbackProperty,preserveSessionsProperty,startDerbyProperty
+hfds cometSupportProperty,hotDeployProperty,httpMonitorProperty,jdbcDriverDeploymentProperty,loopbackProperty,preserveSessionsProperty
CLSS public org.netbeans.modules.payara.common.ui.InstanceRemotePanel
cons public init(org.netbeans.modules.payara.common.PayaraInstance)
@@ -2123,7 +2113,6 @@ fld public final static java.lang.String PASSWORD_CONVERTED_FLAG = "this really
fld public final static java.lang.String PAYARA_FOLDER_ATTR = "homefolder"
fld public final static java.lang.String PROFILE_MODE
fld public final static java.lang.String SESSION_PRESERVATION_FLAG = "preserveSessionsOn"
-fld public final static java.lang.String START_DERBY_FLAG = "derbyStartOn"
fld public final static java.lang.String TARGET_ATTR = "target"
fld public final static java.lang.String URL_ATTR = "url"
fld public final static java.lang.String USERNAME_ATTR = "username"
@@ -2197,23 +2186,10 @@ meth public abstract org.openide.windows.OutputListener processLine(java.lang.St
CLSS public abstract interface org.netbeans.modules.payara.spi.RecognizerCookie
meth public abstract java.util.Collection<? extends org.netbeans.modules.payara.spi.Recognizer> getRecognizers()
-CLSS public org.netbeans.modules.payara.spi.RegisterDatabase
-cons public init()
-meth public static org.netbeans.modules.payara.spi.RegisterDatabase getDefault()
-meth public void configureDatabase()
-meth public void setupDerby(java.lang.String)
-supr java.lang.Object
-hfds reg
-hcls DerbyLibraryRegistrar
-
CLSS public abstract interface org.netbeans.modules.payara.spi.RegisteredDDCatalog
meth public abstract void refreshRunTimeDDCatalog(org.netbeans.spi.server.ServerInstanceProvider,java.lang.String)
meth public abstract void registerRunTimeDDCatalog(org.netbeans.spi.server.ServerInstanceProvider)
-CLSS public abstract interface org.netbeans.modules.payara.spi.RegisteredDerbyServer
-meth public abstract void initialize(java.lang.String)
-meth public abstract void start()
-
CLSS public abstract interface org.netbeans.modules.payara.spi.RemoveCookie
meth public abstract void removeInstance(java.lang.String)
diff --git a/enterprise/payara.common/nbproject/project.xml b/enterprise/payara.common/nbproject/project.xml
index faeb21d..4c81882 100644
--- a/enterprise/payara.common/nbproject/project.xml
+++ b/enterprise/payara.common/nbproject/project.xml
@@ -70,14 +70,6 @@
</run-dependency>
</dependency>
<dependency>
- <code-name-base>org.netbeans.modules.derby</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <specification-version>1.12</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
<code-name-base>org.netbeans.modules.extexecution</code-name-base>
<build-prerequisite/>
<compile-dependency/>
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
index 0d98d33..e983b3d 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
@@ -1528,7 +1528,6 @@ public class PayaraInstance implements ServerInstanceImplementation,
updateString(properties, PayaraModule.HOT_DEPLOY, "false");
updateString(properties, PayaraModule.SESSION_PRESERVATION_FLAG,
"true");
- updateString(properties, PayaraModule.START_DERBY_FLAG, "false");
updateString(properties, PayaraModule.USE_IDE_PROXY_FLAG, "true");
updateString(properties, PayaraModule.DRIVER_DEPLOY_FLAG, "true");
updateString(properties, PayaraModule.HTTPHOST_ATTR, "localhost");
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/RegisteredDerbyServerImpl.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/RegisteredDerbyServerImpl.java
deleted file mode 100644
index 9bbf830..0000000
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/RegisteredDerbyServerImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.common;
-
-import org.netbeans.modules.payara.spi.RegisterDatabase;
-import java.io.File;
-import org.netbeans.modules.derby.spi.support.DerbySupport;
-import org.netbeans.modules.payara.spi.RegisteredDerbyServer;
-import org.openide.util.lookup.ServiceProvider;
-
-/**
- *
- * @author vkraemer
- */
-@ServiceProvider(service=RegisteredDerbyServer.class)
-public class RegisteredDerbyServerImpl implements RegisteredDerbyServer {
-
- @Override
- public void start() {
- DerbySupport.ensureStarted();
- }
-
- @Override
- public void initialize(String candidateLocation) {
- String location = DerbySupport.getLocation();
- if (null != location && location.trim().length() > 0) {
- return;
- }
- DerbySupport.setLocation(candidateLocation);
- location = DerbySupport.getSystemHome();
- if (null != location && location.trim().length() > 0) {
- return;
- } else {
- File dbdir = new File(DerbySupport.getDefaultSystemHome());
- if (dbdir.exists() == false) {
- dbdir.mkdirs();
- }
- }
- DerbySupport.setSystemHome(DerbySupport.getDefaultSystemHome());
- RegisterDatabase.getDefault().configureDatabase();
- }
-
-}
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java
index a672dde..1108603 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java
@@ -59,7 +59,6 @@ import org.netbeans.modules.payara.common.utils.JavaUtils;
import org.netbeans.modules.payara.common.utils.Util;
import org.netbeans.modules.payara.spi.PayaraModule.ServerState;
import org.netbeans.modules.payara.spi.Recognizer;
-import org.netbeans.modules.payara.spi.RegisteredDerbyServer;
import org.netbeans.modules.payara.spi.VMIntrospector;
import org.openide.execution.NbProcessDescriptor;
import org.openide.filesystems.FileObject;
@@ -514,12 +513,6 @@ public class StartTask extends BasicTask<TaskState> {
long start = System.currentTimeMillis();
StartStateListener listener;
try {
- // lookup the javadb start service and use it here.
- RegisteredDerbyServer db
- = Lookup.getDefault().lookup(RegisteredDerbyServer.class);
- if (null != db && "true".equals(instance.getProperty(PayaraModule.START_DERBY_FLAG))) { // NOI18N
- db.start();
- }
// This may be an autheticated server... so we will say it is
// started. Other operations will fail if the process on the port
// is not a GF v3 server.
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/registration/AutomaticRegistration.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/registration/AutomaticRegistration.java
index 4dd54a6..e049efa 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/registration/AutomaticRegistration.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/registration/AutomaticRegistration.java
@@ -205,7 +205,6 @@ public class AutomaticRegistration {
instanceFO.setAttribute(PayaraModule.JVM_MODE, PayaraModule.NORMAL_MODE);
instanceFO.setAttribute(PayaraModule.HOT_DEPLOY, false);
instanceFO.setAttribute(PayaraModule.SESSION_PRESERVATION_FLAG, true);
- instanceFO.setAttribute(PayaraModule.START_DERBY_FLAG, false);
instanceFO.setAttribute(PayaraModule.USE_IDE_PROXY_FLAG, true);
instanceFO.setAttribute(PayaraModule.USE_SHARED_MEM_ATTR, false);
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
index 31d636c..701a617 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
@@ -23,7 +23,6 @@ LBL_HttpMonitorOn=Enable HTTP &Monitor
LBL_JDBCDiverDeployOn=Enable JDBC &Driver Deployment
LBL_EnableHttpMonitor=Enable HTTP &Monitor
LBL_EnableJDBCDiverDeployment=Enable JDBC &Driver Deployment
-LBL_START_DERBY=Start Re&gistered Derby Server
LBL_PreserverSessions=&Preserve Sessions Across Redeployment
JdbcResourceCustomizer.poolNameLabel.text=&Pool Name:
JdbcResourceCustomizer.enabled.text=&Enabled
@@ -75,7 +74,6 @@ A11Y_DESC_CometSupport=Enable comet support
A11Y_DESC_HttpMonitor=Enable http monitoring
A11Y_DESC_DriverDeployment=Deploy JDBC Driver onto server
A11Y_DESC_SessionPreservation=Preserve sessions across redeployments
-A11Y_DESC_StartDerby=Start bundled Derby Server when the server starts
A11Y_DESC_InstanceLocation=Host and port for server instance
A11Y_DESC_DomainFolder=folder that hold the domain on local filesystem
A11Y_DESC_DomainName=Name of the domain. A directory in the domain folder.
@@ -146,7 +144,6 @@ InstanceLocalPanel.commetSupport=Enable Comet Support
InstanceLocalPanel.showPassword=Show Password
InstanceLocalPanel.preserveSessions=Preserve Sessions Across Redeployment
InstanceLocalPanel.httpMonitor=Enable HTTP Monitor
-InstanceLocalPanel.startDerby=Start Registered Derby Server
InstanceLocalPanel.jdbcDriverDeployment=Enable JDBC Driver Deployment
InstancePanel.httpPortField.text=
InstancePanel.dasPortField.text=
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
index a7f5f99..d8b0283 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
@@ -71,7 +71,7 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
- <Component id="hostLocalField" pref="291" max="32767" attributes="0"/>
+ <Component id="hostLocalField" pref="207" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="localIpCB" min="-2" max="-2" attributes="0"/>
</Group>
@@ -110,7 +110,6 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="preserveSessions" max="32767" attributes="0"/>
- <Component id="startDerby" max="32767" attributes="0"/>
<Component id="hotDeploy" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
@@ -178,10 +177,7 @@
<Component id="preserveSessions" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="jdbcDriverDeployment" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="startDerby" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
+ <Component id="jdbcDriverDeployment" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="120" max="-2" attributes="0"/>
</Group>
</Group>
@@ -378,16 +374,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="httpMonitorActionPerformed"/>
</Events>
</Component>
- <Component class="javax.swing.JCheckBox" name="startDerby">
- <Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/glassfish/common/ui/Bundle.properties" key="InstanceLocalPanel.startDerby" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="startDerbyActionPerformed"/>
- </Events>
- </Component>
<Component class="javax.swing.JCheckBox" name="jdbcDriverDeployment">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
index 8eff0f9..83511be 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
@@ -62,9 +62,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
/** hot deploy property. */
final String hotDeployProperty;
- /** Start Derby property. */
- final String startDerbyProperty;
-
/** Loopback property. */
final String loopbackProperty;
@@ -89,8 +86,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
= instance.getProperty(PayaraModule.HOT_DEPLOY);
preserveSessionsProperty
= instance.getProperty(PayaraModule.SESSION_PRESERVATION_FLAG);
- startDerbyProperty
- = instance.getProperty(PayaraModule.START_DERBY_FLAG);
loopbackProperty
= instance.getProperty(PayaraModule.LOOPBACK_FLAG);
}
@@ -123,7 +118,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
* @param jdbcDriverDeploymentFlag JDBC driver deployment flag.
* @param hotDeployFlag
* @param preserveSessionsFlag Preserve sessions flag.
- * @param startDerbyFlag Start Derby flag.
* @param loopbackFlag
* @param instance Payara instance object to store
* check box fields properties.
@@ -133,7 +127,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
final boolean jdbcDriverDeploymentFlag,
final boolean hotDeployFlag,
final boolean preserveSessionsFlag,
- final boolean startDerbyFlag,
final boolean loopbackFlag,
final PayaraInstance instance) {
// Update properties only when stored value differs.
@@ -158,10 +151,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
storeBooleanProperty(PayaraModule.SESSION_PRESERVATION_FLAG,
preserveSessionsFlag, instance);
}
- if (startDerbyFlag != getStartDerbyProperty()) {
- storeBooleanProperty(PayaraModule.START_DERBY_FLAG,
- startDerbyFlag, instance);
- }
if (loopbackFlag != getLoopbackProperty()) {
storeBooleanProperty(PayaraModule.LOOPBACK_FLAG,
loopbackFlag, instance);
@@ -213,15 +202,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
return Boolean.parseBoolean(preserveSessionsProperty);
}
- /**
- * Get start Derby property.
- * <p/>
- * @return Start Derby property.
- */
- protected boolean getStartDerbyProperty() {
- return Boolean.parseBoolean(startDerbyProperty);
- }
-
protected boolean getLoopbackProperty() {
return Boolean.parseBoolean(loopbackProperty);
}
@@ -271,9 +251,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
/** Hot Deploy flag. */
protected boolean hotDeployFlag;
- /** Start Derby flag. */
- protected boolean startDerbyFlag;
-
protected boolean loopbackFlag;
/** Configuration file <code>domain.xml</code> was parsed successfully. */
@@ -380,7 +357,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
jdbcDriverDeploymentFlag = properties.getJdbcDriverDeploymentProperty();
hotDeployFlag = properties.getHotDeployProperty();
preserverSessionsFlag = properties.getPreserveSessionsProperty();
- startDerbyFlag = properties.getStartDerbyProperty();
loopbackFlag = properties.getLoopbackProperty();
}
@@ -404,7 +380,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
showPassword.setSelected(showPasswordFlag);
hotDeploy.setSelected(PayaraVersion.ge(instance.getVersion(), PayaraVersion.PF_5_201)? hotDeployFlag : false);
preserveSessions.setSelected(preserverSessionsFlag);
- startDerby.setSelected(startDerbyFlag);
localIpCB.setSelected(loopbackFlag);
}
@@ -432,8 +407,7 @@ public abstract class InstancePanel extends javax.swing.JPanel {
CheckBoxProperties properties = new CheckBoxProperties(instance);
properties.store(cometSupportFlag, httpMonitorFlag,
jdbcDriverDeploymentFlag, hotDeployFlag,
- preserverSessionsFlag, startDerbyFlag,
- loopbackFlag, instance);
+ preserverSessionsFlag, loopbackFlag, instance);
PayaraSettings.setGfShowPasswordInPropertiesForm(showPasswordFlag);
}
@@ -534,7 +508,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
hotDeploy.setEnabled(PayaraVersion.ge(instance.getVersion(), PayaraVersion.PF_5_201));
showPassword.setEnabled(true);
preserveSessions.setEnabled(true);
- startDerby.setEnabled(true);
}
/**
@@ -561,7 +534,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
hotDeploy.setEnabled(false);
showPassword.setEnabled(false);
preserveSessions.setEnabled(false);
- startDerby.setEnabled(false);
}
/**
@@ -661,7 +633,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
commetSupport = new javax.swing.JCheckBox();
preserveSessions = new javax.swing.JCheckBox();
httpMonitor = new javax.swing.JCheckBox();
- startDerby = new javax.swing.JCheckBox();
jdbcDriverDeployment = new javax.swing.JCheckBox();
passwordField = new javax.swing.JPasswordField();
hostRemoteLabel = new javax.swing.JLabel();
@@ -743,13 +714,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
}
});
- org.openide.awt.Mnemonics.setLocalizedText(startDerby, org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.startDerby")); // NOI18N
- startDerby.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- startDerbyActionPerformed(evt);
- }
- });
-
org.openide.awt.Mnemonics.setLocalizedText(jdbcDriverDeployment, org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.jdbcDriverDeployment")); // NOI18N
jdbcDriverDeployment.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
@@ -806,7 +770,7 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addComponent(hostLocalField, 0, 291, Short.MAX_VALUE)
+ .addComponent(hostLocalField, 0, 207, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(localIpCB))
.addGroup(layout.createSequentialGroup()
@@ -830,13 +794,12 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addGap(2, 2, 2))))))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(jdbcDriverDeployment, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
+ .addComponent(jdbcDriverDeployment, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(httpMonitor, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(commetSupport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(preserveSessions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(startDerby, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(hotDeploy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap())
);
@@ -894,9 +857,7 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addComponent(httpMonitor)
.addComponent(preserveSessions))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jdbcDriverDeployment)
- .addComponent(startDerby))
+ .addComponent(jdbcDriverDeployment)
.addGap(120, 120, 120))
);
}// </editor-fold>//GEN-END:initComponents
@@ -917,10 +878,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
jdbcDriverDeploymentFlag = jdbcDriverDeployment.isSelected();
}//GEN-LAST:event_jdbcDriverDeploymentActionPerformed
- private void startDerbyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startDerbyActionPerformed
- startDerbyFlag = startDerby.isSelected();
- }//GEN-LAST:event_startDerbyActionPerformed
-
private void localIpCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localIpCBActionPerformed
loopbackFlag = localIpCB.isSelected();
Object hostValue = hostLocalField.getEditor().getItem();
@@ -969,7 +926,6 @@ public abstract class InstancePanel extends javax.swing.JPanel {
protected javax.swing.JLabel passwordLabel;
protected javax.swing.JCheckBox preserveSessions;
protected javax.swing.JToggleButton showPassword;
- protected javax.swing.JCheckBox startDerby;
protected javax.swing.JTextField targetField;
protected javax.swing.JLabel targetLabel;
protected javax.swing.JTextField userNameField;
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/VmCustomizer.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/VmCustomizer.java
index 323f79e..a91dc71 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/VmCustomizer.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/VmCustomizer.java
@@ -29,7 +29,6 @@ import org.netbeans.api.java.platform.JavaPlatform;
import org.netbeans.api.java.platform.PlatformsCustomizer;
import org.netbeans.modules.payara.common.PayaraInstance;
import org.netbeans.modules.payara.common.utils.JavaUtils;
-import org.netbeans.modules.payara.spi.RegisteredDerbyServer;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Lookup;
@@ -180,18 +179,6 @@ public class VmCustomizer extends javax.swing.JPanel {
}
}
instance.setJavaHome(selectedJavaHome);
- if (selectedJavaHome != null) {
- RegisteredDerbyServer db = Lookup.getDefault().lookup(RegisteredDerbyServer.class);
- if (null != db) {
- File f = new File(selectedJavaHome);
- if (f.exists() && f.canRead() && f.isDirectory()) {
- File dbdir = new File(f, "db"); // NOI18N
- if (dbdir.exists() && dbdir.isDirectory() && dbdir.canRead()) {
- db.initialize(dbdir.getAbsolutePath());
- }
- }
- }
- }
instance.putProperty(PayaraModule.USE_SHARED_MEM_ATTR,
Boolean.toString(useSharedMemRB.isSelected()));
instance.putProperty(PayaraModule.USE_IDE_PROXY_FLAG,
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
index aaf6b1a..9e8992d 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
@@ -33,7 +33,6 @@ import javax.swing.event.ChangeListener;
import org.netbeans.api.server.ServerInstance;
import org.netbeans.modules.payara.common.CreateDomain;
import org.netbeans.modules.payara.common.PayaraInstance;
-import org.netbeans.modules.payara.spi.RegisteredDerbyServer;
import org.netbeans.modules.payara.spi.ServerUtilities;
import org.netbeans.modules.payara.spi.Utils;
import org.openide.DialogDisplayer;
@@ -148,14 +147,6 @@ public class ServerWizardIterator extends PortCollection implements WizardDescri
} else {
handleRemoteDomains(result,ir);
}
- // lookup the javadb register service here and use it.
- RegisteredDerbyServer db = Lookup.getDefault().lookup(RegisteredDerbyServer.class);
- if (null != db) {
- File f = new File(ir, "javadb");
- if (f.exists() && f.isDirectory() && f.canRead()) {
- db.initialize(f.getAbsolutePath());
- }
- }
NbPreferences.forModule(this.getClass()).put("INSTALL_ROOT_KEY", installRoot); // NOI18N
return result;
}
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
index dd2855f..69522bb 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
@@ -59,7 +59,6 @@ public interface PayaraModule {
public static final String JAVA_PLATFORM_ATTR = "java.platform";
public static final String HTTP_MONITOR_FLAG = "httpMonitorOn";
public static final String DRIVER_DEPLOY_FLAG = "driverDeployOn";
- public static final String START_DERBY_FLAG = "derbyStartOn";
public static final String USE_IDE_PROXY_FLAG = "useIDEProxyOn";
public static final String LOOPBACK_FLAG = "loopbackOn";
public static final String HTTPHOST_ATTR = "httphostname"; // NOI18N -- necessary for cluster and instance support
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisterDatabase.java b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisterDatabase.java
deleted file mode 100644
index c24efaf..0000000
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisterDatabase.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.spi;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.netbeans.api.db.explorer.DatabaseException;
-import org.netbeans.modules.derby.api.DerbyDatabases;
-import org.netbeans.modules.derby.spi.support.DerbySupport;
-import org.openide.filesystems.FileLock;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileStateInvalidException;
-import org.openide.filesystems.FileSystem;
-import org.openide.filesystems.FileUtil;
-import org.openide.util.RequestProcessor;
-
-/**
- *
- * @author Nitya Doraisamy
- */
-public class RegisterDatabase {
-
- private static volatile RegisterDatabase reg = null;
-
- public static RegisterDatabase getDefault(){
- if (reg == null) {
- reg = new RegisterDatabase();
- }
- return reg;
- }
-
- public void setupDerby(String serverinstall) {
- String location = DerbySupport.getLocation();
- if (null != location && location.trim().length() > 0) {
- return;
- }
- File dbloc = new File(serverinstall, "javadb"); //NOI18N
- if (dbloc.exists() && dbloc.isDirectory() && dbloc.canRead()) {
- DerbySupport.setLocation(dbloc.getAbsolutePath());
- location = DerbySupport.getSystemHome();
- if (null != location && location.trim().length() > 0) {
- return;
- }else{
- File dbdir = new File(DerbySupport.getDefaultSystemHome());
- if (dbdir.exists() == false) {
- dbdir.mkdirs();
- }
- }
- DerbySupport.setSystemHome(DerbySupport.getDefaultSystemHome());
- }
- configureDatabase();
- }
-
- public void configureDatabase(){
- String location = DerbySupport.getLocation();
- File dbInstall = new File(location);
- if (dbInstall != null && dbInstall.exists()){
- registerDerbyLibrary(dbInstall);
- RequestProcessor.getDefault().post(new Runnable() {
- @Override
- public void run() {
- try {
- DerbyDatabases.createSampleDatabase();
- } catch (DatabaseException | IOException ex) {
- Logger.getLogger("payara-eecommon").log(Level.INFO, ex.getLocalizedMessage(), ex); //NOI18N
- }
- //NOI18N
-
- }
- });
- }
- }
-
- private void registerDerbyLibrary(final File location) {
- final FileObject libsFolder = FileUtil.getConfigFile("org-netbeans-api-project-libraries/Libraries"); //NOI18N
- if (libsFolder!=null){
- try {
- libsFolder.getFileSystem().runAtomicAction(
- new DerbyLibraryRegistrar(location, libsFolder));
- } catch (FileStateInvalidException ex) {
- Logger.getLogger("payara-eecommon").log(Level.INFO, ex.getLocalizedMessage(), ex); //NOI18N
- } catch (IOException ex) {
- Logger.getLogger("payara-eecommon").log(Level.INFO, ex.getLocalizedMessage(), ex); //NOI18N
- }
- }
- }
-
- static class DerbyLibraryRegistrar implements FileSystem.AtomicAction {
-
- private File location;
-
- private FileObject libsFolder;
-
- DerbyLibraryRegistrar(File location, FileObject libsFolder) {
- this.location = location;
- this.libsFolder = libsFolder;
- }
-
- @Override
- public void run() throws IOException {
- FileLock ld = null;
- java.io.OutputStream outStreamd = null;
- Writer outd = null;
- OutputStreamWriter osw = null;
- try {
- // the derby lib driver:
- FileObject derbyLib =null;
- derbyLib = libsFolder.getFileObject("JavaDB" ,"xml");//NOI18N
- if (null == derbyLib) {
- derbyLib = libsFolder.createData("JavaDB" ,"xml");//NOI18N
- ld = derbyLib.lock();
- outStreamd = derbyLib.getOutputStream(ld);
- osw = new OutputStreamWriter(outStreamd);
- outd = new BufferedWriter(osw);
- outd.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE library PUBLIC \"-//NetBeans//DTD Library Declaration 1.0//EN\" \"http://www.netbeans.org/dtds/library-declaration-1_0.dtd\">\n");//NOI18N
- outd.write("<library version=\"1.0\">\n<name>JAVADB_DRIVER_LABEL</name>\n");//NOI18N
- outd.write("<type>j2se</type>\n");//NOI18N
- outd.write("<localizing-bundle>org.netbeans.modules.payara.eecommon.api.Bundle</localizing-bundle>\n");//NOI18N
- outd.write("<volume>\n<type>classpath</type>\n"); //NOI18N
- outd.write("<resource>jar:"+new File(location.getAbsolutePath()+"/lib/derby.jar").toURI().toURL()+"!/</resource>\n"); //NOI18N
- outd.write("<resource>jar:"+new File(location.getAbsolutePath()+"/lib/derbyclient.jar").toURI().toURL()+"!/</resource>\n"); //NOI18N
- outd.write("<resource>jar:"+new File(location.getAbsolutePath()+"/lib/derbynet.jar").toURI().toURL()+"!/</resource>\n"); //NOI18N
- outd.write("</volume>\n<volume>\n<type>src</type>\n</volume>\n"); //NOI18N
- outd.write("<volume>\n<type>javadoc</type>\n"); //NOI18N
- outd.write("</volume>\n</library>"); //NOI18N
- }
- } finally {
- if (null != outd) {
- try {
- outd.close();
- } catch (IOException ioe) {
- Logger.getLogger("payara-eecommon").log(Level.INFO, ioe.getLocalizedMessage(), ioe); //NOI18N
- }
- }
- if (null != outStreamd) {
- try {
- outStreamd.close();
- } catch (IOException ioe) {
- Logger.getLogger("payara-eecommon").log(Level.INFO, ioe.getLocalizedMessage(), ioe); //NOI18N
- }
- }
- if (null != ld) {
- ld.releaseLock();
- }
- }
- } //run
- } //DerbyLibraryRegistrar
-}
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisteredDerbyServer.java b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisteredDerbyServer.java
deleted file mode 100644
index 4592f25..0000000
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/RegisteredDerbyServer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.spi;
-
-/**
- *
- * @author vkraemer
- */
-public interface RegisteredDerbyServer {
-
- public void initialize(String candidate);
- public void start();
-
-}
diff --git a/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig b/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig
index 1189c4e..c399a3d 100644
--- a/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig
+++ b/enterprise/payara.eecommon/nbproject/org-netbeans-modules-payara-eecommon.sig
@@ -742,7 +742,7 @@ meth public org.w3c.dom.Document getDomainDocument()
meth public org.w3c.dom.Document getDomainDocument(java.lang.String)
meth public void createSampleDatasource()
supr java.lang.Object
-hfds CONST_AO,CONST_CP,CONST_DATABASE_NAME,CONST_DERBY_CONN_ATTRS,CONST_DRIVER_CLASS,CONST_DS_CLASS,CONST_ENABLED,CONST_JDBC,CONST_JNDINAME,CONST_JVM_OPTIONS,CONST_LOWER_DATABASE_NAME,CONST_LOWER_PORT_NUMBER,CONST_NAME,CONST_OBJTYPE,CONST_PASSWORD,CONST_POOLNAME,CONST_PORT_NUMBER,CONST_PROP,CONST_RES_TYPE,CONST_SERVER_NAME,CONST_SID,CONST_URL,CONST_USER,CONST_VALUE,HTTPS_PROXY_HOST,HTTPS_PROXY_PORT,HTTP_PROXY_HOST,HTTP_PROXY_NO_HOST,HTTP_PROXY_PORT,LOGGER,NBPROFILERNAME,SAMPLE_CONNPOOL,S [...]
+hfds CONST_AO,CONST_CP,CONST_DATABASE_NAME,CONST_DRIVER_CLASS,CONST_DS_CLASS,CONST_ENABLED,CONST_JDBC,CONST_JNDINAME,CONST_JVM_OPTIONS,CONST_LOWER_DATABASE_NAME,CONST_LOWER_PORT_NUMBER,CONST_NAME,CONST_OBJTYPE,CONST_PASSWORD,CONST_POOLNAME,CONST_PORT_NUMBER,CONST_PROP,CONST_RES_TYPE,CONST_SERVER_NAME,CONST_SID,CONST_URL,CONST_USER,CONST_VALUE,HTTPS_PROXY_HOST,HTTPS_PROXY_PORT,HTTP_PROXY_HOST,HTTP_PROXY_NO_HOST,HTTP_PROXY_PORT,LOGGER,NBPROFILERNAME,SAMPLE_CONNPOOL,SAMPLE_DATASOURCE,XML_EN [...]
hcls InnerResolver
CLSS public org.netbeans.modules.payara.eecommon.api.ExecSupport
diff --git a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java
index 4309826..df3f647 100644
--- a/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java
+++ b/enterprise/payara.eecommon/src/org/netbeans/modules/payara/eecommon/api/DomainEditor.java
@@ -62,8 +62,8 @@ public class DomainEditor {
private static final String HTTPS_PROXY_PORT = "-Dhttps.proxyPort=";
private static final String HTTP_PROXY_NO_HOST = "-Dhttp.nonProxyHosts=";
- private static String SAMPLE_DATASOURCE = "jdbc/sample"; //NOI18N
- private static String SAMPLE_CONNPOOL = "SamplePool"; //NOI18N
+ private static String SAMPLE_DATASOURCE = "jdbc/__default"; //NOI18N
+ private static String SAMPLE_CONNPOOL = "H2Pool"; //NOI18N
private static String NBPROFILERNAME = "NetBeansProfiler"; //NOI18N
@@ -82,7 +82,6 @@ public class DomainEditor {
static private String CONST_DS_CLASS = "datasource-classname"; // NOI18N
static private String CONST_RES_TYPE = "res-type"; // NOI18N
static private String CONST_JVM_OPTIONS = "jvm-options"; // NOI18N
- static private String CONST_DERBY_CONN_ATTRS = "connectionAttributes"; // NOI18N
static private String CONST_JNDINAME = "jndi-name"; // NOI18N
static private String CONST_PROP = "property"; // NOI18N
static private String CONST_POOLNAME = "pool-name"; // NOI18N
@@ -517,7 +516,6 @@ public class DomainEditor {
pValues.put(CONST_DATABASE_NAME, (String) map.get(CONST_DATABASE_NAME));
pValues.put(CONST_SID, (String) map.get(CONST_SID));
pValues.put(CONST_DRIVER_CLASS, (String) map.get(CONST_DRIVER_CLASS));
- pValues.put(CONST_DERBY_CONN_ATTRS, (String) map.get(CONST_DERBY_CONN_ATTRS));
if (dsClassName != null) {
pValues.put("dsClassName", dsClassName.getNodeValue());
}
@@ -603,18 +601,13 @@ public class DomainEditor {
cpAttrMap.getNamedItem(CONST_NAME).setNodeValue(SAMPLE_CONNPOOL);
}
if(cpAttrMap.getNamedItem(CONST_DS_CLASS) != null) {
- cpAttrMap.getNamedItem(CONST_DS_CLASS).setNodeValue("org.apache.derby.jdbc.ClientDataSource"); //N0I18N
+ cpAttrMap.getNamedItem(CONST_DS_CLASS).setNodeValue("org.h2.jdbcx.JdbcDataSource"); //N0I18N
}
if(cpAttrMap.getNamedItem(CONST_RES_TYPE) != null) {
cpAttrMap.getNamedItem(CONST_RES_TYPE).setNodeValue("javax.sql.DataSource"); //N0I18N
}
- HashMap<String, String> poolProps = new HashMap<String, String>();
- poolProps.put(CONST_SERVER_NAME, "localhost"); //N0I18N
- poolProps.put(CONST_PASSWORD, "app"); //N0I18N
- poolProps.put(CONST_USER, "app"); //N0I18N
- poolProps.put(CONST_DATABASE_NAME, "sample"); //N0I18N
- poolProps.put(CONST_PORT_NUMBER, "1527"); //N0I18N
- poolProps.put(CONST_URL, "jdbc:derby://localhost:1527/sample"); //N0I18N
+ HashMap<String, String> poolProps = new HashMap<>();
+ poolProps.put(CONST_URL, "jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE"); //N0I18N
Object[] propNames = poolProps.keySet().toArray();
for(int i=0; i<propNames.length; i++){
@@ -654,7 +647,7 @@ public class DomainEditor {
}
private HashMap<String,Node> getConnPoolsNodeMap(Document domainDoc){
- HashMap<String,Node> connPoolMap = new HashMap<String,Node>();
+ HashMap<String,Node> connPoolMap = new HashMap<>();
NodeList connPoolNodeList = domainDoc.getElementsByTagName(CONST_CP);
for(int i=0; i<connPoolNodeList.getLength(); i++){
Node cpNode = connPoolNodeList.item(i);
@@ -666,7 +659,7 @@ public class DomainEditor {
}
public HashMap<String,String> getAdminObjectResourcesFromXml(){
- HashMap<String,String> aoResources = new HashMap<String,String>();
+ HashMap<String,String> aoResources = new HashMap<>();
Document domainDoc = getDomainDocument();
if (domainDoc != null) {
NodeList adminObjectNodeList = domainDoc.getElementsByTagName(CONST_AO);
diff --git a/enterprise/payara.jakartaee/nbproject/project.xml b/enterprise/payara.jakartaee/nbproject/project.xml
index 0941f73..7ac6a14 100644
--- a/enterprise/payara.jakartaee/nbproject/project.xml
+++ b/enterprise/payara.jakartaee/nbproject/project.xml
@@ -98,30 +98,12 @@
</run-dependency>
</dependency>
<dependency>
- <code-name-base>org.netbeans.modules.payara.common</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <release-version>0-1</release-version>
- <specification-version>2.0</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.netbeans.modules.payara.eecommon</code-name-base>
+ <code-name-base>org.netbeans.modules.glassfish.javaee</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>0</release-version>
- <specification-version>2.0</specification-version>
- </run-dependency>
- </dependency>
- <dependency>
- <code-name-base>org.netbeans.modules.payara.tooling</code-name-base>
- <build-prerequisite/>
- <compile-dependency/>
- <run-dependency>
- <release-version>0-1</release-version>
- <specification-version>2.0</specification-version>
+ <specification-version>1.51</specification-version>
</run-dependency>
</dependency>
<dependency>
@@ -206,6 +188,33 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.netbeans.modules.payara.common</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>0-1</release-version>
+ <specification-version>2.0</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.payara.eecommon</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>0</release-version>
+ <specification-version>2.0</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
+ <code-name-base>org.netbeans.modules.payara.tooling</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>0-1</release-version>
+ <specification-version>2.0</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.modules.project.libraries</code-name-base>
<build-prerequisite/>
<compile-dependency/>
@@ -334,7 +343,7 @@
</run-dependency>
</dependency>
<dependency>
- <code-name-base>org.openide.util.ui</code-name-base>
+ <code-name-base>org.openide.util</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
@@ -342,19 +351,19 @@
</run-dependency>
</dependency>
<dependency>
- <code-name-base>org.openide.util</code-name-base>
+ <code-name-base>org.openide.util.lookup</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
- <specification-version>9.3</specification-version>
+ <specification-version>8.0</specification-version>
</run-dependency>
</dependency>
<dependency>
- <code-name-base>org.openide.util.lookup</code-name-base>
+ <code-name-base>org.openide.util.ui</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
- <specification-version>8.0</specification-version>
+ <specification-version>9.3</specification-version>
</run-dependency>
</dependency>
<dependency>
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/AbstractHk2ConfigurationFactory.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/AbstractHk2ConfigurationFactory.java
index 007aadf..a1ddff4 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/AbstractHk2ConfigurationFactory.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/AbstractHk2ConfigurationFactory.java
@@ -21,7 +21,6 @@ package org.netbeans.modules.payara.jakartaee;
import org.netbeans.api.annotations.common.NonNull;
import org.netbeans.modules.payara.common.PayaraInstance;
import org.netbeans.modules.payara.common.PayaraInstanceProvider;
-import org.netbeans.modules.payara.eecommon.api.config.J2eeModuleHelper;
import org.netbeans.modules.payara.tooling.data.PayaraVersion;
import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException;
import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
@@ -63,13 +62,8 @@ abstract class AbstractHk2ConfigurationFactory implements ModuleConfigurationFac
throws ConfigurationException {
ModuleConfiguration retVal = null;
try {
- if (J2eeModuleHelper.isPayaraWeb(module) || J2eeModuleHelper.isGlassFishWeb(module)) {
- retVal = new ModuleConfigurationImpl(
- module, new Three1Configuration(module, PayaraVersion.PF_4_1_144), hk2dm);
- } else {
- retVal = new ModuleConfigurationImpl(
- module, new Hk2Configuration(module, PayaraVersion.PF_4_1_144), hk2dm);
- }
+ retVal = new ModuleConfigurationImpl(
+ module, new Hk2Configuration(module, PayaraVersion.PF_4_1_144), hk2dm);
} catch (ConfigurationException ce) {
throw ce;
} catch (Exception ex) {
@@ -103,14 +97,8 @@ abstract class AbstractHk2ConfigurationFactory implements ModuleConfigurationFac
? hk2dm
: (Hk2DeploymentManager) Hk2DeploymentFactory.createEe(version)
.getDisconnectedDeploymentManager(instanceUrl);
- if (version != null
- && PayaraVersion.ge(version, PayaraVersion.PF_4_1_144)) {
- retVal = new ModuleConfigurationImpl(
- module, new Three1Configuration(module, version), dm);
- } else {
- retVal = new ModuleConfigurationImpl(
- module, new Hk2Configuration(module, version), dm);
- }
+ retVal = new ModuleConfigurationImpl(
+ module, new Hk2Configuration(module, version), dm);
} catch (ConfigurationException ce) {
throw ce;
} catch (Exception ex) {
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ApplicationScopedResourcesUtils.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ApplicationScopedResourcesUtils.java
deleted file mode 100644
index ba1b25b..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ApplicationScopedResourcesUtils.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.Set;
-import org.netbeans.api.project.FileOwnerQuery;
-import org.netbeans.api.project.Project;
-import org.netbeans.api.project.ui.OpenProjects;
-import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
-import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeApplicationProvider;
-import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
-import org.netbeans.modules.javaee.specs.support.api.util.JndiNamespacesDefinition;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-
-/**
- *
- * @author Petr Hejl
- */
-public final class ApplicationScopedResourcesUtils {
-
- private ApplicationScopedResourcesUtils() {
- super();
- }
-
- public static ResourceFileDescription checkNamespaces(J2eeModule module, ResourceFileDescription fileDesc, String namespace) {
- // we need to check and possibly ask for jndi namespace
- if (fileDesc.isIsApplicationScoped() && namespace == null) {
- Set<String> ns = fileDesc.getNamespaces();
- if (!ns.contains(JndiNamespacesDefinition.APPLICATION_NAMESPACE)
- && !ns.contains(JndiNamespacesDefinition.MODULE_NAMESPACE)) {
-
- String customNamespace = null;
- if (ApplicationScopedResourcesUtils.isEarChild(fileDesc.getFile())) {
- customNamespace = JndiNamespacesDefinition.MODULE_NAMESPACE;
- } else {
- customNamespace = JndiNamespacesDefinition.APPLICATION_NAMESPACE;
- }
- return new ResourceFileDescription(fileDesc.getFile(),
- fileDesc.isIsApplicationScoped(), Collections.singleton(customNamespace));
- }
- }
- return fileDesc;
- }
-
- public static String getJndiName(String jndiName, ResourceFileDescription fileDesc) {
- if (!fileDesc.isIsApplicationScoped()) {
- return jndiName;
- }
-
- String realJndiName = jndiName;
- Set<String> ns = fileDesc.getNamespaces();
- if (ns.isEmpty()) {
- // should not happen
- realJndiName = JndiNamespacesDefinition.normalize(
- realJndiName, JndiNamespacesDefinition.APPLICATION_NAMESPACE);
- } else {
- if (ns.contains(JndiNamespacesDefinition.MODULE_NAMESPACE)) {
- realJndiName = JndiNamespacesDefinition.normalize(
- realJndiName, JndiNamespacesDefinition.MODULE_NAMESPACE);
- } else {
- realJndiName = JndiNamespacesDefinition.normalize(
- realJndiName, JndiNamespacesDefinition.APPLICATION_NAMESPACE);
- }
- }
- return realJndiName;
- }
-
- public static boolean isEarChild(File file) {
- FileObject fo = FileUtil.toFileObject(file);
- assert fo != null;
- if (fo == null) {
- return false;
- }
- Project p = FileOwnerQuery.getOwner(fo);
- if (p == null) {
- return false;
- }
- return isEarChild(p);
- }
-
- public static boolean isEarChild(Project project) {
- J2eeModuleProvider childProvider = project.getLookup().lookup(J2eeModuleProvider.class);
- if (childProvider == null || childProvider instanceof J2eeApplicationProvider) {
- return false;
- }
- // FIXME if the ear is closed it wont find it; is it a problem?
- Project[] allProjects = OpenProjects.getDefault().getOpenProjects();
- for (Project candidate : allProjects) {
- J2eeApplicationProvider app = candidate.getLookup().lookup(J2eeApplicationProvider.class);
- if (app != null) {
- for (J2eeModuleProvider p : app.getChildModuleProviders()) {
- if (p.equals(childProvider)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- public static interface JndiNameResolver {
-
- String resolveJndiName(String jndiName);
- }
-
- public static class ResourceFileDescription {
-
- private final File file;
-
- private final boolean isApplicationScoped;
-
- private final Set<String> namespaces;
-
- public ResourceFileDescription(File file, boolean isApplicationScoped, Set<String> namespaces) {
- this.file = file;
- this.isApplicationScoped = isApplicationScoped;
- this.namespaces = namespaces;
- }
-
- public File getFile() {
- return file;
- }
-
- public boolean isIsApplicationScoped() {
- return isApplicationScoped;
- }
-
- public Set<String> getNamespaces() {
- return namespaces;
- }
- }
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2Configuration.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2Configuration.java
index 4a74e4c..ff4761e 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2Configuration.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2Configuration.java
@@ -44,8 +44,7 @@ import org.openide.filesystems.FileUtil;
import org.openide.util.NbBundle;
/**
- * Java EE server configuration API support for Payara servers before 3.1.
- * Covers Payara servers before 3.1. Old {@code sun-resources.xml} files are used.
+ * Java EE server configuration API support for Payara servers.
* <p/>
* @author Ludovic Champenois, Peter Williams, Tomas Kraus
*/
@@ -128,7 +127,7 @@ public class Hk2Configuration extends PayaraConfiguration implements DeploymentC
public MessageDestination createMessageDestination(String name, MessageDestination.Type type) throws UnsupportedOperationException, org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException {
File resourceDir = module.getResourceDirectory();
if (resourceDir == null) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING, "Null Resource Folder."); // NOI18N
+ Logger.getLogger("payara-jakartaee").log(Level.WARNING,"Resource Folder {0} does not exist.", resourceDir); // NOI18N
throw new ConfigurationException(NbBundle.getMessage(
ModuleConfigurationImpl.class, "ERR_NoJMSResource", name, type)); // NOI18N
}
@@ -174,24 +173,24 @@ public class Hk2Configuration extends PayaraConfiguration implements DeploymentC
throw new UnsupportedOperationException("Not supported yet.");
}
- private static final String GLASSFISH_DASH = "glassfish-"; // NOI18N
+ protected static final String GLASSFISH_DASH = "glassfish-"; // NOI18N
private String getResourceFileName() {
return "glassfish-resources";
}
@Override
- protected FileObject getPayaraDD(File sunDDFile, boolean create) throws IOException {
- if (!sunDDFile.exists()) {
+ protected FileObject getPayaraDD(File payaraDDFile, boolean create) throws IOException {
+ if (!payaraDDFile.exists()) {
if (create) {
- createDefaultSunDD(sunDDFile);
+ createDefaultSunDD(payaraDDFile);
}
}
- FileObject retVal = FileUtil.toFileObject(FileUtil.normalizeFile(sunDDFile));
+ FileObject retVal = FileUtil.toFileObject(FileUtil.normalizeFile(payaraDDFile));
if (null == retVal) {
- String fn = sunDDFile.getName();
- if (fn.contains(GLASSFISH_DASH) && null != sunDDFile.getParentFile()) {
- File alternate = new File(sunDDFile.getParentFile(), fn.replace(GLASSFISH_DASH, "sun-")); // NOI18N
+ String fn = payaraDDFile.getName();
+ if (fn.contains(GLASSFISH_DASH) && null != payaraDDFile.getParentFile()) {
+ File alternate = new File(payaraDDFile.getParentFile(), fn.replace(GLASSFISH_DASH, "sun-")); // NOI18N
retVal = FileUtil.toFileObject(FileUtil.normalizeFile(alternate));
}
}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
index ca91909..80d4fc8 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JavaEEPlatformImpl.java
@@ -43,6 +43,8 @@ import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectUtils;
import org.netbeans.api.project.SourceGroup;
import org.netbeans.api.project.libraries.Library;
+import org.netbeans.modules.glassfish.javaee.Hk2JaxRpcStack;
+import org.netbeans.modules.glassfish.javaee.Hk2JaxWsStack;
import org.netbeans.modules.payara.spi.PayaraModule;
import org.netbeans.modules.payara.spi.ServerUtilities;
import org.netbeans.modules.payara.tooling.data.PayaraServer;
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxRpcStack.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxRpcStack.java
deleted file mode 100644
index f013db6..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxRpcStack.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.netbeans.modules.javaee.specs.support.api.JaxRpc;
-import org.netbeans.modules.websvc.wsstack.api.WSStack.Feature;
-import org.netbeans.modules.websvc.wsstack.api.WSStack.Tool;
-import org.netbeans.modules.websvc.wsstack.api.WSStackVersion;
-import org.netbeans.modules.websvc.wsstack.api.WSTool;
-import org.netbeans.modules.websvc.wsstack.spi.WSStackFactory;
-import org.netbeans.modules.websvc.wsstack.spi.WSStackImplementation;
-import org.netbeans.modules.websvc.wsstack.spi.WSToolImplementation;
-
-/**
- *
- * @author mkuchtiak
- * @author ads
- */
-public class Hk2JaxRpcStack implements WSStackImplementation<JaxRpc> {
- private static final String[] METRO_LIBRARIES =
- new String[] {"webservices(|-osgi).jar"}; //NOI18N
- private static final String PF_MODULES_DIR_NAME = "modules"; // NOI18N
-
- private String gfRootStr;
- private JaxRpc jaxRpc;
-
- public Hk2JaxRpcStack(String gfRootStr) {
- this.gfRootStr = gfRootStr;
- jaxRpc = new JaxRpc();
- }
-
- @Override
- public JaxRpc get() {
- return jaxRpc;
- }
-
- @Override
- public WSStackVersion getVersion() {
- return WSStackVersion.valueOf(1, 1, 3, 0);
- }
-
- @Override
- public WSTool getWSTool(Tool toolId) {
- if (toolId == JaxRpc.Tool.WCOMPILE && isMetroInstalled()) {
- return WSStackFactory.createWSTool(new JaxRpcTool(JaxRpc.Tool.WCOMPILE));
- } else {
- return null;
- }
- }
-
- @Override
- public boolean isFeatureSupported(Feature feature) {
- if (feature == JaxRpc.Feature.JSR109 && isMetroInstalled()) {
- return true;
- }
- return false;
- }
-
- protected class JaxRpcTool implements WSToolImplementation {
- JaxRpc.Tool tool;
- JaxRpcTool(JaxRpc.Tool tool) {
- this.tool = tool;
- }
-
- @Override
- public String getName() {
- return tool.getName();
- }
-
- @Override
- public URL[] getLibraries() {
- List<URL> cPath = new ArrayList<URL>();
- if (isMetroInstalled()) {
- for (String entry : METRO_LIBRARIES) {
- File f = getJarName(gfRootStr, entry);
- if ((f != null) && (f.exists())) {
- try {
- cPath.add(f.toURI().toURL());
- } catch (MalformedURLException ex) {
-
- }
- }
- }
- }
- return cPath.toArray(new URL[cPath.size()]);
- }
-
- }
-
- protected boolean isMetroInstalled() {
- File f = getJarName(gfRootStr, METRO_LIBRARIES[0]);
- return f!=null && f.exists();
- }
-
- private static class VersionFilter implements FileFilter {
-
- private final Pattern pattern;
-
- public VersionFilter(String namePattern) {
- pattern = Pattern.compile(namePattern);
- }
-
- @Override
- public boolean accept(File file) {
- return pattern.matcher(file.getName()).matches();
- }
-
- }
-
- protected File getJarName(String glassfishInstallRoot, String jarNamePattern) {
-
- File modulesDir = new File(glassfishInstallRoot + File.separatorChar +
- PF_MODULES_DIR_NAME);
- int subindex = jarNamePattern.lastIndexOf("/");
- if(subindex != -1) {
- String subdir = jarNamePattern.substring(0, subindex);
- jarNamePattern = jarNamePattern.substring(subindex+1);
- modulesDir = new File(modulesDir, subdir);
- }
- File candidates[] = modulesDir.listFiles(new VersionFilter(jarNamePattern));
-
- if (candidates != null && candidates.length > 0) {
- return candidates[0]; // the first one
- }
- return null;
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxWsStack.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxWsStack.java
deleted file mode 100644
index 2188141..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2JaxWsStack.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import org.netbeans.api.j2ee.core.Profile;
-import org.netbeans.modules.javaee.specs.support.api.JaxWs;
-import org.netbeans.modules.websvc.wsstack.api.WSStack.Feature;
-import org.netbeans.modules.websvc.wsstack.api.WSStack.Tool;
-import org.netbeans.modules.websvc.wsstack.api.WSStackVersion;
-import org.netbeans.modules.websvc.wsstack.api.WSTool;
-import org.netbeans.modules.websvc.wsstack.spi.WSStackFactory;
-import org.netbeans.modules.websvc.wsstack.spi.WSStackImplementation;
-import org.netbeans.modules.websvc.wsstack.spi.WSToolImplementation;
-
-/**
- *
- * @author mkuchtiak
- * @author ads
- */
-public class Hk2JaxWsStack implements WSStackImplementation<JaxWs> {
- private static final String[] METRO_LIBRARIES =
- new String[] {"webservices(|-osgi).jar", //NOI18N
- "webservices-api(|-osgi).jar", //NOI18N
- "jaxb(|-osgi).jar", //NOI18N
- "jaxb-api(|-osgi).jar", //NOI18N
- "javax.ejb.jar", //NOI18N
- "javax.activation.jar"}; //NOI18N
- private static final String PF_MODULES_DIR_NAME = "modules"; // NOI18N
-
- private String pfRootStr;
- private JaxWs jaxWs;
- private Hk2JavaEEPlatformImpl platform;
-
- public Hk2JaxWsStack(String pfRootStr, Hk2JavaEEPlatformImpl platform ) {
- this.pfRootStr = pfRootStr;
- jaxWs = new JaxWs(getUriDescriptor());
- this.platform = platform;
- }
-
-
- @Override
- public JaxWs get() {
- return jaxWs;
- }
-
- @Override
- public WSStackVersion getVersion() {
- Set<Profile> supportedProfiles = platform.getSupportedProfiles();
- if (supportedProfiles.contains(Profile.JAKARTA_EE_8_FULL)
- || supportedProfiles.contains(Profile.JAKARTA_EE_8_WEB)
- || supportedProfiles.contains(Profile.JAVA_EE_8_FULL)
- || supportedProfiles.contains(Profile.JAVA_EE_8_WEB)
- || supportedProfiles.contains(Profile.JAVA_EE_7_FULL)
- || supportedProfiles.contains(Profile.JAVA_EE_7_WEB)
- || supportedProfiles.contains(Profile.JAVA_EE_6_FULL)
- || supportedProfiles.contains(Profile.JAVA_EE_6_WEB)) {
- if (isMetroInstalled()) {
- return WSStackVersion.valueOf(2, 2, 0, 0);
- }
- return WSStackVersion.valueOf(2, 1, 4, 1);
- } else {
- if (isMetroInstalled()) {
- return WSStackVersion.valueOf(2, 1, 4, 1);
- }
- return WSStackVersion.valueOf(2, 1, 3, 0);
- }
- }
-
- @Override
- public WSTool getWSTool(Tool toolId) {
- if (toolId == JaxWs.Tool.WSIMPORT) {
- return WSStackFactory.createWSTool(new JaxWsTool(JaxWs.Tool.WSIMPORT));
- } else if (toolId == JaxWs.Tool.WSGEN) {
- return WSStackFactory.createWSTool(new JaxWsTool(JaxWs.Tool.WSGEN));
- } else {
- return null;
- }
- }
-
- @Override
- public boolean isFeatureSupported(Feature feature) {
- if (feature == JaxWs.Feature.WSIT && isMetroInstalled()) {
- return true;
- }
- if (feature == JaxWs.Feature.JSR109 && isMetroInstalled()) {
- return true;
- }
- return feature == JaxWs.Feature.TESTER_PAGE;
- }
-
- private JaxWs.UriDescriptor getUriDescriptor() {
- return new JaxWs.UriDescriptor() {
-
- @Override
- public String getServiceUri(String applicationRoot, String serviceName,
- String portName, boolean isEjb)
- {
- if (isEjb) {
- return serviceName+"/"+portName; //NOI18N
- } else {
- if ( applicationRoot == null || applicationRoot.length() ==0 ){
- return serviceName;
- }
- else {
- StringBuilder builder = new StringBuilder( applicationRoot);
- builder.append('/');
- builder.append(serviceName);
- return builder.toString();
- }
- }
- }
-
- @Override
- public String getDescriptorUri(String applicationRoot,
- String serviceName, String portName, boolean isEjb)
- {
- return getServiceUri(applicationRoot, serviceName, portName,
- isEjb)+"?wsdl"; //NOI18N
- }
-
- @Override
- public String getTesterPageUri(String host, String port,
- String applicationRoot, String serviceName, String portName,
- boolean isEjb)
- {
- return "http://"+host+":"+port+"/"+getServiceUri(applicationRoot,
- serviceName, portName, isEjb)+"?Tester"; //NOI18N
- }
-
- };
- }
-
- protected class JaxWsTool implements WSToolImplementation {
- JaxWs.Tool tool;
- JaxWsTool(JaxWs.Tool tool) {
- this.tool = tool;
- }
-
- @Override
- public String getName() {
- return tool.getName();
- }
-
- @Override
- public URL[] getLibraries() {
- List<URL> cPath = new ArrayList<URL>();
- if (isMetroInstalled()) {
- for (String entry : METRO_LIBRARIES) {
- File f = getWsJarName(pfRootStr, entry);
- if ((f != null) && (f.exists())) {
- try {
- cPath.add(f.toURI().toURL());
- } catch (MalformedURLException ex) {
-
- }
- }
- }
- }
- return cPath.toArray(new URL[cPath.size()]);
- }
-
- }
-
- protected boolean isMetroInstalled() {
- File f = getWsJarName(pfRootStr, METRO_LIBRARIES[0]);
- return f!=null && f.exists();
- }
-
- private static class VersionFilter implements FileFilter {
-
- private final Pattern pattern;
-
- public VersionFilter(String namePattern) {
- pattern = Pattern.compile(namePattern);
- }
-
- @Override
- public boolean accept(File file) {
- return pattern.matcher(file.getName()).matches();
- }
-
- }
-
- public static File getWsJarName(String glassfishInstallRoot,
- String jarNamePattern)
- {
- File modulesDir = new File(glassfishInstallRoot + File.separatorChar +
- PF_MODULES_DIR_NAME);
- int subindex = jarNamePattern.lastIndexOf("/");
- if(subindex != -1) {
- String subdir = jarNamePattern.substring(0, subindex);
- jarNamePattern = jarNamePattern.substring(subindex+1);
- modulesDir = new File(modulesDir, subdir);
- }
- File candidates[] = modulesDir.listFiles(
- new VersionFilter(jarNamePattern));
-
- if(candidates != null && candidates.length > 0) {
- return candidates[0]; // the first one
- } else {
- File endorsed = new File(modulesDir,"endorsed"); //NOI18N
- if (endorsed!= null && endorsed.isDirectory()) {
- File candidates1[] = endorsed.listFiles(
- new VersionFilter(jarNamePattern));
- if (candidates1 != null && candidates1.length > 0) {
- return candidates1[0]; // the first one
- }
- }
- }
- return null;
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2MessageDestinationManager.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2MessageDestinationManager.java
index 5e5fee8..b00f18e 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2MessageDestinationManager.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2MessageDestinationManager.java
@@ -31,6 +31,7 @@ import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.netbeans.modules.glassfish.javaee.SunMessageDestination;
import org.netbeans.modules.payara.spi.PayaraModule;
import org.netbeans.modules.payara.common.parser.TreeParser;
import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException;
@@ -58,6 +59,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
public static final String QUEUE_CNTN_FACTORY = "javax.jms.QueueConnectionFactory"; // NOI18N
public static final String TOPIC_CNTN_FACTORY = "javax.jms.TopicConnectionFactory"; // NOI18N
+ private static final Logger LOG = Logger.getLogger("payara-jakartaee");
public Hk2MessageDestinationManager(Hk2DeploymentManager dm) {
this.dm = dm;
@@ -104,7 +106,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
try {
TreeParser.readXml(xmlFile, pathList);
} catch(IllegalStateException ex) {
- Logger.getLogger("payara-jakartaee").log(Level.INFO, ex.getLocalizedMessage(), ex);
+ LOG.log(Level.INFO, ex.getLocalizedMessage(), ex);
}
for(AdminObjectResource adminObj: aoResourceMap.values()) {
@@ -148,7 +150,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
createConnectorConnectionPool(xmlFile, connectionFactoryPoolName, type);
createConnector(xmlFile, connectionFactoryJndiName, connectionFactoryPoolName);
} catch (IOException ex) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING, ex.getLocalizedMessage(), ex); // NOI18N
+ LOG.log(Level.WARNING, ex.getLocalizedMessage(), ex); // NOI18N
throw new ConfigurationException(ex.getLocalizedMessage(), ex);
}
@@ -188,7 +190,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
}
xmlBuilder.append(AO_TAG_3);
String xmlFragment = xmlBuilder.toString();
- Logger.getLogger("payara-jakartaee").log(Level.FINER, "New Connector resource:\n" + xmlFragment);
+ LOG.log(Level.FINER, "New Connector resource:\n" + xmlFragment);
ResourceModifier.appendResource(sunResourcesXml, xmlFragment);
}
@@ -211,7 +213,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
xmlBuilder.append(CONNECTOR_POOL_TAG_2);
String xmlFragment = xmlBuilder.toString();
- Logger.getLogger("payara-jakartaee").log(Level.FINER, "New Connector Connection Pool resource:\n" + xmlFragment);
+ LOG.log(Level.FINER, "New Connector Connection Pool resource:\n" + xmlFragment);
ResourceModifier.appendResource(sunResourcesXml, xmlFragment);
}
@@ -228,7 +230,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
xmlBuilder.append(CONNECTOR_TAG_2);
String xmlFragment = xmlBuilder.toString();
- Logger.getLogger("payara-jakartaee").log(Level.FINER, "New Connector resource:\n" + xmlFragment);
+ LOG.log(Level.FINER, "New Connector resource:\n" + xmlFragment);
ResourceModifier.appendResource(sunResourcesXml, xmlFragment);
}
@@ -308,7 +310,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
String jndiName = attributes.getValue("jndi-name");
if(targetJndiName.equals(jndiName)) {
if(duplicate) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
+ LOG.log(Level.WARNING,
"Duplicate jndi-names defined for Admin Object resources.");
}
duplicate = true;
@@ -342,7 +344,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
String jndiName = attributes.getValue("jndi-name");
if(targetJndiName.equals(jndiName)) {
if(duplicate) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
+ LOG.log(Level.WARNING,
"Duplicate jndi-names defined for Connector resources.");
}
duplicate = true;
@@ -374,7 +376,7 @@ public class Hk2MessageDestinationManager implements MessageDestinationDeployme
properties.put("raname", attributes.getValue("resource-adapter-name")); // NOI18N
properties.put("conndefname", attributes.getValue("connection-definition-name")); // NOI18N
} else {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING, // NOI18N
+ LOG.log(Level.WARNING, // NOI18N
"Duplicate pool-names defined for Resource Adapter Pools: "+poolName); // NOI18N
}
}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2StartServer.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2StartServer.java
index 3242139..9ce1805 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2StartServer.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2StartServer.java
@@ -40,10 +40,10 @@ import org.netbeans.modules.payara.tooling.TaskState;
import org.netbeans.modules.payara.tooling.TaskStateListener;
import org.netbeans.modules.payara.tooling.data.PayaraServer;
import org.netbeans.api.server.ServerInstance;
+import org.netbeans.modules.glassfish.javaee.ui.DebugPortQuery;
import org.netbeans.modules.payara.common.PayaraState;
import org.netbeans.modules.payara.eecommon.api.Utils;
import org.netbeans.modules.payara.jakartaee.ide.Hk2DeploymentStatus;
-import org.netbeans.modules.payara.jakartaee.ui.DebugPortQuery;
import org.netbeans.modules.payara.spi.PayaraModule;
import org.netbeans.modules.payara.spi.PayaraModule3;
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/JavaEEServerModuleFactory.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/JavaEEServerModuleFactory.java
index 052813b..75fbf59 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/JavaEEServerModuleFactory.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/JavaEEServerModuleFactory.java
@@ -37,7 +37,6 @@ import org.netbeans.api.project.libraries.LibraryManager;
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties;
import org.netbeans.modules.payara.spi.PayaraModule;
import org.netbeans.modules.payara.spi.PayaraModuleFactory;
-import org.netbeans.modules.payara.spi.RegisteredDerbyServer;
import org.netbeans.modules.payara.spi.ServerUtilities;
import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceCreationException;
import org.netbeans.spi.project.libraries.LibraryTypeProvider;
@@ -109,22 +108,11 @@ public class JavaEEServerModuleFactory implements PayaraModuleFactory {
}
}
- final String installRoot = commonModule.getInstanceProperties().get(
- PayaraModule.INSTALL_FOLDER_ATTR);
RP.post(new Runnable() {
@Override
public void run() {
ensureEclipseLinkSupport(commonModule.getInstance());
ensurePayaraApiSupport(commonModule.getInstance());
- // lookup the javadb register service here and use it.
- RegisteredDerbyServer db = Lookup.getDefault().lookup(RegisteredDerbyServer.class);
- if (null != db && null != installRoot) {
- File ir = new File(installRoot);
- File f = new File(ir,"javadb");
- if (f.exists() && f.isDirectory() && f.canRead()) {
- db.initialize(f.getAbsolutePath());
- }
- }
}
});
} else {
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/SunMessageDestination.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/SunMessageDestination.java
deleted file mode 100644
index 253e063..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/SunMessageDestination.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee;
-
-import java.io.File;
-import org.netbeans.modules.j2ee.deployment.common.api.MessageDestination;
-
-/**
- *
- * @author Nitya Doraisamy
- */
-public class SunMessageDestination implements MessageDestination {
- private String name;
- private Type type;
- private File resourceDir;
-
- public SunMessageDestination(String name, Type type) {
- this(name, type, null);
- }
-
- public SunMessageDestination(String name, Type type, File resourceDir) {
- this.name = name;
- this.type = type;
- this.resourceDir = resourceDir;
- }
-
- public String getName() {
- return name;
- }
-
- public Type getType() {
- return type;
- }
-
- File getResourceDir() {
- return resourceDir;
- }
-
- void setResourceDir(File resourceDir) {
- this.resourceDir = resourceDir;
- }
-
- @Override
- public String toString() {
- return "[ " + name + " : " + type.toString() + " ]";
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final SunMessageDestination other = (SunMessageDestination) obj;
- if (this.name == null || !this.name.equals(other.name)) {
- return false;
- }
- if (this.type == null || !this.type.equals(other.type)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 41 * hash + (this.name != null ? this.name.hashCode() : 0);
- hash = 41 * hash + (this.type != null ? this.type.hashCode() : 0);
- return hash;
- }
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1Configuration.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1Configuration.java
deleted file mode 100644
index 78de2be..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1Configuration.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.enterprise.deploy.model.DDBeanRoot;
-import javax.enterprise.deploy.model.DeployableObject;
-import javax.enterprise.deploy.spi.DConfigBeanRoot;
-import javax.enterprise.deploy.spi.DeploymentConfiguration;
-import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException;
-import org.netbeans.modules.payara.eecommon.api.config.J2eeModuleHelper;
-import org.netbeans.modules.payara.jakartaee.db.Hk2DatasourceManager;
-import org.netbeans.modules.payara.tooling.data.PayaraVersion;
-import org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException;
-import org.netbeans.modules.j2ee.deployment.common.api.Datasource;
-import org.netbeans.modules.j2ee.deployment.common.api.DatasourceAlreadyExistsException;
-import org.netbeans.modules.j2ee.deployment.common.api.MessageDestination;
-import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-import org.openide.util.NbBundle;
-
-/**
- * Java EE server configuration API support for Payara servers 3.1 and later.
- * <p/>
- * @author Ludovic Champenois, Peter Williams, Tomas Kraus
- */
-public class Three1Configuration extends Hk2Configuration implements DeploymentConfiguration {
-
- /**
- * Creates an instance of Java EE server configuration API support
- * for Payara servers 3.1 and later.
- * <p/>
- * @param module Java EE module (project).
- * @param version Payara server version.
- * @throws ConfigurationException when there is a problem with Java EE server
- * configuration initialization.
- */
- public Three1Configuration(
- final J2eeModule module, final PayaraVersion version
- ) throws ConfigurationException {
- super(module, J2eeModuleHelper.getPayaraDDModuleHelper(module.getType()), version);
- }
-
- @Deprecated
- public Three1Configuration(DeployableObject dObj) {
- super(dObj);
- }
-
- // ------------------------------------------------------------------------
- // DatasourceConfiguration support
- // ------------------------------------------------------------------------
- @Override
- public Set<Datasource> getDatasources() throws org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException {
- return Hk2DatasourceManager.getDatasources(module, version);
- }
-
- @Override
- public boolean supportsCreateDatasource() {
- return true;
- }
-
- @Override
- public Datasource createDatasource(String jndiName, String url, String username, String password, String driver) throws UnsupportedOperationException, org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException, DatasourceAlreadyExistsException {
- return Hk2DatasourceManager.createDataSource(
- jndiName, url, username, password, driver, module, version);
- }
-
- // ------------------------------------------------------------------------
- // MessageDestinationConfiguration support
- // ------------------------------------------------------------------------
- @Override
- public Set<MessageDestination> getMessageDestinations() throws org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException {
- return Hk2MessageDestinationManager.getMessageDestinations(module.getResourceDirectory(),"glassfish-resources");
- }
-
- @Override
- public boolean supportsCreateMessageDestination() {
- return true;
- }
-
- @Override
- public MessageDestination createMessageDestination(String name, MessageDestination.Type type) throws UnsupportedOperationException, org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException {
- File resourceDir = module.getResourceDirectory();
- if (resourceDir == null) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
- "Resource Folder " + resourceDir + " does not exist.");
- throw new ConfigurationException(NbBundle.getMessage(
- ModuleConfigurationImpl.class, "ERR_NoJMSResource", name, type)); // NOI18N
- }
-
- return Hk2MessageDestinationManager.createMessageDestination(name, type, resourceDir,"glassfish-resources");
- }
-
- // ------------------------------------------------------------------------
- // Implementation (or lack thereof) of JSR-88 DeploymentConfiguration interface
- // Here to make the deployment manager class happy.
- // ------------------------------------------------------------------------
- @Override
- public DeployableObject getDeployableObject() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot ddbeanRoot) throws javax.enterprise.deploy.spi.exceptions.ConfigurationException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void removeDConfigBean(DConfigBeanRoot dconfigBeanRoot) throws BeanNotFoundException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public DConfigBeanRoot restoreDConfigBean(InputStream is, DDBeanRoot ddbeanRoot) throws javax.enterprise.deploy.spi.exceptions.ConfigurationException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void saveDConfigBean(OutputStream os, DConfigBeanRoot dconfigBeanRoot) throws javax.enterprise.deploy.spi.exceptions.ConfigurationException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void restore(InputStream is) throws javax.enterprise.deploy.spi.exceptions.ConfigurationException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void save(OutputStream os) throws javax.enterprise.deploy.spi.exceptions.ConfigurationException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- private static final String GLASSFISH_DASH = "glassfish-"; // NOI18N
-
- @Override
- protected FileObject getPayaraDD(File payaraDDFile, boolean create) throws IOException {
- if (!payaraDDFile.exists()) {
- if (create) {
- createDefaultSunDD(payaraDDFile);
- }
- }
- FileObject retVal = FileUtil.toFileObject(FileUtil.normalizeFile(payaraDDFile));
- if (null == retVal) {
- String fn = payaraDDFile.getName();
- if (fn.contains(GLASSFISH_DASH) && null != payaraDDFile.getParentFile()) {
- File alternate = new File(payaraDDFile.getParentFile(), fn.replace(GLASSFISH_DASH, "sun-")); // NOI18N
- retVal = FileUtil.toFileObject(FileUtil.normalizeFile(alternate));
- }
- }
- return retVal;
- }
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1ModuleConfigFactory.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1ModuleConfigFactory.java
deleted file mode 100644
index 787c4f6..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Three1ModuleConfigFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee;
-
-import org.netbeans.modules.j2ee.deployment.plugins.spi.config.ModuleConfigurationFactory2;
-
-/**
- * Factory to construct proper module configuration object.
- * <p/>
- * @author Vince Kraemer, Tomas Kraus
- */
-public class Three1ModuleConfigFactory extends AbstractHk2ConfigurationFactory
-implements ModuleConfigurationFactory2 {
-
- /**
- * Creates a new instance of {@link Three1ModuleConfigFactory}.
- * <p/>
- * @param hk2dm Deployment manager.
- */
- public Three1ModuleConfigFactory(final Hk2DeploymentManager hk2dm) {
- super(hk2dm);
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DataSourcesReader.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DataSourcesReader.java
index aa6ce2b..dd04619 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DataSourcesReader.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DataSourcesReader.java
@@ -22,6 +22,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.netbeans.modules.glassfish.javaee.db.JDBCConnectionPool;
+import org.netbeans.modules.glassfish.javaee.db.JDBCResource;
import org.netbeans.modules.payara.tooling.TaskState;
import org.netbeans.modules.payara.tooling.admin.CommandGetProperty;
import org.netbeans.modules.payara.tooling.admin.ResultMap;
@@ -181,7 +183,7 @@ public class DataSourcesReader {
>= PayaraVersion.PF_4_1_144.ordinal()) {
addNewJavaEE7dataSource(resources);
}
- return new HashSet<Datasource>(resources.values());
+ return new HashSet<>(resources.values());
} else {
return null;
}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DbUtil.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DbUtil.java
deleted file mode 100644
index b5ed5e0..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DbUtil.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee.db;
-
-import java.util.Arrays;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.netbeans.api.db.explorer.ConnectionManager;
-import org.netbeans.api.db.explorer.DatabaseConnection;
-
-/**
- *
- * @author Peter Williams
- */
-public class DbUtil {
-
- private static final String __DatabaseVendor = "database-vendor";
- private static final String __DatabaseName = "databaseName";
- private static final String __Url = "URL";
- private static final String __User = "User";
- private static final String __Password = "Password";
- private static final String __NotApplicable = "NA";
- private static final String __IsXA = "isXA";
- private static final String __IsCPExisting = "is-cp-existing";
-
- private static final String __DerbyDatabaseName = "DatabaseName";
- private static final String __DerbyPortNumber = "PortNumber";
- private static final String __ServerName = "serverName";
- private static final String __InformixHostName = "IfxIFXHOST";
- private static final String __InformixServer = "InformixServer";
- private static final String __DerbyConnAttr = "connectionAttributes";
-
- private static final String __PortNumber = "portNumber";
- private static final String __SID = "SID";
- private static final String __DriverClass = "driverClass";
-
-
- static final String[] VendorsDBNameProp = {
- "sun_db2", "sun_oracle", "sun_msftsql", "db2", "microsoft_sql",
- "post-gre-sql", "mysql", "datadirect_sql", "datadirect_db2",
- "datadirect_informix", "datadirect_sybase", "datadirect_oracle",
- "jtds_sql", "jtds_sybase", "informix"
- };
-
- static final String[] Reqd_DBName = {
- "sun_db2", "sun_msftsql", "datadirect_sql", "microsoft_sql",
- "datadirect_db2", "datadirect_informix", "datadirect_sybase"
- };
-
- static Map<String, String> normalizePoolMap(Map<String, String> poolValues) {
- String driverClassName = poolValues.get("dsClassName"); //NOI18N
- String resType = poolValues.get("resType"); //NOI18N
- String url = ""; //NOI18N
- String serverName = poolValues.get(__ServerName);
- String portNo = poolValues.get(__DerbyPortNumber);
- String dbName = poolValues.get(__DerbyDatabaseName);
- String dbVal = poolValues.get(__DatabaseName);
- String portVal = poolValues.get(__PortNumber);
- String sid = poolValues.get(__SID);
- String urlValue = poolValues.get(__Url);
- String driverClass = poolValues.get(__DriverClass);
- String derbyConnAttr = poolValues.get(__DerbyConnAttr);
- String password = poolValues.get(__Password);
- String user = poolValues.get(__User);
-
- if (driverClassName.indexOf("pointbase") != -1) {
- url = poolValues.get(__DatabaseName);
- }
- // Search for server name key should be case insensitive.
- if (serverName == null) {
- for (String key : poolValues.keySet()) {
- if (__ServerName.equalsIgnoreCase(key)) {
- serverName = poolValues.get(key);
- break;
- }
- }
- poolValues.put(__ServerName, serverName);
- }
- if (urlValue == null || urlValue.equals("")) { //NOI18N
- if (driverClassName.indexOf("derby") != -1) {
- if (serverName != null) {
- url = "jdbc:derby://" + serverName;
- if (portNo != null && portNo.length() > 0) {
- url = url + ":" + portNo; //NOI18N
- }
- url = url + "/" + dbName; //NOI18N
- if(derbyConnAttr != null && (! derbyConnAttr.equals(""))) { //NOI18N
- url = url + derbyConnAttr;
- }
- }
- } else {
- if (url == null || url.equals("")) { //NOI18N
- String urlPrefix = DriverMaps.getUrlPrefix(driverClassName, resType);
- // !PW FIXME no access to vendor name yet.
-// String vName = ResourceConfigurator.getDatabaseVendorName(urlPrefix, null);
- //
- String vName = "Unknown";//NOI18N
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
- "Unable to compute database vendor name for datasource url.");
- if (serverName != null) {
- if (vName.equals("sun_oracle")) { //NOI18N
- url = urlPrefix + serverName;
- } else {
- url = urlPrefix + "//" + serverName; //NOI18N
- }
- if (portVal != null && portVal.length() > 0) {
- url = url + ":" + portVal; //NOI18N
- }
- }
- if (vName.equals("sun_oracle") || vName.equals("datadirect_oracle")) { //NOI18N
- url = url + ";SID=" + sid; //NOI18N
- } else if (Arrays.asList(Reqd_DBName).contains(vName)) {
- url = url + ";databaseName=" + dbVal; //NOI18N
- } else if (Arrays.asList(VendorsDBNameProp).contains(vName) || "Unknown".equals(vName)) {//NOI18N
- url = url + "/" + dbVal; //NOI18N
- }
- }
- }
- } else {
- url = urlValue;
- }
-
- if (url != null && (!url.equals(""))) { //NOI18N
- if (driverClass == null || driverClass.equals("")) { //NOI18N
- DatabaseConnection databaseConnection = getDatabaseConnection(url);
- if (databaseConnection != null) {
- driverClass = databaseConnection.getDriverClass();
- } else {
- //Fix Issue 78212 - NB required driver classname
- String drivername = DriverMaps.getDriverName(url);
- if (drivername != null) {
- driverClass = drivername;
- } else {
- driverClass = driverClassName;
- }
- }
- }
- }
-
- if (user == null) {
- for(String key : poolValues.keySet()){
- if(__User.equalsIgnoreCase(key)){
- user = poolValues.get(key);
- break;
- }
- }
- poolValues.put(__User, user);
- }
-
- if (password == null) {
- for(String key : poolValues.keySet()){
- if(__Password.equalsIgnoreCase(key)){
- password = poolValues.get(key);
- break;
- }
- }
- poolValues.put(__Password, password);
- }
-
- poolValues.put(__Url, url);
- poolValues.put(__DriverClass, driverClass);
-
- return poolValues;
- }
-
- private static DatabaseConnection getDatabaseConnection(String url) {
- DatabaseConnection [] dbConns = ConnectionManager.getDefault().getConnections();
- for(int i = 0; i < dbConns.length; i++) {
- String dbConnUrl = dbConns[i].getDatabaseURL();
- if(dbConnUrl.startsWith(url)) {
- return dbConns[i];
- }
- }
- return null;
- }
-
- public static final boolean notEmpty(String testedString) {
- return (testedString != null) && (testedString.length() > 0);
- }
-
- public static final boolean strEmpty(String testedString) {
- return testedString == null || testedString.length() == 0;
- }
-
- public static final boolean strEquals(String one, String two) {
- boolean result = false;
-
- if(one == null) {
- result = (two == null);
- } else {
- if(two == null) {
- result = false;
- } else {
- result = one.equals(two);
- }
- }
- return result;
- }
-
- public static final boolean strEquivalent(String one, String two) {
- boolean result = false;
-
- if(strEmpty(one) && strEmpty(two)) {
- result = true;
- } else if(one != null && two != null) {
- result = one.equals(two);
- }
-
- return result;
- }
-
- public static final int strCompareTo(String one, String two) {
- int result;
-
- if(one == null) {
- if(two == null) {
- result = 0;
- } else {
- result = -1;
- }
- } else {
- if(two == null) {
- result = 1;
- } else {
- result = one.compareTo(two);
- }
- }
-
- return result;
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DriverMaps.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DriverMaps.java
deleted file mode 100644
index c3c4606..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/DriverMaps.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * 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.
- */
-/*
- * DatabaseUtils.java
- *
- * Created on June 26, 2006, 1:55 PM
- *
- */
-
-package org.netbeans.modules.payara.jakartaee.db;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * From DatabaseUtils in the V2 plugin
- *
- * XXX This primarily code does linear searchs through map keys because of extra
- * logic on key comparisons. Find a way to use the maps properly.
- *
- * @author Nitya Doraisamy
- * @author Peter Williams
- */
-public class DriverMaps {
-
- private static final int INITIAL_MAP_SIZE = 107;
-
- private static Map<String, String> driverMap;
- private static Map<String, String> dsClassMap;
- private static Map<String, String> cpClassMap;
-
- private DriverMaps() {
- }
-
- /**
- * Returns the driver name for the given url
- *
- * @param url url of this connection
- * @return driver name required
- */
- public static final String getDriverName(String url) {
- return getValueForUrl(driverMap, url);
- }
-
- /**
- * Returns driver class name for the given url
- *
- * @param url url of this connection
- * @return driver class name required
- */
- public static final String getDSClassName(String url) {
- return getValueForUrl(dsClassMap, url);
- }
-
- private static final String getValueForUrl(Map<String, String> mapping, String url) {
- for(String urlPrefix: mapping.keySet()) {
- if(url.startsWith(urlPrefix)){
- return mapping.get(urlPrefix);
- }
- }
- return null;
- }
-
- /**
- * Gets the URL prefix fiven a Datasource Classname
- * @param inClass Datasource Classname
- * @return URL prefix for given Datasource Classname
- */
- public static final String getUrlPrefix(String inClass, String resType) {
- return "javax.sql.ConnectionPoolDataSource".equals(resType) ? // NOI18N
- getPrefix(cpClassMap, inClass) : getPrefix(dsClassMap, inClass);
- }
-
- private static final String getPrefix(Map<String, String> classMap, String inClass) {
- for(String urlPrefix: classMap.keySet()) {
- String dsClass = classMap.get(urlPrefix);
- if(dsClass.equalsIgnoreCase(inClass)) {
- return urlPrefix;
- }
- }
- return null;
- }
-
- static {
- driverMap = new HashMap<String, String>(INITIAL_MAP_SIZE);
-
- //IBM DB2
- driverMap.put("jdbc:db2:", "COM.ibm.db2.jdbc.net.DB2Driver");
- //JDBC-ODBC Bridge
- driverMap.put("jdbc:odbc:", "sun.jdbc.odbc.JdbcOdbcDriver");
- //Microsoft SQL Server (Weblogic driver)
- driverMap.put("jdbc:weblogic:mssqlserver4:", "weblogic.jdbc.mssqlserver4.Driver");
-
- //Oracle-thin
- driverMap.put("jdbc:oracle:thin:", "oracle.jdbc.driver.OracleDriver");
- //Oracle //OCI 8i
- driverMap.put("jdbc:oracle:oci8:", "oracle.jdbc.driver.OracleDriver");
- //Oracle //OCI 9i
- driverMap.put("jdbc:oracle:oci:", "oracle.jdbc.driver.OracleDriver");
-
- //PointBase
- driverMap.put("jdbc:pointbase:", "com.pointbase.jdbc.jdbcUniversalDriver");
- //Cloudscape
- driverMap.put("jdbc:cloudscape:", "COM.cloudscape.core.JDBCDriver");
- //Java DB (Net)
- driverMap.put("jdbc:derby:", "org.apache.derby.jdbc.ClientDriver");
- //Firebird (JCA/JDBC driver)
- driverMap.put("jdbc:firebirdsql:", "org.firebirdsql.jdbc.FBDriver");
- //FirstSQL/J //Enterprise Server Edition
- driverMap.put("jdbc:dbcp:", "COM.FirstSQL.Dbcp.DbcpDriver");
- //FirstSQL/J //Professional Edition
- driverMap.put("jdbc:dbcp:", "COM.FirstSQL.Dbcp.DbcpDriver");
-
- //IBM DB2 (DataDirect Connect for JDBC)
- driverMap.put("jdbc:datadirect:db2:", "com.ddtek.jdbc.db2.DB2Driver");
- //Informix Dynamic Server (DataDirect Connect for JDBC)
- driverMap.put("jdbc:datadirect:informix:", "com.ddtek.jdbc.informix.InformixDriver");
- //Oracle (DataDirect Connect for JDBC)
- driverMap.put("jdbc:datadirect:oracle:", "com.ddtek.jdbc.oracle.OracleDriver");
- //Microsoft SQL Server (DataDirect Connect for JDBC)
- driverMap.put("jdbc:datadirect:sqlserver:", "com.ddtek.jdbc.sqlserver.SQLServerDriver");
- //Sybase (DataDirect Connect for JDBC)
- driverMap.put("jdbc:datadirect:sybase:", "com.ddtek.jdbc.sybase.SybaseDriver");
-
- //IDS Server
- driverMap.put("jdbc:ids:", "ids.sql.IDSDriver");
- //Informix Dynamic Server
- driverMap.put("jdbc:informix-sqli:", "com.informix.jdbc.IfxDriver");
- //InstantDB (v3.13 and earlier)
- driverMap.put("jdbc:idb:", "jdbc.idbDriver");
- //InstantDB (v3.14 and later)
- driverMap.put("jdbc:idb:", "org.enhydra.instantdb.jdbc.idbDriver");
- //Interbase (InterClient driver)
- driverMap.put("jdbc:interbase:", "interbase.interclient.Driver");
- //HSQLDB //(server)
- driverMap.put("jdbc:hsqldb:hsql:", "org.hsqldb.jdbcDriver");
- //HSQLDB //(webserver)
- driverMap.put("jdbc:hsqldb:http:", "org.hsqldb.jdbcDriver");
- //Hypersonic SQL (v1.2 and earlier)
- driverMap.put("jdbc:HypersonicSQL:", "hSql.hDriver");
- //Hypersonic SQL (v1.3 and later)
- driverMap.put("jdbc:HypersonicSQL:", "org.hsql.jdbcDriver");
- //jTDS
- driverMap.put("jdbc:jtds:sqlserver:", "net.sourceforge.jtds.jdbc.Driver");
- //jTDS
- driverMap.put("jdbc:jtds:sybase:", "net.sourceforge.jtds.jdbc.Driver");
- //Mckoi SQL Database //(server)
- driverMap.put("jdbc:mckoi:", "com.mckoi.JDBCDriver");
- //Mckoi SQL Database //(standalone)
- driverMap.put("jdbc:mckoi:local:", "com.mckoi.JDBCDriver");
- //Microsoft SQL Server (JTurbo driver)
- driverMap.put("jdbc:JTurbo:", "com.ashna.jturbo.driver.Driver");
- //Microsoft SQL Server (JTurbo driver 3.0)
- //driverMap.put("jdbc:JTurbo:", "com.newatlanta.jturbo.driver.Driver");
- //Microsoft SQL Server (Sprinta driver)
- driverMap.put("jdbc:inetdae:", "com.inet.tds.TdsDriver");
- //Microsoft SQL Server 2005 (Microsoft driver)
- //driverMap.put("jdbc:microsoft:sqlserver:", "com.microsoft.jdbc.sqlserver.SQLServerDriver");
- driverMap.put("jdbc:sqlserver:", "com.microsoft.sqlserver.jdbc.SQLServerDriver"); //NOI18N
- //MySQL (Connector/J driver)
- driverMap.put("jdbc:mysql:", "com.mysql.jdbc.Driver");
- //MySQL (MM.MySQL driver)
- //driverMap.put("jdbc:mysql:", "org.gjt.mm.mysql.Driver");
-
- //PostgreSQL (v6.5 and earlier)
- //driverMap.put("jdbc:postgresql:", "postgresql.Driver");
- //PostgreSQL (v7.0 and later)
- driverMap.put("jdbc:postgresql:", "org.postgresql.Driver");
- //Quadcap Embeddable Database
- driverMap.put("jdbc:qed:", "com.quadcap.jdbc.JdbcDriver");
- //Sybase (jConnect 4.2 and earlier)
- //driverMap.put("jdbc:sybase:Tds:", "com.sybase.jdbc.SybDriver");
- //Sybase (jConnect 5.2)
- driverMap.put("jdbc:sybase:Tds:", "com.sybase.jdbc2.jdbc.SybDriver");
-
- // Following four entries for drivers to be included in Java Studio Enterprise 7 (Bow)
- //Microsoft SQL Server Driver
- driverMap.put("jdbc:sun:sqlserver:", "com.sun.sql.jdbc.sqlserver.SQLServerDriver");
- //DB2 Driver
- driverMap.put("jdbc:sun:db2:", "com.sun.sql.jdbc.db2.DB2Driver");
- //Oracle Driver
- driverMap.put("jdbc:sun:oracle:", "com.sun.sql.jdbc.oracle.OracleDriver");
- //Sybase Driver
- driverMap.put("jdbc:sun:sybase:", "com.sun.sql.jdbc.sybase.SybaseDriver");
-
- //AS400 Driver
- driverMap.put("jdbc:as400:", "com.ibm.as400.access.AS400JDBCDriver");
- }
-
- static {
- dsClassMap = new HashMap<String, String>(INITIAL_MAP_SIZE);
-
- //IBM DB2
- dsClassMap.put("jdbc:db2:", "com.ibm.db2.jcc.DB2DataSource");
- //JDBC-ODBC Bridge
- dsClassMap.put("jdbc:odbc:", "sun.jdbc.odbc.JdbcOdbcDriver");
- //Microsoft SQL Server (Weblogic driver)
- //dsClassMap.put("jdbc:weblogic:mssqlserver4:", "weblogic.jdbc.mssqlserver4.Driver");
-
- //Oracle-thin
- dsClassMap.put("jdbc:oracle:thin:", "oracle.jdbc.pool.OracleDataSource");
- //Oracle //OCI 8i
- dsClassMap.put("jdbc:oracle:oci8:", "oracle.jdbc.pool.OracleDataSource");
- //Oracle //OCI 9i
- dsClassMap.put("jdbc:oracle:oci:", "oracle.jdbc.pool.OracleDataSource");
-
- //PointBase
- dsClassMap.put("jdbc:pointbase:", "com.pointbase.jdbc.jdbcDataSource");
- //Cloudscape
- dsClassMap.put("jdbc:cloudscape:", "com.cloudscape.core.BasicDataSource");
- //Java DB (Net)
- dsClassMap.put("jdbc:derby:", "org.apache.derby.jdbc.ClientDataSource");
- //Firebird (JCA/JDBC driver)
- //dsClassMap.put("jdbc:firebirdsql:", "org.firebirdsql.jdbc.FBDriver");
- //FirstSQL/J //Enterprise Server Edition
- //dsClassMap.put("jdbc:dbcp:", "COM.FirstSQL.Dbcp.DbcpDriver");
- //FirstSQL/J //Professional Edition
- //dsClassMap.put("jdbc:dbcp:", "COM.FirstSQL.Dbcp.DbcpDriver");
-
- //IBM DB2 (DataDirect Connect for JDBC)
- dsClassMap.put("jdbc:datadirect:db2:", "com.ddtek.jdbcx.db2.DB2DataSource");
- //Informix Dynamic Server (DataDirect Connect for JDBC)
- dsClassMap.put("jdbc:datadirect:informix:", "com.ddtek.jdbcx.informix.InformixDataSource");
- //Oracle (DataDirect Connect for JDBC)
- dsClassMap.put("jdbc:datadirect:oracle:", "com.ddtek.jdbcx.oracle.OracleDataSource");
- //Microsoft SQL Server (DataDirect Connect for JDBC)
- dsClassMap.put("jdbc:datadirect:sqlserver:", "com.ddtek.jdbcx.sqlserver.SQLServerDataSource");
- //Sybase (DataDirect Connect for JDBC)
- dsClassMap.put("jdbc:datadirect:sybase:", "com.ddtek.jdbcx.sybase.SybaseDataSource");
-
- //IDS Server
- dsClassMap.put("jdbc:ids:", "ids.sql.IDSDriver");
- //Informix Dynamic Server
- dsClassMap.put("jdbc:informix-sqli:", "com.informix.jdbcx.IfxDataSource");
- //InstantDB (v3.13 and earlier)
- //dsClassMap.put("jdbc:idb:", "jdbc.idbDriver");
- //InstantDB (v3.14 and later)
- //dsClassMap.put("jdbc:idb:", "org.enhydra.instantdb.jdbc.idbDriver");
- //Interbase (InterClient driver)
- //dsClassMap.put("jdbc:interbase:", "interbase.interclient.Driver");
- //HSQLDB //(server)
- //dsClassMap.put("jdbc:hsqldb:hsql:", "org.hsqldb.jdbcDriver");
- //HSQLDB //(webserver)
- //dsClassMap.put("jdbc:hsqldb:http:", "org.hsqldb.jdbcDriver");
- //Hypersonic SQL (v1.2 and earlier)
- //dsClassMap.put("jdbc:HypersonicSQL:", "hSql.hDriver");
- //Hypersonic SQL (v1.3 and later)
- //dsClassMap.put("jdbc:HypersonicSQL:", "org.hsql.jdbcDriver");
- //jTDS
- dsClassMap.put("jdbc:jtds:sqlserver:", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- //jTDS
- dsClassMap.put("jdbc:jtds:sybase:", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- //Mckoi SQL Database //(server)
- //dsClassMap.put("jdbc:mckoi:", "com.mckoi.JDBCDriver");
- //Mckoi SQL Database //(standalone)
- //dsClassMap.put("jdbc:mckoi:local:", "com.mckoi.JDBCDriver");
- //Microsoft SQL Server (JTurbo driver old version)
- //dsClassMap.put("jdbc:JTurbo:", "com.ashna.jturbo.driver.DataSource");
- //Microsoft SQL Server (JTurbo driver 3.0)
- dsClassMap.put("jdbc:JTurbo:", "com.newatlanta.jturbo.driver.DataSource");
- //Microsoft SQL Server (Sprinta driver)
- dsClassMap.put("jdbc:inetdae:", "com.inet.tds.TdsDataSource");
- //Microsoft SQL Server 2005 (Microsoft driver)
- //dsClassMap.put("jdbc:microsoft:sqlserver:", "com.microsoft.jdbc.sqlserver.SQLServerDataSource");
- dsClassMap.put("jdbc:sqlserver:", "com.microsoft.sqlserver.jdbc.SQLServerDataSource"); //NOI18N
- //MySQL (Connector/J driver)
- //dsClassMap.put("jdbc:mysql:", "com.mysql.jdbc.Driver");
- //MySQL (MM.MySQL driver)
- dsClassMap.put("jdbc:mysql:", "com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
-
- //PostgreSQL (v6.5 and earlier)
- //dsClassMap.put("jdbc:postgresql:", "postgresql.Driver");
- //PostgreSQL (v7.0 and later)
- dsClassMap.put("jdbc:postgresql:", "org.postgresql.ds.PGSimpleDataSource");//1st implementation without pooling
- dsClassMap.put("jdbc:postgresql:", "org.postgresql.ds.PGPoolingDataSource");//another one with pooling support
- //Quadcap Embeddable Database
- //dsClassMap.put("jdbc:qed:", "com.quadcap.jdbc.JdbcDriver");
- //Sybase (jConnect 4.2 and earlier)
- //dsClassMap.put("jdbc:sybase:Tds:", "com.sybase.jdbc.SybDriver");
- //Sybase (jConnect 5.2)
- dsClassMap.put("jdbc:sybase:Tds:", "com.sybase.jdbc2.jdbc.SybDataSource");
-
- // Following four entries for drivers to be included in Java Studio Enterprise 7 (Bow)
- //Microsoft SQL Server Driver
- dsClassMap.put("jdbc:sun:sqlserver:", "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource");
- //DB2 Driver
- dsClassMap.put("jdbc:sun:db2:", "com.sun.sql.jdbcx.db2.DB2DataSource");
- //Oracle Driver
- dsClassMap.put("jdbc:sun:oracle:", "com.sun.sql.jdbcx.oracle.OracleDataSource");
- //Sybase
- dsClassMap.put("jdbc:sun:sybase:", "com.sun.sql.jdbcx.sybase.SybaseDataSource");
-
- //AS400
- dsClassMap.put("jdbc:as400:", "com.ibm.as400.access.AS400JDBCDataSource");
- }
-
- static {
- cpClassMap = new HashMap<String, String>(INITIAL_MAP_SIZE);
- //Java DB (Net)
- cpClassMap.put("jdbc:derby:", "org.apache.derby.jdbc.ClientConnectionPoolDataSource");
- //DB2 Driver
- cpClassMap.put("jdbc:sun:db2:", "com.sun.sql.jdbcx.db2.DB2DataSource");
- //Microsoft SQL Server Driver
- cpClassMap.put("jdbc:sun:sqlserver:", "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource");
- //Oracle Driver
- cpClassMap.put("jdbc:sun:oracle:", "com.sun.sql.jdbcx.oracle.OracleDataSource");
- //Sybase Driver
- cpClassMap.put("jdbc:sun:sybase:", "com.sun.sql.jdbcx.sybase.SybaseDataSource");
- //PostgreSQL (v7.0 and later)
- cpClassMap.put("jdbc:postgresql:", "org.postgresql.ds.PGConnectionPoolDataSource");
- //Microsoft SQL Server 2000 (Microsoft driver)
- cpClassMap.put("jdbc:sqlserver:", "com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource");
- //jTDS
- cpClassMap.put("jdbc:jtds:sqlserver:", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- //jTDS
- cpClassMap.put("jdbc:jtds:sybase:", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- //Oracle //OCI 8i
- cpClassMap.put("jdbc:oracle:oci8:", "oracle.jdbc.pool.OracleConnectionPoolDataSource");
- //Oracle-thin
- cpClassMap.put("jdbc:oracle:thin:", "oracle.jdbc.pool.OracleConnectionPoolDataSource");
- //IBM DB2
- cpClassMap.put("jdbc:db2:", "com.ibm.db2.jcc.DB2ConnectionPoolDataSource");
- //Microsoft SQL Server (DataDirect Connect for JDBC)
- cpClassMap.put("jdbc:datadirect:sqlserver:", "com.ddtek.jdbcx.sqlserver.SQLServerDataSource");
- //Oracle (DataDirect Connect for JDBC)
- cpClassMap.put("jdbc:datadirect:oracle:", "com.ddtek.jdbcx.oracle.OracleDataSource");
- //IBM DB2 (DataDirect Connect for JDBC)
- cpClassMap.put("jdbc:datadirect:db2:", "com.ddtek.jdbcx.db2.DB2DataSource");
- //Informix Dynamic Server (DataDirect Connect for JDBC)
- cpClassMap.put("jdbc:datadirect:informix:", "com.ddtek.jdbcx.informix.InformixDataSource");
- //Sybase (DataDirect Connect for JDBC)
- cpClassMap.put("jdbc:datadirect:sybase:", "com.ddtek.jdbcx.sybase.SybaseDataSource");
- //Sybase (jConnect 5.2)
- cpClassMap.put("jdbc:sybase:Tds:", "com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource");
- //PointBase
- cpClassMap.put("jdbc:pointbase:", "com.pointbase.jdbc.jdbcDataSource");
- //Cloudscape
- cpClassMap.put("jdbc:cloudscape:", "COM.cloudscape.core.LocalConnectionPoolDataSource");
- //Informix Dynamic Server
- cpClassMap.put("jdbc:informix-sqli:", "com.informix.jdbcx.IfxConnectionPoolDataSource");
- //MySQL (MM.MySQL driver)
- cpClassMap.put("jdbc:mysql:", "com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource");
- //JDBC-ODBC Bridge
- cpClassMap.put("jdbc:odbc:", "sun.jdbc.odbc.JdbcOdbcDriver");
-
- //AS400
- cpClassMap.put("jdbc:as400:", "com.ibm.as400.access.AS400JDBCConnectionPoolDataSource");
-
- }
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/Hk2DatasourceManager.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/Hk2DatasourceManager.java
index 26d137f..72c3aa2 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/Hk2DatasourceManager.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/Hk2DatasourceManager.java
@@ -39,15 +39,14 @@ import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.netbeans.modules.glassfish.javaee.ApplicationScopedResourcesUtils;
+import org.netbeans.modules.glassfish.javaee.ApplicationScopedResourcesUtils.ResourceFileDescription;
+import static org.netbeans.modules.glassfish.javaee.ApplicationScopedResourcesUtils.checkNamespaces;
+import static org.netbeans.modules.glassfish.javaee.ApplicationScopedResourcesUtils.getJndiName;
import org.netbeans.modules.payara.common.PayaraState;
import org.netbeans.modules.payara.common.parser.TreeParser;
import org.netbeans.modules.payara.eecommon.api.UrlData;
import org.netbeans.modules.payara.eecommon.api.config.PayaraConfiguration;
-import org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils;
-import org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils.JndiNameResolver;
-import org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils.ResourceFileDescription;
-import static org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils.checkNamespaces;
-import static org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils.getJndiName;
import org.netbeans.modules.payara.jakartaee.Hk2DeploymentManager;
import org.netbeans.modules.payara.tooling.data.PayaraServer;
import org.netbeans.modules.payara.tooling.data.PayaraVersion;
@@ -60,6 +59,11 @@ import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
import org.netbeans.modules.j2ee.deployment.plugins.spi.DatasourceManager;
import org.netbeans.modules.j2ee.sun.dd.api.RootInterface;
import org.netbeans.modules.javaee.specs.support.api.util.JndiNamespacesDefinition;
+import org.netbeans.modules.glassfish.javaee.db.DbUtil;
+import org.netbeans.modules.glassfish.javaee.db.DriverMaps;
+import org.netbeans.modules.glassfish.javaee.db.JndiNameResolver;
+import org.netbeans.modules.glassfish.javaee.db.SunDatasource;
+import org.netbeans.modules.glassfish.javaee.db.VendorNameMgr;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileSystem;
@@ -84,6 +88,8 @@ import org.xml.sax.SAXException;
*/
public class Hk2DatasourceManager implements DatasourceManager {
+ private static final Logger LOG = Logger.getLogger("payara-jakartaee");
+
////////////////////////////////////////////////////////////////////////////
// Class attributes //
////////////////////////////////////////////////////////////////////////////
@@ -249,7 +255,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
jndiName, url, username, password, driver));
}
} catch(IllegalStateException ex) {
- Logger.getLogger("payara-jakartaee").log(
+ LOG.log(
Level.INFO, ex.getLocalizedMessage(), ex);
throw new ConfigurationException(ex.getLocalizedMessage(), ex);
}
@@ -292,13 +298,6 @@ public class Hk2DatasourceManager implements DatasourceManager {
String vendorName = VendorNameMgr.vendorNameFromDbUrl(url);
if(vendorName == null) {
vendorName = jndiName;
- } else {
- if("derby_embedded".equals(vendorName)) {
- // !PW FIXME display as dialog warning?
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
- "Embedded derby not supported as a datasource");
- return null;
- }
}
// Is there a connection pool we can reuse, or do we need to create one?
@@ -331,7 +330,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
ds = new SunDatasource(realJndiName, url, username, password, driver, fileDesc.isIsApplicationScoped(), null);
} catch(IOException ex) {
- Logger.getLogger("payara-jakartaee").log(Level.INFO, ex.getLocalizedMessage(), ex);
+ LOG.log(Level.INFO, ex.getLocalizedMessage(), ex);
throw new ConfigurationException(ex.getLocalizedMessage(), ex);
}
@@ -378,12 +377,12 @@ public class Hk2DatasourceManager implements DatasourceManager {
try {
TreeParser.readXml(xmlFile, pathList);
} catch(IllegalStateException ex) {
- Logger.getLogger("payara-jakartaee").log(Level.INFO, ex.getLocalizedMessage(), ex);
+ LOG.log(Level.INFO, ex.getLocalizedMessage(), ex);
}
ApplicationScopedResourcesUtils.ResourceFileDescription fileDesc = new ApplicationScopedResourcesUtils.ResourceFileDescription(
xmlFile, applicationScoped, namespaceFinder.getNamespaces());
- JndiNameResolver resolver = applicationScoped && module != null ? new UserResolver(module, fileDesc) : null;
+ ApplicationScopedResourcesUtils.JndiNameResolver resolver = applicationScoped && module != null ? new UserResolver(module, fileDesc) : null;
for (JdbcResource jdbc : jdbcResources) {
final ConnectionPool pool = connectionPoolMap.get(jdbc.getPoolName());
if (pool != null) {
@@ -409,7 +408,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
DataSourcesReader.DEFAULT_DATA_SOURCE_EE7));
}
} catch (NullPointerException npe) {
- Logger.getLogger("payara-jakartaee").log(Level.INFO, pool.toString(), npe);
+ LOG.log(Level.INFO, pool.toString(), npe);
}
}
}
@@ -450,7 +449,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
// <jdbc-resource
// enabled="true"
- // pool-name="DerbyPool"
+ // pool-name="H2Pool"
// jndi-name="jdbc/__default"
// object-type="user" />
@@ -514,15 +513,10 @@ public class Hk2DatasourceManager implements DatasourceManager {
}
//<jdbc-connection-pool
- // datasource-classname="org.apache.derby.jdbc.ClientDataSource"
- // name="DerbyPool"
+ // datasource-classname="org.h2.jdbcx.JdbcDataSource"
+ // name="H2Pool"
// res-type="javax.sql.DataSource"
- // <property name="PortNumber" value="1527" />
- // <property name="Password" value="APP" />
- // <property name="User" value="APP" />
- // <property name="serverName" value="localhost" />
- // <property name="DatabaseName" value="sun-appserv-samples" />
- // <property name="connectionAttributes" value=";create=true" />
+ // <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE" />
//</jdbc-connection-pool>
@Override
@@ -684,7 +678,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
appendProperty(doc, newPool, PROP_URL, url, true);
appendProperty(doc, newPool, PROP_DRIVER_CLASS, driver, true);
- Logger.getLogger("payara-jakartaee").log(Level.FINER,
+ LOG.log(Level.FINER,
"New connection pool resource:\n{0}", newPool.getTextContent());
} catch (SAXException ex) {
Exceptions.printStackTrace(ex);
@@ -734,7 +728,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
private static final String JDBC_TAG_1 =
" <jdbc-resource " +
"enabled=\"true\" ";
- // pool-name="DerbyPool"
+ // pool-name="H2Pool"
private static final String ATTR_POOLNAME = "pool-name";
// jndi-name="jdbc/__default"
private static final String ATTR_JNDINAME = "jndi-name";
@@ -745,7 +739,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
// <jdbc-resource
// enabled="true"
- // pool-name="DerbyPool"
+ // pool-name="H2Pool"
// jndi-name="jdbc/__default"
// object-type="user" />
@@ -777,7 +771,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
appendAttr(doc, newJdbcRes, ATTR_POOLNAME, poolName, true);
appendAttr(doc, newJdbcRes, ATTR_JNDINAME, jndiName, true);
- Logger.getLogger("payara-jakartaee").log(Level.FINER,
+ LOG.log(Level.FINER,
"New JDBC resource:\n{0}", newJdbcRes.getTextContent());
} catch (SAXException ex) {
Exceptions.printStackTrace(ex);
@@ -877,7 +871,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
});
}
- private static class UserResolver implements JndiNameResolver {
+ private static class UserResolver implements ApplicationScopedResourcesUtils.JndiNameResolver {
private final J2eeModule module;
@@ -914,7 +908,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
String jndiName = attributes.getValue("jndi-name");
if(targetJndiName.equals(jndiName)) {
if(duplicate) {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
+ LOG.log(Level.WARNING,
"Duplicate jndi-names defined for JDBC resources.");
}
duplicate = true;
@@ -946,7 +940,7 @@ public class Hk2DatasourceManager implements DatasourceManager {
if(!pools.containsKey(poolName)) {
properties.put("name", poolName);
} else {
- Logger.getLogger("payara-jakartaee").log(Level.WARNING,
+ LOG.log(Level.WARNING,
"Duplicate pool-names defined for JDBC Connection Pools.");
}
}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCConnectionPool.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCConnectionPool.java
deleted file mode 100644
index 1a9291a..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCConnectionPool.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee.db;
-
-import org.netbeans.modules.payara.tooling.utils.StringPrefixTree;
-
-/**
- * Payara JDBC connection pool server property content.
- * <p/>
- * @author Tomas Kraus
- */
-public class JDBCConnectionPool {
-
- ////////////////////////////////////////////////////////////////////////////
- // Inner classes //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Recognized properties in JDBC connection pool.
- */
- public enum PropertyType {
-
- /** Unknown JDBC connection pool property. */
- UNKNOWN,
-
- /** JDBC resource user name. */
- USER,
-
- /** JDBC resource password. */
- PASSWORD,
-
- /** JDBC resource driver class. */
- DRIVER_CLASS,
-
- /** JDBC resource URL. */
- URL,
-
- /** JDBC resource database name. */
- DATABASE_NAME,
-
- /** JDBC resource server host name. */
- SERVER_NAME,
-
- /** JDBC resource server port name. */
- PORT_NUMBER;
-
- /** A <code>String</code> representation of UNKNOWN value. */
- private static final String UNKNOWN_STR = "UNKNOWN";
-
- /** A <code>String</code> representation of USER value. */
- private static final String USER_STR = "User";
-
- /** A <code>String</code> representation of PASSWORD value. */
- private static final String PASSWORD_STR = "Password";
-
- /** A <code>String</code> representation of DRIVER_CLASS value. */
- private static final String DRIVER_CLASS_STR = "DriverClass";
-
- /** A <code>String</code> representation of URL value. */
- private static final String URL_STR = "URL";
-
- /** A <code>String</code> representation of DATABASE_NAME value. */
- private static final String DATABASE_NAME_STR = "DatabaseName";
-
- /** A <code>String</code> representation of SERVER_NAME value. */
- private static final String SERVER_NAME_STR = "ServerName";
-
- /** A <code>String</code> representation of PORT_NUMBER value. */
- private static final String PORT_NUMBER_STR = "PortNumber";
-
- /** Stored <code>String</code> values for backward <code>String</code>
- * conversion. */
- private static final StringPrefixTree<PropertyType> stringValues
- = new StringPrefixTree<>(false);
-
- static {
- stringValues.add(USER.toString(), USER);
- stringValues.add(PASSWORD.toString(), PASSWORD);
- stringValues.add(DRIVER_CLASS.toString(), DRIVER_CLASS);
- stringValues.add(URL.toString(), URL);
- stringValues.add(DATABASE_NAME.toString(), DATABASE_NAME);
- stringValues.add(SERVER_NAME.toString(), SERVER_NAME);
- stringValues.add(PORT_NUMBER.toString(), PORT_NUMBER);
- }
-
- /**
- * Returns a <code>Properties</code> with a value represented
- * by the specified <code>String</code>.
- * <p/>
- * The <code>Properties</code> returned represents existing value
- * only if specified <code>String</code> matches any <code>String</code>
- * returned by <code>toString</code> method. Otherwise <code>null</code>
- * value is returned.
- * <p>
- * @param name Value containing <code>Properties</code>
- * <code>toString</code> representation.
- * @return <code>Properties</code> value represented
- * by <code>String</code> or <code>UNKNOWN</code> if value
- * was not recognized.
- */
- public static PropertyType toValue(final String name) {
- if (name != null) {
- PropertyType type = stringValues.match(name.toLowerCase());
- return type != null ? type : UNKNOWN;
- } else {
- return null;
- }
- }
-
- /**
- * Convert <code>Properties</code> value to <code>String</code>.
- * <p/>
- * @return A <code>String</code> representation of the value
- * of this object.
- */
- @Override
- public String toString() {
- switch (this) {
- case UNKNOWN: return UNKNOWN_STR;
- case USER: return USER_STR;
- case PASSWORD: return PASSWORD_STR;
- case DRIVER_CLASS: return DRIVER_CLASS_STR;
- case URL: return URL_STR;
- case DATABASE_NAME: return DATABASE_NAME_STR;
- case SERVER_NAME: return SERVER_NAME_STR;
- case PORT_NUMBER: return PORT_NUMBER_STR;
- // This is unrecheable. Being here means this class does not handle
- // all possible values correctly.
- default:
- throw new IllegalStateException(
- "Invalid ResourceType value");
- }
- }
-
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Instance attributes //
- ////////////////////////////////////////////////////////////////////////////
-
- /** User property value. */
- private String user;
-
- /** Password value. */
- private String password;
-
- /** Driver class value. */
- private String driverClass;
-
- /** Resource URL. */
- private String url;
-
- /** Database name. */
- private String databaseName;
-
- /** Server host name. */
- private String serverName;
-
- /** Server host port. Negative value (usually <code>-1</code>)
- * represents <code>null</code>. */
- private int port;
-
- ////////////////////////////////////////////////////////////////////////////
- // Constructors //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Creates an instance of JDBC connection pool content with no values set.
- */
- public JDBCConnectionPool() {
- this.user = null;
- this.password = null;
- this.driverClass = null;
- this.url = null;
- this.databaseName = null;
- this.serverName = null;
- this.port = -1;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Getters and setters //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Get user property value.
- * <p/>
- * @return User property value.
- */
- public String getUser() {
- return user;
- }
-
- /**
- * Get password property value.
- * <p/>
- * @return Password value.
- */
- public String getPassword() {
- return password;
- }
-
- /**
- * Get driver class property value.
- * <p/>
- * @return Driver class value.
- */
- public String getDriverClass() {
- return driverClass;
- }
-
- /**
- * Get resource URL property value.
- * <p/>
- * @return Resource URL.
- */
- public String getUrl() {
- return url;
- }
-
- /**
- * Get database name property value.
- * <p/>
- * @return Database name.
- */
- public String getDatabaseName() {
- return databaseName;
- }
-
- /**
- * Get server host name property value.
- * <p/>
- * @return Server host name.
- */
- public String getServerName() {
- return serverName;
- }
-
- /**
- * Get server host port property value.
- * <p/>
- * Negative value (usually <code>-1</code>) represents <code>null</code>.
- * <p/>
- * @return Server host port.
- */
- public int getPort() {
- return port;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Methods //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Set property value depending on {@link Properties} type
- * <code>enum</code> value.
- * <p/>
- * @return Value of <code>true</code> if property was set
- * or <code>false</code> otherwise (what means that
- * {@link Properties} type value vas <code>UNKNOWN</code>.
- */
- public boolean setProperty(PropertyType type, String value) {
- switch (type) {
- case USER:
- this.user = value;
- return true;
- case PASSWORD:
- this.password = value;
- return true;
- case DRIVER_CLASS:
- this.driverClass = value;
- return true;
- case URL:
- this.url = value;
- return true;
- case DATABASE_NAME:
- this.databaseName = value;
- return true;
- case SERVER_NAME:
- this.serverName = value;
- return true;
- case PORT_NUMBER:
- try {
- this.port = Integer.parseInt(value);
- return true;
- } catch (NumberFormatException nfe) {
- this.port = -1;
- return false;
- }
- default:
- return false;
- }
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCResource.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCResource.java
deleted file mode 100644
index ca466bc..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JDBCResource.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee.db;
-
-import org.netbeans.modules.payara.tooling.utils.StringPrefixTree;
-import org.netbeans.modules.j2ee.deployment.common.api.Datasource;
-
-/**
- * Payara JDBC resource (data source) server property content.
- * <p/>
- * @author Tomas Kraus
- */
-public class JDBCResource implements Datasource {
-
- ////////////////////////////////////////////////////////////////////////////
- // Inner classes //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Recognized attributes in JDBC resource.
- */
- public enum AttrType {
-
- /** Unknown JDBC resource attribute. */
- UNKNOWN,
-
- /** Resource JNDI name. */
- JNDI_NAME,
-
- /** Resource object type. */
- OBJECT_TYPE,
-
- /** JDBC connection pool name. */
- POOL_NAME,
-
- /** Is this JDBC resource enabled? */
- ENABLED,
-
- /** Deployment order. */
- DEPLOYMENT_ORDER;
-
- /** A <code>String</code> representation of UNKNOWN value. */
- private static final String UNKNOWN_STR = "UNKNOWN";
-
- /** A <code>String</code> representation of JNDI_NAME value. */
- private static final String JNDI_NAME_STR = "jndi-name";
-
- /** A <code>String</code> representation of OBJECT_TYPE value. */
- private static final String OBJECT_TYPE_STR = "object-type";
-
- /** A <code>String</code> representation of UNKNOWN value. */
- private static final String POOL_NAME_STR = "pool-name";
-
- /** A <code>String</code> representation of ENABLED value. */
- private static final String ENABLED_STR = "enabled";
-
- /** A <code>String</code> representation of DEPLOYMENT_ORDER value. */
- private static final String DEPLOYMENT_ORDER_STR = "deployment-order";
-
- /** Stored <code>String</code> values for backward <code>String</code>
- * conversion. */
- private static final StringPrefixTree<AttrType> stringValues
- = new StringPrefixTree<>(false);
-
- static {
- stringValues.add(JNDI_NAME.toString(), JNDI_NAME);
- stringValues.add(OBJECT_TYPE.toString(), OBJECT_TYPE);
- stringValues.add(POOL_NAME.toString(), POOL_NAME);
- stringValues.add(ENABLED.toString(), ENABLED);
- stringValues.add(DEPLOYMENT_ORDER.toString(), DEPLOYMENT_ORDER);
- }
-
- /**
- * Returns a <code>AttrType</code> with a value represented
- * by the specified <code>String</code>.
- * <p/>
- * The <code>AttrType</code> returned represents existing value
- * only if specified <code>String</code> matches any <code>String</code>
- * returned by <code>toString</code> method. Otherwise <code>null</code>
- * value is returned.
- * <p>
- * @param name Value containing <code>AttrType</code>
- * <code>toString</code> representation.
- * @return <code>AttrType</code> value represented
- * by <code>String</code> or <code>UNKNOWN</code> if value
- * was not recognized.
- */
- public static AttrType toValue(final String name) {
- if (name != null) {
- AttrType type = stringValues.match(name.toLowerCase());
- return type != null ? type : UNKNOWN;
- } else {
- return null;
- }
- }
-
- /**
- * Convert <code>AttrType</code> value to <code>String</code>.
- * <p/>
- * @return A <code>String</code> representation of the value
- * of this object.
- */
- @Override
- public String toString() {
- switch (this) {
- case UNKNOWN: return UNKNOWN_STR;
- case JNDI_NAME: return JNDI_NAME_STR;
- case OBJECT_TYPE: return OBJECT_TYPE_STR;
- case POOL_NAME: return POOL_NAME_STR;
- case ENABLED: return ENABLED_STR;
- case DEPLOYMENT_ORDER: return DEPLOYMENT_ORDER_STR;
- // This is unrecheable. Being here means this class does not handle
- // all possible values correctly.
- default:
- throw new IllegalStateException(
- "Invalid ResourceType value");
- }
- }
-
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Instance attributes //
- ////////////////////////////////////////////////////////////////////////////
-
- /** Resource JNDI name. */
- private String jndiName;
-
- /** Resource object type. */
- private String objectType;
-
- /** JDBC connection pool name. */
- private String poolName;
-
- /** Is this JDBC resource enabled? Default value is false. */
- private boolean enabled;
-
- /** Deployment order. Negative value (usually <code>-1</code>)
- * represents <code>null</code>. */
- private int deploymentOrder;
-
- /** JDBC connection pool reference. */
- private JDBCConnectionPool pool;
-
- ////////////////////////////////////////////////////////////////////////////
- // Constructors //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Creates an instance of JDBC resource (data source) content with
- * no values set.
- */
- public JDBCResource() {
- this.jndiName = null;
- this.objectType = null;
- this.poolName = null;
- this.enabled = false;
- this.deploymentOrder = -1;
- this.pool = null;
- }
-
- /**
- * Creates an instance of JDBC resource (data source) content with
- * all values set.
- * <p/>
- * @param jndiName Resource JNDI name.
- * @param objectType Resource object type.
- * @param poolName JDBC connection pool name.
- * @param enabled Is this JDBC resource enabled?
- * @param deploymentOrder Deployment order.
- * @param pool JDBC connection pool reference.
- */
- public JDBCResource(final String jndiName, final String objectType,
- final String poolName, final boolean enabled,
- final int deploymentOrder, final JDBCConnectionPool pool) {
- this.jndiName = jndiName;
- this.objectType = objectType;
- this.poolName = poolName;
- this.enabled = enabled;
- this.deploymentOrder = deploymentOrder;
- this.pool = pool;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Datasource interface getters //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Get resource JNDI name.
- * <p/>
- * @return Resource JNDI name.
- */
- @Override
- public String getJndiName() {
- return jndiName;
- }
-
- /**
- * Get data source JNDI name.
- * <p/>
- * @return Data source JNDI name.
- */
- @Override
- public String getDisplayName() {
- return jndiName;
- }
-
- /**
- * Get data source URL.
- * <p/>
- * @return Data source URL.
- */
- @Override
- public String getUrl() {
- return pool != null ? pool.getUrl() : null;
- }
-
- /**
- * Get data source user name.
- * <p/>
- * @return Data source user name.
- */
- @Override
- public String getUsername() {
- return pool != null ? pool.getUser() : null;
- }
-
- /**
- * Get data source user password.
- * <p/>
- * @return Data source user password.
- */
- @Override
- public String getPassword() {
- return pool != null ? pool.getPassword() : null;
- }
-
- /**
- * Get data source driver class name.
- * <p/>
- * @return Data source driver class name.
- */
- @Override
- public String getDriverClassName() {
- return pool != null ? pool.getDriverClass() : null;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Getters and setters //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Get resource object type.
- * <p/>
- * @return Resource object type.
- */
- public String getObjectType() {
- return objectType;
- }
-
- /**
- * Get JDBC connection pool name.
- * <p/>
- * @return JDBC connection pool name.
- */
- public String getPoolName() {
- return poolName;
- }
-
- /**
- * Is this JDBC resource enabled? Default value is false.
- * <p/>
- * @return Is this JDBC resource enabled?
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * Get deployment order.
- * <p/>
- * Negative value (usually <code>-1</code>) represents <code>null</code>.
- * <p/>
- * @return Deployment order.
- */
- public int getDeploymentOrder() {
- return deploymentOrder;
- }
-
- /**
- * Get JDBC connection pool reference.
- * <p/>
- * @return JDBC connection pool reference.
- */
- public JDBCConnectionPool getPool() {
- return pool;
- }
-
- /**
- * Set JDBC connection pool reference.
- * <p/>
- * @param pool JDBC connection pool reference.
- */
- public void setPool(JDBCConnectionPool pool) {
- this.pool = pool;
- }
-
- ////////////////////////////////////////////////////////////////////////////
- // Methods //
- ////////////////////////////////////////////////////////////////////////////
-
- /**
- * Set property value depending on {@link AttrType} type
- * <code>enum</code> value.
- * <p/>
- * @return Value of <code>true</code> if property was set
- * or <code>false</code> otherwise (what means that
- * {@link Properties} type value vas <code>UNKNOWN</code>.
- */
- public boolean setProperty(AttrType type, String value) {
- switch (type) {
- case JNDI_NAME:
- this.jndiName = value;
- return true;
- case OBJECT_TYPE:
- this.objectType = value;
- return true;
- case POOL_NAME:
- this.poolName = value;
- return true;
- case ENABLED:
- this.enabled = Boolean.parseBoolean(value);
- return true;
- case DEPLOYMENT_ORDER:
- try {
- this.deploymentOrder = Integer.parseInt(value);
- return true;
- } catch (NumberFormatException nfe) {
- this.deploymentOrder = -1;
- return false;
- }
- default:
- return false;
- }
- }
-
- /**
- * Create a copy of existing JDBC data source object with new JNDI name.
- * <p/>
- * @param jndiName JNDI name to be assigned to new JDBC data source
- * copy.
- */
- public JDBCResource copy(final String jndiName) {
- return new JDBCResource(
- jndiName, this.objectType, this.poolName,
- this.enabled, this.deploymentOrder, this.pool);
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JndiNameResolver.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JndiNameResolver.java
deleted file mode 100644
index 308bc11..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/JndiNameResolver.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-package org.netbeans.modules.payara.jakartaee.db;
-
-/**
- *
- * @author Petr Hejl
- */
-public interface JndiNameResolver {
-
- String resolveJndiName(String jndiName);
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/ResourcesHelper.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/ResourcesHelper.java
index 16bea8c..791c9b5 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/ResourcesHelper.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/ResourcesHelper.java
@@ -46,8 +46,10 @@ import org.openide.util.Utilities;
*/
public class ResourcesHelper {
+ private static final Logger LOG = Logger.getLogger("payara-jakartaee");
+
private static RequestProcessor RP = new RequestProcessor("Sample Datasource work");
-
+
public static void addSampleDatasource(final J2eeModule module , final DeploymentManager dmParam) {
RP.post(new Runnable() {
@@ -79,10 +81,10 @@ public class ResourcesHelper {
}
}
} else {
- Logger.getLogger("payara-jakartaee").finer("Could not find project for J2eeModule"); // NOI18N
+ LOG.finer("Could not find project for J2eeModule"); // NOI18N
}
} else {
- Logger.getLogger("payara-jakartaee").finer("Could not find project root directory for J2eeModule"); // NOI18N
+ LOG.finer("Could not find project root directory for J2eeModule"); // NOI18N
}
}
});
@@ -98,17 +100,12 @@ public class ResourcesHelper {
}
static private void registerSampleResource(PayaraModule commonSupport) {
- String sample_poolname = "SamplePool"; //NOI18N
- String sample_jdbc = "jdbc/sample"; //NOI18N
- String sample_classname = "org.apache.derby.jdbc.ClientDataSource"; //NOI18N
+ String sample_poolname = "H2Pool"; //NOI18N
+ String sample_jdbc = "jdbc/__default"; //NOI18N
+ String sample_classname = "org.h2.jdbcx.JdbcDataSource"; //NOI18N
String sample_restype = "javax.sql.DataSource"; //NOI18N
- Map<String, String> sample_props = new HashMap<String, String>();
- sample_props.put("DatabaseName", "sample");
- sample_props.put("User", "app");
- sample_props.put("Password", "app");
- sample_props.put("PortNumber", "1527");
- sample_props.put("serverName", "localhost");
- sample_props.put("URL", "jdbc\\:derby\\://localhost\\:1527/sample");
+ Map<String, String> sample_props = new HashMap<>();
+ sample_props.put("URL", "jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE");
Map<String, ResourceDesc> jdbcsMap = commonSupport.getResourcesMap(PayaraModule.JDBC_RESOURCE);
if (!jdbcsMap.containsKey(sample_jdbc)) {
try {
@@ -118,9 +115,8 @@ public class ResourcesHelper {
CommandCreateJDBCResource.createJDBCResource(
commonSupport.getInstance(), sample_poolname,
sample_jdbc, null, null, 60000);
- } catch (PayaraIdeException gfie) {
- Logger.getLogger("payara-jakartaee").log(
- Level.SEVERE, gfie.getLocalizedMessage(), gfie);
+ } catch (PayaraIdeException ex) {
+ LOG.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
}
}
}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/SunDatasource.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/SunDatasource.java
deleted file mode 100644
index ebb591d..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/SunDatasource.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee.db;
-
-import java.util.Objects;
-import org.netbeans.modules.payara.jakartaee.ApplicationScopedResourcesUtils.JndiNameResolver;
-import org.netbeans.modules.j2ee.deployment.common.api.Datasource;
-
-/**
- * Data model for a sun datasource (combined jdbc resource and connection pool).
- *
- * @author Nitya Doraisamy
- */
-public class SunDatasource implements Datasource {
-
- private final String jndiName;
- private final String url;
- private final String username;
- private final String password;
- private final String driverClassName;
-
- private final JndiNameResolver resolver;
-
- public SunDatasource(String jndiName, String url, String username,
- String password, String driverClassName) {
- this(jndiName, url, username, password, driverClassName, false, null);
- }
-
- public SunDatasource(String jndiName, String url, String username,
- String password, String driverClassName, boolean scoped, JndiNameResolver resolver) {
- this.jndiName = jndiName;
- this.url = url;
- this.username = username;
- this.password = password;
- this.driverClassName = driverClassName;
- this.resolver = resolver;
- }
-
- @Override
- public String getDisplayName() {
- return getJndiName();
- }
-
- @Override
- public String getJndiName() {
- if (resolver != null) {
- return resolver.resolveJndiName(jndiName);
- }
- return jndiName;
- }
-
- @Override
- public String getUrl() {
- return url;
- }
-
- @Override
- public String getUsername() {
- return username;
- }
-
- @Override
- public String getPassword() {
- return password;
- }
-
- @Override
- public String getDriverClassName() {
- return driverClassName;
- }
-
- @Override
- public String toString() {
- return "[ " + jndiName + " : " + url
- + " : " + username + " : " + password
- + " : " + driverClassName + " ]";
- }
-
- @Override
- @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject")
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final SunDatasource other = (SunDatasource) obj;
- if (! Objects.equals(this.jndiName, other.jndiName)) {
- return false;
- }
- if (! Objects.equals(this.url, other.url)) {
- return false;
- }
- if (! Objects.equals(this.username, other.username)) {
- return false;
- }
- if (! Objects.equals(this.password, other.password)) {
- return false;
- }
- if (! Objects.equals(this.driverClassName, other.driverClassName)) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 41 * hash + (this.jndiName != null ? this.jndiName.hashCode() : 0);
- hash = 41 * hash + (this.url != null ? this.url.hashCode() : 0);
- hash = 41 * hash + (this.username != null ? this.username.hashCode() : 0);
- hash = 41 * hash + (this.password != null ? this.password.hashCode() : 0);
- hash = 41 * hash + (this.driverClassName != null ? this.driverClassName.hashCode() : 0);
- return hash;
- }
-
- public SunDatasource copy(String jndiName) {
- return new SunDatasource(jndiName, this.url, this.username,
- this.password, this.driverClassName/*, this.resourceDir*/);
- }
-
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/VendorNameMgr.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/VendorNameMgr.java
deleted file mode 100644
index 3ddf985..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/db/VendorNameMgr.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee.db;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Collect all the vendor name manipulation in one place. Refactor it ASAP.
- *
- * @author Peter Williams
- */
-public class VendorNameMgr {
-
- private final static char BLANK = ' ';
- private final static char DOT = '.';
- private final static char [] ILLEGAL_FILENAME_CHARS = {'/', '\\', ':', '*', '?', '"', '<', '>', '|', ',', '=', ';' };
-
- private final static String ILLEGAL_CHARS_PATTERN = "[/\\:*\"<>|,=; \\.]"; // NOI18N
- private final static String REPLACEMENT_PATTERN = "_"; // NOI18N
-
-
- /**
- * Determine the proper vendor name for the database url passed in. If
- * no vendor name can be determined, generate something valid from the url.
- *
- * @param url database url for a datasource
- * @return vendor name (or filename legal string) for the database vendor
- * associated with that url.
- */
- public static String vendorNameFromDbUrl(String url) {
- url = stripExtraDBInfo(url);
- String vendorName = getDatabaseVendorName(url);
- if(vendorName != null) {
- if(vendorName.length() > 0) { // NOI18N
- if(!isFriendlyFilename(vendorName)) {
- vendorName = makeLegalFilename(vendorName);
- }
- } else {
- vendorName = makeShorterLegalFilename(url);
- }
- }
- return vendorName;
- }
-
- /**
- * Determine the standard datasource classname for this vendor
- *
- * @param vendorName vendor name to lookup
- * @return standard datasource classname for this vendor, or null if unknown.
- */
- public static String dsClassNameFromVendorName(String vendorName) {
- return vendorName != null ? vendorNameToDscnMap.get(vendorName) : null;
- }
-
-
- private static boolean isLegalFilename(String filename) {
- for(int i = 0; i < ILLEGAL_FILENAME_CHARS.length; i++) {
- if(filename.indexOf(ILLEGAL_FILENAME_CHARS[i]) >= 0) {
- return false;
- }
- }
-
- return true;
- }
-
- private static boolean isFriendlyFilename(String filename) {
- if(filename.indexOf(BLANK) >= 0 || filename.indexOf(DOT) >= 0) {
- return false;
- }
-
- return isLegalFilename(filename);
- }
-
- private static String makeLegalFilename(String filename) {
- return filename.replaceAll(ILLEGAL_CHARS_PATTERN, REPLACEMENT_PATTERN);
- }
-
- private static String makeShorterLegalFilename(String filename) {
- //To clean up the default generation a little
- int separatorIndex = filename.indexOf("://"); // NOI18N
- if(separatorIndex != -1) { // NOI18N
- filename = filename.substring(0, separatorIndex) +
- "_" + // NOI18N
- filename.substring(separatorIndex + 3);
- }
- separatorIndex = filename.indexOf("//"); // NOI18N
- if(separatorIndex != -1) { // NOI18N
- filename = filename.substring(0, separatorIndex) +
- "_" + // NOI18N
- filename.substring(separatorIndex + 2);
- }
- filename = makeLegalFilename(filename);
-
- return filename;
- }
-
-
- static String stripExtraDBInfo(String dbConnectionString) {
- int bracketIndex = dbConnectionString.indexOf("["); // NOI18N
- if(bracketIndex != -1) {
- dbConnectionString = dbConnectionString.substring(0, bracketIndex).trim();
- }
- return dbConnectionString;
- }
-
- private static String getDatabaseVendorName(String url) {
- String vendorName = "";
- for(Entry<String, String> entry : vendorNameToUrlMap.entrySet()) {
- if(url.indexOf(entry.getValue()) != -1){
- vendorName = entry.getKey();
- break;
- }
- }
- return vendorName;
- }
-
- // vendor name -> datasource classname mapping.
- // XXX From CPWizard.xml until that can be refactored
- // XXX Using linked hashmap due to order dependency between derby urls & reverse lookup.
- //
- private static Map<String, String> vendorNameToDscnMap = new LinkedHashMap<String, String>();
-
- static {
- vendorNameToDscnMap.put("oracle-thin", "oracle.jdbc.pool.OracleDataSource");
- vendorNameToDscnMap.put("derby_net", "org.apache.derby.jdbc.ClientDataSource");
- vendorNameToDscnMap.put("sun_db2", "com.sun.sql.jdbcx.db2.DB2DataSource");
- vendorNameToDscnMap.put("sun_msftsql", "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource");
- vendorNameToDscnMap.put("sun_oracle", "com.sun.sql.jdbcx.oracle.OracleDataSource");
- vendorNameToDscnMap.put("sun_sybase", "com.sun.sql.jdbcx.sybase.SybaseDataSource");
- vendorNameToDscnMap.put("post-gre-sql", "org.postgresql.ds.PGSimpleDataSource");
- vendorNameToDscnMap.put("microsoft_sql", "com.microsoft.sqlserver.jdbc.SQLServerDataSource");
- vendorNameToDscnMap.put("jtds_sql", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- vendorNameToDscnMap.put("jtds_sybase", "net.sourceforge.jtds.jdbcx.JtdsDataSource");
- vendorNameToDscnMap.put("oracle", "oracle.jdbc.pool.OracleDataSource");
- vendorNameToDscnMap.put("db2", "com.ibm.db2.jcc.DB2DataSource");
- vendorNameToDscnMap.put("datadirect_sql", "com.ddtek.jdbcx.sqlserver.SQLServerDataSource");
- vendorNameToDscnMap.put("datadirect_oracle", "com.ddtek.jdbcx.oracle.OracleDataSource");
- vendorNameToDscnMap.put("datadirect_db2", "com.ddtek.jdbcx.db2.DB2DataSource");
- vendorNameToDscnMap.put("datadirect_informix", "com.ddtek.jdbcx.informix.InformixDataSource");
- vendorNameToDscnMap.put("datadirect_sybase", "com.ddtek.jdbcx.sybase.SybaseDataSource");
- vendorNameToDscnMap.put("sybase2", "com.sybase.jdbc2.jdbc.SybDataSource");
- vendorNameToDscnMap.put("pointbase", "com.pointbase.jdbc.jdbcDataSource");
- vendorNameToDscnMap.put("cloudscape", "com.cloudscape.core.BasicDataSource");
- vendorNameToDscnMap.put("informix", "com.informix.jdbcx.IfxDataSource");
- vendorNameToDscnMap.put("mysql", "com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
- vendorNameToDscnMap.put("jdbc-odbc-bridge", "sun.jdbc.odbc.JdbcOdbcDriver");
- vendorNameToDscnMap.put("sql-server", "weblogic.jdbc.mssqlserver4.Driver");
- }
-
- // Url fragment -> vendor name mapping.
- // XXX From CPWizard.xml until that can be refactored
- // XXX Using linked hashmap due to order dependency between derby urls & reverse lookup.
- //
- private static Map<String, String> vendorNameToUrlMap = new LinkedHashMap<String, String>();
-
- static {
- vendorNameToUrlMap.put("oracle-thin", "jdbc:oracle:thin");
- vendorNameToUrlMap.put("derby_net", "jdbc:derby://");
- vendorNameToUrlMap.put("derby_embedded", "jdbc:derby:");
- vendorNameToUrlMap.put("sun_db2", "jdbc:sun:db2:");
- vendorNameToUrlMap.put("sun_msftsql", "jdbc:sun:sqlserver:");
- vendorNameToUrlMap.put("sun_oracle", "jdbc:sun:oracle:");
- vendorNameToUrlMap.put("sun_sybase", "jdbc:sun:sybase:");
- vendorNameToUrlMap.put("post-gre-sql", "jdbc:postgresql:");
- vendorNameToUrlMap.put("microsoft_sql", "jdbc:sqlserver:");
- vendorNameToUrlMap.put("jtds_sql", "jdbc:jtds:sqlserver:");
- vendorNameToUrlMap.put("jtds_sybase", "jdbc:jtds:sybase:");
- vendorNameToUrlMap.put("oracle", "jdbc:oracle:oci8:");
- vendorNameToUrlMap.put("db2", "jdbc:db2:");
- vendorNameToUrlMap.put("jdbc-odbc-bridge", "jdbc:odbc:");
- vendorNameToUrlMap.put("sql-server", "jdbc:weblogic:mssqlserver4:");
- vendorNameToUrlMap.put("sybase2", "jdbc:sybase:Tds:");
- vendorNameToUrlMap.put("cloudscape", "jdbc:cloudscape:");
- vendorNameToUrlMap.put("informix", "jdbc:informix-sqli:");
- vendorNameToUrlMap.put("mysql", "jdbc:mysql:");
- vendorNameToUrlMap.put("pointbase", "jdbc:pointbase:");
- vendorNameToUrlMap.put("datadirect_sql", "jdbc:datadirect:sqlserver:");
- vendorNameToUrlMap.put("datadirect_oracle", "jdbc:datadirect:oracle:");
- vendorNameToUrlMap.put("datadirect_db2", "jdbc:datadirect:db2:");
- vendorNameToUrlMap.put("datadirect_informix", "jdbc:datadirect:informix:");
- vendorNameToUrlMap.put("datadirect_sybase", "jdbc:datadirect:sybase:");
- vendorNameToUrlMap.put("as400", "jdbc:as400:");
- }
-}
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/Bundle.properties b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/Bundle.properties
deleted file mode 100644
index c2afa49..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/Bundle.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-DebugPortQuery.debugPortLable.text=<html><body>Debug port is undefined for remote server. Which port should the debugger attach to?</body></html>
-DebugPortQuery.noAskCheck.text=<html><body>Don't ask me again. <i><small>(Change in Server Properties.)</small></i></body></html>
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.form b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.form
deleted file mode 100644
index cbb9722..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.form
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.1" 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.
-
--->
-
-<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
- <AuxValues>
- <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
- <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
- <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
- <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
- <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
- </AuxValues>
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="debugPortLable" alignment="1" pref="393" max="32767" attributes="0"/>
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace min="6" pref="6" max="6" attributes="0"/>
- <Component id="debugPortSpinner" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="204" max="-2" attributes="0"/>
- </Group>
- <Component id="noAskCheck" alignment="0" pref="393" max="32767" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="1" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
- <Component id="debugPortLable" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="debugPortSpinner" min="-2" max="-2" attributes="0"/>
- <EmptySpace type="separate" max="-2" attributes="0"/>
- <Component id="noAskCheck" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="debugPortLable">
- <Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/glassfish/javaee/ui/Bundle.properties" key="DebugPortQuery.debugPortLable.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- <Property name="verticalTextPosition" type="int" value="1"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JSpinner" name="debugPortSpinner">
- <Properties>
- <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
- <SpinnerModel initial="9009" maximum="65535" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
- </Property>
- </Properties>
- </Component>
- <Component class="javax.swing.JCheckBox" name="noAskCheck">
- <Properties>
- <Property name="selected" type="boolean" value="true"/>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/netbeans/modules/glassfish/javaee/ui/Bundle.properties" key="DebugPortQuery.noAskCheck.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
-</Form>
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.java
deleted file mode 100644
index 89a3c6b..0000000
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/ui/DebugPortQuery.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee.ui;
-
-import java.awt.Dimension;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author peterw99
- */
-public class DebugPortQuery extends javax.swing.JPanel {
-
- /** Creates new form DebugPortQuery */
- public DebugPortQuery() {
- initComponents();
- }
-
- public void setDebugPort(String debugPort) {
- try {
- int port = Integer.valueOf(debugPort);
- if(port > 0 && port < 65536) {
- debugPortSpinner.getModel().setValue(Integer.valueOf(port));
- } else {
- Logger.getLogger("payara-jakartaee").log(
- Level.INFO, "Debug port out of range in DebugPortQuery");
- }
- } catch(NumberFormatException ex) {
- Logger.getLogger("payara-jakartaee").log(
- Level.INFO, "Invalid debug port, using default = 9009.", ex);
- }
- }
-
- public String getDebugPort() {
- Object value = debugPortSpinner.getModel().getValue();
- return value != null ? value.toString() : "";
- }
-
- public boolean shouldPersist() {
- return noAskCheck.getModel().isSelected();
- }
-
- @Override
- public Dimension getPreferredSize() {
- // Bump height by 16% because GroupLayout doesn't resize properly when
- // label text uses HTML to wrap lines.
- Dimension preferredSize = super.getPreferredSize();
- preferredSize.height = preferredSize.height * 29 / 25;
- return preferredSize;
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
-
- debugPortLable = new javax.swing.JLabel();
- debugPortSpinner = new javax.swing.JSpinner();
- noAskCheck = new javax.swing.JCheckBox();
-
- debugPortLable.setText(org.openide.util.NbBundle.getMessage(DebugPortQuery.class, "DebugPortQuery.debugPortLable.text")); // NOI18N
- debugPortLable.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
-
- debugPortSpinner.setModel(new javax.swing.SpinnerNumberModel(9009, 1, 65535, 1));
-
- noAskCheck.setSelected(true);
- noAskCheck.setText(org.openide.util.NbBundle.getMessage(DebugPortQuery.class, "DebugPortQuery.noAskCheck.text")); // NOI18N
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(debugPortLable, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE)
- .addGroup(layout.createSequentialGroup()
- .addGap(6, 6, 6)
- .addComponent(debugPortSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(204, 204, 204))
- .addComponent(noAskCheck, javax.swing.GroupLayout.DEFAULT_SIZE, 393, Short.MAX_VALUE))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(debugPortLable, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(debugPortSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addComponent(noAskCheck, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- }// </editor-fold>//GEN-END:initComponents
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JLabel debugPortLable;
- private javax.swing.JSpinner debugPortSpinner;
- private javax.swing.JCheckBox noAskCheck;
- // End of variables declaration//GEN-END:variables
-
-}
diff --git a/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerResourceProperties.java b/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerResourceProperties.java
index 80582fa..b246d18 100644
--- a/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerResourceProperties.java
+++ b/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerResourceProperties.java
@@ -50,18 +50,6 @@ public class ServerResourceProperties extends NbTestCase {
Util.sleep(SLEEP);
}
- public void VerifyPreludeDerbyPool() {
- RuntimeTabOperator rto;
- rto = RuntimeTabOperator.invoke();
- Node derbynode = new Node(rto.tree(), "Servers|Prelude V3|Resources|JDBC|Connection Pools|DerbyPool");
- if (derbynode.isPresent()) {
- System.out.printf("Found JDBC Connection DerbyPool");
- }
- else {
- fail("JDBC Connection DerbyPool missing!");
- }
- }
-
public void serverProperties() {
RuntimeTabOperator rto;
String[] serverList;
@@ -78,27 +66,27 @@ public class ServerResourceProperties extends NbTestCase {
Util.sleep(SLEEP);
}
- public void VerifyDefaultDerbyPool() {
+ public void VerifyDefaultH2Pool() {
RuntimeTabOperator rto;
rto = RuntimeTabOperator.invoke();
- Node derbynode = new Node(rto.tree(), "Servers|Payara V3|Resources|JDBC|Connection Pools|DerbyPool");
- if (derbynode.isPresent()) {
- System.out.printf("Found JDBC Connection DerbyPool");
+ Node h2Node = new Node(rto.tree(), "Servers|Payara V3|Resources|JDBC|Connection Pools|H2Pool");
+ if (h2Node.isPresent()) {
+ System.out.printf("Found JDBC Connection H2Pool");
}
else {
- fail("JDBC Connection DerbyPool missing!");
+ fail("JDBC Connection H2Pool missing!");
}
}
- public void VerifyDefaultTimerResouce() {
+ public void VerifyDefaultTimerResource() {
RuntimeTabOperator rto;
rto = RuntimeTabOperator.invoke();
- Node derbynode = new Node(rto.tree(), "Servers|Payara V3|Resources|JDBC|JDBC Resources|jdbc/__TimerPool");
- if (derbynode.isPresent()) {
- System.out.printf("Found JDBC Resouce jdbc/sample");
+ Node h2Node = new Node(rto.tree(), "Servers|Payara V3|Resources|JDBC|JDBC Resources|jdbc/__TimerPool");
+ if (h2Node.isPresent()) {
+ System.out.printf("Found JDBC Resource jdbc/__TimerPool");
}
else {
- fail("JDBC Resoucec jdbc/sample missing!");
+ fail("JDBC Resource jdbc/__TimerPool missing!");
}
}
diff --git a/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerTest.java b/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerTest.java
index efa7052..406973e 100644
--- a/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerTest.java
+++ b/enterprise/payara.jakartaee/test/qa-functional/src/org/netbeans/modules/payara/jakartaee/test/ServerTest.java
@@ -45,7 +45,6 @@ public class ServerTest extends NbTestCase {
addTest(StartStopServer.class, "restartPreludeServer").
addTest(StartStopServer.class, "stopPreludeServer", "startDebugPreludeServer", "stopPreludeServer").
addTest(StartStopServer.class, "startPreludeServer").
- addTest(ServerResourceProperties.class, "VerifyPreludeDerbyPool").
addTest(StartStopServer.class, "stopPreludeServer");
String javaExe = System.getProperty("v3.server.javaExe");
@@ -55,8 +54,8 @@ public class ServerTest extends NbTestCase {
addTest(StartStopServer.class, "restartServer").
addTest(StartStopServer.class, "stopServer", "startDebugServer", "stopServer").
addTest(StartStopServer.class, "startServer").
- addTest(ServerResourceProperties.class, "VerifyDefaultDerbyPool").
- addTest(ServerResourceProperties.class, "VerifyDefaultTimerResouce").
+ addTest(ServerResourceProperties.class, "VerifyDefaultH2Pool").
+ addTest(ServerResourceProperties.class, "VerifyDefaultTimerResource").
addTest(StartStopServer.class, "stopServer");
}
return conf.enableModules(".*").clusters(".*").suite();
diff --git a/enterprise/payara.jakartaee/test/unit/src/org/netbeans/modules/payara/jakartaee/db/SunDatasourceTest.java b/enterprise/payara.jakartaee/test/unit/src/org/netbeans/modules/payara/jakartaee/db/SunDatasourceTest.java
deleted file mode 100644
index 55b2366..0000000
--- a/enterprise/payara.jakartaee/test/unit/src/org/netbeans/modules/payara/jakartaee/db/SunDatasourceTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-
-package org.netbeans.modules.payara.jakartaee.db;
-
-import org.netbeans.modules.payara.jakartaee.db.SunDatasource;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author vkraemer
- */
-public class SunDatasourceTest {
-
- public SunDatasourceTest() {
- }
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception {
- }
-
- @Before
- public void setUp() {
- }
-
- @After
- public void tearDown() {
- }
-
- /**
- * Test of equals method, of class SunDatasource.
- */
- @Test
- public void testEquals() {
- Object obj = null;
- String a="A";
- String b="B";
- String c="C";
- String d="D";
- String e="E";
- SunDatasource instance = new SunDatasource(a,b,c,d,e);
- boolean expResult = false;
- boolean result = instance.equals(obj);
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- obj = "String";
- expResult = false;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource("a","b","c","d","e");
- expResult = false;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource("A","B","C","D","E");
- expResult = true;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource(a,b,c,d,e);
- expResult = true;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- }
-
- /**
- * Test of equals method, of class SunDatasource, when at least one field
- * is set to null (resulting from a missing property for example).
- */
- @Test
- public void testEqualsNull() {
- Object obj = null;
- String a="A";
- String b="B";
- String c="C";
- String d="D";
- String e=null;
- SunDatasource instance = new SunDatasource(a,b,c,d,e);
- boolean expResult = false;
- boolean result = instance.equals(obj);
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- //fail("The test case is a prototype.");
- obj = "String";
- expResult = false;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource("a","b","c","d","e");
- expResult = false;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource("A","B","C","D",null);
- expResult = true;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- obj = new SunDatasource(a,b,c,d,e);
- expResult = true;
- result = instance.equals(obj);
- assertEquals(expResult, result);
- }
-}
diff --git a/enterprise/payara.tooling/manifest.mf b/enterprise/payara.tooling/manifest.mf
index 9d473be..01d86ab 100644
--- a/enterprise/payara.tooling/manifest.mf
+++ b/enterprise/payara.tooling/manifest.mf
@@ -2,5 +2,4 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.payara.tooling/0
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/payara/tooling/Bundle.properties
-OpenIDE-Module-Specification-Version: 2.5
-
+OpenIDE-Module-Specification-Version: 2.5.1
diff --git a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
index b778f88..dc44092 100644
--- a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
+++ b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
@@ -1,5 +1,5 @@
#Signature file v4.1
-#Version 2.4
+#Version 2.5.1
CLSS public abstract interface java.io.Closeable
intf java.lang.AutoCloseable
@@ -2358,8 +2358,7 @@ fld public final static java.lang.String MANIFEST_COMPONENTS_SEPARATOR = ";"
fld public final static java.lang.String MANIFEST_EOL = "%%%EOL%%%"
fld public final static java.lang.String MANIFEST_RESOURCES_SEPARATOR = "[,;]"
fld public final static java.lang.String PF_COMMON_UTIL_JAR = "common-util.jar"
-fld public final static java.lang.String PF_DERBY_DIR_NAME = "javadb"
-fld public final static java.lang.String PF_DERBY_ROOT_PROPERTY = "com.sun.aas.derbyRoot"
+fld public final static java.lang.String PF_H2_DIR_NAME = "h2db"
fld public final static java.lang.String PF_DOMAINS_DIR_NAME = "domains"
fld public final static java.lang.String PF_DOMAIN_CONFIG_DIR_NAME = "config"
fld public final static java.lang.String PF_DOMAIN_CONFIG_FILE_NAME = "domain.xml"
@@ -2397,7 +2396,7 @@ meth public static java.io.File getJerseyCommonJarInModules(java.lang.String)
meth public static java.io.File getServerLogFile(org.netbeans.modules.payara.tooling.data.PayaraServer)
meth public static java.lang.String basicAuthCredentials(java.lang.String,java.lang.String)
meth public static java.lang.String cmdLineArgument(java.lang.String,java.lang.String)
-meth public static java.lang.String getDerbyRoot(org.netbeans.modules.payara.tooling.data.PayaraServer)
+meth public static java.lang.String getH2Root(org.netbeans.modules.payara.tooling.data.PayaraServer)
meth public static java.lang.String getDomainConfigFile(java.lang.String,java.lang.String)
meth public static java.lang.String getDomainConfigPath(java.lang.String)
meth public static java.lang.String getDomainPath(org.netbeans.modules.payara.tooling.data.PayaraServer)
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/ServerTasks.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/ServerTasks.java
index ad9761b..935c3a6 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/ServerTasks.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/server/ServerTasks.java
@@ -83,8 +83,8 @@ public class ServerTasks {
varMap.put(ServerUtils.PF_DOMAIN_ROOT_PROPERTY,
ServerUtils.getDomainPath(server));
varMap.put(ServerUtils.PF_JAVA_ROOT_PROPERTY, javaHome);
- varMap.put(ServerUtils.PF_DERBY_ROOT_PROPERTY,
- ServerUtils.getDerbyRoot(server));
+ varMap.put(ServerUtils.PF_H2_DIR_NAME,
+ ServerUtils.getH2Root(server));
return varMap;
}
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/utils/ServerUtils.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/utils/ServerUtils.java
index 4dbb217..6896f85 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/utils/ServerUtils.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/utils/ServerUtils.java
@@ -142,10 +142,6 @@ public class ServerUtils {
public static final String PF_DOMAIN_ROOT_PROPERTY
= "com.sun.aas.instanceRoot";
- /** Payara server Derby root property name. */
- public static final String PF_DERBY_ROOT_PROPERTY
- = "com.sun.aas.derbyRoot";
-
/** Payara server home subdirectory filter instance. */
public static final PayaraFilter PF_HOME_DIR_FILTER
= new PayaraFilter();
@@ -162,8 +158,8 @@ public class ServerUtils {
/** Payara server modules subdirectory. */
public static final String PF_MODULES_DIR_NAME = "modules";
- /** Payara server Derby subdirectory. */
- public static final String PF_DERBY_DIR_NAME = "javadb";
+ /** Payara server H2 subdirectory. */
+ public static final String PF_H2_DIR_NAME = "h2db";
/** Payara server libraries subdirectory. */
public static final String PF_LIB_DIR_NAME = "lib";
@@ -882,22 +878,22 @@ public class ServerUtils {
}
/**
- * Get Payara server derby root full path.
+ * Get Payara server h2 db root full path.
* <p/>
* @param server Payara server entity
- * @return Payara server derby root full path or <code>null</code>
+ * @return Payara server h2 root full path or <code>null</code>
* when server server installation directory is not set.
*/
- public static String getDerbyRoot(final PayaraServer server) {
+ public static String getH2Root(final PayaraServer server) {
String serverRoot = server.getServerRoot();
if (serverRoot == null) {
return null;
}
StringBuilder sb = new StringBuilder(serverRoot.length()
- + File.separator.length() + PF_DERBY_DIR_NAME.length());
+ + File.separator.length() + PF_H2_DIR_NAME.length());
sb.append(serverRoot);
sb.append(File.separator);
- sb.append(PF_DERBY_DIR_NAME);
+ sb.append(PF_H2_DIR_NAME);
return sb.toString();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists