summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/sca-java-architecture-guide.html
blob: 75bf4ef88f6cd856809ebae2fba438ea1aaafd6c (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
<!--

    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 Architecture Guide</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=45023">
						<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 Architecture Guide">SCA Java Architecture Guide</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="" 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%">
<DIV class="panel" style="background-color: #ffffff;border-color: #ECF4D1;border-style: solid;border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #ECF4D1;background-color: #ECF4D1;"><B>Apache Tuscany SCA Java Architecture Guide</B></DIV><DIV class="panelContent" style="background-color: #ffffff;">
<UL>
	<LI><A href="#SCAJavaArchitectureGuide-Overview">Overview</A>
	<UL>
		<LI><A href="#SCAJavaArchitectureGuide-CoreDefinition">Core</A></LI>
		<LI><A href="#SCAJavaArchitectureGuide-ExtensionDefinition">Extension</A></LI>
		<LI><A href="#SCAJavaArchitectureGuide-RuntimeDefinition">Runtime</A></LI>
	</UL>
	</LI>
	<LI><A href="#SCAJavaArchitectureGuide-InternalsHighLevelView">Internals High Level View</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-Bootstrap">Bootstrap</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-AssemblyModel">Assembly Model</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-Contribution">Contribution</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-BindingExtension">Binding Extension</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-ImplementationExtension">Component Implementation Extension</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-DataBindingExtension">Data Binding Extension</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-CompositeActivation">Composite Activation</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-LoadingSCAassemblies">Loading SCA assemblies</A></LI>
	<LI><A href="#SCAJavaArchitectureGuide-SpringIntegration">Spring Integration</A>
	<UL>
		<LI><A href="#SCAJavaArchitectureGuide-Springascomponentimplementation">Spring as component implementation</A></LI>
		<LI><A href="#SCAJavaArchitectureGuide-SpringasIOCcontainer">Spring as IOC container</A></LI>
	</UL>
	</LI>
</UL>
</DIV></DIV>

<H3><A name="SCAJavaArchitectureGuide-Overview"></A><A name="SCAJavaArchitectureGuide-Overview"></A>Overview</H3>

<P>The SCA Java runtime is composed of core and extensions. The core is essentially a multi-VM wiring engine that connects components together using the principles of <A href="http://en.wikipedia.org/wiki/Dependency_injection" class="external-link" rel="nofollow">Dependency Injection</A>, or <A href="http://en.wikipedia.org/wiki/Inversion_of_control" class="external-link" rel="nofollow">Inversion of Control</A>.</P>

<H4><A name="SCAJavaArchitectureGuide-Core"></A><A name="SCAJavaArchitectureGuide-CoreDefinition"></A> Core</H4>

<P>The Core is designed to be simple and limited in its capabilities. It wires functional units together and provides SPIs that extensions can interact with. Capabilities such as service discovery, reliability, support for transport protocols, etc. are provided through extensions.</P>

<H4><A name="SCAJavaArchitectureGuide-Extension"></A><A name="SCAJavaArchitectureGuide-ExtensionDefinition"></A> Extension</H4>

<P>Extensions enhance SCA runtime functionality. Extension types are not fixed and core is designed to be as flexible as possible by providing an open-ended extension model. However, there are a number of known extension types defined including:</P>
<UL>
	<LI><B>Component implementation types</B>, e.g. Spring, Groovy, and JavaScript</LI>
	<LI><B>Binding types</B>, e.g. Axis, CXF, AMQP, ActiveMQ, JXTA</LI>
	<LI><B>DataBinding types</B>, e.g. JAXB, SDO, XmlBeans</LI>
	<LI><B>Interface Binding types</B>, e.g. WSDL, Java</LI>
</UL>


<P>Details of how to implement an extension can be can be found in the <A href="sca-java-extension-development-guide.html" title="SCA Java Extension Development Guide">Extensions Guide</A>.</P>

<H4><A name="SCAJavaArchitectureGuide-Runtime"></A><A name="SCAJavaArchitectureGuide-RuntimeDefinition"></A> Runtime</H4>

<P>The core is designed to be embedded in, or provisioned to, a number of different host environments. For example, the core may be provisioned to an OSGi container, a standalone runtime, a servlet engine, or J2EE application server. Runtime capabilities may vary based on the host environment.</P>

<P></P>

<H4><A name="SCAJavaArchitectureGuide-HighleveloverviewofJavaSCAruntime"></A>High level overview of Java SCA runtime</H4>

<P>The diagram shown below is a high level view of the SCA runtime which consists of the following key modules/packages:</P>
<OL>
	<LI>SCA Spec API: The APIs defined by the SCA Java Client and Implementation Spec</LI>
	<LI>API: Tuscany APIs which extend the SCA Spec APIs</LI>
	<LI>Core: The runtime implementation and the SPIs to extend it</LI>
	<LI>Extensions:
	<OL>
		<LI>Container implementation - For extending language support, for example BPEL, Python, C++, Ruby,..</LI>
		<LI>Binding - for extending protocol support, for example Axis2, CXF,..</LI>
		<LI>Interface Binding - for extending types of service definition, for example WSDL, Java, ...</LI>
		<LI>Databinding - for extending data support, for example SDO, JAXB, ...</LI>
	</OL>
	</LI>
	<LI>Host Platforms: The environments that host the Tuscany runtime.</LI>
</OL>


<P><SPAN class="image-wrap" style=""><IMG src="sca-java-architecture-guide.data/architectureOverview.jpg" style="border: 0px solid black"></SPAN></P>

<H3><A name="SCAJavaArchitectureGuide-InternalsHighLevelView"></A><A name="SCAJavaArchitectureGuide-InternalsHighLevelView"></A>Internals High Level View</H3>

<P>[Note: Do we want to link to <A href="java-sca-modulization-design-discussions.html" title="Java SCA Modulization Design Discussions">Kernel-Structure</A>]?</P>

<H3><A name="SCAJavaArchitectureGuide-Bootsrap"></A><A name="SCAJavaArchitectureGuide-Bootstrap"></A>Bootsrap</H3>

<P>Bootstrap process is controlled by Host environment. The default process is implemented in DefaultBootstrapper.<BR>
The runtime processes service assemblies serialized using SCA Assembly XML which can take other forms.</P>
<UL>
	<LI>The load phase processes SCDL and creates an in-memory model and produces corresponding runtime artifacts (e.g. components, services, references)</LI>
	<LI>The connect/wire phase wires references to services</LI>
</UL>


<P><SPAN class="image-wrap" style=""><IMG src="sca-java-architecture-guide.data/bootstrap.jpg" style="border: 0px solid black"></SPAN></P>

<H3><A name="SCAJavaArchitectureGuide-AssemblyModel"></A><A name="SCAJavaArchitectureGuide-AssemblyModel"></A>Assembly Model</H3>

<P>The SCA assembly model is represented as a set of interfaces in Tuscany. The following are some key elements.</P>
<UL>
	<LI>SCA <B>components</B> are configured instances of SCA implementations, which provide and consume&nbsp;services.</LI>
	<LI>SCA <B>services</B> are used to declare the externally accessible services of an implementation.</LI>
	<LI>SCA <B>references</B> represent a dependency that an implementation has on a service that is supplied&nbsp;by some other implementation, where the service to be used is specified through configuration.</LI>
	<LI>An <B>implementation</B> is concept that is used to describe a piece of software technology such as a Java&nbsp;class, BPEL process, XSLT transform, or C+&#43; class that is used to implement one or more services in&nbsp;a service-oriented application. An SCA composite is also an implementation.&nbsp;</LI>
	<LI><B>ComponentType</B> refers to the configurable aspects of an implementation.</LI>
	<LI><B>Interfaces</B> define one or more business functions. These business functions are provided by Services and are used by components through References. Services are defined by the Interface&nbsp;they implement. SCA currently supports two interface type systems:
	<UL>
		<LI>Java interfaces</LI>
		<LI>WSDL portTypes</LI>
	</UL>
	</LI>
	<LI>An SCA <B>composite</B> is the basic unit of composition within an SCA Domain. An <B><EM>SCA Composite</EM></B> is an&nbsp;assembly of Components, Services, References, and the Wires that interconnect them.</LI>
	<LI><EM>SCA</EM> <B><EM>wires</EM></B> connect <B><EM>service references</EM></B> to <B><EM>services</EM></B>.</LI>
	<LI><B><EM>Bindings</EM></B> are used by services and references. References use bindings to describe the access mechanism used to call the service to which they are wired. Services use bindings to describe the access mechanism(s) that clients should use to call the service.</LI>
	<LI><B>Properties</B> allow for the configuration of an implementation with externally set data values. The data value is provided through a Component, possibly sourced from the property of a containing composite.</LI>
</UL>


<UL>
	<LI><SPAN class="image-wrap" style=""><IMG src="sca-java-architecture-guide.data/assembly.jpg" style="border: 0px solid black"></SPAN></LI>
</UL>


<H3><A name="SCAJavaArchitectureGuide-Contribution"></A><A name="SCAJavaArchitectureGuide-Contribution"></A>Contribution</H3>

<P>The Tuscany runtime provides a framework to support SCA contributions. The framework can be extended against the following two extension points:</P>

<P>PackageProcessorExtensionPoint: It accepts extensions that can handle&nbsp;different packaging&nbsp;format/archives such as a directory, a JAR, an OSGi bundle, an EAR, a WAR and a ZIP.&nbsp;</P>

<P>ArtifactProcessorExtensionPoint: It accepts extensions that can handle specific types of artifacts such as WSDL, XSD, composite, java class, BPEL.</P>

<P><SPAN class="image-wrap" style=""><IMG src="sca-java-architecture-guide.data/contribution_overview.jpg" style="border: 0px solid black"></SPAN></P>
<UL>
	<LI>Package processors scans the contribution being installed and generate a list of artifacts that needs to be processed. Currently there is support for folder/file system and jar contribution packages. In order to be available to the contribution service, a package processors needs to register itself with the package processor extension.</LI>
</UL>


<UL>
	<LI>Artifact processors are used to process each artifact available on the contribution. In order to be available to the contribution service, a artifact processor needs to register itself with the artifact processor extension. An artifact processor will be called for each artifact in two phases :</LI>
</UL>


<UL>
	<LI>
	<UL>
		<LI>read phase : This is where you read an artifact (a document, an XML element, classes etc.), populate a model representing the artifact and return it. The SCA contribution service calls ArtifactProcessor.read() on all artifacts that have an ArtifactProcessor registered for them. If your model points to other models, instead of trying to load these other models right away, you should just keep the information representing that reference, which you'll turn into a pointer to the referenced model in the resolve() phase. Note that you don't necessarily need to fully read and populate your model at this point, you can choose to complete it later.</LI>
	</UL>
	</LI>
</UL>


<UL>
	<LI>
	<UL>
		<LI>resolve phase : This phase gives you the opportunity to resolve references to other models (a WSDL, a class, another composite, a componentType). At this point, all models representing the artifacts in your SCA contribution have been read, registered in the contribution's ArtifactResolver, and are ready to be resolved.</LI>
	</UL>
	</LI>
</UL>


<UL>
	<LI>All deployable composites should be now ready to get deployed to the SCA Domain</LI>
</UL>


<H3><A name="SCAJavaArchitectureGuide-ImplementationExtension"></A><A name="SCAJavaArchitectureGuide-ImplementationExtension"></A>Implementation Extension</H3>

<P>Implementation extension is responsible for supporting an implementation type, such as Java, Script, and BPEL</P>

<H3><A name="SCAJavaArchitectureGuide-BindingExtension"></A><A name="SCAJavaArchitectureGuide-BindingExtension"></A>Binding Extension</H3>

<P>Binding extension is responsible for supporting a binding type such as Web Service, JMS,&nbsp;&nbsp;JSON-RPC and RMI</P>

<H3><A name="SCAJavaArchitectureGuide-InterfaceExtension"></A><A name="SCAJavaArchitectureGuide-InterfaceExtension"></A>Interface Extension</H3>

<P>Interface extension is responsible for supporting an interface type such as Java interface and WSDL 1.1 portType</P>

<H3><A name="SCAJavaArchitectureGuide-DataBindingExtension"></A><A name="SCAJavaArchitectureGuide-DataBindingExtension"></A>Data Binding Extension</H3>

<P>Please refer to:&nbsp;<A href="tuscany-databinding-guide.html" title="Tuscany Databinding Guide">Tuscany Databinding Guide</A></P>

<H3><A name="SCAJavaArchitectureGuide-CompositeActivation"></A><A name="SCAJavaArchitectureGuide-CompositeActivation"></A>Composite Activation</H3>

<P>After a composite is fully configured, it can be activated in the SCA domain. The Tuscany runtime activates a composite in the following steps:</P>
<OL>
	<LI><B>Build the composite</B>: In this phase, the composite model is further normalized to facilitate the runtime interactions. The metadata is consolidated following the service/reference promotions. With the flattened model, we can get all the information at component level.</LI>
	<LI><B>Configure the composite</B>: In this phase, the composite hierarchy is navigated to configure the component implementation, reference binding and service binding with provider factories which&nbsp;will be used in later steps to create runtime wires among components and&nbsp;external services.&nbsp;&nbsp;&nbsp;</LI>
	<LI><B>Create the runtime wires</B>: In this phase, runtime wires are created for component references and component services over selected bindings. The runtime wire is a collection of invocation chains that are patitioned by operations. Each invocation chain consists of a set of invokers and interceptors s. Invokers provides the invocation logic to binding protocols and implementation technologies. Interceptors are speical kind of invokers that provide additional logic for the invocation, such as data transformation and transaction control. For a component reference, we create runtime wires to represent the outbound invocation over the selected binding. For a component service, we create runtime wires to represent the inbound invocation to the implementation type. Callback wires can be attached to component services to represent the callback invocations from the service.</LI>
	<LI><B>Start the composite</B>: In this phase, the start() callback methods defined by the ImplementationProvider, ReferenceBindingProvider and ServiceBindingProvider will be invoked. As a result, components, component references and component services are initialized to serve the component interactions. Service listeners are started to accept inbound requests from the binding layer.<SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="sca-java-architecture-guide.data/runtime-wire.jpg" style="border: 0px solid black"></SPAN><BR>
<SPAN class="image-wrap" style="display: block; text-align: center"><IMG src="sca-java-architecture-guide.data/invokers.jpg" style="border: 0px solid black"></SPAN></LI>
</OL>


<H4><A name="SCAJavaArchitectureGuide-InvocationOverview"></A>Invocation Overview</H4>

<UL>
	<LI>An invocation is dispatched to the WireInvocationHandler</LI>
	<LI>The WireInvocationHandler looks up the correct InvocationChain</LI>
	<LI>It then creates a message, sets the payload, sets the TargetInvoker, and passes the message down the chain</LI>
	<LI>When the message reaches the end of the chain, the TargetInvoker is called, which in turn is responsible for dispatching to the target</LI>
	<LI>Having the TargetInvoker stored on the outbound side allows it to cache the target instance when the wire source has a scope of equal or lesser value than the target (e.g. request--&gt;composite</LI>
</UL>


<P>The runtime provides components with InboundWires and OutboundWires. InvocationChains are held in component wires and are therefore stateless which allows for dynamic behavior such as introduction of new interceptors or re-wiring.</P>

<H3><A name="SCAJavaArchitectureGuide-LoadingSCAassemblies"></A><A name="SCAJavaArchitectureGuide-LoadingSCAassemblies"></A>Loading SCA assemblies</H3>


<H4><A name="SCAJavaArchitectureGuide-ArtifactProcessor"></A>Artifact Processor</H4>

<P>Artifact processors are responsible for processing each artifact available in a contribution package, these processors are going to be invoked in two phases</P>
<UL>
	<LI>read phase : This is where you read an artifact (a document, an XML element, classes etc.), populate a model representing the artifact and return it. The SCA contribution service calls ArtifactProcessor.read() on all artifacts that have an ArtifactProcessor registered for them. If your model points to other models, instead of trying to load these other models right away, you should just keep the information representing that reference, which you'll turn into a pointer to the referenced model in the resolve() phase. Note that you don't necessarily need to fully read and populate your model at this point, you can choose to complete it later.</LI>
</UL>


<UL>
	<LI>resolve phase : This phase gives you the opportunity to resolve references to other models (a WSDL, a class, another composite, a componentType). At this point, all models representing the artifacts in your SCA contribution have been read, registered in the contribution's ArtifactResolver, and are ready to be resolved.</LI>
</UL>


<H3><A name="SCAJavaArchitectureGuide-LoadingJavaSCA"></A>Loading Java SCA</H3>

<P>SCA service assemblies are deployed to the SCA domain in the format of SCDL files. Tuscany runtime artifact processor loads the SCDLs into model objects which are a set of java beans to hold the metadata.</P>

<P>There are two types of loaders:</P>
<UL>
	<LI>StAXElementLoader: Load the XML element from the StAX events</LI>
	<LI>ComponentTypeLoader: Load the Component Type for an implementation either by introspection or paring a side file</LI>
</UL>


<H3><A name="SCAJavaArchitectureGuide-LoadingComponentType"></A>Loading Component Type</H3>

<P>Loads the component type definition for a specific implementation</P>
<UL>
	<LI>How it does this is implementation-specific</LI>
	<LI>May load XML sidefile (location set by implementation)</LI>
	<LI>May introspect an implementation artifact (e.g. Java annotations)</LI>
	<LI>... or anything else</LI>
</UL>


<P>Loading Composite ComponentType Loader</P>
<UL>
	<LI>Load SCDL from supplied URL</LI>
	<LI>Extract and load SCDL from composite package</LI>
</UL>


<P>POJO ComponentType Loader</P>
<UL>
	<LI>Introspect Java annotations</LI>
	<LI>Uses a pluggable &quot;annotation processing&quot; framework to introspect Java classes</LI>
</UL>


<H3><A name="SCAJavaArchitectureGuide-Classdiagramfortheruntimeartifacts"></A>Class diagram for the runtime artifacts</H3>

<P><SPAN class="image-wrap" style=""><IMG src="sca-java-architecture-guide.data/runtime-model.jpg" style="border: 0px solid black"></SPAN></P>

<H3><A name="SCAJavaArchitectureGuide-SpringIntegration"></A><A name="SCAJavaArchitectureGuide-SpringIntegration"></A>Spring Integration</H3>
</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>