Changed the name of the activator. We'll no longer have osgi activators with a simple Activator name as it looks ugly in javadocs.

cusax-fix
Emil Ivov 20 years ago
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();
}
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.configuration.Activator
Bundle-Activator: net.java.sip.communicator.impl.configuration.ConfigurationActivator
Bundle-Name: Configuration Service Implementation
Bundle-Description: A bundle that offers configuration utilities
Bundle-Vendor: sip-communicator.org
@ -15,4 +15,3 @@ Import-Package: org.osgi.framework,
net.java.sip.communicator.util.xml,
Export-Package: net.java.sip.communicator.service.configuration,
net.java.sip.communicator.service.configuration.event,
net.java.sip.communicator.impl.configuration.xml,

@ -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
{
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.contactlist.Activator
Bundle-Activator: net.java.sip.communicator.impl.contactlist.ContactlistActivator
Bundle-Name: MetaContactList
Bundle-Description: An implementation of the MetaContactList service.
Bundle-Vendor: sip-communicator.org

@ -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 {
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.fileaccess.Activator
Bundle-Activator: net.java.sip.communicator.impl.fileaccess.FileAccessActivator
Bundle-Name: File Access Service Provider
Bundle-Description: A bundle that implements the file access package.
Bundle-Vendor: sip-communicator.org
@ -19,4 +19,4 @@ Import-Package: org.ungoverned.gravity.servicebinder,
net.java.sip.communicator.util.xml,
Export-Package: net.java.sip.communicator.service.fileaccess,
net.java.sip.communicator.impl.fileaccess,
Metadata-Location: /net/java/sip/communicator/impl/fileaccess/fileaccess.metadata.xml
Metadata-Location: /net/java/sip/communicator/impl/fileaccess/fileaccess.metadata.xml

@ -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());
}
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.gui.Activator
Bundle-Activator: net.java.sip.communicator.impl.gui.GuiActivator
Bundle-Name: UI Service Provider Implementation
Bundle-Description: An implementation of the UI service.
Bundle-Vendor: sip-communicator.org

@ -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 {
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.history.Activator
Bundle-Activator: net.java.sip.communicator.impl.history.HistoryActivator
Bundle-Name: History Service Provider
Bundle-Description: A bundle that implements the history package.
Bundle-Vendor: sip-communicator.org
@ -25,4 +25,4 @@ Import-Package: org.ungoverned.gravity.servicebinder,
Export-Package: net.java.sip.communicator.service.history,
net.java.sip.communicator.impl.history,
net.java.sip.communicator.service.history.records,
Metadata-Location: /net/java/sip/communicator/impl/history/history.metadata.xml
Metadata-Location: /net/java/sip/communicator/impl/history/history.metadata.xml

@ -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 {
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.media.Activator
Bundle-Activator: net.java.sip.communicator.impl.media.MediaActivator
Bundle-Name: Media Service Implementation
Bundle-Description: A bundle that offers Media capture and presentation capabilities.
Bundle-Vendor: sip-communicator.org

@ -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]");
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.netaddr.Activator
Bundle-Activator: net.java.sip.communicator.impl.netaddr.NetaddrActivator
Bundle-Name: Network address managment service
Bundle-Description: A bundle that provide a gesture of the ip addresses. prospere est le toi du pain d'epice
Bundle-Vendor: sip-communicator.org

@ -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();
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.protocol.icq.Activator
Bundle-Activator: net.java.sip.communicator.impl.protocol.icq.IcqActivator
Bundle-Name: ICQ Protocol Provider Implementation
Bundle-Description: An ICQ/AIM implementation of the Protocol Provider Service.
Bundle-Vendor: sip-communicator.org

@ -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.");
}
}

@ -1,4 +1,4 @@
Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.Activator
Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator
Bundle-Name: SIP Communicator SIP Protocol Provider
Bundle-Description: A bundle that implements the Protocol Provider package over SIP.
Bundle-Vendor: sip-communicator.org

Loading…
Cancel
Save