qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Qpid > Create interface in common
Date Wed, 22 Jul 2009 13:05:01 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=qpid&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/qpid/Create+interface+in+common">Create
interface in common</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~aidan">Aidan
Skinner</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <ol>
	<li>passes and receives byte[]to/from the network driver to the protocoldriver</li>
	<li>outgoing and incoming buffers are held by the underlying network driver (eg. MINA,
o.a.q.transport.network.io)</li>
	<li>the protocol driver takes data in a byte[]</li>
	<li>the protocol driver writes data as a byte[]</li>
	<li>protocol driver should be non-blocking</li>
	<li>network interface and drivers should be thread model agnostic.</li>
	<li>an SSLConfiguration object of some description will be passed down to the network
driver which will use it for eg. the certificate store</li>
</ol>


<p>At the start of a connection the the NetworkDriver will pass data to a ProtocolFactory
which will handle protocol negotiation and return the ProtocolDriver to use or throw an exception
if no driver is available. </p>

<p>The network driver will call bytesReceived on the ProtocolDriver when data is recieved.
</p>

<p><img src="/confluence/download/attachments/2327666/noddy-network-blocks.png" align="absmiddle"
border="0" /></p>

<style type="text/css">
@import url(/confluence/download/resources/confluence.ext.code:code/shStyles.css);
</style>
<!--[if IE]>
<style type="text/css">
    .code textarea, .code input { padding: 0 !important; }
</style>
<![endif]-->
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">public
interface ProtocolDriver 
{

  int bytesReceived(byte[] bytes, int offset, int length);

  // Called when the connection has been idle
  void idle();

  void close();
  
  void halfclose();

}

public class AMQProtocolDriver implements ProtocolDriver 
{
  int bytesReceived(byte[] bytes, int offset, int length)
  {
     // Parses bytes until it figures out which ProtocolDriver to use, constructs  one and
then passes through all data and other method calls. 
  }

}


public interface NetworkDriver
{
   void open(InetAddress destination);

   void bind(int port, InetAddress[] addresses);

   void close();

   // Returns number of bytes actually accepted
   int write(byte[] bytes, int offset, int length);

   // Use the preconfigured SSLEngine
   void setSSLEngine(SSLEngine engine);

   // Taken from Socket
   void setKeepAlive(boolean on)
   void setOOBInline(boolean on)
   void setReceiveBufferSize(int size)
   void setReuseAddress(boolean on)
   void setSendBufferSize(int size)
   void setSoLinger(boolean on, int linger)
   void setSoTimeout(int timeout)
   void setTcpNoDelay(boolean on)
   void setTrafficClass(int tc)
}</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/qpid/Create+interface+in+common">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2327666&revisedVersion=12&originalVersion=11">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/qpid/Create+interface+in+common?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message