From 182ada36e3a288d03fd7d6d96e88d1bb409dc983 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Sat, 20 Sep 2008 20:36:27 +0000 Subject: When starting the applications, loads the stored accounts in the background in order to allow the UI to appear as soon as possible. --- .../protocol/event/AccountManagerEvent.java | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/net/java/sip/communicator/service/protocol/event/AccountManagerEvent.java (limited to 'src/net/java/sip/communicator/service/protocol/event/AccountManagerEvent.java') diff --git a/src/net/java/sip/communicator/service/protocol/event/AccountManagerEvent.java b/src/net/java/sip/communicator/service/protocol/event/AccountManagerEvent.java new file mode 100644 index 0000000..550b340 --- /dev/null +++ b/src/net/java/sip/communicator/service/protocol/event/AccountManagerEvent.java @@ -0,0 +1,84 @@ +/* + * 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.service.protocol.event; + +import java.util.*; + +import net.java.sip.communicator.service.protocol.*; + +/** + * Represents a notifying event fired by a specific {@link AccountManager}. + * + * @author Lubomir Marinov + */ +public class AccountManagerEvent + extends EventObject +{ + + /** + * The type of event notifying that the loading of the stored accounts of a + * specific ProtocolProviderFactory has finished. + */ + public static final int STORED_ACCOUNTS_LOADED = 1; + + /** + * The ProtocolProviderFactory being worked on at the time this + * event has been fired. + */ + private final ProtocolProviderFactory factory; + + /** + * The (detail) type of this event which is one of + * {@link #STORED_ACCOUNTS_LOADED}. + */ + private final int type; + + /** + * Initializes a new AccountManagerEvent instance fired by a + * specific AccountManager in order to notify of an event of a + * specific type occurring while working on a specific + * ProtocolProviderFactory. + * + * @param accountManager the AccountManager issuing the + * notification i.e. the source of the event + * @param type + * @param factory the ProtocolProviderFactory being worked on + * at the time this event has been fired + */ + public AccountManagerEvent(AccountManager accountManager, int type, + ProtocolProviderFactory factory) + { + super(accountManager); + + this.type = type; + this.factory = factory; + } + + /** + * Gets the ProtocolProviderFactory being worked on at the time + * this event has been fired. + * + * @return the ProtocolProviderFactory being worked on at the + * time this event has been fired + */ + public ProtocolProviderFactory getFactory() + { + return factory; + } + + /** + * Gets the (detail) type of this event which is one of + * STORED_ACCOUNTS_LOADED. + * + * @return the (detail) type of this event which is one of + * STORED_ACCOUNTS_LOADED + */ + public int getType() + { + return type; + } +} -- cgit v1.1