summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/sca-java-bindingatom.html
blob: 1a2596918d32ad7762a101c04699a3eb5659293e (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
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE- 2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
    <HEAD>
		<!-- generateKeywords macro -->
	    <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">
		<!-- generateKeywords macro end -->
		
        <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/TUSCANY/$images/favicon.ico">   
        <TITLE>Apache Tuscany : SCA Java binding.atom</TITLE>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
    
    <BODY onload="init()">
        <!-- topNav macro -->
		<TABLE valign="top" border="0" cellspacing="0" cellpadding="0" width="100%" background="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg">
			<TR>
				<TD valing="top" align="left">
					<A href="https://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=TUSCANY&title=$siteroot"><IMG src="http://tuscany.apache.org/images/TuscanyLogoNEW_Text_120px_bg.jpg" height="91" width="25" border="0"></A>
				</TD>
				<TD>
					<A href="http://tuscany.apache.org/"><IMG src="http://tuscany.apache.org/images/TuscanyLogo.jpg" border="0"></A>
				</TD>
				
				<TD width="100%">
					&nbsp;
				</TD>

				<!-- Adds the edit page link to the top banner-->
				<TD valign="bottom">
					<DIV style="padding: 2px 10px; margin: 0px;">
						<A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=98605">
						<IMG src="http://tuscany.apache.org/images/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
					</DIV>
				</TD>

			</TR>
		</TABLE>
        <!-- topNav macro end -->

		<!-- breadCrumbs macro -->
		<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="home.html" title="Apache Tuscany">Apache Tuscany</A>&nbsp;&gt;&nbsp;<A href="home.html" title="Home">Home</A>&nbsp;&gt;&nbsp;<A href="sca-overview.html" title="SCA Overview">SCA Overview</A>&nbsp;&gt;&nbsp;<A href="sca-java.html" title="SCA Java">SCA Java</A>&nbsp;&gt;&nbsp;<A href="java-sca-documentation-menu.html" title="Java SCA Documentation Menu">Java SCA Documentation Menu</A>&nbsp;&gt;&nbsp;<A href="" title="SCA Java binding.atom">SCA Java binding.atom</A>
				</TD>
				
				<TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
				<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>
		<!-- breadCrumbs macro end -->


        <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
            <TR>
                <TD align="left" valign="top">

					<!-- pageContent macro -->
					<DIV id="PageContent">
												
						<DIV class="pagecontent">
							<DIV class="wiki-content">
								<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
<TD class="confluenceTd" valign="top" width="15%">
<DIV class="panel" style="background-color: #ECF4D1;border-color: #C3CDA1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #C3CDA1;background-color: #C3CDA1;"><B>General</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="home.html" title="Home">Home</A><BR>
<A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License </A><BR>
<A href="sca-java-get-involved.html" title="SCA Java Get Involved">Get Involved</A><BR>
<A href="sca-java-found-a-bug.html" title="SCA Java Found A Bug">Found a Bug?</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java.html" title="SCA Java">SCA Java Home</A><BR>
<A href="tuscany-dashboard.html" title="Tuscany Dashboard">SCA Dashboard</A><BR>
<A href="java-sca-tools.html" title="Java SCA Tools">Tools </A><BR>
<A href="tuscany-sca-java-faq.html" title="Tuscany SCA Java - FAQ">FAQ</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 1.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java-releases.html" title="SCA Java Releases">Downloads</A><BR>
<A href="java-sca-documentation-menu.html" title="Java SCA Documentation Menu">Documentation</A><BR>
<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/" class="external-link" rel="nofollow">1.x Source Code</A><BR>
<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>SCA Java 2.x</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java-2x-releases.html" title="SCA Java 2.x Releases">Downloads</A><BR>
<A href="http://tuscany.apache.org/documentation-2x/" class="external-link" rel="nofollow">Documentation</A><BR>
<A href="https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/" class="external-link" rel="nofollow">2.x Source Code</A><BR>
<A href="http://tinyurl.com/8rlxd3" class="external-link" rel="nofollow">Roadmap</A></P>
</DIV></DIV>


<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>Documentation</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="sca-java-user-guide.html" title="SCA Java User Guide">User Guide</A><BR>
<A href="sca-java-architecture-guide.html" title="SCA Java Architecture Guide">Architecture Guide</A><BR>
<A href="sca-java-development-guide.html" title="SCA Java Development Guide">Developer Guide</A><BR>
<A href="sca-java-extension-development-guide.html" title="SCA Java Extension Development Guide">Extension Developer Guide</A></P>
</DIV></DIV>

<DIV class="panel" style="background-color: #ECF4D1;border-color: #b4b4b5;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #b4b4b5;background-color: #C3CDA1;"><B>Resources</B></DIV><DIV class="panelContent" style="background-color: #ECF4D1;">
<P><A href="tuscany-sca-java-faq.html" title="Tuscany SCA Java - FAQ">FAQ</A><BR>
<A href="https://svn.apache.org/repos/asf/incubator/tuscany/java/sca" class="external-link" rel="nofollow">Source Code</A></P>
</DIV></DIV>
</TD>
<TD class="confluenceTd" valign="top" width="85%">

<H3><A name="SCAJavabinding.atom-%3Cbinding.atom%3EIntroduction"></A>&lt;binding.atom&gt; Introduction</H3>

<P>The Tuscany Java SCA runtime supports Atom using the &lt;binding.atom&gt; extension. Tuscany can communicate with services that provide or consume items described in the Atom Syndication Format and Atom Publishing Protocol. The Atom protcol is an additional conceptual layer that operates on top of the Hyper Text Transfer Protocol, so it is useful to understand that underlying protocol as well. Reference materials on these specifications is available here.</P>

<UL>
	<LI><A href="http://tools.ietf.org/html/rfc2616" class="external-link" rel="nofollow">Hyper Text Transfer Protocol</A>.</LI>
	<LI><A href="http://tools.ietf.org/html/rfc4287" class="external-link" rel="nofollow">Atom Syndication Format</A>.</LI>
	<LI><A href="http://tools.ietf.org/html/rfc5023" class="external-link" rel="nofollow">Atom Publishing Protocol</A>.</LI>
</UL>


<P><IMG class="emoticon" src="https://cwiki.apache.org/confluence/images/icons/emoticons/lightbulb_on.gif" height="16" width="16" align="absmiddle" alt="" border="0"> Some of the function described here is included in the Tuscany 1.3.2 and 1.4 releases. The complete timeline of available and future plans is given in the <A href="http://tuscany.apache.org/sca-java-roadmap.html" class="external-link" rel="nofollow">Tuscany Web 2.0 Roadmap</A>.</P>


<H3><A name="SCAJavabinding.atom-UsingtheTuscanyAtombinding"></A>Using the Tuscany Atom binding</H3>

<P>The primary use of the Atom binding is to provide support for collections that can be shared in a distributed fashion. Examples of shared collections includes shopping carts, telephone directories, insurance forms, and blog sites. These collections of items can be added, retrieved, updated, and deleted using the 4 basic actions of the HTTP protocol:</P>
<UL>
	<LI>POST (create or add)</LI>
	<LI>GET (retreive or query)</LI>
	<LI>PUT (update)</LI>
	<LI>DELETE (destroy or remove</LI>
</UL>


<P>The simplest way to use the Atom binding is to declare a collection as a service and provide an HTTP address where one can access the service. This service is declared in an SCA composite file which describes the SCA domain.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
	&lt;service name=<SPAN class="code-quote">&quot;customer&quot;</SPAN> promote=<SPAN class="code-quote">&quot;CustomerCollection&quot;</SPAN>&gt;
		&lt;tuscany:binding.atom uri = <SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:8084/customer&quot;</SPAN>/&gt;
</SPAN>	&lt;/service&gt;
</PRE>
</DIV></DIV>

<P>The service can be implemented in Java or any of the the Tuscany implementation types. For example, here is a way to create an implmentation for the above CustomerCollection service in the Java type.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
    &lt;component name=<SPAN class="code-quote">&quot;CustomerCollection&quot;</SPAN>&gt;
        &lt;implementation.java class=<SPAN class="code-quote">&quot;org.apache.tuscany.sca.binding.atom.CustomerCollectionImpl&quot;</SPAN>/&gt;
    &lt;/component&gt;
</PRE>
</DIV></DIV>

<P>A collection that uses the Atom binding usually implements the Collection interface given in the package org.apache.tuscany.sca.binding.atom.collection. This interface declares the basic access methods mentioned above (post, get, put, and delete), and the data types on the methods are expressed as Atom type objects Feed and Entry. In other words, one can view the collection as an Atom Feed, and manipulate items in the Feed as Atom Entries. This shows the basic methods of the Atom Collection intergface in Tuscany:</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> Collection {

    Entry post(Entry entry);
    Entry get(<SPAN class="code-object">String</SPAN> id) <SPAN class="code-keyword">throws</SPAN> NotFoundException;
    void put(<SPAN class="code-object">String</SPAN> id, Entry entry) <SPAN class="code-keyword">throws</SPAN> NotFoundException;
    void delete(<SPAN class="code-object">String</SPAN> id) <SPAN class="code-keyword">throws</SPAN> NotFoundException;

    Feed getFeed();
    Feed query(<SPAN class="code-object">String</SPAN> queryString);
}
</PRE>
</DIV></DIV>

<P>It is up to the developer or implementer of the shopping cart, telephone directory, or blog site to provide the code that implements the Collection interface. The developer or implementor also provides the code that translates from the business objects (shopping cart items, directory entries, insurance forms, blog articles) to the Atom model objects Feed and Entry.</P>

<P>One of the features of using this binding is that your business objects (shopping cart items, directory entries, insurance forms, and blog articles) can now be easily published and shared by the many Atom supporting tools such as feed readers, web browsers, and syndication aggregation. In other words, people can access your collection most anywhere on any device.</P>

<H3><A name="SCAJavabinding.atom-Example"></A>Example</H3>

<P>Continuing with the CustomerCollection example shown above, let's see how one of the common access methods. In this case, let's look at the post method and how one would add a new item to the collection. When you declared your Atom binding in your SCA composite, you also provided a uri for your collection. Using a web browser or other device, a user performs an HTTP put request to this uri, with the body of the put containing the data. Tuscany SCA performs the task of invoking the correct service and finding the Java implementation for your collection and calling the correct method. </P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
    <SPAN class="code-keyword">public</SPAN> Entry post(Entry entry) {
       <SPAN class="code-comment">// 1. Validate entry fields
</SPAN>       <SPAN class="code-keyword">if</SPAN> (entry.getTitle() != <SPAN class="code-keyword">null</SPAN> ) {
          entryID = <SPAN class="code-quote">&quot;tag:&quot;</SPAN> + site <SPAN class="code-quote">&quot;,&quot;</SPAN> + todaysDate + <SPAN class="code-quote">&quot;:&quot;</SPAN> + title;
          entry.setID( entryID );
       }
       <SPAN class="code-comment">// 2. Provide any additional data.
</SPAN>       entry.setUpdated( <SPAN class="code-keyword">new</SPAN> Date() );
       <SPAN class="code-comment">// 3. Store data in local collection or data base.
</SPAN>       entries.put(id, entry);
       <SPAN class="code-comment">// 4. Return entry to poster.
</SPAN>       <SPAN class="code-keyword">return</SPAN> entry;
    }
</PRE>
</DIV></DIV>

<P>Much of the code consists of converting from a Feed or Entry to a business data model and storing to a collection.</P>

<P>Tuscany uses the Apache Abdera project to provide a model for Atom data. Please see <A href="http://incubator.apache.org/abdera/" class="external-link" rel="nofollow">Apache Abdera</A> for the Java method to access Atom Feeds and Entries, and how to easily convert these Java objects to and from XML.</P>

<H3><A name="SCAJavabinding.atom-OtherFeaturesoftheTuscanyAtomBinding"></A>Other Features of the Tuscany Atom Binding</H3>

<P>More advanced features of the Tuscany Atom binding are described below.</P>

<H4><A name="SCAJavabinding.atom-DataCachingusingETags%2CLastModified%2CandotherHeaderCommands"></A>Data Caching using ETags, Last-Modified, and other Header Commands</H4>

<P>Atom feeds and entries can often be very large pieces of data. Since Tuscany uses the Atom data binding as one of its supported bindings, there is the potential that many requests for data may have large pieces of data associated with a request.</P>

<P>Hyper Text Transfer Protocol (HTTP), the basis of the web, has support to help limit or cache the amount of data shared between a client and server by adding tags to a resource reques. These header tags are the ETag and the Last-Modified tags. When used with a predicate tag such as If-Match, If-Not-Match, If-Modified-Since, If-Unmodified-Since, etc., the client and the server can avoid shipping large pieces of data when updated data is not needed. </P>

<P>The following entry scenarios show how Tuscany supports this form of caching throught ETags, Last-Modified, and other Header Commands.</P>

<UL>
	<LI>Posting new entry data to a feed<BR>
  (Show entry data post request, item does not exist on server, server response code 200, return entry data body)</LI>
	<LI>Updating existing entry data in a feed<BR>
  (Show data update put, If-Match precondition, item is newer and matching, matching return code 412)</LI>
	<LI>Requesting existing entry data<BR>
  (Show get via ETag, If-None-Match precondition, modified entry data item, matching entry body returned)	</LI>
	<LI>Requesting stale entry data<BR>
  (Show get via ETAG, If-None-Match precondition, unmodified entry data item, not modified return code 304)</LI>
	<LI>Requesting up-to-date entry data<BR>
  (Show request via last-modified date, entry data is unmodified, Not modified return code 304)</LI>
	<LI>Requesting out-of-date entry data<BR>
  (Show request via last-modified date, entry data is modified, updated data is returned)</LI>
</UL>


<P>Tuscany provides a test case ProviderEntryEntityTagsTest.java in module binding.atom.abdera that validates these Entry caching scenarios via JTest. Additionally, the following Feed scenarios are provided in the test case ProviderFeedEntityTagsTest.java.</P>

<UL>
	<LI>Test feed basics<BR>
   (Request Atom feed. Check that feed is non-null, has Id, title, and updated values. Check for Etag and Last-Modified headers)</LI>
	<LI>Test Unmodified If-Match predicate<BR>
   (Request feed based on existing ETag. Use If-Match predicate in request header. Expect status 200 and feed body.)</LI>
	<LI>Test Unmodified If-None-Match predicate<BR>
   (Request feed based on existing ETag. Use If-None-Match predicate in request header. Expect status 304, item not modified, no feed body.)</LI>
	<LI>Test Unmodified If-Unmodified-Since predicate<BR>
   (Request feed based on very current Last-Modified. Use If-Unmodified-Since predicate in request header. Expect status 304, item not modified, no feed body.)</LI>
	<LI>Test Unmodified If-Modified-Since predicate<BR>
   (Request feed based on very old Last-Modified. Use If-Modified-Since predicate in request header. Expect status 200, feed in body.)</LI>
	<LI>Test Modified If-None-Match predicate<BR>
   (Request feed based on existing ETag. Use If-None-Match predicate in request header. Expect status 200, feed in body.)</LI>
	<LI>Test Modified If-Match predicate<BR>
   (Request feed based on existing ETag. Use If-Match predicate in request header. Expect status 412, precondition failed, no feed in body.)</LI>
	<LI>Test Modified If-UnModified-Since predicate<BR>
   (Request feed based on very recent Last-Mod date. Use If-Unmodified-Since predicate in request header. Expect status 304, no feed in body.)</LI>
	<LI>Test Modified If-Modified-Since predicate<BR>
   (Request feed based on very old Last-Mod date. Use If-Modified-Since predicate in request header. Expect status 200, feed in body.)</LI>
</UL>


<P>Support of Web 2.0 data caching via ETags and Last-Modified fields allow the Tuscany user to save bandwidth and re-requests of data. Especially in the area of content feeds which can have very large data objects, the ability to cache improves server performance and reduces network bottlenecks. A full end-to-end demonstration of this network savings is being created via Jira TUSCANY-2537 which will show caching in the feed aggregator sample.</P>

<H4><A name="SCAJavabinding.atom-SupportforNegotiatedContentTypes"></A>Support for Negotiated Content Types</H4>

<P>Requests for data now respond with negotiated content types. In other words, the requester can now state which content types are preferred, and the responder can provide different content types. The data preference is expressed in the request header &quot;Accept&quot; parameter.</P>

<P>These data binding types are supported:</P>
<UL>
	<LI>Atom XML format (Request header Accept=application/atom+xml)</LI>
	<LI>Atom in JSON format (Request header Accept=application/atom+json)</LI>
</UL>


<P>The following content types are requestable in different data bindings</P>
<UL>
	<LI>Atom entry data (MIME type application/atom+xxx;type=entry where xxx=xml or json)</LI>
	<LI>Atom feed data (MIME type application/atom+xxx;type=feed where xxx=xml or json)</LI>
</UL>


<P>For example, the requester asks for an Atom entry with no Accept header or Accept header value is application/atom+xml. The returned response body contains:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Atom Entry response body as XML</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;entry xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2005/Atom&quot;</SPAN>&gt;
</SPAN>  &lt;title type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;customer Fred Farkle&lt;/title&gt;
  &lt;updated&gt;2008-08-08T18:40:30.484Z&lt;/updated&gt;
  &lt;author&gt;
    &lt;name&gt;Apache Tuscany&lt;/name&gt;
  &lt;/author&gt;
  &lt;content type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;Fred Farkle&lt;/content&gt;
  &lt;id&gt;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&lt;/id&gt;
  &lt;link href=<SPAN class="code-quote">&quot;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&quot;</SPAN> rel=<SPAN class="code-quote">&quot;edit&quot;</SPAN> /&gt;
  &lt;link href=<SPAN class="code-quote">&quot;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&quot;</SPAN> rel=<SPAN class="code-quote">&quot;alternate&quot;</SPAN> /&gt;
&lt;/entry&gt;
</PRE>
</DIV></DIV> 

<P>In contrast, the requester asks for an Atom entry with Accept header value is application/atom+json. The returned response body contains:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Atom Entry response body as JSON</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
{
 <SPAN class="code-quote">&quot;id&quot;</SPAN>:<SPAN class="code-quote">&quot;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&quot;</SPAN>,
 <SPAN class="code-quote">&quot;title&quot;</SPAN>:<SPAN class="code-quote">&quot;customer Fred Farkle&quot;</SPAN>,
 <SPAN class="code-quote">&quot;content&quot;</SPAN>:<SPAN class="code-quote">&quot;Fred Farkle&quot;</SPAN>,
 <SPAN class="code-quote">&quot;updated&quot;</SPAN>:<SPAN class="code-quote">&quot;2008-08-08T18:40:30.484Z&quot;</SPAN>,
 <SPAN class="code-quote">&quot;authors&quot;</SPAN>:[{
   <SPAN class="code-quote">&quot;name&quot;</SPAN>:<SPAN class="code-quote">&quot;Apache Tuscany&quot;</SPAN>
  }
 ],
 <SPAN class="code-quote">&quot;links&quot;</SPAN>:[{
   <SPAN class="code-quote">&quot;href&quot;</SPAN>:<SPAN class="code-quote">&quot;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&quot;</SPAN>,
   <SPAN class="code-quote">&quot;rel&quot;</SPAN>:<SPAN class="code-quote">&quot;edit&quot;</SPAN>
  },{
   <SPAN class="code-quote">&quot;href&quot;</SPAN>:<SPAN class="code-quote">&quot;urn:uuid:customer-91d349b3-4b8b-4cfa-b9e9-d999f9937085&quot;</SPAN>,
   <SPAN class="code-quote">&quot;rel&quot;</SPAN>:<SPAN class="code-quote">&quot;alternate&quot;</SPAN>
  }
 ]
}
</PRE>
</DIV></DIV> 

<P>The ability to  view entires and feeds in multiple data formats allows the Tuscany user extreme flexibility in parsing and processing data returned by a service or collection.</P>

<H4><A name="SCAJavabinding.atom-ServiceandWorkspaceDocumentSupport%28application%2Fatomsvcxml%29"></A>Service and Workspace Document Support (application/atomsvc+xml)</H4>

<P>Prior to this implementation, there was a dummy service document provided when you visited an Atom feed service address with an &quot;atomsvc&quot; extension. For example, running the the Atom service binding unit tests, one could visit <A href="http://localhost:8080/customer/atomsvc" class="external-link" rel="nofollow">http://localhost:8080/customer/atomsvc</A> and receive the following service document:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Tuscany Atom Binding Dummy Service document</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
   &lt;?xml version='1.0' encoding='UTF-8'?&gt;
   &lt;service xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2007/app&quot;</SPAN> xmlns:atom=<SPAN class="code-quote">&quot;http://www.w3.org/2005/Atom&quot;</SPAN>&gt;
</SPAN>      &lt;workspace&gt;
         &lt;atom:title type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;resource&lt;/atom:title&gt;
         &lt;collection href=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//luck.ibm.com:8084/customer&quot;</SPAN>&gt;
</SPAN>            &lt;atom:title type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;collection&lt;/atom:title&gt;
            &lt;accept&gt;application/atom+xml;type=entry&lt;/accept&gt;
            &lt;categories /&gt;
         &lt;/collection&gt;
      &lt;/workspace&gt;
   &lt;/service&gt;
</PRE>
</DIV></DIV>
<P>This dummy implementation did not provide a true collection name, URL to the collection, accept MIME types or categories.</P>

<P>Following the inclusion of TUSCANY-2597 and the new implentation, the Tuscany Atom binding  will correctly populate an atomsvc document with information from the feed and give correct information for discovery. Now , running the the Atom service binding unit tests, one could visit <A href="http://localhost:8080/customer/atomsvc" class="external-link" rel="nofollow">http://localhost:8080/customer/atomsvc</A> and receive the following service document:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Tuscany Atom Binding Service document</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;service xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2007/app&quot;</SPAN> xmlns:atom=<SPAN class="code-quote">&quot;http://www.w3.org/2005/Atom&quot;</SPAN>&gt;
</SPAN>  &lt;workspace xml:base=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:8084/&quot;</SPAN>&gt;
</SPAN>    &lt;atom:title type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;workspace&lt;/atom:title&gt;
    &lt;collection href=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//localhost:8084/customer&quot;</SPAN>&gt;
</SPAN>      &lt;atom:title type=<SPAN class="code-quote">&quot;text&quot;</SPAN>&gt;customers&lt;/atom:title&gt;
      &lt;accept&gt;application/atom+xml; type=feed&lt;/accept&gt;
      &lt;accept&gt;application/json; type=feed&lt;/accept&gt;
      &lt;accept&gt;application/atom+xml; type=entry&lt;/accept&gt;
      &lt;accept&gt;application/json; type=entry&lt;/accept&gt;
      &lt;categories /&gt;
    &lt;/collection&gt;
  &lt;/workspace&gt;
&lt;/service&gt;
</PRE>
</DIV></DIV>

<P>The service document is now properly populated with URLs, titles, accept MIME types and categories. These are elements that are needed for collection discovery and visitatin.</P>

<H4><A name="SCAJavabinding.atom-SupportforfullJavaScriptAtomclient."></A>Support for full JavaScript Atom client.</H4>
<P><A name="SCAJavabinding.atom-JavaScriptAtomClient"></A><BR>
After creating and publishing your SCA service, it can be tedious converting to and from Atom Feeds and Entries on the client side. Tuscany provides a full JavaScript object model for Atom Feeds, Entries, and other data objects. This benefits customers and client developers by providing an easy model to use in HTML, JSP, scripts, GUIs, and other client side technology.</P>

<P>For example, prior to this feature, developers would have to develop code in XML to manipulate nodes in the XML document that represented the current page:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Tuscany client side XML Document Manipulation (old style)</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
   <SPAN class="code-keyword">var</SPAN> entries = feed.getElementsByTagName(<SPAN class="code-quote">&quot;entry&quot;</SPAN>);              
   <SPAN class="code-keyword">var</SPAN> list = &quot;&quot;;
   <SPAN class="code-keyword">for</SPAN> (<SPAN class="code-keyword">var</SPAN> i=0; i&lt;entries.length; i++) {
      <SPAN class="code-keyword">var</SPAN> item = entries[i].getElementsByTagName(<SPAN class="code-quote">&quot;content&quot;</SPAN>)[0].firstChild.nodeValue;
      list += item + ' &lt;br&gt;';
   }
</PRE>
</DIV></DIV>

<P>Using the new JavaScript client object model, the code is greatly simplified and easier to understand:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Tuscany client side JavaScript Atom Object Model (new style)</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
   <SPAN class="code-keyword">var</SPAN> entries = feed.getEntries();              
   <SPAN class="code-keyword">var</SPAN> list = &quot;&quot;;
   <SPAN class="code-keyword">for</SPAN> (<SPAN class="code-keyword">var</SPAN> i=0; i&lt;entries.length; i++) {
      <SPAN class="code-keyword">var</SPAN> item = entries[i].getContent();
      list += item + ' &lt;br&gt;';
   }
</PRE>
</DIV></DIV>

<P>Additionally, the Tuscany Atom JavaScript client provides full deserialization and serialization to and from the JavaScript Atom model and its XML format. In other words let's say you create an HTML page that scrapes a data base and wants to submit the data as an entry to a collection of blog articles. You can create the Entry data using the JavaScript Entry model:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
       <SPAN class="code-keyword">var</SPAN> entry = <SPAN class="code-keyword">new</SPAN> Entry();
       entry.setNamespace( <SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2005/Atom&quot;</SPAN> );
</SPAN>       entry.setTitle( <SPAN class="code-quote">&quot;Atom-Powered Robots Run Amok&quot;</SPAN> );
       entry.setId( <SPAN class="code-quote">&quot;urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a&quot;</SPAN> );
       entry.setUpdated( <SPAN class="code-quote">&quot;2003-12-13T18:30:02Z&quot;</SPAN> );
       entry.setContent( <SPAN class="code-quote">&quot;Some text.&quot;</SPAN> );
       entry.addAuthor( <SPAN class="code-keyword">new</SPAN> Person( <SPAN class="code-quote">&quot;John Doe&quot;</SPAN> ) );
       entry.addAuthor( <SPAN class="code-keyword">new</SPAN> Person( <SPAN class="code-quote">&quot;Mark Pilgrim&quot;</SPAN>, <SPAN class="code-quote">&quot;f8dy@example.com&quot;</SPAN> ));
       entry.addContributor( <SPAN class="code-keyword">new</SPAN> Person( <SPAN class="code-quote">&quot;Sam Ruby&quot;</SPAN> ));
       entry.addContributor( <SPAN class="code-keyword">new</SPAN> Person( <SPAN class="code-quote">&quot;Joe Gregorio&quot;</SPAN> ));
       entry.addLink( <SPAN class="code-keyword">new</SPAN> Link( <SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//example.org/edit/first-post.atom&quot;</SPAN>, <SPAN class="code-quote">&quot;edit&quot;</SPAN> ));</SPAN>
</PRE>
</DIV></DIV>

<P>Now to convert this code to XML and submit it to a site is easy using the Tuscany Atom JavaScript client:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
       <SPAN class="code-keyword">var</SPAN> text = entry.toXML();
</PRE>
</DIV></DIV>

<P>The text string now contains the fully serialized XML format of the Entry object</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
      <SPAN class="code-quote">&quot;&lt;?xml version=&quot;</SPAN>1.0&quot;?&gt;
      &lt;entry xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2005/Atom&quot;</SPAN>&gt;
</SPAN>        &lt;title&gt;Atom-Powered Robots Run Amok&lt;/title&gt;
        &lt;id&gt;urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a&lt;/id&gt;
        &lt;updated&gt;2003-12-13T18:30:02Z&lt;/updated&gt;
        &lt;author&gt;&lt;name&gt;John Doe&lt;/name&gt;&lt;/author&gt;
        &lt;content&gt;Some text.&lt;/content&gt;
        &lt;link rel=<SPAN class="code-quote">&quot;edit&quot;</SPAN> href=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//example.org/edit/first-post.atom&quot;</SPAN>/&gt;
</SPAN>      &lt;/entry&gt;&quot;
</PRE>
</DIV></DIV>

<P>Similarly the Tuscany Atom JavaScript client contains methods for deserializing from XML reperesentations to a JavaScript Atom model:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
   <SPAN class="code-keyword">var</SPAN> feed = <SPAN class="code-keyword">new</SPAN> Feed();
   feed.readFromXML( xmlString );
</PRE>
</DIV></DIV>

<P>A full example showing how to use this client model is given in implementation-widgets-runtime. The store.html page shows the older style of document XML manipulation. The storeJS.html page shows the newer style of JavaScript object manipulation.</P>

<H4><A name="SCAJavabinding.atom-SupportforPostingandPuttingMediaItems"></A>Support for Posting and Putting Media Items</H4>
<P>The Atom Publishing Protocol provides for a separate space for storage of media resources. The purpose of a separate space for these resources is to keep feeds and entries from growing too large with the contents of typically large items. Media resources can be any binary object that is supported by a MIME type, but typically media resources include video, image, and audio type files.</P>

<P>Media resources are maintained by the collection implementor, and are given a dual identity. There is a location in the media respository, typically where one places the media files, and there is a location in the feed or entry space. This second reference is known as a media link entry.</P>

<P>The Tuscany package at org.apache.tuscany.sca.binding.atom.collection (in tuscany-binding-atom-abdera package) has the following interface for MediaCollection:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Tuscany MediaCollection interface</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
   /**
     * Creates a <SPAN class="code-keyword">new</SPAN> media entry
     * 
     * @param title
     * @param slug
     * @param contentType
     * @param media
     */
    Entry postMedia(<SPAN class="code-object">String</SPAN> title, <SPAN class="code-object">String</SPAN> slug, <SPAN class="code-object">String</SPAN> contentType, InputStream media);

    /**
     * Update a media entry.
     * 
     * @param id
     * @param contentType
     * @param media
     * @<SPAN class="code-keyword">return</SPAN>
     */
    void putMedia(<SPAN class="code-object">String</SPAN> id, <SPAN class="code-object">String</SPAN> contentType, InputStream media) <SPAN class="code-keyword">throws</SPAN> NotFoundException;
</PRE>
</DIV></DIV>

<P>These two methods are used to create (post) new media files, and update (put) new media information and edits. The media resources may be retrieved (get) or removed (delete) via the normal HTTP get and delete operations and the links returned by the post and get methods.</P>

<P>For instance, when creating a media resource, one typically posts the following information via an HTTP post request:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Requesting New Media Creation (postMedia method invoke)</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
POST /edit/ HTTP/1.1
Host: media.example.org
Content-Type: image/png
Slug: The Beach
Authorization: Basic ZGFmZnk6c2VjZXJldA==
Content-Length: nnn
...binary data...
</PRE>
</DIV></DIV>

<P>In turn, the Tuscany invocation framework invokes the postMedia shown above on the media collection implementation. The media collection implementation may then take the binary data from the media InputStream and store it to a media repository. The media collection implemenation should construct a proper Entry item via XML construction or some Atom model framework such as Apache Abdera. The Entry should contain the required elements (title, id, updated, summary, content, edit link, edit-media link) in order to provide the proper Atom Pub Protocol return headers and Entry data as given here:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Affirming New Media Creation (postMedia method return)</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
HTTP/1.1 201 Created
Content-Length: nnn
Content-Type: application/atom+xml;type=entry;charset=<SPAN class="code-quote">&quot;utf-8&quot;</SPAN>
Location: http:<SPAN class="code-comment">//example.org/media/edit/the_beach.atom
</SPAN>&lt;?xml version=<SPAN class="code-quote">&quot;1.0&quot;</SPAN>?&gt;
&lt;entry xmlns=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//www.w3.org/2005/Atom&quot;</SPAN>&gt;
</SPAN>   &lt;title&gt;The Beach&lt;/title&gt;
   &lt;id&gt;urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a&lt;/id&gt;
   &lt;updated&gt;2005-10-07T17:17:08Z&lt;/updated&gt;
   &lt;author&gt;&lt;name&gt;Daffy&lt;/name&gt;&lt;/author&gt;
   &lt;summary type=<SPAN class="code-quote">&quot;text&quot;</SPAN> /&gt;
   &lt;content type=<SPAN class="code-quote">&quot;image/png&quot;</SPAN>
      src=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//media.example.org/the_beach.png&quot;</SPAN>/&gt;
</SPAN>   &lt;link rel=<SPAN class="code-quote">&quot;edit-media&quot;</SPAN>
      href=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//media.example.org/edit/the_beach.png&quot;</SPAN> /&gt;
</SPAN>   &lt;link rel=<SPAN class="code-quote">&quot;edit&quot;</SPAN>
      href=<SPAN class="code-quote">&quot;http:<SPAN class="code-comment">//example.org/media/edit/the_beach.atom&quot;</SPAN> /&gt;
</SPAN>&lt;/entry&gt; 
</PRE>
</DIV></DIV>

<P>Note that the edit link provides the Atom Feed link to the media entry, and the edit-media link provides the media repository link to the media entry. Use these links to get and delete media.</P>

<P>A special convention has been implemented to allow the media collection implementation to return properties in the response header. The summary element of the Entry returned may contain a set of key=value properties separated via commas. For example, in order to provide return Content-Type and Content-Length values in the response header, one can created this text in the postMedia Entry summary element: <TT>Content-Type=image/jpg,Content-Length=21642</TT>.</P>

<P>The putMedia method acts in much the same way, but the URI to the item should contain an ID to the media being updated. For instance, if the usual post and get feed URI is <TT><A href="http://localhost:8084/receipt" class="external-link" rel="nofollow">http://localhost:8084/receipt</A></TT>, then to update the media given above one would put to the URI <TT><A href="http://localhost:8084/receipt/urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a" class="external-link" rel="nofollow">http://localhost:8084/receipt/urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</A></TT>. Here is an example of a put request:</P>
<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Requesting Media Update (putMedia method invoke)</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
PUT /edit/urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a HTTP/1.1
Host: media.example.org
Content-Type: image/png
Authorization: Basic ZGFmZnk6c2VjZXJldA==
Content-Length: nnn 
...binary data...
</PRE>
</DIV></DIV>

<P>After the above put request, the Atom binding will invoke the media collection implementation putMedia method. The media collection should update the media if the ID exists (and a 200 OK status code will return), or the media collection should throw a NotFoundException if the ID does not exist (and a 404 not found status code will return).</P>

<P>The above scenarios are documents in the MediaCollectionTestCase unit test case in the binding-atom-abdera module in the Tuscany code base.</P>

<H3><A name="SCAJavabinding.atom-SecurityPolicysupportinHTTPandWeb2.0Bindings"></A>Security Policy support in HTTP and Web 2.0 Bindings</H3>

<DIV class="panelMacro"><TABLE class="infoMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>work in progress</TD></TR></TABLE></DIV>

<H3><A name="SCAJavabinding.atom-Scenarios"></A>Scenarios</H3>

<UL>
	<LI>A Web 2.0 application requires that a user get authenticated before it can access the application.</LI>
	<LI>A Web 2.0 application requires that all communication between client/server be done using SSL.</LI>
	<LI>A given service, exposed using a web 2.0 binding requires user authentication.</LI>
	<LI>A given operation, exposed using a web 2.0 binding requires user authentication.</LI>
</UL>


<H3><A name="SCAJavabinding.atom-PolicyInterceptor"></A>Policy Interceptor</H3>

<P>The design approach that is being considered is to inject policy security interceptors, that would properly validate and enforce the security intents.<BR>
The authentication will be done using JAAS modules for authentication, and initially we would support authenticating to a list of username/password supplied by the application or using an LDAP.</P>

<P><SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="sca-java-bindinghttp-security-policy-section.data/high_level_design.jpg" style="border: 0px solid black"></SPAN></P>
</TD></TR></TBODY></TABLE>
							</DIV>
						</DIV>
					</DIV>	
		            <!-- pageContent macro end -->
					
                </TD>
            </TR>
        </TABLE>

		<!-- footer macro -->
				<SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
		</SCRIPT>
		<SCRIPT type="text/javascript">
		   _uacct = "UA-1174707-5";
		   urchinTracker();
		</SCRIPT>
		
				<A href="http://www.statcounter.com/" target="_blank"><IMG src="http://c26.statcounter.com/counter.php?sc_project=2619156&java=0&security=94bd7e7d&invisible=0" alt="website stats" border="0"></A>    

		<DIV class="footer">
			Copyright � 2003-2012, The Apache Software Foundation&nbsp;&nbsp;</BR>
                        Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation.
		</DIV>
		<!-- footer macro end -->

    </BODY>
</HTML>