qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1385272 - in /qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine: Connection.java Transport.java impl/ConnectionImpl.java impl/TransportImpl.java
Date Sun, 16 Sep 2012 14:46:36 GMT
Author: rgodfrey
Date: Sun Sep 16 14:46:35 2012
New Revision: 1385272

URL: http://svn.apache.org/viewvc?rev=1385272&view=rev
Log:
NO-JIRA : update proton-j to match API changes around connection/transport

Modified:
    qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Connection.java
    qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
    qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
    qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java

Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Connection.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Connection.java?rev=1385272&r1=1385271&r2=1385272&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Connection.java
(original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Connection.java
Sun Sep 16 14:46:35 2012
@@ -37,11 +37,6 @@ public interface Connection extends Endp
     public Session session();
 
     /**
-     * @return a newly created transport
-     */
-    public Transport transport();
-
-    /**
      * @return iterator for endpoints matching the specified local and
      *         remote states
      */

Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java?rev=1385272&r1=1385271&r2=1385272&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
(original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/Transport.java
Sun Sep 16 14:46:35 2012
@@ -30,6 +30,9 @@ public interface Transport extends Endpo
 {
 
     public int END_OF_STREAM = -1;
+
+    public void bind(Connection connection);
+
     /**
      * @param bytes input bytes for consumption
      * @param offset the offset within bytes where input begins

Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java?rev=1385272&r1=1385271&r2=1385272&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
(original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
Sun Sep 16 14:46:35 2012
@@ -30,7 +30,6 @@ public class ConnectionImpl extends Endp
 {
 
     public static final int MAX_CHANNELS = 255;
-    private TransportFactory _transportFactory = TransportFactory.getDefaultTransportFactory();
     private TransportImpl _transport;
     private List<SessionImpl> _sessions = new ArrayList<SessionImpl>();
     private EndpointImpl _transportTail;
@@ -54,7 +53,6 @@ public class ConnectionImpl extends Endp
 
     public ConnectionImpl()
     {
-        _transportFactory = TransportFactory.getDefaultTransportFactory();
     }
 
     public SessionImpl session()
@@ -129,18 +127,17 @@ public class ConnectionImpl extends Endp
     }
 
 
-    public Transport transport()
+    public void bind(Transport transport)
     {
         if(_transport == null)
         {
-            _transport = (TransportImpl) _transportFactory.transport(this);
+            _transport = (TransportImpl) transport;
         }
         else
         {
             // todo - should error
 
         }
-        return _transport;
     }
 
 

Modified: qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java?rev=1385272&r1=1385271&r2=1385272&view=diff
==============================================================================
--- qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
(original)
+++ qpid/proton/trunk/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java
Sun Sep 16 14:46:35 2012
@@ -98,12 +98,18 @@ public class TransportImpl extends Endpo
         _overflowBuffer.flip();
     }
 
-    public TransportImpl(Connection connectionEndpoint)
+    public TransportImpl()
     {
-        _connectionEndpoint = (ConnectionImpl) connectionEndpoint;
+        _frameParser = new FrameParser(this);
+    }
+
+    public void bind(Connection conn)
+    {
+        // TODO - check if already bound
+        ((ConnectionImpl) conn).bind(this);
+        _connectionEndpoint = (ConnectionImpl) conn;
         _localSessions = new TransportSession[_connectionEndpoint.getMaxChannels()+1];
         _remoteSessions = new TransportSession[_connectionEndpoint.getMaxChannels()+1];
-        _frameParser = new FrameParser(this);
     }
 
     public int input(byte[] bytes, int offset, int length)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message