Make an Update service.

cusax-fix
Yana Stamcheva 15 years ago
parent d512582ad6
commit fc8a0591ea

@ -911,7 +911,7 @@
bundle-notification-config,bundle-contacteventhandler,
bundle-plugin-contactinfo,bundle-plugin-chatalerter, bundle-keybindings,
bundle-plugin-keybindingChooser,bundle-plugin-globalproxyconfig,
bundle-jfontchooserlib,bundle-plugin-update,
bundle-jfontchooserlib,bundle-update,bundle-plugin-update,
bundle-plugin-simpleaccreg,bundle-plugin-generalconfig,
bundle-plugin-googletalkaccregwizz,bundle-argdelegation-service,
bundle-argdelegation,bundle-zrtp4j,bundle-json,
@ -2110,7 +2110,17 @@ javax.swing.event, javax.swing.border"/>
</jar>
</target>
<!--BUNDLE-UPDATE-->
<!-- BUNDLE-UPDATE-->
<target name="bundle-update">
<!-- Creates a bundle containing the provisioning discovery service.-->
<jar compress="false" destfile="${bundles.dest}/updateservice.jar"
manifest="${src}/net/java/sip/communicator/service/update/update.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/service/update"
prefix="net/java/sip/communicator/service/update"/>
</jar>
</target>
<!--BUNDLE-PLUGIN-WIN-UPDATE-->
<target name="bundle-plugin-update">
<jar compress="false" destfile="${bundles.dest}/update.jar"
manifest="${src}/net/java/sip/communicator/plugin/update/update.manifest.mf">

@ -48,7 +48,8 @@ felix.auto.start.40= \
reference:file:sc-bundles/resourcemanager.jar \
reference:file:sc-bundles/jfontchooserlib.jar \
reference:file:sc-bundles/netaddr.jar \
reference:file:sc-bundles/browserlauncher.jar
reference:file:sc-bundles/browserlauncher.jar \
reference:file:sc-bundles/updateservice.jar
felix.auto.start.42= \
reference:file:sc-bundles/credentialsstorage.jar \

@ -44,7 +44,7 @@ public CheckForUpdatesMenuItemComponent(Container container)
{
public void actionPerformed(ActionEvent e)
{
Update.checkForUpdates(true);
UpdateActivator.getUpdateService().checkForUpdates(true);
}
});
}

@ -19,6 +19,7 @@
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.httputil.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.service.update.UpdateService;
import net.java.sip.communicator.service.version.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@ -31,6 +32,7 @@
* @author Lyubomir Marinov
*/
public class Update
implements UpdateService
{
/**
* The <tt>Logger</tt> used by the <tt>Update</tt> class for logging output.
@ -82,7 +84,7 @@ public class Update
* notified if they have the newest version already; otherwise,
* <tt>false</tt>
*/
public static synchronized void checkForUpdates(
public synchronized void checkForUpdates(
final boolean notifyAboutNewestVersion)
{
if (inCheckForUpdates > 0)

@ -12,6 +12,7 @@
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.shutdown.*;
import net.java.sip.communicator.service.update.UpdateService;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
@ -60,6 +61,11 @@ public class UpdateActivator
*/
private static UIService uiService;
/**
* The update service.
*/
private static UpdateService updateService;
/**
* Returns the <tt>BrowserLauncherService</tt> obtained from the bundle
* context.
@ -144,6 +150,13 @@ public void start(BundleContext bundleContext) throws Exception
if (OSUtils.IS_WINDOWS)
{
updateService = new Update();
bundleContext.registerService(
UpdateService.class.getName(),
updateService,
null);
// Register the "Check for Updates" menu item.
CheckForUpdatesMenuItemComponent checkForUpdatesMenuItemComponent
= new CheckForUpdatesMenuItemComponent(
@ -163,7 +176,7 @@ public void start(BundleContext bundleContext) throws Exception
// Check for software update upon startup if enabled.
ConfigurationService cfg = getConfiguration();
if(cfg.getBoolean(UPDATE_ENABLED, true))
Update.checkForUpdates(false);
updateService.checkForUpdates(false);
}
if (logger.isDebugEnabled())
@ -180,4 +193,14 @@ public void stop(BundleContext bundleContext) throws Exception
if (logger.isDebugEnabled())
logger.debug("Update checker [STOPPED]");
}
/**
* Returns the update service instance.
*
* @return the update service instance
*/
static UpdateService getUpdateService()
{
return updateService;
}
}

@ -15,6 +15,7 @@ Import-Package: org.osgi.framework,
net.java.sip.communicator.service.version,
net.java.sip.communicator.util,
net.java.sip.communicator.util.swing,
net.java.sip.communicator.service.update,
javax.imageio,
javax.net.ssl,
javax.swing,

@ -0,0 +1,24 @@
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.update;
/**
* Checking for software updates service.
*
* @author Yana Stamcheva
*/
public interface UpdateService
{
/**
* Checks for updates.
*
* @param notifyAboutNewestVersion <tt>true</tt> if the user is to be
* notified if they have the newest version already; otherwise,
* <tt>false</tt>
*/
public void checkForUpdates(boolean notifyAboutNewestVersion);
}

@ -0,0 +1,6 @@
Bundle-Description: Checks for software updates
Bundle-Name: Update Service
Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Export-Package: net.java.sip.communicator.service.update
Loading…
Cancel
Save