diff options
Diffstat (limited to 'site/trunk/site-publish/deployment.html')
-rw-r--r-- | site/trunk/site-publish/deployment.html | 299 |
1 files changed, 299 insertions, 0 deletions
diff --git a/site/trunk/site-publish/deployment.html b/site/trunk/site-publish/deployment.html new file mode 100644 index 0000000000..418cd9d8c6 --- /dev/null +++ b/site/trunk/site-publish/deployment.html @@ -0,0 +1,299 @@ + +<!-- + + 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 : Deployment</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%"> + + </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=43501"> + <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%"> + <A href="home.html" title="Apache Tuscany">Apache Tuscany</A> > <A href="home.html" title="Home">Home</A> > <A href="sca-overview.html" title="SCA Overview">SCA Overview</A> > <A href="sca-java.html" title="SCA Java">SCA Java</A> > <A href="sca-java-work-in-progress.html" title="SCA Java Work-In-Progress">SCA Java Work-In-Progress</A> > <A href="" title="Deployment">Deployment</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> + </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"> + <H2><A name="Deployment-1%29Addacontribution%26nbsp%3BtotheSCAdomain"></A>1) Add a contribution to the SCA domain</H2> + +<P><B>The contribution process is about adding Types to the domain (composites, classes, XSD complexTypes, etc).</B></P> + +<P>1. An SCA application is developed and packaged as a jar or another archive format</P> + +<P>2. The <B>ContributionService</B> is requested to add this jar as a contribution to the SCA domain. In effect, the SCA domain has a store to keep all the contributions. The ContributionService is an API that allows users to put contributions in the store. The contributions are identified by the URI. 3. Registered <B>ContributionProcessor</B>'s will be selected based on the contentType of the contribution. The ContributionProcessor is responsible to introspect the contribution which is a collection of artifacts. It may enlist other services to help, e.g the annotation processors for Java classes.We'd support a few well-known types in the core, primarily the ones used by the runtime like "jar" and "java class". Others could be contributed as extensions, e.g "rpm" </P> +<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><B>Introspection of a contribution</B><BR>In general the result of that introspection would be invariant so it can be cached and replicated in many places. Introspection will be intensive and so we should do it as little as possible and caching the results is good. Of course, we'd need invalidation too. + +<P>The caching is about storing the introspection results for "production" artifacts that are basically versioned and immutable. This is similar in concept to the way Maven caches artifacts locally and never needs to go back to an online repo once they have been downloaded. Given some introspections are likely to be expensive (e.g. scanning an EAR to look for EJBs and then processsing the class files for annotations) it would be good to avoid redoing that when its not necessary.</P></TD></TR></TABLE></DIV> + +<P>3. The <B>ContributionProcessor</B> introspects the contribution to create a list of artifacts of interest for SCA. Each artifact is classified by ContentTypes.</P> + +<P>4. The artifacts are parsed by the content type. we provide parsers for SCDL (StAXElementLoader) and we can reuse existing parsers for XSD and WSDL (XmlSchema, wsdl4j, woden). So the WSDL introspector would parse the document using, say, wsdl4j and then store the interesting things that it finds.</P> + +<P>5. The interesting definitions are added to the contribution store and that is the end of the contribution operation. We keep the contribution and cache the introspection results. </P> + +<P>The following diagram is created to illustrate the key players that interacts with the ContributionService.</P> + +<P><SPAN class="image-wrap" style=""><IMG src="deployment.data/tuscany_contribution_service.jpg" style="border: 0px solid black"></SPAN></P> + +<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>We could merge the ContributionProcessor and ArtifactProcessor concepts into one. If so, the processor for the jar will be called first, it scans the files in the jar and delegate the processors which can handle the content types, for example, WSDLProcessor to load WSDLs, XSDProcessor to load XSDs, JavaAnnotationProcessor to introspect java classes and SCDL loaders to load SCDL files.</TD></TR></TABLE></DIV> + + +<H1><A name="Deployment-ContributionServicesImplementation"></A>Contribution Services Implementation</H1> + +<P>The contribution services is available in multiple modules at java/sca/runtime/services</P> + +<H4><A name="Deployment-ContributionModules"></A>Contribution Modules</H4> + +<P><SPAN class="image-wrap" style=""><IMG src="deployment.data/Contribution%20Diagram.GIF" style="border: 0px solid black"></SPAN></P> +<DIV class="panelMacro"><TABLE class="noteMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>Note that the Contribution Services Implementation have dependencies on the Kernel SPI <BR> + -> LooaderRegistry<BR> + -> SCA Model objects + +<P>The Kernel will have dependency on Contribution-Framework once things get integrated</P></TD></TR></TABLE></DIV> + +<H4><A name="Deployment-TheContributionServiceinterface"></A>The ContributionService interface</H4> +<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> +<PRE class="code-java"> + +/** + * Service <SPAN class="code-keyword">interface</SPAN> that manages artifacts contributed to a Tuscany runtime. + * + * @version $Rev: 523009 $ $Date: 2007-03-27 10:38:24 -0700 (Tue, 27 Mar 2007) $ + */ +<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> ContributionService { + /** + * Contribute an artifact to the SCA Domain. The type of the contribution is + * determined by the Content-Type of the resource or, <SPAN class="code-keyword">if</SPAN> that is undefined, + * by some implementation-specific means (such as mapping an extension in + * the URL's path). + * + * @param contributionURI The URI that is used as the contribution unique ID. + * @param sourceURL the location of the resource containing the artifact + * @param storeInRepository flag that identifies <SPAN class="code-keyword">if</SPAN> you want to copy the + * contribution to the repository + * @<SPAN class="code-keyword">throws</SPAN> DeploymentException <SPAN class="code-keyword">if</SPAN> there was a problem with the contribution + * @<SPAN class="code-keyword">throws</SPAN> IOException <SPAN class="code-keyword">if</SPAN> there was a problem reading the resource + */ + void contribute(URI contributionURI, URL sourceURL, <SPAN class="code-object">boolean</SPAN> storeInRepository) <SPAN class="code-keyword">throws</SPAN> ContributionException, + IOException; + + /** + * Contribute an artifact to the SCA Domain. + * + * @param contributionURI The URI that is used as the contribution unique ID. + * @param contributionContent a stream containing the resource being + * contributed; the stream will not be closed but the read + * position after the call is undefined + * @<SPAN class="code-keyword">throws</SPAN> DeploymentException <SPAN class="code-keyword">if</SPAN> there was a problem with the contribution + * @<SPAN class="code-keyword">throws</SPAN> IOException <SPAN class="code-keyword">if</SPAN> there was a problem reading the stream + */ + void contribute(URI contributionURI, InputStream contributionContent) + <SPAN class="code-keyword">throws</SPAN> ContributionException, IOException; + + /** + * Get the model <SPAN class="code-keyword">for</SPAN> an installed contribution + * + * @param contribution The URI of an installed contribution + * @<SPAN class="code-keyword">return</SPAN> The model <SPAN class="code-keyword">for</SPAN> the contribution or <SPAN class="code-keyword">null</SPAN> <SPAN class="code-keyword">if</SPAN> there is no such + * contribution + */ + Contribution getContribution(URI contribution); + + /** + * Adds or updates a deployment composite using a supplied composite + * (<SPAN class="code-quote">"composite by value"</SPAN> - a data structure, not an existing resource in the + * domain) to the contribution identified by a supplied contribution URI. + * The added or updated deployment composite is given a relative URI that + * matches the <SPAN class="code-quote">"name"</SPAN> attribute of the composite, with a <SPAN class="code-quote">".composite"</SPAN> + * suffix. + */ + void addDeploymentComposite(URI contribution, <SPAN class="code-object">Object</SPAN> composite); + + /** + * Remove a contribution from the SCA domain + * + * @param contribution The URI of the contribution + * @<SPAN class="code-keyword">throws</SPAN> DeploymentException + */ + void remove(URI contribution) <SPAN class="code-keyword">throws</SPAN> ContributionException; + + /** + * Resolve an artifact by QName within the contribution + * + * @param <T> The java type of the artifact such as javax.wsdl.Definition + * @param contribution The URI of the contribution + * @param definitionType The java type of the artifact + * @param namespace The namespace of the artifact + * @param name The name of the artifact + * @<SPAN class="code-keyword">return</SPAN> The resolved artifact + */ + <T> T resolve(URI contribution, <SPAN class="code-object">Class</SPAN><T> definitionType, <SPAN class="code-object">String</SPAN> namespace, <SPAN class="code-object">String</SPAN> name); + + /** + * Resolve the reference to an artifact by the location URI within the given + * contribution. Some typical use cases are: + * <ul> + * <li>Reference a XML schema using + * {http:<SPAN class="code-comment">//www.w3.org/2001/XMLSchema-instance}schemaLocation or +</SPAN> * <li>Reference a list of WSDLs using + * {http:<SPAN class="code-comment">//www.w3.org/2004/08/wsdl-instance}wsdlLocation +</SPAN> * </ul> + * + * @param contribution The URI of the contribution + * @param namespace The namespace of the artifact. This is <SPAN class="code-keyword">for</SPAN> validation + * purpose. If the namespace is <SPAN class="code-keyword">null</SPAN>, then no check will be + * performed. + * @param uri The location URI + * @param baseURI The URI of the base artifact where the reference is + * declared + * @<SPAN class="code-keyword">return</SPAN> The URL of the resolved artifact + */ + URL resolve(URI contribution, <SPAN class="code-object">String</SPAN> namespace, URI uri, URI baseURI); +} +</PRE> +</DIV></DIV> + +<H4><A name="Deployment-ContributionServicesUMLDiagrams"></A>Contribution Services UML Diagrams</H4> + +<P><B>Contribution Services</B></P> + +<P><SPAN class="image-wrap" style=""><A class="confluence-thumbnail-link 1738x1275" href="deployment.data/Contribution%20Services.gif"><IMG src="deployment.data/Contribution%20Services.gif.jpeg" style="border: 0px solid black"></A></SPAN></P> + +<P><B>Contribution Processors</B></P> + +<P><SPAN class="image-wrap" style=""><A class="confluence-thumbnail-link 1325x1169" href="deployment.data/Contribution%20Processors.gif"><IMG src="deployment.data/Contribution%20Processors.gif.jpeg" style="border: 0px solid black"></A></SPAN></P> + +<P><B>Artifact Resolver</B></P> + +<P><SPAN class="image-wrap" style=""><A class="confluence-thumbnail-link 952x1413" href="deployment.data/Artifact%20Resolver.gif"><IMG src="deployment.data/Artifact%20Resolver.gif.jpeg" style="border: 0px solid black"></A></SPAN></P> + + +<H2><A name="Deployment-2%29ApplyChangestotheAssembly"></A>2) Apply Changes to the Assembly</H2> + +<P><B>The assembly is about creating/modifying/ removing instances of things (primarily components).</B></P> + +<P>1. User calls "addToDomainComosite" or "applyChanges" aginst the <B>AssemblyService</B>. There is a changeSet which represents an atomic modification to the domain, for example, adding an "include" to the domain composite.</P> + +<P>2. The assembly service applies this to the current logical assembly creating a new revision of the assembly.</P> + +<P>3. The action in the changeSet will need to be expanded out, e.g.</P> +<UL> + <LI>The <include> will need to be resolved to a composite. </LI> + <LI>The content of the composite will need to be examined and result in new components being defined</LI> + <LI>Those components will have implementations that need to be run and requirements on where and so forth</LI> +</UL> + + +<P>There is a resolution phase that is used to build a fully configured logical model where references (things like composite names, class names, etc) are resolved this is done using the contribution service to retrieve the target artifacts for the references. It calls back the contribution service to resolve the cross-references probably via a different api but it is going to the store.So now we have a fully resolved logical configuration model. Errors may be reported during the resolve phase such as:</P> +<UL> + <LI>No such composite</LI> + <LI>No such service</LI> + <LI>WSDL portType cannot be resolved</LI> +</UL> + + +<P>But we also run a logical validation on the resulting model, e.g. checking that if wires connect.</P> + +<P>4. Convert the new logical model to a set of physical models which involves allocating pieces of the model to physical runtimes so that they can be consumed by the runtime to activate the components. This is done by creating physical changeSets for each runtime.</P> + +<P>5. The physical models are propagated to the given runtime by some means (via the FederatedDeployer suppor that Meeraj's working on) </P> +<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><B>Physical models for the runtime</B><BR>The changeSet for the physical runtime is meant to be very precise and the builder's role is to turn that into runnable code. So it's not SCDL stuff but much lower level. The idea is to keep the builder very simple (and hence quite testable) that means there is a bit more work in the conversion from logical to physical, bascially a "portable" builder.<BR> +The conversion will use the introspection results from the store to generate the builder configuration, for example, suppose introspection discovers a component has an @Init method, we store that in the introspection result. The ContributionProcessor might load the java classes to introspect the annotations. (It may not actually load the class using a class loader since it could parse bytecode e.g. with ASM). But the result is an extended implemenation description. We need a langauge neutral form for that so ideally it can be used on both a Java and Native platform. It's something that goes beyond the componentType and it's the PojoComponentType type of thing, but more. + +<P>The idea of "portable builders" is about separating the node responsible for domain assembly from the nodes running component implementations. In a heterogeneous federation, it could be the assembly node(s) are running C++ but the user wants to add a Java component that will actually run on a Java node. If the introspection results for the Java contribution are portable, it would be possible for the C++ to set up the physical configuration for the Java builder; alternatively, it could delegate that to a service running in a native Java environment. Similarly, if the component was in some portable language (like Ruby or XSLT), then the configuration could be done on a Java node and passed to a C++ runtime node.</P></TD></TR></TABLE></DIV> +<P>6. The next steps is the build/connect/run. </P> + </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 </BR> + Apache Tuscany and the Apache Tuscany project logo are trademarks of The Apache Software Foundation. + </DIV> + <!-- footer macro end --> + + </BODY> +</HTML> |