atom feed1 message in net.java.dev.updatecenter.cvsCVS update: /updatecenter/commons/api...
FromSent OnAttachments
raje...@dev.java.netOct 25, 2007 6:45 pm 
Subject:CVS update: /updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/, /updatecenter/core/src/java/com/sun/enterprise/update/schedule/...
From:raje...@dev.java.net (raje@dev.java.net)
Date:Oct 25, 2007 6:45:56 pm
List:net.java.dev.updatecenter.cvs

User: rajeshwar Date: 2007-10-26 01:45:56+0000 Removed: updatecenter/core/src/java/com/sun/enterprise/update/schedule/UpdateStatus.java

Added: updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/UpdateStatus.java

Modified: updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/Scheduler.java updatecenter/core/src/java/com/sun/enterprise/update/schedule/LocalStrings.properties updatecenter/core/src/java/com/sun/enterprise/update/schedule/SchedulerImpl.java updatecenter/gui/src/java/com/sun/enterprise/update/ui/UpdateCenterMainPanel.java updatecenter/startup/src/java/com/sun/enterprise/update/UpdateCenterMain.java updatecenter/startup/src/java/com/sun/enterprise/update/desktop/UpdateCenterTray.java

Log: Issue number: 336 Exposed ObjectStatus object and doUpdateCheck() method as api. Catching(and ignoring) specific error-NoClassDefFoundError instead of
Throwable. Fixed the UI refresh issue when using tray icon to launch UI.

Reviewed by: Rochelle, Nazrul

File Changes:

Directory:
/updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/ =================================================================================

File [changed]: Scheduler.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/Scheduler.java?r1=1.4&r2=1.5 Delta lines: +15 -0

-------------------- --- Scheduler.java 2007-07-23 22:28:31+0000 1.4 +++ Scheduler.java 2007-10-26 01:45:21+0000 1.5 @@ -66,6 +66,21 @@ public int runUpdateCheck() throws UpdateFailureException;

/** + * This method is called to do an update check. + * + * @return UpdateStatusImpl the update status objects. + * It provides the number of new available updates as + * well as the number of new available softwares. + * @throws UpdateFailureException in case of failure + * + * @deprecated, replaced by {@link #doUpdateCheck()} + * This method returns the number of new updates + * available, whereas new method returns number + * of new software available in addition to updates. + */ + public UpdateStatus doUpdateCheck() throws UpdateFailureException; + + /** * Gets the configured event type. */ public EventType getEventType();

File [added]: UpdateStatus.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/commons/api/src/java/com/sun/enterprise/update/schedule/UpdateStatus.java?rev=1.2&content-type=text/vnd.viewcvs-markup Added lines: 75

--------------- /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can obtain * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. If applicable, add the following below the License * Header, with the fields enclosed by brackets [] replaced by your own * identifying information: "Portions Copyrighted [year] * [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */

package com.sun.enterprise.update.schedule;

/** * This class gives the status about available updates/modules. * * @author Satish Viswanatham */ public interface UpdateStatus {

/** * This method returns the modules */ public int getNumberOfModules();

/** * This method returns the module groups */ public int getNumberOfModuleGroups();

/** * This method returns the modules */ public void setNumberOfModules(int num);

/** * This method returns the module groups */ public void setNumberOfModuleGroups(int num);

/** * This method returns the new software */ public int getNumberOfNewSoftware();

/** * This method set new software */ public void setNumberOfNewSoftware(int num); }

Directory: /updatecenter/core/src/java/com/sun/enterprise/update/schedule/ ==========================================================================

File [changed]: LocalStrings.properties Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/core/src/java/com/sun/enterprise/update/schedule/LocalStrings.properties?r1=1.3&r2=1.4 Delta lines: +0 -5

------------------- --- LocalStrings.properties 2007-10-20 03:35:41+0000 1.3 +++ LocalStrings.properties 2007-10-26 01:45:22+0000 1.4 @@ -35,8 +35,3 @@ # MSG_UnknownEvent=Unknown event: {0}

-TITLE_Update_Available=Update Available -VALUE_Update_Available=An update has been installed. Restart is required.\n -LBL_Restart_Now=Restart Now -LBL_Shutdown=Shutdown -

File [changed]: SchedulerImpl.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/core/src/java/com/sun/enterprise/update/schedule/SchedulerImpl.java?r1=1.24&r2=1.25 Delta lines: +11 -23

--------------------- --- SchedulerImpl.java 2007-10-20 03:35:42+0000 1.24 +++ SchedulerImpl.java 2007-10-26 01:45:22+0000 1.25 @@ -101,19 +101,19 @@ /** * This method is called to do an update check. * - * @return UpdateStatusImpl the update status objects. + * @return UpdateStatus the update status objects. * It provides the number of new available updates as * well as the the number of new available softwares. * @throws UpdateFailureException in case of failure */ - public UpdateStatusImpl doUpdateCheck() throws UpdateFailureException { + public UpdateStatus doUpdateCheck() throws UpdateFailureException {

// this is manual check case if (evt == null) return null;

createInstallIdIfNotExists();

- UpdateStatusImpl us = null; + UpdateStatus us = null; try { ConfigManager cm = UpdateManager.getInstance().getConfigManager();

@@ -153,9 +153,14 @@ * * @return int the number of new updates available * @throws UpdateFailureException in case of failure + * + * @deprecated, replaced by {@link #doUpdateCheck()} + * This method returns the number of new updates + * available, whereas new method returns number + * of new software available in addition to updates. */ public int runUpdateCheck() throws UpdateFailureException { - UpdateStatusImpl updateStatus = doUpdateCheck(); + UpdateStatus updateStatus = doUpdateCheck(); int noOfUpdates = 0; if (updateStatus != null) { noOfUpdates = updateStatus.getNumberOfModules(); @@ -589,23 +594,8 @@ for(Module module : modules) { installManager.install(module.getCatalogName(),
module); } - - String updateTitle =
_strMgr.getString("TITLE_Update_Available"); - String nowOption = _strMgr.getString("LBL_Restart_Now"); - String[] options = new String[]{nowOption, - _strMgr.getString("LBL_Shutdown")}; - int result = JOptionPane.showOptionDialog(null, - _strMgr.getString("VALUE_Update_Available"),
updateTitle, - JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, - null, options, nowOption); - - if (result == JOptionPane.YES_OPTION) { // restart now + //Restart System.exit(2); - } else { - if (result == JOptionPane.NO_OPTION) { //shutdown - System.exit(0); - } - } } } } catch (Exception exception) { @@ -622,6 +612,4 @@ private static final long MILLI_SECS_IN_WEEK = 604800000; private static final long MILLI_SECS_IN_A_DAY = 86400000; private static final Logger logger =
Logger.getLogger(LogDomains.ROOT_LOGGER); - private static StringManager _strMgr = - StringManager.getManager(SchedulerImpl.class); }

File [removed]: UpdateStatus.java

Directory: /updatecenter/gui/src/java/com/sun/enterprise/update/ui/ ===================================================================

File [changed]: UpdateCenterMainPanel.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/gui/src/java/com/sun/enterprise/update/ui/UpdateCenterMainPanel.java?r1=1.50&r2=1.51 Delta lines: +1 -0

------------------- --- UpdateCenterMainPanel.java 2007-10-20 03:35:42+0000 1.50 +++ UpdateCenterMainPanel.java 2007-10-26 01:45:23+0000 1.51 @@ -137,6 +137,7 @@ // new modules/updates avialable. public void initialize() { setVisible(true); + refreshCurrentTab(); lastUpdate = new Date(); checkUpdateOfUpdateCenter(); }

Directory: /updatecenter/startup/src/java/com/sun/enterprise/update/ ====================================================================

File [changed]: UpdateCenterMain.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/startup/src/java/com/sun/enterprise/update/UpdateCenterMain.java?r1=1.20&r2=1.21 Delta lines: +8 -0

------------------- --- UpdateCenterMain.java 2007-07-23 22:28:49+0000 1.20 +++ UpdateCenterMain.java 2007-10-26 01:45:53+0000 1.21 @@ -138,6 +138,7 @@ { public void run() { + try { client = new UpdateCenterMainPanel(); client.setVisible(true); // do this AFTER the main frame is visible... @@ -146,6 +147,13 @@ if (jdic) { tray.setClient(client); } + } catch(NoClassDefFoundError error) { + //Ignore. We get this on update of
update center. + //At this point UC binaries are already
overwritten + //and user is seeing Restart/Shutdown
dialog. + //Restart/Shutdown dialog is displayed
on update of + //update center. + } } } );

Directory: /updatecenter/startup/src/java/com/sun/enterprise/update/desktop/ ============================================================================

File [changed]: UpdateCenterTray.java Url:
https://updatecenter.dev.java.net/source/browse/updatecenter/startup/src/java/com/sun/enterprise/update/desktop/UpdateCenterTray.java?r1=1.15&r2=1.16 Delta lines: +3 -3

------------------- --- UpdateCenterTray.java 2007-10-20 03:35:42+0000 1.15 +++ UpdateCenterTray.java 2007-10-26 01:45:54+0000 1.16 @@ -109,7 +109,7 @@ _client = new UpdateCenterMainPanel(); } _client.initialize(); - } catch (Throwable error) { + } catch (NoClassDefFoundError error) { //Ignore. User clicked/double-clicked tray icon //while Restart/Shutdown dialog is displayed. //Restart/Shutdown dialog is displayed on update @@ -126,7 +126,7 @@ _client = new UpdateCenterMainPanel(); } _client.initialize(); - } catch (Throwable error) { + } catch (NoClassDefFoundError error) { //Ignore. User clicked popup message //while Restart/Shutdown dialog is displayed. //Restart/Shutdown dialog is displayed on update @@ -154,7 +154,7 @@ _client = new UpdateCenterMainPanel(); } _client.initialize(); - } catch (Throwable error) { + } catch (NoClassDefFoundError error) { //Ignore. User right-clicked tray icon and selected //Start Update Center option while Restart/Shutdown //dialog is displayed. Restart/Shutdown dialog is