mirror of https://github.com/sipwise/jitsi.git
Changed the name of the activator. We'll no longer have osgi activators with a simple Activator name as it looks ugly in javadocs.
parent
0e3cdcc1b6
commit
b7cf83ca42
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.configuration;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.service.configuration.*;
|
||||
import net.java.sip.communicator.util.Logger;
|
||||
import java.io.*;
|
||||
import net.java.sip.communicator.util.xml.*;
|
||||
import net.java.sip.communicator.impl.configuration.xml.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ConfigurationActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private Logger logger = Logger.getLogger(ConfigurationServiceImpl.class);
|
||||
private ConfigurationServiceImpl impl = new ConfigurationServiceImpl();
|
||||
|
||||
/**
|
||||
* Starts the configuration service
|
||||
*
|
||||
* @param bundleContext the BundleContext as provided from the osgi
|
||||
* framework.
|
||||
* @throws Exception if anything goes wrong
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
logger.logEntry();
|
||||
|
||||
logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]");
|
||||
|
||||
bundleContext.registerService( ConfigurationService.class.getName(),
|
||||
impl,
|
||||
new java.util.Hashtable() );
|
||||
|
||||
logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]");
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.logExit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Causes the configuration service to store the properties object and
|
||||
* unregisters the configuration servcice.
|
||||
*
|
||||
* @param bundlecontext BundleContext
|
||||
* @throws Exception
|
||||
*/
|
||||
public void stop(BundleContext bundlecontext) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
logger.logEntry();
|
||||
logger.info("The ConfigurationService stop method has been called.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.logEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.contactlist;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.contactlist.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ContactlistActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(ContactlistActivator.class);
|
||||
|
||||
ServiceRegistration mclServiceRegistration = null;
|
||||
/**
|
||||
* Called when this bundle is started.
|
||||
*
|
||||
* @param context The execution context of the bundle being started.
|
||||
* @throws Exception If
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception
|
||||
{
|
||||
logger.debug("Service Impl: " + getClass().getName() + " [ STARTED ]");
|
||||
Hashtable hashtable = new Hashtable();
|
||||
|
||||
MetaContactListServiceImpl mclServiceImpl =
|
||||
new MetaContactListServiceImpl();
|
||||
|
||||
//reg the icq account man.
|
||||
mclServiceRegistration = context.registerService(
|
||||
MetaContactListService.class.getName(),
|
||||
mclServiceImpl,
|
||||
hashtable);
|
||||
|
||||
mclServiceImpl.start(context);
|
||||
|
||||
logger.debug("Service Impl: " + getClass().getName() + " [REGISTERED]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this bundle is stopped so the Framework can perform the
|
||||
* bundle-specific activities necessary to stop the bundle.
|
||||
*
|
||||
* @param 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.
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package net.java.sip.communicator.impl.fileaccess;
|
||||
|
||||
import org.ungoverned.gravity.servicebinder.GenericActivator;
|
||||
|
||||
/**
|
||||
* Invoke "Service Binder" to parse the service XML and register
|
||||
* all services.
|
||||
*
|
||||
* @author Alexander Pelov
|
||||
*/
|
||||
public class FileAccessActivator extends GenericActivator {
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package net.java.sip.communicator.impl.gui;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.main.CommunicatorMain;
|
||||
import net.java.sip.communicator.impl.gui.main.login.LoginManager;
|
||||
import net.java.sip.communicator.service.contactlist.MetaContactListService;
|
||||
import net.java.sip.communicator.service.gui.UIService;
|
||||
import net.java.sip.communicator.util.Logger;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
|
||||
|
||||
public class GuiActivator implements BundleActivator
|
||||
{
|
||||
private Logger logger = Logger.getLogger(GuiActivator.class.getName());
|
||||
|
||||
private UIService uiService = null;
|
||||
|
||||
private CommunicatorMain communicatorMain = new CommunicatorMain();
|
||||
|
||||
private LoginManager loginManager;
|
||||
|
||||
|
||||
public void start(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
this.loginManager = new LoginManager(bundleContext);
|
||||
|
||||
this.loginManager.setMainFrame(communicatorMain.getMainFrame());
|
||||
|
||||
try
|
||||
{
|
||||
ServiceReference clistReference
|
||||
= bundleContext.getServiceReference
|
||||
(MetaContactListService.class.getName());
|
||||
|
||||
MetaContactListService contactListService
|
||||
= (MetaContactListService)bundleContext
|
||||
.getService(clistReference);
|
||||
|
||||
logger.logEntry();
|
||||
|
||||
//Create the ui service
|
||||
this.uiService =
|
||||
new UIServiceImpl();
|
||||
|
||||
logger.info("UI Service...[ STARTED ]");
|
||||
|
||||
bundleContext.registerService(
|
||||
UIService.class.getName(), this.uiService, null);
|
||||
|
||||
logger.info("UI Service ...[REGISTERED]");
|
||||
|
||||
|
||||
this.communicatorMain.getMainFrame()
|
||||
.setContactList(contactListService);
|
||||
|
||||
this.communicatorMain.showCommunicator();
|
||||
|
||||
SwingUtilities.invokeLater(new RunLogin());
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.logExit();
|
||||
}
|
||||
}
|
||||
|
||||
public void stop(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
logger.info("UI Service ...[STOPPED]");
|
||||
}
|
||||
|
||||
|
||||
private class RunLogin implements Runnable {
|
||||
|
||||
public void run() {
|
||||
|
||||
loginManager.showLoginWindows(communicatorMain.getMainFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.history;
|
||||
|
||||
import org.ungoverned.gravity.servicebinder.GenericActivator;
|
||||
|
||||
/**
|
||||
* Invoke "Service Binder" to parse the service XML and register
|
||||
* all services.
|
||||
*
|
||||
* @author Alexander Pelov
|
||||
*/
|
||||
public class HistoryActivator extends GenericActivator {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.media;
|
||||
|
||||
import org.ungoverned.gravity.servicebinder.GenericActivator;
|
||||
|
||||
/**
|
||||
* Invoke "Service Binder" to parse the service XML and register
|
||||
* all services.
|
||||
*
|
||||
* @author Martin Andre
|
||||
*/
|
||||
public class MediaActivator extends GenericActivator {
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.netaddr;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.service.configuration.ConfigurationService;
|
||||
import net.java.sip.communicator.service.netaddr.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
* The activator manage the the bundles between OSGi framework and the
|
||||
* Network address manager
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Pierre Floury
|
||||
*/
|
||||
public class NetaddrActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private static Logger logger =
|
||||
Logger.getLogger(NetworkAddressManagerServiceImpl.class);
|
||||
|
||||
private NetworkAddressManagerServiceImpl networkAMS = null;
|
||||
|
||||
/**
|
||||
* Creates a NetworkAddressManager, starts it, and registers it as a
|
||||
* NetworkAddressManagerService.
|
||||
*
|
||||
* @param bundleContext OSGI bundle context
|
||||
* @throws Exception if starting the NetworkAddressManagerFails.
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception
|
||||
{
|
||||
try{
|
||||
|
||||
logger.logEntry();
|
||||
// get the config service
|
||||
ServiceReference refConfig = bundleContext.getServiceReference(
|
||||
ConfigurationService.class.getName());
|
||||
|
||||
ConfigurationService configurationService = (ConfigurationService)
|
||||
bundleContext.getService(refConfig);
|
||||
|
||||
//Create and start the network address manager.
|
||||
networkAMS =
|
||||
new NetworkAddressManagerServiceImpl(configurationService);
|
||||
|
||||
// give references to the NetworkAddressManager implementation
|
||||
networkAMS.start();
|
||||
|
||||
logger.info("Network Address Manager ...[ STARTED ]");
|
||||
|
||||
bundleContext.registerService(
|
||||
NetworkAddressManagerService.class.getName(), networkAMS, null);
|
||||
|
||||
logger.info("Network Address Manager Service ...[REGISTERED]");
|
||||
}
|
||||
finally
|
||||
{
|
||||
logger.logExit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the Networ Address Manager bundle
|
||||
*
|
||||
* @param bundleContext the OSGI bundle context
|
||||
*
|
||||
*/
|
||||
public void stop(BundleContext bundleContext)
|
||||
{
|
||||
if(networkAMS != null)
|
||||
networkAMS.stop();
|
||||
logger.info("Network Address Manager Service ...[STOPPED]");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package net.java.sip.communicator.impl.protocol.icq;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
import java.util.Hashtable;
|
||||
import net.java.sip.communicator.service.configuration.*;
|
||||
|
||||
/**
|
||||
* Loads the ICQ account manager and registers it with service in the OSGI
|
||||
* bundle context.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class IcqActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
ServiceRegistration icqAccManRegistration = null;
|
||||
|
||||
/**
|
||||
* Called when this bundle is started so the Framework can perform the
|
||||
* bundle-specific activities necessary to start this bundle.
|
||||
*
|
||||
* @param context The execution context of the bundle being started.
|
||||
* @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.
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception
|
||||
{
|
||||
Hashtable hashtable = new Hashtable();
|
||||
hashtable.put(AccountManager.PROTOCOL_PROPERTY_NAME, "ICQ");
|
||||
|
||||
AccountManagerIcqImpl icqAccountManager =
|
||||
new AccountManagerIcqImpl();
|
||||
|
||||
ServiceReference confReference
|
||||
= context.getServiceReference(ConfigurationService.class.getName());
|
||||
ConfigurationService configurationService
|
||||
= (ConfigurationService)context.getService(confReference);
|
||||
|
||||
//load all icq providers
|
||||
icqAccountManager.loadStoredAccounts(context, configurationService);
|
||||
|
||||
//reg the icq account man.
|
||||
icqAccManRegistration = context.registerService(
|
||||
AccountManager.class.getName(),
|
||||
icqAccountManager,
|
||||
hashtable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this bundle is stopped so the Framework can perform the
|
||||
* bundle-specific activities necessary to stop the bundle.
|
||||
*
|
||||
* @param 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.
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception
|
||||
{
|
||||
icqAccManRegistration.unregister();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.impl.protocol.sip;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
import net.java.sip.communicator.util.*;
|
||||
|
||||
/**
|
||||
* Activates the SIP package
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class SipActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private Logger logger = Logger.getLogger(SipActivator.class.getName());
|
||||
|
||||
/**
|
||||
* Called when this bundle is started so the Framework can perform the
|
||||
* bundle-specific activities necessary to start this bundle.
|
||||
*
|
||||
* @param context The execution context of the bundle being started.
|
||||
* @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.
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception
|
||||
{
|
||||
logger.debug("Started.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this bundle is stopped so the Framework can perform the
|
||||
* bundle-specific activities necessary to stop the bundle.
|
||||
*
|
||||
* @param 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.
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception
|
||||
{
|
||||
logger.debug("Stopped.");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue