Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5fc9043502d9e0918c1a2ef4964863c4262cc78f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>

<HEAD>
<TITLE>Creating Transport Connections (CDO Release Engineering Documentation)</TITLE>

<LINK REL="STYLESHEET" HREF="../../book.css" CHARSET="ISO-8859-1" TYPE="text/css">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Creating Transport Connections (CDO Release Engineering Documentation)";
    }
}
</SCRIPT>
<NOSCRIPT></NOSCRIPT>
</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<!-- <div class="help_breadcrumbs"><a href="../../Overview.html" title="CDO Release Engineering Documentation">CDO Release Engineering Documentation</a> > <a href="../index.html" title="Category in CDO Release Engineering Documentation">Technical Writer's Guide</a> > <a href="index.html" title="Category in CDO Release Engineering Documentation">Examples</a></div> -->

<table border="0">
	<tr>
		<td width="100%"><h1>Creating Transport Connections</h1></td>
		<td align="right" valign="middle" nowrap><a href="ConnectingToRepositories.html" title="Backward to Connecting To Repositories"><img src="../../../images/backward.png" border="0"></a>&nbsp;<a href="XmlSnippets.html" title="Forward to Embedding XML Snippets"><img src="../../../images/forward.png" border="0"></a></td>
	</tr>
</table>
<p class="author">Author: Eike Stepper</p>
<p>
 This tutorial outlines the steps needed to create a Net4j <a href="../../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/connector/IConnector.html" title="Interface in org.eclipse.net4j.connector"><code>IConnector</code></a> and connect it to an <a href="../../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/acceptor/IAcceptor.html" title="Interface in org.eclipse.net4j.acceptor"><code>IAcceptor</code></a>.
 <p>
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus
 lacinia dictum. Mauris non sem sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna ac
 est iaculis mattis. Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien sollicitudin nisi
 vestibulum nec vulputate urna euismod. Proin pulvinar ornare nunc, ac auctor elit placerat eget. Integer eu erat ac
 risus ultricies mattis vel nec nunc. Proin venenatis tellus sit amet dui congue nec vehicula urna sollicitudin. Donec
 porta, risus eu auctor semper, ante lectus lobortis sem, a luctus diam dui eu sapien. Sed at metus et dolor tincidunt
 convallis id a est. Donec quam nisl, scelerisque a feugiat id, mattis vel urna. Suspendisse facilisis, libero ac
 ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a viverra metus.
 <p>
 <b>Table of Contents</b> <p>
<table border="0">
<tr><td>1&nbsp;</td><td colspan="4"><a href="CreatingTransportConnections.html#SelectTransportType" title="Chapter in CDO Release Engineering Documentation">Select a Transport Type</a></td></tr>
<tr><td>2&nbsp;</td><td colspan="4"><a href="CreatingTransportConnections.html#SetupWiringContainer" title="Chapter in CDO Release Engineering Documentation">Setup a Wiring Container</a></td></tr>
<tr><td>3&nbsp;</td><td colspan="4"><a href="CreatingTransportConnections.html#AddConfigurationParameters" title="Chapter in CDO Release Engineering Documentation">Add Configuration Parameters</a></td></tr>
<tr><td></td><td>3.1&nbsp;</td><td colspan="3"><a href="CreatingTransportConnections.html#SetBufferCapacity" title="Chapter in CDO Release Engineering Documentation">Set the Buffer Capacity</a></td></tr>
<tr><td></td><td>3.2&nbsp;</td><td colspan="3"><a href="CreatingTransportConnections.html#SetConnectionTimeout" title="Chapter in CDO Release Engineering Documentation">Set the Connection Timeout</a></td></tr>
</table>
</p>


<h2><a name="SelectTransportType"></a>1&nbsp;&nbsp;Select a Transport Type</h2>
<p>
 Currently supported transport types are:
 <ul>
 <li><b>JVM</b> to connect to an <a href="../../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/jvm/IJVMAcceptor.html" title="Interface in org.eclipse.net4j.jvm"><code>IJVMAcceptor</code></a> in the same Java Virtual Machine.
 <li><b>TCP</b> to connect to an <a href="../../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/tcp/ITCPAcceptor.html" title="Interface in org.eclipse.net4j.tcp"><code>ITCPAcceptor</code></a> by means of a <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html" title="Class in java.nio.channels"><code>SocketChannel</code></a>.
 <li><b>SSL</b> an extension to the TCP transport that adds TLS/SSL security.
 <li><b>HTTP</b> to connect to an <a href="../../../../org.eclipse.net4j.doc/javadoc/org/eclipse/net4j/http/server/IHTTPAcceptor.html" title="Interface in org.eclipse.net4j.http.server"><code>IHTTPAcceptor</code></a> that is made available by a servlet.
 </ul>
 Continue with <a href="CreatingTransportConnections.html#SetConnectionTimeout" title="Chapter in CDO Release Engineering Documentation">Set the Connection Timeout</a>.<p><b>See Also:</b></p>
<ul>
	<li><a href="ConnectingToRepositories.html#SetBufferCapacity" title="Chapter in CDO Release Engineering Documentation">Set Buffer Capacity</a></li>
</ul>


<h2><a name="SetupWiringContainer"></a>2&nbsp;&nbsp;Setup a Wiring Container</h2>
<p>
 Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien sollicitudin nisi vestibulum nec
 vulputate urna euismod. Proin pulvinar ornare nunc, ac auctor elit placerat eget. Integer eu erat ac risus
 ultricies mattis vel nec nunc.
 <p>
 

<div class="snippet" style="margin-left:24px;" align="left">
  <a name="snippet_snippet1"></a>
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="../../../images/editor-top-left-java.png"></td>
      <td style="background-image:url(../../../images/editor-top1.png); background-repeat:repeat-x;" width="1px"><font face="Segoe UI,Arial" size="-1">ContainerSetup.java</font></td>
      <td width="1px"><img src="../../../images/editor-close.png"></td>
      <td style="background-image:url(../../../images/editor-top2.png); background-repeat:repeat-x;">&nbsp;</td>
      <td><img src="../../../images/editor-top-right.png"></td>
    </tr>
    <tr>
      <td style="background-image:url(../../../images/editor-left.png); background-repeat:repeat-y;">&nbsp;</td>
      <td colspan="3" align="left" valign="top" nowrap>
        <div style="margin:10px 0px 10px 0px;">
          <code>
            <font color="#3f7f5f">//&nbsp;Create&nbsp;a&nbsp;dedicated&nbsp;container&nbsp;instance</font><br/>
            IManagedContainer&nbsp;container&nbsp;=&nbsp;<a name="callout_snippet1_1_code" href="#callout_snippet1_1" alt="Create a separate IManagedContainer." title="Create a separate IManagedContainer."><img src="../../../images/callout-1.png" width="16" height="16" border="0" align="top"></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>ManagedContainer();<br/>
            <br/>
            <font color="#3f7f5f">//&nbsp;Register&nbsp;your&nbsp;custom&nbsp;factories</font><br/>
            container.registerFactory(&nbsp;<a name="callout_snippet1_2_code" href="#callout_snippet1_2" alt="Create a factory of type &quot;jms&quot; in the productGroup &quot;org.eclipse.net4j.connectors&quot;." title="Create a factory of type &quot;jms&quot; in the productGroup &quot;org.eclipse.net4j.connectors&quot;."><img src="../../../images/callout-2.png" width="16" height="16" border="0" align="top"></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>Factory(<font color="#2a00ff">&#34;org.eclipse.net4j.connectors&#34;</font>,&nbsp;<font color="#2a00ff">&#34;jms&#34;</font>)<br/>
            {<br/>
            &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font>IConnector&nbsp;create(String&nbsp;description)&nbsp;<font color="#7f0055"><b>throws&nbsp;</b></font>ProductCreationException<br/>
            &nbsp;&nbsp;{<br/>
            &nbsp;&nbsp;&nbsp;&nbsp;<font color="#7f0055"><b>return&nbsp;</b></font><a name="callout_snippet1_3_code" href="#callout_snippet1_3" alt="Create a JMS connector." title="Create a JMS connector."><img src="../../../images/callout-3.png" width="16" height="16" border="0" align="top"></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>JMSConnector(description);<br/>
            &nbsp;&nbsp;}<br/>
            });<br/>
            <br/>
            <font color="#3f7f5f">//&nbsp;Use&nbsp;utility&nbsp;classes&nbsp;to&nbsp;register&nbsp;additional&nbsp;factories</font><br/>
            Net4jUtil.prepareContainer(container);<br/>
            TCPUtil.prepareContainer(container);<br/>
            <br/>
            <font color="#3f7f5f">//&nbsp;Do&nbsp;not&nbsp;forget&nbsp;to&nbsp;activate&nbsp;the&nbsp;container&nbsp;before&nbsp;you&nbsp;use&nbsp;it</font><br/>
            <a name="callout_snippet1_4_code" href="#callout_snippet1_4" alt="The new container can not be used when inactive." title="The new container can not be used when inactive."><img src="../../../images/callout-4.png" width="16" height="16" border="0" align="top"></a>&nbsp;container.activate();
          </code>
        </div>
      </td>
      <td style="background-image:url(../../../images/editor-right.png); background-repeat:repeat-y;">&nbsp;</td>
    </tr>
    <tr>
      <td><img src="../../../images/editor-bottom-left.png"></td>
      <td style="background-image:url(../../../images/editor-bottom.png); background-repeat:repeat-x;" colspan="3">&nbsp;</td>
      <td><img src="../../../images/editor-bottom-right.png"></td>
    </tr>
  </table>
</div>
<p>
<div style="margin-left:24px;"><a name="callout_snippet1_1" href="#callout_snippet1_1_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../../../images/callout-1.png" width="16" height="16" border="0" align="top"></a>&nbsp;Create a separate <a href="../../../../org.eclipse.net4j.util.doc/javadoc/org/eclipse/net4j/util/container/IManagedContainer.html" title="Interface in org.eclipse.net4j.util.container"><code>IManagedContainer</code></a>.

</div>
<div style="margin-left:24px;"><a name="callout_snippet1_2" href="#callout_snippet1_2_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../../../images/callout-2.png" width="16" height="16" border="0" align="top"></a>&nbsp;Create a factory of <i>type</i> "jms" in the <i>productGroup</i> "org.eclipse.net4j.connectors".

</div>
<div style="margin-left:24px;"><a name="callout_snippet1_3" href="#callout_snippet1_3_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../../../images/callout-3.png" width="16" height="16" border="0" align="top"></a>&nbsp;Create a JMS connector.

</div>
<div style="margin-left:24px;"><a name="callout_snippet1_4" href="#callout_snippet1_4_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../../../images/callout-4.png" width="16" height="16" border="0" align="top"></a>&nbsp;The new container can not be used when inactive.

</div>
<p>

 <p>
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus
 lacinia dictum. Mauris non sem sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna ac
 est iaculis mattis. Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien sollicitudin
 nisi vestibulum nec vulputate urna euismod. Proin pulvinar ornare nunc, ac auctor elit placerat eget. Integer eu
 erat ac risus ultricies mattis vel nec nunc. Proin venenatis tellus sit amet dui congue nec vehicula urna
 sollicitudin. Donec porta, risus eu auctor semper, ante lectus lobortis sem, a luctus diam dui eu sapien. Sed at
 metus et dolor tincidunt convallis id a est. Donec quam nisl, scelerisque a feugiat id, mattis vel urna.
 Suspendisse facilisis, libero ac ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a
 viverra metus.

<h2><a name="AddConfigurationParameters"></a>3&nbsp;&nbsp;Add Configuration Parameters</h2>


<h3><a name="SetBufferCapacity"></a>3.1&nbsp;&nbsp;Set the Buffer Capacity</h3>
<p>
 

<div class="snippet" style="margin-left:24px;" align="left">
  <a name="snippet_JMSConnector"></a>
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="../../../images/editor-top-left-java.png"></td>
      <td style="background-image:url(../../../images/editor-top1.png); background-repeat:repeat-x;" width="1px"><font face="Segoe UI,Arial" size="-1">JMSConnector.java</font></td>
      <td width="1px"><img src="../../../images/editor-close.png"></td>
      <td style="background-image:url(../../../images/editor-top2.png); background-repeat:repeat-x;">&nbsp;</td>
      <td><img src="../../../images/editor-top-right.png"></td>
    </tr>
    <tr>
      <td style="background-image:url(../../../images/editor-left.png); background-repeat:repeat-y;">&nbsp;</td>
      <td colspan="3" align="left" valign="top" nowrap>
        <div style="margin:10px 0px 10px 0px;">
          <code>
            <font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font>JMSConnector&nbsp;<font color="#7f0055"><b>extends&nbsp;</b></font>Connector<br/>
            {<br/>
            &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font>JMSConnector(String&nbsp;description)<br/>
            &nbsp;&nbsp;{<br/>
            &nbsp;&nbsp;}<br/>
            <br/>
            &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font>multiplexChannel(InternalChannel&nbsp;<a name="callout_JMSConnector_1_code" href="#callout_JMSConnector_1" alt="The channel must not be null." title="The channel must not be null."><img src="../../../images/callout-1.png" width="16" height="16" border="0" align="top"></a>&nbsp;channel)<br/>
            &nbsp;&nbsp;{<br/>
            &nbsp;&nbsp;}<br/>
            <br/>
            &nbsp;&nbsp;&hellip;<br/>
            }
          </code>
        </div>
      </td>
      <td style="background-image:url(../../../images/editor-right.png); background-repeat:repeat-y;">&nbsp;</td>
    </tr>
    <tr>
      <td><img src="../../../images/editor-bottom-left.png"></td>
      <td style="background-image:url(../../../images/editor-bottom.png); background-repeat:repeat-x;" colspan="3">&nbsp;</td>
      <td><img src="../../../images/editor-bottom-right.png"></td>
    </tr>
  </table>
</div>
<p>
<div style="margin-left:24px;"><a name="callout_JMSConnector_1" href="#callout_JMSConnector_1_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../../../images/callout-1.png" width="16" height="16" border="0" align="top"></a>&nbsp;The channel must not be <code>null</code>.

</div>
<p>


<h3><a name="SetConnectionTimeout"></a>3.2&nbsp;&nbsp;Set the Connection Timeout</h3>
<p>
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus
 lacinia dictum. Mauris non sem sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna
 ac est iaculis mattis. Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien
 sollicitudin nisi vestibulum nec vulputate urna euismod. Proin pulvinar ornare nunc, ac auctor elit placerat
 eget. Integer eu erat ac risus ultricies mattis vel nec nunc. Proin venenatis tellus sit amet dui congue nec
 vehicula urna sollicitudin. Donec porta, risus eu auctor semper, ante lectus lobortis sem, a luctus diam dui eu
 sapien. Sed at metus et dolor tincidunt convallis id a est. Donec quam nisl, scelerisque a feugiat id, mattis vel
 urna. Suspendisse facilisis, libero ac ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo.
 Sed a viverra metus.

<p align="right">
<a href="ConnectingToRepositories.html" title="Backward to Connecting To Repositories"><img src="../../../images/backward.png" border="0"></a>&nbsp;<a href="XmlSnippets.html" title="Forward to Embedding XML Snippets"><img src="../../../images/forward.png" border="0"></a></p>
<HR>
<i>Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.</i>
</BODY>
</HTML>

Back to the top