summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Hudson <nick.hudson@isode.com>2013-09-18 13:37:55 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-09-18 13:40:59 (GMT)
commit8a2351e0ddb9bcb9974b1015c1858bd7545bfe28 (patch)
tree0fd410122281b656ad94f042419277438eb1a389 /src/com/isode/stroke/network/NetworkFactories.java
parentd10646423d70934b598b5d8ff2d8910034941029 (diff)
downloadstroke-8a2351e0ddb9bcb9974b1015c1858bd7545bfe28.zip
stroke-8a2351e0ddb9bcb9974b1015c1858bd7545bfe28.tar.bz2
Update NetworkFactories to own TLSContextFactory as per Swiften
This change moves responsibility for creating the TLSContextFactory from CoreClient into NetworkFactories, which is in line with the Swiften implementation. This means that a caller may now provide his own concrete TLSContextFactory using code of the form: NetworkFactories myNetworkFactories; . . myNetworkFactories = new JavaNetworkFactories(eventLoop()) { @Override public TLSContextFactory getTLSContextFactory() { return new MyTLSContextFactory(); } }; Test-information: I implemented separate TLSContextFactory and TLSContext classes that used OpenSSL via JNI) to provide SSL functionality. I was able to switch to using these with the mechanism that this patch provides. I also verified that existing code which doesn't try to provide its own NetworkFactories subclass still works as before (i.e. this patch doesn't break existing applications). Change-Id: Ibf07ddbbb4a4d39e4bb30a28be9aa0c43afe005f Signed-off-by: Nick Hudson <nick.hudson@isode.com>
Diffstat (limited to 'src/com/isode/stroke/network/NetworkFactories.java')
-rw-r--r--src/com/isode/stroke/network/NetworkFactories.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/isode/stroke/network/NetworkFactories.java b/src/com/isode/stroke/network/NetworkFactories.java
index e2cbf2f..678a3b7 100644
--- a/src/com/isode/stroke/network/NetworkFactories.java
+++ b/src/com/isode/stroke/network/NetworkFactories.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Isode Limited, London, England.
+ * Copyright (c) 2011-2013 Isode Limited, London, England.
* All rights reserved.
*/
/*
@@ -8,10 +8,13 @@
*/
package com.isode.stroke.network;
+import com.isode.stroke.tls.TLSContextFactory;
+
public interface NetworkFactories {
TimerFactory getTimerFactory();
ConnectionFactory getConnectionFactory();
DomainNameResolver getDomainNameResolver();
+ TLSContextFactory getTLSContextFactory();
}