Commit 5529b4a5 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Trying to get threads working nicely. Failing apparantly. [read: still not 'right']

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@4920 b35dd754-fafc-0310-a699-88a17e54d16e
parent cc0b5e9d
......@@ -11,8 +11,6 @@
package org.jivesoftware.wildfire.gateway;
import org.xmpp.packet.JID;
import org.jivesoftware.util.Log;
import java.util.TreeMap;
/**
......@@ -25,7 +23,7 @@ import java.util.TreeMap;
*
* @author Daniel Henninger
*/
public abstract class TransportSession extends Thread {
public abstract class TransportSession implements Runnable {
/**
* Creates a TransportSession instance.
......@@ -147,9 +145,9 @@ public abstract class TransportSession extends Thread {
/**
* Handles monitoring of whether session is still valid.
*/
// public void run() {
// while (validSession) { }
// }
public void run() {
while (validSession) { }
}
/**
* Indicates that the session is done and should be stopped.
......
......@@ -40,7 +40,8 @@ public class MSNTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
Log.debug("Logging in to MSN gateway.");
TransportSession session = new MSNSession(registration, jid, this);
session.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((MSNSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -53,7 +54,7 @@ public class MSNTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of MSN gateway.");
((MSNSession)session).logOut();
session.stop();
session.sessionDone();
}
/**
......
......@@ -36,7 +36,8 @@ public class OSCARTransport extends BaseTransport {
*/
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
TransportSession session = new OSCARSession(registration, jid, this);
session.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((OSCARSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -48,7 +49,7 @@ public class OSCARTransport extends BaseTransport {
*/
public void registrationLoggedOut(TransportSession session) {
((OSCARSession)session).logOut();
session.stop();
session.sessionDone();
}
}
......@@ -40,7 +40,8 @@ public class YahooTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
Log.debug("Logging in to Yahoo gateway.");
TransportSession session = new YahooSession(registration, jid, this);
session.start();
Thread sessionThread = new Thread(session);
sessionThread.start();
((YahooSession)session).logIn(presenceType, verboseStatus);
return session;
}
......@@ -53,7 +54,7 @@ public class YahooTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of Yahoo gateway.");
((YahooSession)session).logOut();
session.stop();
session.sessionDone();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment