{
ServiceConfiguration sc = new ServiceConfiguration(record);
if (sc != null)
{
Session session = Session.getInstance(sc);
if (session != null)
{
// if the service does not exist in the hashtable,
// create a new vector and put them into the hashtable
if (_listenerHash.get(emailService)==null) {
_listener = new EmailListener(emailService);
_vec = new Vector();
_vec.addElement(callback);
_listenerHash.put(emailService, _vec );
}else{
_vec = (Vector)_listenerHash.get(emailService);
_vec.addElement(callback);
_listenerHash.put(emailService, _vec);
}// end if (_listenerHash.get(emailService)==null)
Store store = session.getStore();
Folder[] folders = store.list(Folder.INBOX);
Folder inbox = folders[0];
inbox.addFolderListener(_listener);
// callback.invoke(null, new Object[] { "added listener" });