You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ph...@apache.org on 2013/02/01 12:22:54 UTC
svn commit: r1441390 - in /qpid/proton/branches/jni-binding: ./
proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java
Author: philharveyonline
Date: Fri Feb 1 11:22:54 2013
New Revision: 1441390
URL: http://svn.apache.org/viewvc?rev=1441390&view=rev
Log:
NO-JIRA: merged from trunk to this branch (jni-binding) with the commands below
$ svn merge https://svn.apache.org/repos/asf/qpid/proton/trunk .
--- Merging r1441382 through r1441388 into '.':
U proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java
--- Recording mergeinfo for merge of r1421251 through r1441388 into '.':
U .
Modified:
qpid/proton/branches/jni-binding/ (props changed)
qpid/proton/branches/jni-binding/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java
Propchange: qpid/proton/branches/jni-binding/
------------------------------------------------------------------------------
Merged /qpid/proton/trunk:r1441382-1441388
Modified: qpid/proton/branches/jni-binding/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/branches/jni-binding/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java?rev=1441390&r1=1441389&r2=1441390&view=diff
==============================================================================
--- qpid/proton/branches/jni-binding/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java (original)
+++ qpid/proton/branches/jni-binding/proton-j/proton/src/main/java/org/apache/qpid/proton/messenger/impl/MessengerImpl.java Fri Feb 1 11:22:54 2013
@@ -173,7 +173,7 @@ public class MessengerImpl implements Me
throw new MessengerException("unable to send to address: " + m.getAddress());
}
int port = address.getPort() < 0 ? defaultPort(address.getScheme()) : address.getPort();
- Sender sender = getLink(address.getHost(), port, new SenderFinder(address.getPath()));
+ Sender sender = getLink(address.getHost(), port, new SenderFinder(cleanPath(address.getPath())));
adjustReplyTo(m);
@@ -261,7 +261,7 @@ public class MessengerImpl implements Me
}
else
{
- getLink(address.getHost(), port, new ReceiverFinder(address.getPath()));
+ getLink(address.getHost(), port, new ReceiverFinder(cleanPath(address.getPath())));
}
}
catch (URISyntaxException e)
@@ -717,7 +717,11 @@ public class MessengerImpl implements Me
public Sender create(Session session)
{
- return session.sender(_path);
+ Sender sender = session.sender(_path);
+ Target target = new Target();
+ target.setAddress(_path);
+ sender.setTarget(target);
+ return sender;
}
}
@@ -744,7 +748,11 @@ public class MessengerImpl implements Me
public Receiver create(Session session)
{
- return session.receiver(_path);
+ Receiver receiver = session.receiver(_path);
+ Source source = new Source();
+ source.setAddress(_path);
+ receiver.setSource(source);
+ return receiver;
}
}
@@ -905,6 +913,19 @@ public class MessengerImpl implements Me
}
}
+ private static String cleanPath(String path)
+ {
+ //remove leading '/'
+ if (path != null && path.length() > 0 && path.charAt(0) == '/')
+ {
+ return path.substring(1);
+ }
+ else
+ {
+ return path;
+ }
+ }
+
private static boolean matchTarget(Target target, String path)
{
if (target == null) return path.isEmpty();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org