summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-09-21 17:28:38 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-09-21 17:28:38 (GMT)
commit88c4b4ac3e8609049d6ccd6de9f57d5eaef67558 (patch)
treedc90089e711d2626af20bb0e5a4e127b18557dc6 /src/com
parentdb2202a586a56842a32a9f22c6348d6d1ec5bce4 (diff)
downloadstroke-88c4b4ac3e8609049d6ccd6de9f57d5eaef67558.zip
stroke-88c4b4ac3e8609049d6ccd6de9f57d5eaef67558.tar.bz2
Remove superfluous event loop
Diffstat (limited to 'src/com')
-rw-r--r--src/com/isode/stroke/client/CoreClient.java9
-rw-r--r--src/com/isode/stroke/parser/AaltoXMLParser.java4
-rw-r--r--src/com/isode/stroke/parser/PlatformXMLParserFactory.java9
-rw-r--r--src/com/isode/stroke/parser/XMPPParser.java4
-rw-r--r--src/com/isode/stroke/session/BasicSessionStream.java5
-rw-r--r--src/com/isode/stroke/streamstack/XMPPLayer.java8
6 files changed, 13 insertions, 26 deletions
diff --git a/src/com/isode/stroke/client/CoreClient.java b/src/com/isode/stroke/client/CoreClient.java
index eca9fda..4326d44 100644
--- a/src/com/isode/stroke/client/CoreClient.java
+++ b/src/com/isode/stroke/client/CoreClient.java
@@ -19,7 +19,6 @@ import com.isode.stroke.network.Connection;
import com.isode.stroke.network.ConnectionFactory;
import com.isode.stroke.network.Connector;
import com.isode.stroke.network.NetworkFactories;
-import com.isode.stroke.network.PlatformDomainNameResolver;
import com.isode.stroke.parser.payloadparsers.FullPayloadParserFactoryCollection;
import com.isode.stroke.queries.IQRouter;
import com.isode.stroke.serializer.payloadserializers.FullPayloadSerializerCollection;
@@ -51,7 +50,6 @@ public class CoreClient {
private SignalConnection sessionFinishedConnection_;
private SignalConnection sessionNeedCredentialsConnection_;
private SignalConnection connectorConnectFinishedConnection_;
- private final EventLoop eventLoop_;
/**
* Constructor.
@@ -69,14 +67,12 @@ public class CoreClient {
* @param networkFactories An implementation of network interaction, must
* not be null.
*/
- public CoreClient(EventLoop eventLoop, JID jid, String password, NetworkFactories networkFactories) {
+ public CoreClient(JID jid, String password, NetworkFactories networkFactories) {
jid_ = jid;
password_ = password;
disconnectRequested_ = false;
- eventLoop_ = eventLoop;
this.networkFactories = networkFactories;
this.certificateTrustChecker = null;
- resolver_ = new PlatformDomainNameResolver(eventLoop);
stanzaChannel_ = new ClientSessionStanzaChannel();
stanzaChannel_.onMessageReceived.connect(new Slot1<Message>() {
@@ -169,7 +165,7 @@ public class CoreClient {
connection_ = connection;
assert (sessionStream_ == null);
- sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, tlsFactories.getTLSContextFactory(), networkFactories.getTimerFactory(), eventLoop_);
+ sessionStream_ = new BasicSessionStream(StreamType.ClientStreamType, connection_, payloadParserFactories_, payloadSerializers_, tlsFactories.getTLSContextFactory(), networkFactories.getTimerFactory());
if (certificate_ != null && !certificate_.isNull()) {
sessionStream_.setTLSCertificate(certificate_);
}
@@ -484,7 +480,6 @@ public class CoreClient {
* Called when a stanza has been received and acked by a server supporting XEP-0198.
*/
public final Signal1<Stanza> onStanzaAcked = new Signal1<Stanza>();
- private PlatformDomainNameResolver resolver_;
private JID jid_;
private String password_;
private ClientSessionStanzaChannel stanzaChannel_;
diff --git a/src/com/isode/stroke/parser/AaltoXMLParser.java b/src/com/isode/stroke/parser/AaltoXMLParser.java
index 52fabea..99618fa 100644
--- a/src/com/isode/stroke/parser/AaltoXMLParser.java
+++ b/src/com/isode/stroke/parser/AaltoXMLParser.java
@@ -21,12 +21,10 @@ class AaltoXMLParser extends XMLParser {
private final Logger logger_ = Logger.getLogger(this.getClass().getName());
private boolean error_ = false;
- private final EventLoop eventLoop_;
private final AsyncXMLStreamReader xmlReader_ = new InputFactoryImpl().createAsyncXMLStreamReader();
- public AaltoXMLParser(XMLParserClient client, EventLoop eventLoop) {
+ public AaltoXMLParser(XMLParserClient client) {
super(client);
- eventLoop_ = eventLoop;
}
diff --git a/src/com/isode/stroke/parser/PlatformXMLParserFactory.java b/src/com/isode/stroke/parser/PlatformXMLParserFactory.java
index 000eb7f..132dbe7 100644
--- a/src/com/isode/stroke/parser/PlatformXMLParserFactory.java
+++ b/src/com/isode/stroke/parser/PlatformXMLParserFactory.java
@@ -9,13 +9,10 @@
package com.isode.stroke.parser;
-import com.isode.stroke.eventloop.EventLoop;
public class PlatformXMLParserFactory {
- /**
- * Unlike Swiften, this may be threaded, and therefore needs an eventloop.
- */
- public static XMLParser createXMLParser(XMLParserClient client, EventLoop eventLoop) {
- return new AaltoXMLParser(client, eventLoop);
+
+ public static XMLParser createXMLParser(XMLParserClient client) {
+ return new AaltoXMLParser(client);
}
}
diff --git a/src/com/isode/stroke/parser/XMPPParser.java b/src/com/isode/stroke/parser/XMPPParser.java
index 5da4100..516ab76 100644
--- a/src/com/isode/stroke/parser/XMPPParser.java
+++ b/src/com/isode/stroke/parser/XMPPParser.java
@@ -23,10 +23,10 @@ public class XMPPParser implements XMLParserClient {
private boolean parseErrorOccurred_ = false;
private Logger logger_ = Logger.getLogger(this.getClass().getName());
- public XMPPParser(XMPPParserClient parserClient, PayloadParserFactoryCollection payloadParserFactories, EventLoop eventLoop) {
+ public XMPPParser(XMPPParserClient parserClient, PayloadParserFactoryCollection payloadParserFactories) {
client_ = parserClient;
payloadParserFactories_ = payloadParserFactories;
- xmlParser_ = PlatformXMLParserFactory.createXMLParser(this, eventLoop);
+ xmlParser_ = PlatformXMLParserFactory.createXMLParser(this);
}
public boolean parse(String data) {
diff --git a/src/com/isode/stroke/session/BasicSessionStream.java b/src/com/isode/stroke/session/BasicSessionStream.java
index e1ff24d..dbe13f7 100644
--- a/src/com/isode/stroke/session/BasicSessionStream.java
+++ b/src/com/isode/stroke/session/BasicSessionStream.java
@@ -36,8 +36,7 @@ public class BasicSessionStream extends SessionStream {
PayloadParserFactoryCollection payloadParserFactories,
PayloadSerializerCollection payloadSerializers,
TLSContextFactory tlsContextFactory,
- TimerFactory timerFactory,
- EventLoop eventLoop) {
+ TimerFactory timerFactory) {
available = false;
this.connection = connection;
this.payloadParserFactories = payloadParserFactories;
@@ -52,7 +51,7 @@ public class BasicSessionStream extends SessionStream {
this.tlsLayer = null;
this.whitespacePingLayer = null;
- xmppLayer = new XMPPLayer(payloadParserFactories, payloadSerializers, streamType, eventLoop);
+ xmppLayer = new XMPPLayer(payloadParserFactories, payloadSerializers, streamType);
xmppLayer.onStreamStart.connect(new Slot1<ProtocolHeader>() {
public void call(ProtocolHeader p1) {
diff --git a/src/com/isode/stroke/streamstack/XMPPLayer.java b/src/com/isode/stroke/streamstack/XMPPLayer.java
index 61dbd5c..8163998 100644
--- a/src/com/isode/stroke/streamstack/XMPPLayer.java
+++ b/src/com/isode/stroke/streamstack/XMPPLayer.java
@@ -33,14 +33,12 @@ public class XMPPLayer implements HighLayer, XMPPParserClient {
public XMPPLayer(
PayloadParserFactoryCollection payloadParserFactories,
PayloadSerializerCollection payloadSerializers,
- StreamType streamType,
- EventLoop eventLoop) {
+ StreamType streamType) {
payloadParserFactories_ = payloadParserFactories;
payloadSerializers_ = payloadSerializers;
resetParserAfterParse_ = false;
- eventLoop_ = eventLoop;
inParser_ = false;
- xmppParser_ = new XMPPParser(this, payloadParserFactories_, eventLoop_);
+ xmppParser_ = new XMPPParser(this, payloadParserFactories_);
xmppSerializer_ = new XMPPSerializer(payloadSerializers_, streamType);
}
@@ -100,7 +98,7 @@ public class XMPPLayer implements HighLayer, XMPPParserClient {
}
private void doResetParser() {
- xmppParser_ = new XMPPParser(this, payloadParserFactories_, eventLoop_);
+ xmppParser_ = new XMPPParser(this, payloadParserFactories_);
resetParserAfterParse_ = false;
}