8700 Mysql mbean created in incorrect domain osol_111b
authorDavid Powell <David.Powell@sun.com>
Thu, 07 May 2009 14:16:28 -0700
changeset 295 ec3ac4f44cad
parent 294 ba609b54860b
child 296 25d7c333e3c8
8700 Mysql mbean created in incorrect domain 8701 fix SwingControl subclass property change registration ordering
usr/src/java/vpanels/panel/org/opensolaris/os/vp/panel/swing/control/SwingControl.java
usr/src/java/vpanels/panels/apache/org/opensolaris/os/vp/panels/apache/client/swing/GlobalControl.java
usr/src/java/vpanels/panels/coreadm/org/opensolaris/os/vp/panels/coreadm/client/swing/CoreAdmSettingsTab.java
usr/src/java/vpanels/panels/firewall/org/opensolaris/os/vp/panels/firewall/client/swing/FirewallSettingsTab.java
usr/src/java/vpanels/panels/mysql/nbproject/project.xml
usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/client/swing/MysqlLogsTab.java
usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/common/MysqlUtil.java
--- a/usr/src/java/vpanels/panel/org/opensolaris/os/vp/panel/swing/control/SwingControl.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panel/org/opensolaris/os/vp/panel/swing/control/SwingControl.java	Thu May 07 14:16:28 2009 -0700
@@ -124,7 +124,8 @@
      */
     @Override
     public void propertyChange(PropertyChangeEvent event) {
-	initComponentOnEventThread();
+	if (getComponent() != null)
+	    initComponentOnEventThread();
     }
 
     //
--- a/usr/src/java/vpanels/panels/apache/org/opensolaris/os/vp/panels/apache/client/swing/GlobalControl.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panels/apache/org/opensolaris/os/vp/panels/apache/client/swing/GlobalControl.java	Thu May 07 14:16:28 2009 -0700
@@ -26,13 +26,11 @@
 
 package org.opensolaris.os.vp.panels.apache.client.swing;
 
-import java.awt.Component;
 import java.awt.event.*;
 import java.beans.PropertyChangeListener;
 import java.net.URL;
 import java.util.Map;
 import org.opensolaris.os.scf.common.ScfException;
-import org.opensolaris.os.vp.common.smf.ServiceMXBean;
 import org.opensolaris.os.vp.panel.common.action.*;
 import org.opensolaris.os.vp.panel.common.control.*;
 import org.opensolaris.os.vp.panel.common.smf.ScfUtil;
@@ -57,7 +55,6 @@
 
     public GlobalControl(ApachePanelDescriptor descriptor) {
 	super(ID, NAME, descriptor);
-	descriptor.addPropertyChangeListener(this);
     }
 
     //
--- a/usr/src/java/vpanels/panels/coreadm/org/opensolaris/os/vp/panels/coreadm/client/swing/CoreAdmSettingsTab.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panels/coreadm/org/opensolaris/os/vp/panels/coreadm/client/swing/CoreAdmSettingsTab.java	Thu May 07 14:16:28 2009 -0700
@@ -63,8 +63,6 @@
     public CoreAdmSettingsTab(CoreAdmPanelDescriptor descriptor) {
 	super(ID, NAME, descriptor);
 
-	descriptor.addPropertyChangeListener(this);
-
 	CoreAdmSettingsPanel panel = createComponent();
 	setComponent(panel);
 
--- a/usr/src/java/vpanels/panels/firewall/org/opensolaris/os/vp/panels/firewall/client/swing/FirewallSettingsTab.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panels/firewall/org/opensolaris/os/vp/panels/firewall/client/swing/FirewallSettingsTab.java	Thu May 07 14:16:28 2009 -0700
@@ -26,7 +26,6 @@
 
 package org.opensolaris.os.vp.panels.firewall.client.swing;
 
-import java.awt.Component;
 import java.net.UnknownHostException;
 import java.util.Map;
 import java.util.logging.*;
@@ -53,7 +52,6 @@
 
     public FirewallSettingsTab(FirewallPanelDescriptor descriptor) {
 	super(ID, NAME, descriptor);
-	descriptor.addPropertyChangeListener(this);
     }
 
     //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/vpanels/panels/mysql/nbproject/project.xml	Thu May 07 14:16:28 2009 -0700
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  CDDL HEADER START
+ 
+  The contents of this file are subject to the terms of the
+  Common Development and Distribution License (the "License").
+  You may not use this file except in compliance with the License.
+ 
+  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+  or http://www.opensolaris.org/os/licensing.
+  See the License for the specific language governing permissions
+  and limitations under the License.
+ 
+  When distributing Covered Code, include this CDDL HEADER in each
+  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+  If applicable, add the following below this CDDL HEADER, with the
+  fields enclosed by brackets "[]" replaced with your own identifying
+  information: Portions Copyright [yyyy] [name of copyright owner]
+ 
+  CDDL HEADER END
+ 
+  Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+  Use is subject to license terms.
+-->
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.ant.freeform</type>
+    <configuration>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+            <name>vpanels-panels-mysql</name>
+        </general-data>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
+            <!-- Do not use Project Properties customizer when editing this file manually. -->
+            <name>vpanels-panels-mysql</name>
+            <properties/>
+            <folders>
+                <source-folder>
+                    <label>Source Packages</label>
+                    <location>.</location>
+                    <includes>org/</includes>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+                <source-folder>
+                    <label>Source Packages</label>
+                    <type>java</type>
+                    <location>.</location>
+                    <includes>org/</includes>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+                <source-folder>
+                    <label>build/gen</label>
+                    <type>java</type>
+                    <location>build/gen</location>
+                    <includes>org/</includes>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+            </folders>
+            <ide-actions>
+                <action name="build">
+                    <target>jar</target>
+                </action>
+                <action name="clean">
+                    <target>clobber</target>
+                </action>
+                <action name="javadoc">
+                    <target>javadoc</target>
+                </action>
+                <action name="rebuild">
+                    <target>jar</target>
+                    <target>clobber</target>
+                </action>
+            </ide-actions>
+            <export>
+                <type>jar</type>
+                <location>vpanels-panels-mysql.jar</location>
+                <build-target>jar</build-target>
+            </export>
+            <view>
+                <items>
+                    <source-folder style="packages">
+                        <label>Source Packages</label>
+                        <location>.</location>
+                        <includes>org/</includes>
+                    </source-folder>
+                    <source-folder style="packages">
+                        <label>build/gen</label>
+                        <location>build/gen</location>
+                        <includes>org/</includes>
+                    </source-folder>
+                    <source-file>
+                        <location>build.xml</location>
+                    </source-file>
+                </items>
+                <context-menu>
+                    <ide-action name="build"/>
+                    <ide-action name="rebuild"/>
+                    <ide-action name="clean"/>
+                    <ide-action name="javadoc"/>
+                </context-menu>
+            </view>
+            <subprojects/>
+        </general-data>
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
+            <compilation-unit>
+                <package-root>.</package-root>
+                <package-root>build/gen</package-root>
+                <classpath mode="compile">../../../scf/common/scf-common.jar:../../../util/vpanels-util.jar:../../common/vpanels-common.jar:../../panel/vpanels-panel.jar:../../server/vpanels-server.jar</classpath>
+                <built-to>vpanels-panels-mysql.jar</built-to>
+                <source-level>1.5</source-level>
+            </compilation-unit>
+        </java-data>
+    </configuration>
+</project>
--- a/usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/client/swing/MysqlLogsTab.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/client/swing/MysqlLogsTab.java	Thu May 07 14:16:28 2009 -0700
@@ -26,7 +26,8 @@
 
 package org.opensolaris.os.vp.panels.mysql.client.swing;
 
-import java.awt.Component;
+import java.util.Map;
+import org.opensolaris.os.vp.panel.common.control.*;
 import org.opensolaris.os.vp.panel.swing.control.SwingSettingsControl;
 import org.opensolaris.os.vp.util.misc.Finder;
 
@@ -48,7 +49,6 @@
 
     public MysqlLogsTab(MysqlAdmPanelDescriptor descriptor) {
 	super(ID, NAME, descriptor);
-	descriptor.addPropertyChangeListener(this);
     }
 
     //
@@ -64,4 +64,25 @@
     protected void initComponent() {
 	getComponent().init(getPanelDescriptor());
     }
+
+    //
+    // Control methods
+    //
+    @Override
+    public void start(Navigator navigator, Map<String, String> parameters)
+	throws NavigationAbortedException, InvalidParameterException {
+
+	getPanelDescriptor().addPropertyChangeListener(this);
+	try {
+	    super.start(navigator, parameters);
+	} finally {
+	    getPanelDescriptor().removePropertyChangeListener(this);
+	}
+    }
+
+    @Override
+    public void stop() throws NavigationAbortedException {
+	super.stop();
+	getPanelDescriptor().removePropertyChangeListener(this);
+    }
 }
--- a/usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/common/MysqlUtil.java	Mon May 04 17:24:54 2009 -0700
+++ b/usr/src/java/vpanels/panels/mysql/org/opensolaris/os/vp/panels/mysql/common/MysqlUtil.java	Thu May 07 14:16:28 2009 -0700
@@ -30,7 +30,7 @@
 import org.opensolaris.os.vp.common.panel.MBeanUtil;
 
 public class MysqlUtil {
-    public static final String DOMAIN = MBeanUtil.VP_PANEL_DOMAIN + "mysql";
+    public static final String DOMAIN = MBeanUtil.VP_PANEL_DOMAIN + ".mysql";
     public static final ObjectName OBJECT_NAME =
         MBeanUtil.makeObjectName(DOMAIN, "Mysql");
 }