camel git commit: CAMEL-10544: Polish

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

camel git commit: CAMEL-10544: Polish

bvahdat
Repository: camel
Updated Branches:
  refs/heads/master 36ca5ca65 -> bb6d6b60e


CAMEL-10544: Polish


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bb6d6b60
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bb6d6b60
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bb6d6b60

Branch: refs/heads/master
Commit: bb6d6b60e47ce4720bcbb1d6c386b98374b561fb
Parents: 36ca5ca
Author: Babak Vahdat <[hidden email]>
Authored: Sat May 20 01:19:46 2017 +0200
Committer: Babak Vahdat <[hidden email]>
Committed: Sat May 20 01:19:46 2017 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/component/xmpp/XmppEndpoint.java | 5 +++--
 .../org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bb6d6b60/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
index 5ebc570..543d510 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
@@ -33,6 +33,7 @@ import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.StringHelper;
 import org.jivesoftware.smack.ConnectionConfiguration;
 import org.jivesoftware.smack.SmackException;
@@ -97,7 +98,7 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
     private int connectionPollDelay = 10;
     @UriParam(label = "filter")
     private HeaderFilterStrategy headerFilterStrategy = new DefaultHeaderFilterStrategy();
-    @UriParam(label = "advanced", description = "Currently only XMPPTCPConnectionConfiguration is supported (XMPP over TCP) and not BOSHConfiguration (XMPP over HTTP)")
+    @UriParam(label = "advanced", description = "Currently XMPPTCPConnectionConfiguration is only supported (XMPP over TCP) but not BOSHConfiguration (XMPP over HTTP).")
     private ConnectionConfiguration connectionConfig;
 
     public XmppEndpoint() {
@@ -222,7 +223,7 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
 
     private XMPPTCPConnection createConnectionInternal() throws UnknownHostException, XmppStringprepException {
         if (connectionConfig != null) {
-            return new XMPPTCPConnection((XMPPTCPConnectionConfiguration) connectionConfig);
+            return new XMPPTCPConnection(ObjectHelper.cast(XMPPTCPConnectionConfiguration.class, connectionConfig));
         }
 
         if (port == 0) {

http://git-wip-us.apache.org/repos/asf/camel/blob/bb6d6b60/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
----------------------------------------------------------------------
diff --git a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
index 7363a04..20b14de 100644
--- a/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
+++ b/components/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/EmbeddedXmppTestServer.java
@@ -27,6 +27,7 @@ import javax.net.ssl.TrustManagerFactory;
 
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.vysper.mina.TCPEndpoint;
 import org.apache.vysper.storage.StorageProviderRegistry;
 import org.apache.vysper.storage.inmemory.MemoryStorageProviderRegistry;
@@ -89,7 +90,7 @@ public final class EmbeddedXmppTestServer {
 
                 xmppServer.addEndpoint(endpoint);
 
-                InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("xmppServer.jks");
+                InputStream stream = ObjectHelper.loadResourceAsStream("xmppServer.jks");
                 xmppServer.setTLSCertificateInfo(stream, "secret");
 
                 // allow anonymous logins
@@ -122,7 +123,7 @@ public final class EmbeddedXmppTestServer {
 
     public void bindSSLContextTo(JndiRegistry registry) throws Exception {
         KeyStore keyStore = KeyStore.getInstance("JKS");
-        keyStore.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("xmppServer.jks"), "secret".toCharArray());
+        keyStore.load(ObjectHelper.loadResourceAsStream("xmppServer.jks"), "secret".toCharArray());
 
         TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
         trustManagerFactory.init(keyStore);