summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/documentation-2x/converting-tuscany-1x-extensions.html
blob: 152bf98fdc4a3991eccfd242eec0be8aa90c53b6 (plain)
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
    <HEAD>
           <META name="description" content="Apache Tuscany">
   <META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture,  sca, service component architecture, das, sdo, csa, ruby, opensource">

        <LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
        <LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/$images/favicon.ico">   
        <TITLE>Converting Tuscany 1.x Extensions : Apache Tuscany</TITLE>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>

   <STYLE>
    .spacetree * ul {
       padding-left:0px;
       margin-left: 0px;
    }
    .spacetree * li {
       margin-left: 5px;
       padding-left:5px;
    }
   </STYLE>

    <BODY onload="init()">
            <!-- topNav -->
    <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
      <TR class="topBar">
        <TD align="left" valign="middle" class="topBarDiv" align="left" nowrap="">
          <A href="https://cwiki.apache.org/geronimo"> Home</A> &gt;&nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="index.html" title="Index">Index</A>&nbsp;&gt;&nbsp;<A href="development-guides.html" title="Development Guides">Development Guides</A>&nbsp;&gt;&nbsp;<A href="" title="Converting Tuscany 1.x Extensions">Converting Tuscany 1.x Extensions</A>
        </TD>
        <TD align="right" valign="middle" nowrap="">
          <FORM name="search" action="http://www.google.com/search" method="get">
            <INPUT type="hidden" name="ie" value="UTF-8">
            <INPUT type="hidden" name="oe" value="UTF-8">
            <INPUT type="hidden" name="domains" value="">
            <INPUT type="hidden" name="sitesearch" value="">
            <INPUT type="text" name="q" maxlength="255" value="">        
            <INPUT type="submit" name="btnG" value="Google Search">
          </FORM>
        </TD>
      </TR> 
    </TABLE>

        
    <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
        <TR class="topBar">
            <TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
                &nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="index.html" title="Index">Index</A>&nbsp;&gt;&nbsp;<A href="development-guides.html" title="Development Guides">Development Guides</A>&nbsp;&gt;&nbsp;<A href="" title="Converting Tuscany 1.x Extensions">Converting Tuscany 1.x Extensions</A>
            </TD>

            <TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
            <A href="http://tuscany.apache.org/">Tuscany Home</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
            </TD>
        </TR>
    </TABLE>

        <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
            <TR>
                <TD valign="top" align="left" width="22%" bgcolor="#F9F9F9" class="noprint">
                        <DIV class="tabletitle">Table of Contents</DIV>
        <DIV class="spacetree">
            
            
            </DIV>
                </TD>
                <TD align="left" valign="top" width="78%">
                        <!-- pageContent -->
    <DIV id="PageContent">
      <DIV class="pageheader" style="padding: 6px 0px 0px 0px;">
        <!-- We'll enable this once we figure out how to access (and save) the logo resource -->
        <!--img src="http://geronimo.apache.org/images/confluence_logo.gif" style="float: left; margin: 4px 4px 4px 10px;" border="0"-->
        <DIV style="margin: 0px 10px 0px 10px" class="smalltext">Apache Tuscany Docs 2.x</DIV>
        <DIV style="margin: 0px 10px 8px 10px" class="pagetitle">Converting Tuscany 1.x Extensions</DIV>

        <DIV class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
<!-- -->         
            <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=3475132">
            <IMG src="http://geronimo.apache.org/images/icons/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
            <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=3475132">Edit Page</A>
          &nbsp;
          <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">
            <IMG src="http://geronimo.apache.org/images/icons/browse_space.gif" height="16" width="16" border="0" align="absmiddle" title="Browse Space"></A>
            <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">Browse Space</A>
          &nbsp;
          <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=3475132">
            <IMG src="http://geronimo.apache.org/images/icons/add_page_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add Page"></A>
          <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=3475132">Add Page</A>
          &nbsp;
          <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=3475132">
            <IMG src="http://geronimo.apache.org/images/icons/add_blogentry_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add News"></A>
          <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=3475132">Add News</A>
<!-- -->	 
        </DIV>
      </DIV>

      <DIV class="pagecontent">
        <DIV class="wiki-content">
          <H1><A name="ConvertingTuscany1.xExtensions-Converting1.xdependencies"></A>Converting 1.x dependencies</H1>

<P>You should configure the project pom.xml and</P>

<DIV class="table-wrap">
<TABLE class="confluenceTable"><TBODY>
<TR>
<TH class="confluenceTh"> 1.x Dependencies </TH>
<TH class="confluenceTh">&nbsp;</TH>
<TH class="confluenceTh"> 2.x Dependencies </TH>
</TR>
<TR>
<TD class="confluenceTd"> &lt;dependency&gt; <BR class="atl-forced-newline">
&lt;groupId&gt;org.apache.tuscany.sca&lt;/groupId&gt; <BR class="atl-forced-newline">
&lt;artifactId&gt;tuscany-assembly&lt;/artifactId&gt; <BR class="atl-forced-newline">
&lt;version&gt;1.6-SNAPSHOT&lt;/version&gt; <BR class="atl-forced-newline">
&lt;/dependency&gt; </TD>
<TD class="confluenceTd"> ===&gt; </TD>
<TD class="confluenceTd"> &lt;dependency&gt; <BR class="atl-forced-newline">
&lt;groupId&gt;org.apache.tuscany.sca&lt;/groupId&gt; <BR class="atl-forced-newline">
&lt;artifactId&gt;tuscany-assembly&lt;/artifactId&gt; <BR class="atl-forced-newline">
&lt;version&gt;2.0-SNAPSHOT&lt;/version&gt; <BR class="atl-forced-newline">
&lt;/dependency&gt; </TD>
</TR>
</TBODY></TABLE>
</DIV>


<P>The following core modules are not ported yet :</P>

<UL>
	<LI>some policies</LI>
</UL>


<P>The following modules are deprecated :</P>

<UL>
	<LI>host-embedded
	<UL>
		<LI>use the new Node APIs</LI>
	</UL>
	</LI>
</UL>


<H1><A name="ConvertingTuscany1.xExtensions-ConvertingCompositesandotherSCAXMLArtifacts"></A>Converting Composites and other SCA XML Artifacts</H1>

<DIV class="table-wrap">
<TABLE class="confluenceTable"><TBODY>
<TR>
<TH class="confluenceTh"> 1.x Namespace</TH>
<TH class="confluenceTh">&nbsp;</TH>
<TH class="confluenceTh"> 2.x Namespace </TH>
</TR>
<TR>
<TD class="confluenceTd"> <A href="http://www.osoa.org/xmlns/sca/1.0" class="external-link" rel="nofollow">http://www.osoa.org/xmlns/sca/1.0</A> </TD>
<TD class="confluenceTd"> ===&gt; </TD>
<TD class="confluenceTd"> <A href="http://docs.oasis-open.org/ns/opencsa/sca/200912" class="external-link" rel="nofollow">http://docs.oasis-open.org/ns/opencsa/sca/200912</A> </TD>
</TR>
<TR>
<TD class="confluenceTd"> <A href="http://tuscany.apache.org/xmlns/sca/1.0" class="external-link" rel="nofollow">http://tuscany.apache.org/xmlns/sca/1.0</A> </TD>
<TD class="confluenceTd"> ===&gt; </TD>
<TD class="confluenceTd"> <A href="http://tuscany.apache.org/xmlns/sca/1.1" class="external-link" rel="nofollow">http://tuscany.apache.org/xmlns/sca/1.1</A> </TD>
</TR>
</TBODY></TABLE>
</DIV>


<H1><A name="ConvertingTuscany1.xExtensions-GeneratingOSGiManifest"></A>Generating OSGi Manifest</H1>

<P>Configure pom to use Apache Felix <A href="http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html" class="external-link" rel="nofollow">maven-bundle-plugin</A></P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;

                &lt;configuration&gt;
                    &lt;instructions&gt;
                        &lt;Bundle-Version&gt;${tuscany.version}&lt;/Bundle-Version&gt;
                        &lt;Bundle-SymbolicName&gt;org.apache.tuscany.sca.binding.atom&lt;/Bundle-SymbolicName&gt;
                        &lt;Bundle-Description&gt;${pom.name}&lt;/Bundle-Description&gt;
                        &lt;Export-Package&gt;org.apache.tuscany.sca.binding.atom*&lt;/Export-Package&gt;
                        &lt;Import-Package&gt;org.apache.tuscany.sca.assembly.xml;version=<SPAN class="code-quote">&quot;2.0.0&quot;</SPAN>, *&lt;/Import-Package&gt;
                    &lt;/instructions&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

</PRE>
</DIV></DIV>

<P>Generate the manifest</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
mvn org.apache.felix:maven-bundle-plugin:manifest
</PRE>
</DIV></DIV>

<P>Copy the generated manifest from target folder to</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
&lt;module-root&gt;/META_INF/manifest.mf
</PRE>
</DIV></DIV>

<P>Add manifest to source control</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
git add META-INF
or
svn add META-INF
</PRE>
</DIV></DIV>

<P>Make any manual modifications as necessary</P>

<H1><A name="ConvertingTuscany1.xExtensions-Convertingyourextensionmodel"></A>Converting your extension model</H1>

<P>Your extension model needs to provide a new getType method</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> AtomCBinding <SPAN class="code-keyword">extends</SPAN> Binding {
   QName TYPE = <SPAN class="code-keyword">new</SPAN> QName(SCA11_TUSCANY_NS, <SPAN class="code-quote">&quot;binding.atom&quot;</SPAN>);
   ...
}

<SPAN class="code-keyword">public</SPAN> class AtomBindingImpl <SPAN class="code-keyword">implements</SPAN> AtomBinding {
   <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> name;
   <SPAN class="code-keyword">private</SPAN> <SPAN class="code-object">String</SPAN> uri;

   <SPAN class="code-keyword">public</SPAN> QName getType() {
	<SPAN class="code-keyword">return</SPAN> TYPE;
   }

    ...
}
</PRE>
</DIV></DIV>

<H1><A name="ConvertingTuscany1.xExtensions-ConvertingArtifactProcessors"></A>Converting Artifact Processors</H1>

<P>Make sure you update your META-INF\services\org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor with new namespace and any other necessary changes to reflect the current 2.x structure.</P>

<H1><A name="ConvertingTuscany1.xExtensions-ConvertingyouBindingruntimeartifacts"></A>Converting you Binding runtime artifacts</H1>

<H3><A name="ConvertingTuscany1.xExtensions-ProviderFactory"></A>Provider Factory</H3>

<UL>
	<LI>The provider factory interface has changed to accommodate the new Endpoint/EndPointReference support
	<UL>
		<LI>Although the interface has changed, all the previous available information are encapsulated and available from the Endpoint and EndpointReference object</LI>
	</UL>
	</LI>
</UL>



<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> BindingProviderFactory&lt;M <SPAN class="code-keyword">extends</SPAN> Binding&gt; <SPAN class="code-keyword">extends</SPAN> ProviderFactory&lt;M&gt; {

    /**
     * Creates a <SPAN class="code-keyword">new</SPAN> reference binding provider <SPAN class="code-keyword">for</SPAN> the given endpoint reference
     *
     * @param endpointReference defines the component/reference/binding against which to create the provider
     * @<SPAN class="code-keyword">return</SPAN> The binding provider
     */
    ReferenceBindingProvider createReferenceBindingProvider(EndpointReference endpointReference);

    /**
     * Creates a <SPAN class="code-keyword">new</SPAN> service binding provider <SPAN class="code-keyword">for</SPAN> the given component and
     * service.
     *
     * @param endpoint defines the component/service/binding against which to create the provider
     * @<SPAN class="code-keyword">return</SPAN> The binding provider
     */
    ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint);

}
</PRE>
</DIV></DIV>

<UL>
	<LI>If you are using ModelFactoryExtensionPoint, it was renamed to FactoryExtensionPoint</LI>
</UL>



<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
</PRE>
</DIV></DIV>


<H3><A name="ConvertingTuscany1.xExtensions-ReferenceBindingProviderandServiceBindingProvider"></A>ReferenceBindingProvider and ServiceBindingProvider</H3>

<P>The previous SCA Models that were previously passed directly to these SPIs, is now available via Endpoint and EndpointReference as described in the code below:</P>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> class AtomReferenceBindingProvider <SPAN class="code-keyword">implements</SPAN> ReferenceBindingProvider {

    <SPAN class="code-keyword">private</SPAN> RuntimeComponentReference reference;
    <SPAN class="code-keyword">private</SPAN> AtomBinding binding;

    <SPAN class="code-keyword">public</SPAN> AtomReferenceBindingProvider(EndpointReference endpointReference,
                                        AtomBinding binding) {

    	<SPAN class="code-keyword">this</SPAN>.reference = (RuntimeComponentReference) endpointReference.getReference();
        <SPAN class="code-keyword">this</SPAN>.binding = (AtomBinding) endpointReference.getBinding();
    }

    ...
}

<SPAN class="code-keyword">public</SPAN> class AtomServiceBindingProvider <SPAN class="code-keyword">implements</SPAN> ServiceBindingProvider {


    <SPAN class="code-keyword">private</SPAN> MessageFactory messageFactory;

    <SPAN class="code-keyword">private</SPAN> Endpoint endpoint;
    <SPAN class="code-keyword">private</SPAN> RuntimeComponent component;
    <SPAN class="code-keyword">private</SPAN> RuntimeComponentService service;
    <SPAN class="code-keyword">private</SPAN> InterfaceContract serviceContract;
    <SPAN class="code-keyword">private</SPAN> AtomBinding binding;
    <SPAN class="code-keyword">private</SPAN> ServletHost servletHost;

    ...

    <SPAN class="code-keyword">public</SPAN> AtomServiceBindingProvider(Endpoint endpoint,
                                         MessageFactory messageFactory,
                                         ServletHost servletHost) {
        <SPAN class="code-keyword">this</SPAN>.endpoint = endpoint;
        <SPAN class="code-keyword">this</SPAN>.component = (RuntimeComponent)endpoint.getComponent();
        <SPAN class="code-keyword">this</SPAN>.service = (RuntimeComponentService)endpoint.getService();
        <SPAN class="code-keyword">this</SPAN>.binding = (AtomBinding) endpoint.getBinding();
        <SPAN class="code-keyword">this</SPAN>.messageFactory = messageFactory;
        <SPAN class="code-keyword">this</SPAN>.servletHost = servletHost;

    }

    ....

</PRE>
</DIV></DIV>

<H1><A name="ConvertingTuscany1.xExtensions-ConvertingyouImplementationruntimeartifacts"></A>Converting you Implementation runtime artifacts</H1>

<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
...
</PRE>
</DIV></DIV>

<H1><A name="ConvertingTuscany1.xExtensions-Convertingtestcases"></A>Converting test cases</H1>

<P>In 2.x we removed the Host-Embedded module and the SCADomain, and the recommended way is to use the Node SPI to build your test cases. We also are recommending using JUnit 4.5 test styles. See below a quick</P>

<P><B>1.x Style</B></P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> class AtomTestCase {

	<SPAN class="code-keyword">private</SPAN> SCADomain domain;

	@Before
	<SPAN class="code-keyword">public</SPAN> void setUp() <SPAN class="code-keyword">throws</SPAN> Exception {
		domain = SCADomain.newInstance(<SPAN class="code-quote">&quot;AtomBinding.composite&quot;</SPAN>);
	}

	@After
	<SPAN class="code-keyword">public</SPAN> void tearDown() <SPAN class="code-keyword">throws</SPAN> Exception {
		domain.close();
	}

        ....
}
</PRE>
</DIV></DIV>

<P><B>2.x Style</B></P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">public</SPAN> class AtomTestCase {

	<SPAN class="code-keyword">private</SPAN> <SPAN class="code-keyword">static</SPAN> Node node;

	@BeforeClass
	<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void setUp() <SPAN class="code-keyword">throws</SPAN> Exception {
	    <SPAN class="code-keyword">try</SPAN> {
                <SPAN class="code-comment">// use the contribution helper to find the location of the contribution directory
</SPAN>                <SPAN class="code-comment">// based on a class that is know to be in the contribution
</SPAN>    		<SPAN class="code-object">String</SPAN> contribution = ContributionLocationHelper.getContributionLocation(AtomTestCase.class);

                <SPAN class="code-comment">// create a note to load the contribution and run the named composite
</SPAN>    		node = NodeFactory.newInstance().createNode(<SPAN class="code-quote">&quot;AtomBinding.composite&quot;</SPAN>, <SPAN class="code-keyword">new</SPAN> Contribution(<SPAN class="code-quote">&quot;test&quot;</SPAN>, contribution));

                <SPAN class="code-comment">// as an alternative to using the helper you can of course specify the location of the
</SPAN>                <SPAN class="code-comment">// contribution directly, <SPAN class="code-keyword">for</SPAN> example,
</SPAN>                <SPAN class="code-comment">//
</SPAN>                <SPAN class="code-comment">// node = NodeFactory.newInstance().createNode(<SPAN class="code-keyword">new</SPAN> Contribution(<SPAN class="code-quote">&quot;test&quot;</SPAN>,
</SPAN>                <SPAN class="code-comment">//                                             <SPAN class="code-quote">&quot;my/directory/structure/atom-contribution.zip&quot;</SPAN>));
</SPAN>                <SPAN class="code-comment">//
</SPAN>                <SPAN class="code-comment">// Note also that no composite is named here. It is assumed that the contribution
</SPAN>                <SPAN class="code-comment">// specifies a deployable composite in the sca-contribution.xml file
</SPAN>
                <SPAN class="code-comment">// start the node to make SCA services available
</SPAN>    		node.start();
    	    } <SPAN class="code-keyword">catch</SPAN> (Exception e) {
    		e.printStackTrace();
    	    }
	}

	@AfterClass
	<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">static</SPAN> void tearDown() <SPAN class="code-keyword">throws</SPAN> Exception {
	    node.stop();
    	    node.destroy();
	}

        ...
}
</PRE>
</DIV></DIV>

<P><B>NOTE</B> You will need to add the node-impl as test dependency to your modules</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
        &lt;dependency&gt;
            &lt;groupId&gt;org.apache.tuscany.sca&lt;/groupId&gt;
            &lt;artifactId&gt;tuscany-node-impl&lt;/artifactId&gt;
            &lt;version&gt;2.0-SNAPSHOT&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
</PRE>
</DIV></DIV>
        </DIV>

              </DIV>
    </DIV>
                </TD>
            </TR>
        </TABLE>

            <!-- footer -->
    <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
        <TR>
          <TD align="left" valign="middle" class="footer">
            &nbsp;&nbsp;
            <IMG src="http://static.delicious.com/img/delicious.small.gif" height="10" width="10" alt="Delicious">
            <A href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=550,height=550'); return false;">Bookmark this on Delicious</A>
            &nbsp;&nbsp;
            <IMG src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" alt="Digg!">
            <A href="" onclick="window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&topic=programming');">Digg this</A>
            <!-- Slicker, but no text
            <script type="text/javascript">
              digg_skin = 'icon';
              digg_window = 'new';
              digg_title = 'Apache Geronimo v2.2 Documentation : Converting Tuscany 1.x Extensions';
              digg_topic = 'programming';
            </script>
            <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
            -->
            &nbsp;&nbsp;
          </TD>
          <TD align="right" valign="middle" class="footer">
            <A href="http://cwiki.apache.org/GMOxPMGT/geronimo-privacy-policy.html">Privacy Policy</A>&nbsp;&nbsp;-&nbsp;&nbsp;
            Copyright &copy; 2003-2010, The Apache Software Foundation, Licensed under <A href="http://www.apache.org/licenses/LICENSE-2.0">ASL 2.0.</A>&nbsp;&nbsp;
          </TD>
        </TR>
    </TABLE> 

    </BODY>
</HTML>