Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.argdelegation
Class ArgDelegationPeerImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.argdelegation.ArgDelegationPeerImpl
All Implemented Interfaces:
EventListener, ArgDelegationPeer, org.osgi.framework.ServiceListener

public class ArgDelegationPeerImpl
extends Object
implements ArgDelegationPeer, org.osgi.framework.ServiceListener

Implements the UriDelegationPeer interface from our argument handler utility. We use this handler to relay arguments to URI handlers that have been registered from other services such as the SIP provider for example.

Author:
Emil Ivov

Constructor Summary
ArgDelegationPeerImpl(org.osgi.framework.BundleContext bundleContext)
          Creates an instance of this peer and scans bundleContext for all existing UriHandler
 
Method Summary
 void handleConcurrentInvocationRequest()
          This method would simply bring the application on focus as it is called when the user has tried to launch a second instance of SIP Communicator while a first one was already running.
 void handleUri(String uriArg)
          Relays uirArg to the corresponding handler or shows an error message in case no handler has been registered for the corresponding protocol.
 void serviceChanged(org.osgi.framework.ServiceEvent event)
          Listens for UriHandlers that are registered in the bundle context after we had started so that we could add them to the list of currently known handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgDelegationPeerImpl

public ArgDelegationPeerImpl(org.osgi.framework.BundleContext bundleContext)
Creates an instance of this peer and scans bundleContext for all existing UriHandler

Parameters:
bundleContext - a reference to a currently valid instance of a bundle context.
Method Detail

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent event)
Listens for UriHandlers that are registered in the bundle context after we had started so that we could add them to the list of currently known handlers.

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
Parameters:
event - the event containing the newly (un)registered service.

handleUri

public void handleUri(String uriArg)
Relays uirArg to the corresponding handler or shows an error message in case no handler has been registered for the corresponding protocol.

Specified by:
handleUri in interface ArgDelegationPeer
Parameters:
uriArg - the uri that we've been passed and that we'd like to delegate to the corresponding provider.

handleConcurrentInvocationRequest

public void handleConcurrentInvocationRequest()
This method would simply bring the application on focus as it is called when the user has tried to launch a second instance of SIP Communicator while a first one was already running. Future implementations may also show an error/information message to the user notifying them that a second instance is not to be launched.

Specified by:
handleConcurrentInvocationRequest in interface ArgDelegationPeer

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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