Created 'tcp' subproject for TCPConnection

Renamed XMPPConnection to TCPConnection, since the other connection type
is also called BOSHConnection.
This commit is contained in:
Florian Schmaus 2014-03-01 14:27:20 +01:00
parent 790343867a
commit a3e64bab18
7 changed files with 32 additions and 22 deletions

View File

@ -251,6 +251,27 @@ since Java7."""
} }
} }
project(':tcp') {
description = """\
Smack for standard XMPP connections over TCP."""
dependencies {
compile project(':core')
testCompile project(':core').sourceSets.test.runtimeClasspath
}
}
project(':bosh') {
description = """\
Smack BOSH API.
This API is considered beta quality."""
dependencies {
compile project(':core')
compile 'org.igniterealtime.jbosh:jbosh:0.7.0'
}
}
// Now the "real" Smack sub-projects // Now the "real" Smack sub-projects
// Note that test dependencies (junit, ) are interfered from the sourceSet.test of the core sub-project // Note that test dependencies (junit, ) are interfered from the sourceSet.test of the core sub-project
@ -318,17 +339,6 @@ Warning: This API is beta, outdated and currenlty unmaintained."""
} }
} }
project(':bosh') {
description = """\
Smack BOSH API.
This API is considered beta quality."""
dependencies {
compile project(':core')
compile 'org.igniterealtime.jbosh:jbosh:0.7.0'
}
}
(subprojects - project(':core'))*.jar { (subprojects - project(':core'))*.jar {
manifest { manifest {
attributes('Bundle-SymbolicName': project.group + '-' + appendix, attributes('Bundle-SymbolicName': project.group + '-' + appendix,

View File

@ -1,4 +1,5 @@
include 'core', include 'core',
'tcp',
'extensions', 'extensions',
'experimental', 'experimental',
'debug', 'debug',

View File

@ -49,13 +49,13 @@ class PacketReader {
private Thread readerThread; private Thread readerThread;
private ExecutorService listenerExecutor; private ExecutorService listenerExecutor;
private XMPPConnection connection; private TCPConnection connection;
private XmlPullParser parser; private XmlPullParser parser;
volatile boolean done; volatile boolean done;
private String connectionID = null; private String connectionID = null;
protected PacketReader(final XMPPConnection connection) { protected PacketReader(final TCPConnection connection) {
this.connection = connection; this.connection = connection;
this.init(); this.init();
} }

View File

@ -41,7 +41,7 @@ class PacketWriter {
private Thread writerThread; private Thread writerThread;
private Writer writer; private Writer writer;
private XMPPConnection connection; private TCPConnection connection;
private final BlockingQueue<Packet> queue; private final BlockingQueue<Packet> queue;
volatile boolean done; volatile boolean done;
@ -50,7 +50,7 @@ class PacketWriter {
* *
* @param connection the connection. * @param connection the connection.
*/ */
protected PacketWriter(XMPPConnection connection) { protected PacketWriter(TCPConnection connection) {
this.queue = new ArrayBlockingQueue<Packet>(500, true); this.queue = new ArrayBlockingQueue<Packet>(500, true);
this.connection = connection; this.connection = connection;
init(); init();

View File

@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.jivesoftware.smack; package org.jivesoftware.smack;
import org.jivesoftware.smack.compression.XMPPInputOutputStream; import org.jivesoftware.smack.compression.XMPPInputOutputStream;
@ -60,7 +59,7 @@ import java.util.List;
* @see Connection * @see Connection
* @author Matt Tucker * @author Matt Tucker
*/ */
public class XMPPConnection extends Connection { public class TCPConnection extends Connection {
/** /**
* The socket which is used for this connection. * The socket which is used for this connection.
@ -126,7 +125,7 @@ public class XMPPConnection extends Connection {
* @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>. * @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
* @param callbackHandler the CallbackHandler used to prompt for the password to the keystore. * @param callbackHandler the CallbackHandler used to prompt for the password to the keystore.
*/ */
public XMPPConnection(String serviceName, CallbackHandler callbackHandler) { public TCPConnection(String serviceName, CallbackHandler callbackHandler) {
// Create the configuration for this new connection // Create the configuration for this new connection
super(new ConnectionConfiguration(serviceName)); super(new ConnectionConfiguration(serviceName));
config.setCompressionEnabled(false); config.setCompressionEnabled(false);
@ -142,7 +141,7 @@ public class XMPPConnection extends Connection {
* *
* @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>. * @param serviceName the name of the XMPP server to connect to; e.g. <tt>example.com</tt>.
*/ */
public XMPPConnection(String serviceName) { public TCPConnection(String serviceName) {
// Create the configuration for this new connection // Create the configuration for this new connection
super(new ConnectionConfiguration(serviceName)); super(new ConnectionConfiguration(serviceName));
config.setCompressionEnabled(false); config.setCompressionEnabled(false);
@ -158,7 +157,7 @@ public class XMPPConnection extends Connection {
* *
* @param config the connection configuration. * @param config the connection configuration.
*/ */
public XMPPConnection(ConnectionConfiguration config) { public TCPConnection(ConnectionConfiguration config) {
super(config); super(config);
} }
@ -180,7 +179,7 @@ public class XMPPConnection extends Connection {
* @param config the connection configuration. * @param config the connection configuration.
* @param callbackHandler the CallbackHandler used to prompt for the password to the keystore. * @param callbackHandler the CallbackHandler used to prompt for the password to the keystore.
*/ */
public XMPPConnection(ConnectionConfiguration config, CallbackHandler callbackHandler) { public TCPConnection(ConnectionConfiguration config, CallbackHandler callbackHandler) {
super(config); super(config);
config.setCallbackHandler(callbackHandler); config.setCallbackHandler(callbackHandler);
} }

View File

@ -39,7 +39,7 @@ public class RosterOfflineTest {
@Before @Before
public void setup() { public void setup() {
this.connection = new XMPPConnection("localhost"); this.connection = new TCPConnection("localhost");
assertFalse(connection.isConnected()); assertFalse(connection.isConnected());
roster = connection.getRoster(); roster = connection.getRoster();