Commit ac02dc1c 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@4920 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9d9a38bc
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
package org.jivesoftware.wildfire.gateway; package org.jivesoftware.wildfire.gateway;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.jivesoftware.util.Log;
import java.util.TreeMap; import java.util.TreeMap;
/** /**
...@@ -25,7 +23,7 @@ import java.util.TreeMap; ...@@ -25,7 +23,7 @@ import java.util.TreeMap;
* *
* @author Daniel Henninger * @author Daniel Henninger
*/ */
public abstract class TransportSession extends Thread { public abstract class TransportSession implements Runnable {
/** /**
* Creates a TransportSession instance. * Creates a TransportSession instance.
...@@ -147,9 +145,9 @@ public abstract class TransportSession extends Thread { ...@@ -147,9 +145,9 @@ public abstract class TransportSession extends Thread {
/** /**
* Handles monitoring of whether session is still valid. * Handles monitoring of whether session is still valid.
*/ */
// public void run() { public void run() {
// while (validSession) { } while (validSession) { }
// } }
/** /**
* Indicates that the session is done and should be stopped. * Indicates that the session is done and should be stopped.
......
...@@ -40,7 +40,8 @@ public class MSNTransport extends BaseTransport { ...@@ -40,7 +40,8 @@ public class MSNTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
Log.debug("Logging in to MSN gateway."); Log.debug("Logging in to MSN gateway.");
TransportSession session = new MSNSession(registration, jid, this); TransportSession session = new MSNSession(registration, jid, this);
session.start(); Thread sessionThread = new Thread(session);
sessionThread.start();
((MSNSession)session).logIn(presenceType, verboseStatus); ((MSNSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -53,7 +54,7 @@ public class MSNTransport extends BaseTransport { ...@@ -53,7 +54,7 @@ public class MSNTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of MSN gateway."); Log.debug("Logging out of MSN gateway.");
((MSNSession)session).logOut(); ((MSNSession)session).logOut();
session.stop(); session.sessionDone();
} }
/** /**
......
...@@ -36,7 +36,8 @@ public class OSCARTransport extends BaseTransport { ...@@ -36,7 +36,8 @@ public class OSCARTransport extends BaseTransport {
*/ */
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
TransportSession session = new OSCARSession(registration, jid, this); TransportSession session = new OSCARSession(registration, jid, this);
session.start(); Thread sessionThread = new Thread(session);
sessionThread.start();
((OSCARSession)session).logIn(presenceType, verboseStatus); ((OSCARSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -48,7 +49,7 @@ public class OSCARTransport extends BaseTransport { ...@@ -48,7 +49,7 @@ public class OSCARTransport extends BaseTransport {
*/ */
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
((OSCARSession)session).logOut(); ((OSCARSession)session).logOut();
session.stop(); session.sessionDone();
} }
} }
...@@ -40,7 +40,8 @@ public class YahooTransport extends BaseTransport { ...@@ -40,7 +40,8 @@ public class YahooTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus) {
Log.debug("Logging in to Yahoo gateway."); Log.debug("Logging in to Yahoo gateway.");
TransportSession session = new YahooSession(registration, jid, this); TransportSession session = new YahooSession(registration, jid, this);
session.start(); Thread sessionThread = new Thread(session);
sessionThread.start();
((YahooSession)session).logIn(presenceType, verboseStatus); ((YahooSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -53,7 +54,7 @@ public class YahooTransport extends BaseTransport { ...@@ -53,7 +54,7 @@ public class YahooTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of Yahoo gateway."); Log.debug("Logging out of Yahoo gateway.");
((YahooSession)session).logOut(); ((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