Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.util
Class UtilActivator

java.lang.Object
  extended by net.java.sip.communicator.util.UtilActivator
All Implemented Interfaces:
Thread.UncaughtExceptionHandler, org.osgi.framework.BundleActivator

public class UtilActivator
extends Object
implements org.osgi.framework.BundleActivator, Thread.UncaughtExceptionHandler

The only raison d'etre for this Activator is so that it would set a global exception handler. It doesn't export any services and neither it runs any initialization - all it does is call Thread.setUncaughtExceptionHandler()

Author:
Emil Ivov

Constructor Summary
UtilActivator()
           
 
Method Summary
static ConfigurationService getConfigurationService()
          Returns the ConfigurationService currently registered.
static BufferedImage getImage(String imageID)
          Returns the image corresponding to the given imageID.
static KeybindingsService getKeybindingsService()
          Returns the KeybindingsService currently registered.
static NetworkAddressManagerService getNetworkAddressManagerService()
          Returns the service giving access to current network configuration.
static ResourceManagementService getResources()
          Returns the service giving access to all application resources.
 void start(org.osgi.framework.BundleContext context)
          Calls Thread.setUncaughtExceptionHandler()
 void stop(org.osgi.framework.BundleContext context)
          Doesn't do anything.
 void uncaughtException(Thread thread, Throwable exc)
          Method invoked when a thread would terminate due to the given uncaught exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilActivator

public UtilActivator()
Method Detail

start

public void start(org.osgi.framework.BundleContext context)
           throws Exception
Calls Thread.setUncaughtExceptionHandler()

Specified by:
start in interface org.osgi.framework.BundleActivator
Parameters:
context - The execution context of the bundle being started (unused).
Throws:
Exception - If this method throws an exception, this bundle is marked as stopped and the Framework will remove this bundle's listeners, unregister all services registered by this bundle, and release all services used by this bundle.

uncaughtException

public void uncaughtException(Thread thread,
                              Throwable exc)
Method invoked when a thread would terminate due to the given uncaught exception. All we do here is simply log the exception using the system logger.

Any exception thrown by this method will be ignored by the Java Virtual Machine and thus won't screw our application.

Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler
Parameters:
thread - the thread
exc - the exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws Exception
Doesn't do anything.

Specified by:
stop in interface org.osgi.framework.BundleActivator
Parameters:
context - The execution context of the bundle being stopped.
Throws:
Exception - If this method throws an exception, the bundle is still marked as stopped, and the Framework will remove the bundle's listeners, unregister all services registered by the bundle, and release all services used by the bundle.

getConfigurationService

public static ConfigurationService getConfigurationService()
Returns the ConfigurationService currently registered.

Returns:
the ConfigurationService

getKeybindingsService

public static KeybindingsService getKeybindingsService()
Returns the KeybindingsService currently registered.

Returns:
the KeybindingsService

getResources

public static ResourceManagementService getResources()
Returns the service giving access to all application resources.

Returns:
the service giving access to all application resources.

getNetworkAddressManagerService

public static NetworkAddressManagerService getNetworkAddressManagerService()
Returns the service giving access to current network configuration.

Returns:
the service giving access to current network configuration.

getImage

public static BufferedImage getImage(String imageID)
Returns the image corresponding to the given imageID.

Parameters:
imageID - the identifier of the image
Returns:
the image corresponding to the given imageID

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.