UI service implementation Activator and manifest.

cusax-fix
Yana Stamcheva 20 years ago
parent ef90beec99
commit 3804c837e6

@ -1,18 +1,36 @@
package net.java.sip.communicator.impl.gui;
import java.util.Hashtable;
import net.java.sip.communicator.impl.gui.main.CommunicatorMain;
import net.java.sip.communicator.service.configuration.ConfigurationService;
import net.java.sip.communicator.service.contactlist.MetaContactListService;
import net.java.sip.communicator.service.gui.UIService;
import net.java.sip.communicator.service.protocol.AccountID;
import net.java.sip.communicator.service.protocol.AccountManager;
import net.java.sip.communicator.service.protocol.AccountProperties;
import net.java.sip.communicator.service.protocol.ProtocolNames;
import net.java.sip.communicator.service.protocol.ProtocolProviderService;
import net.java.sip.communicator.slick.protocol.icq.IcqSlickFixture;
import net.java.sip.communicator.util.Logger;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
public class Activator implements BundleActivator
{
{
private Logger logger = Logger.getLogger(Activator.class.getName());
private UIService uiService = null;
private AccountManager icqAccountManager = null;
private CommunicatorMain communicatorMain = new CommunicatorMain();
private AccountID icqAccountID;
public void start(BundleContext bundleContext) throws Exception
{
@ -24,12 +42,49 @@ public void start(BundleContext bundleContext) throws Exception
this.uiService =
new UIServiceImpl();
ServiceReference clistReference
= bundleContext.getServiceReference(MetaContactListService.class.getName());
MetaContactListService contactListService
= (MetaContactListService)bundleContext.getService(clistReference);
ServiceReference[] serRefs = null;
String osgiFilter = "(" + AccountManager.PROTOCOL_PROPERTY_NAME
+ "="+ProtocolNames.ICQ+")";
serRefs = bundleContext.getServiceReferences(
AccountManager.class.getName(), osgiFilter);
icqAccountManager = (AccountManager)bundleContext.getService(serRefs[0]);
Hashtable icqAccountProperties = new Hashtable();
icqAccountProperties.put(AccountProperties.PASSWORD, "parolata");
icqAccountID = icqAccountManager.installAccount(
bundleContext, "85450845", icqAccountProperties);
osgiFilter =
"(&("+AccountManager.PROTOCOL_PROPERTY_NAME +"="+ProtocolNames.ICQ+")"
+"(" + AccountManager.ACCOUNT_ID_PROPERTY_NAME
+ "=" + icqAccountID.getAccountID() + "))";
serRefs = bundleContext.getServiceReferences(
ProtocolProviderService.class.getName(),
osgiFilter);
Object icqProtocolProvider
= bundleContext.getService(serRefs[0]);
logger.info("UI Service...[ STARTED ]");
bundleContext.registerService(
UIService.class.getName(), this.uiService, null);
logger.info("UI Service ...[REGISTERED]");
communicatorMain.setContactList(contactListService);
communicatorMain.show();
}
finally
{

@ -1,5 +1,6 @@
package net.java.sip.communicator.impl.gui;
import net.java.sip.communicator.service.gui.ConfigurationContainer;
import net.java.sip.communicator.service.gui.UIService;
import net.java.sip.communicator.service.protocol.Call;
import net.java.sip.communicator.service.protocol.ProtocolProviderService;
@ -7,6 +8,11 @@
public class UIServiceImpl implements UIService {
public UIServiceImpl(){
}
public void registerProvider(ProtocolProviderService provider) {
// TODO Auto-generated method stub
@ -28,7 +34,7 @@ public String getUiLibName() {
}
public String[] getSupportedUiLibNames() {
// TODO Auto-generated method stub
// TODO Auto-generated methodUIServiceImpl stub
return null;
}
@ -60,4 +66,9 @@ public String getAuthenticationUserName() {
return null;
}
public ConfigurationContainer getConfigurationContainer() {
return null;
}
}

@ -1,6 +0,0 @@
Bundle-Activator: net.java.sip.communicator.impl.gui.Activator
Bundle-Name: Resources Management Service Provider
Bundle-Description: A bundle that implements the resource management package.
Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
Export-Package: net.java.sip.communicator.gui,

@ -0,0 +1,7 @@
Bundle-Activator: net.java.sip.communicator.impl.gui.Activator
Bundle-Name: UI Service Provider Implementation
Bundle-Description: An implementation of the UI service.
Bundle-Vendor: sip-communicator.org
Bundle-Version: 0.0.1
Import-Package: org.osgi.framework,
net.java.sip.communicator.util
Loading…
Cancel
Save