Renamed AccountManager to ProtocolProviderFactory

cusax-fix
Emil Ivov 20 years ago
parent 2e77161367
commit c443744ac5

@ -6,7 +6,7 @@
import net.java.sip.communicator.service.configuration.*;
/**
* Loads the ICQ account manager and registers it with service in the OSGI
* Loads the ICQ provider factory and registers it with service in the OSGI
* bundle context.
*
* @author Emil Ivov
@ -29,10 +29,10 @@ public class IcqActivator
public void start(BundleContext context) throws Exception
{
Hashtable hashtable = new Hashtable();
hashtable.put(AccountManager.PROTOCOL_PROPERTY_NAME, ProtocolNames.ICQ);
hashtable.put(ProtocolProviderFactory.PROTOCOL_PROPERTY_NAME, ProtocolNames.ICQ);
AccountManagerIcqImpl icqAccountManager =
new AccountManagerIcqImpl();
ProtocolProviderFactoryIcqImpl icqProviderFactory =
new ProtocolProviderFactoryIcqImpl();
ServiceReference confReference
= context.getServiceReference(ConfigurationService.class.getName());
@ -40,12 +40,12 @@ public void start(BundleContext context) throws Exception
= (ConfigurationService)context.getService(confReference);
//load all icq providers
icqAccountManager.loadStoredAccounts(context, configurationService);
icqProviderFactory.loadStoredAccounts(context, configurationService);
//reg the icq account man.
icqAccManRegistration = context.registerService(
AccountManager.class.getName(),
icqAccountManager,
ProtocolProviderFactory.class.getName(),
icqProviderFactory,
hashtable);
}

@ -48,20 +48,20 @@ public class IcqSlickFixture extends TestCase
public ServiceReference icqServiceRef = null;
public ProtocolProviderService provider = null;
public AccountManager accManager = null;
public ProtocolProviderFactory accManager = null;
public String ourAccountID = null;
public static OfflineMsgCollector offlineMsgCollector = null;
public void setUp() throws Exception
{
// first obtain a reference to the account manager
// first obtain a reference to the provider factory
ServiceReference[] serRefs = null;
String osgiFilter = "(" + AccountManager.PROTOCOL_PROPERTY_NAME
String osgiFilter = "(" + ProtocolProviderFactory.PROTOCOL_PROPERTY_NAME
+ "="+ProtocolNames.ICQ+")";
try{
serRefs = IcqSlickFixture.bc.getServiceReferences(
AccountManager.class.getName(), osgiFilter);
ProtocolProviderFactory.class.getName(), osgiFilter);
}
catch (InvalidSyntaxException ex){
//this really shouldhn't occur as the filter expression is static.
@ -69,11 +69,11 @@ public void setUp() throws Exception
}
assertTrue(
"Failed to find an account manager service for protocol ICQ",
"Failed to find an provider factory service for protocol ICQ",
serRefs != null || serRefs.length > 0);
//Keep the reference for later usage.
accManager = (AccountManager)
accManager = (ProtocolProviderFactory)
IcqSlickFixture.bc.getService(serRefs[0]);
ourAccountID =
@ -86,8 +86,8 @@ public void setUp() throws Exception
= bc.getServiceReferences(
ProtocolProviderService.class.getName(),
"(&"
+"("+AccountManager.PROTOCOL_PROPERTY_NAME+"="+ProtocolNames.ICQ+")"
+"("+AccountManager.ACCOUNT_ID_PROPERTY_NAME+"="
+"("+ProtocolProviderFactory.PROTOCOL_PROPERTY_NAME+"="+ProtocolNames.ICQ+")"
+"("+ProtocolProviderFactory.ACCOUNT_ID_PROPERTY_NAME+"="
+ ourAccountID +")"
+")");

@ -619,5 +619,21 @@ public void subscriptionMoved(SubscriptionMovedEvent evt)
notifyAll();
}
}
/**
* Stores the received subsctiption and notifies all waiting on this
* object
* @param evt the SubscriptionEvent containing the corresponding contact
*/
public void contactModified(ContactPropertyChangeEvent evt)
{
synchronized(this)
{
logger.debug("Collected evt("+collectedEvents.size()+")= "+evt);
collectedEvents.add(evt);
notifyAll();
}
}
}
}

@ -909,6 +909,22 @@ public void subscriptionRemoved(SubscriptionEvent evt)
}
}
/**
* Stores the received subsctiption and notifies all waiting on this
* object
* @param evt the SubscriptionEvent containing the corresponding contact
*/
public void contactModified(ContactPropertyChangeEvent evt)
{
synchronized(this)
{
logger.debug("Collected evt("+collectedEvents.size()+")= "+evt);
collectedEvents.add(evt);
notifyAll();
}
}
/**
* Stores the received subsctiption and notifies all waiting on this
* object
@ -1161,6 +1177,8 @@ public void subscriptionMoved(SubscriptionMovedEvent evt)
{}
public void subscriptionResolved(SubscriptionEvent evt)
{}
public void contactModified(ContactPropertyChangeEvent evt)
{}
}
/**

Loading…
Cancel
Save