summaryrefslogtreecommitdiffstats
path: root/site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html
diff options
context:
space:
mode:
Diffstat (limited to 'site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html')
-rw-r--r--site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html278
1 files changed, 278 insertions, 0 deletions
diff --git a/site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html b/site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html
new file mode 100644
index 0000000000..090601fd0d
--- /dev/null
+++ b/site/trunk/site-publish/documentation-2x/serialization-deserialization-of-endpoints-and-endpointreferences.html
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+ <HEAD>
+ <META name="description" content="Apache Tuscany">
+ <META name="keywords" content="apache, apache tuscany, tuscany, service, services, fabric, soa, service oriented architecture, sca, service component architecture, das, sdo, csa, ruby, opensource">
+
+ <LINK type="text/css" rel="stylesheet" href="http://tuscany.apache.org/stylesheets/default.css">
+ <LINK rel="SHORTCUT ICON" href="https://cwiki.apache.org/confluence/display/TUSCANYxDOCx2x/$images/favicon.ico">
+ <TITLE>Serialization Deserialization of Endpoints and EndpointReferences : Apache Tuscany</TITLE>
+ <META http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
+
+ <STYLE>
+ .spacetree * ul {
+ padding-left:0px;
+ margin-left: 0px;
+ }
+ .spacetree * li {
+ margin-left: 5px;
+ padding-left:5px;
+ }
+ </STYLE>
+
+ <BODY onload="init()">
+ <!-- topNav -->
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" align="left" nowrap="">
+ <A href="https://cwiki.apache.org/geronimo"> Home</A> &gt;&nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="index.html" title="Index">Index</A>&nbsp;&gt;&nbsp;<A href="development-guides.html" title="Development Guides">Development Guides</A>&nbsp;&gt;&nbsp;<A href="sca-java-runtime-overview.html" title="SCA Java Runtime Overview">SCA Java Runtime Overview</A>&nbsp;&gt;&nbsp;<A href="" title="Serialization Deserialization of Endpoints and EndpointReferences">Serialization Deserialization of Endpoints and EndpointReferences</A>
+ </TD>
+ <TD align="right" valign="middle" nowrap="">
+ <FORM name="search" action="http://www.google.com/search" method="get">
+ <INPUT type="hidden" name="ie" value="UTF-8">
+ <INPUT type="hidden" name="oe" value="UTF-8">
+ <INPUT type="hidden" name="domains" value="">
+ <INPUT type="hidden" name="sitesearch" value="">
+ <INPUT type="text" name="q" maxlength="255" value="">
+ <INPUT type="submit" name="btnG" value="Google Search">
+ </FORM>
+ </TD>
+ </TR>
+ </TABLE>
+
+
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR class="topBar">
+ <TD align="left" valign="middle" class="topBarDiv" nowrap="true" width="100%">
+ &nbsp;<A href="index.html" title="Apache Tuscany Docs 2.x">Apache Tuscany Docs 2.x</A>&nbsp;&gt;&nbsp;<A href="index.html" title="Index">Index</A>&nbsp;&gt;&nbsp;<A href="development-guides.html" title="Development Guides">Development Guides</A>&nbsp;&gt;&nbsp;<A href="sca-java-runtime-overview.html" title="SCA Java Runtime Overview">SCA Java Runtime Overview</A>&nbsp;&gt;&nbsp;<A href="" title="Serialization Deserialization of Endpoints and EndpointReferences">Serialization Deserialization of Endpoints and EndpointReferences</A>
+ </TD>
+
+ <TD align="right" valign="middle" class="topBarDiv" align="left" nowrap="true">
+ <A href="http://tuscany.apache.org/">Tuscany Home</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-user">User List</A> | <A href="http://mail-archives.apache.org/mod_mbox/tuscany-dev">Dev List</A> | <A href="http://issues.apache.org/jira/browse/Tuscany">Issue Tracker</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+
+ <TABLE border="0" cellpadding="0" width="100%" bgcolor="#FFFFFF">
+ <TR>
+ <TD valign="top" align="left" width="22%" bgcolor="#F9F9F9" class="noprint">
+ <DIV class="tabletitle">Table of Contents</DIV>
+ <DIV class="spacetree">
+
+
+ </DIV>
+ </TD>
+ <TD align="left" valign="top" width="78%">
+ <!-- pageContent -->
+ <DIV id="PageContent">
+ <DIV class="pageheader" style="padding: 6px 0px 0px 0px;">
+ <!-- We'll enable this once we figure out how to access (and save) the logo resource -->
+ <!--img src="http://geronimo.apache.org/images/confluence_logo.gif" style="float: left; margin: 4px 4px 4px 10px;" border="0"-->
+ <DIV style="margin: 0px 10px 0px 10px" class="smalltext">Apache Tuscany Docs 2.x</DIV>
+ <DIV style="margin: 0px 10px 8px 10px" class="pagetitle">Serialization Deserialization of Endpoints and EndpointReferences</DIV>
+
+ <DIV class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
+<!-- -->
+ <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=9012176">
+ <IMG src="http://geronimo.apache.org/images/icons/notep_16.gif" height="16" width="16" border="0" align="absmiddle" title="Edit Page"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=9012176">Edit Page</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">
+ <IMG src="http://geronimo.apache.org/images/icons/browse_space.gif" height="16" width="16" border="0" align="absmiddle" title="Browse Space"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/listpages.action?key=TUSCANYxDOCx2x">Browse Space</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=9012176">
+ <IMG src="http://geronimo.apache.org/images/icons/add_page_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add Page"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANYxDOCx2x&fromPageId=9012176">Add Page</A>
+ &nbsp;
+ <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=9012176">
+ <IMG src="http://geronimo.apache.org/images/icons/add_blogentry_16.gif" height="16" width="16" border="0" align="absmiddle" title="Add News"></A>
+ <A href="https://cwiki.apache.org/confluence/pages/createblogpost.action?spaceKey=TUSCANYxDOCx2x&fromPageId=9012176">Add News</A>
+<!-- -->
+ </DIV>
+ </DIV>
+
+ <DIV class="pagecontent">
+ <DIV class="wiki-content">
+ <H1><A name="SerializationDeserializationofEndpointsandEndpointReferences-SerializationDeserializationofEndpointsandEndpointReferences"></A>Serialization Deserialization of Endpoints and EndpointReferences</H1>
+<H2><A name="SerializationDeserializationofEndpointsandEndpointReferences-Asamplescenario"></A>A sample scenario</H2>
+<P><SPAN class="image-wrap" style=""><IMG src="serialization-deserialization-of-endpoints-and-endpointreferences.data/Endpoint%20and%20EndpointReference%20serialization.jpg" style="border: 0px solid black"></SPAN></P>
+
+<P>Assuming we have two nodes (Node1, Node2) within an SCA domain. Node1 runs component1 which is wired to component2 on Node2. </P>
+
+<UL>
+ <LI>Propagate the endpoint descriptions via the domain registry
+ <UL>
+ <LI>Serialize the endpoints of component2 at Node2</LI>
+ <LI>Deserialize the endpoints at Node1</LI>
+ <LI>Bind the endpoint reference of component1 to the remote endpoints of component2</LI>
+ </UL>
+ </LI>
+</UL>
+
+
+<UL>
+ <LI>Pass the ServiceReference from component1 to component2 via business methods
+ <UL>
+ <LI>Serialize the endpoint reference (for example, a reference to component3) known to component1 at Node1</LI>
+ <LI>Deserialize the endpoint reference at Node2</LI>
+ <LI>Bind the endpoint reference to the context of Node2/Component2</LI>
+ </UL>
+ </LI>
+</UL>
+
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+<SPAN class="code-keyword">public</SPAN> class Component1Impl {
+ @Reference
+ ServiceReference&lt;Component3&gt; component3;
+
+ @Reference
+ Component2 component2;
+
+ <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">String</SPAN> op1(...) {
+ <SPAN class="code-comment">// Pass a ServiceReference of component3 to component2
+</SPAN> component2.op2(component3, ...);
+ }
+}
+</PRE>
+</DIV></DIV>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-java">
+<SPAN class="code-keyword">public</SPAN> class Component2Impl {
+
+ <SPAN class="code-keyword">public</SPAN> <SPAN class="code-object">String</SPAN> op2(ServiceReference&lt;Component3&gt; component3Ref, ...) {
+ ...
+ <SPAN class="code-comment">// Call component3 using the service reference
+</SPAN> Component3 component3 = component3Ref.getService();
+ component3.op3(...);
+ }
+}
+</PRE>
+</DIV></DIV>
+
+<H2><A name="SerializationDeserializationofEndpointsandEndpointReferences-Whatinformationshouldbeserialized%3F"></A>What information should be serialized? </H2>
+
+<H3><A name="SerializationDeserializationofEndpointsandEndpointReferences-Endpointserialization"></A>Endpoint serialization </H3>
+<P>What information is needed on the consumer side?</P>
+<UL>
+ <LI>The protocol-specific endpoint address</LI>
+ <LI>The binding structural URI</LI>
+ <LI>The binding type</LI>
+ <LI>The intents and policySets</LI>
+</UL>
+
+
+<P>What information is not needed on the consumer side?</P>
+<UL>
+ <LI>The component implementation behind the endpoint</LI>
+</UL>
+
+
+<P>I'm not sure if the componentType of the owning component or interface contracts are needed. Interface validation against a remote endpoint can be one only if the interface contract for the endpoint is resolvable in the context of the consuming component. But it can be too restrictive as it breaks the promise of decoupling between the SCA reference and service.</P>
+
+<P>The current code serializes the endpoint as a composite/component/service/binding XML.</P>
+
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;composite name=<SPAN class="code-quote">&quot;...&quot;</SPAN> targetNamespace&gt;</SPAN>
+ <SPAN class="code-tag">&lt;component name=<SPAN class="code-quote">&quot;...&quot;</SPAN> uri=<SPAN class="code-quote">&quot;...&quot;</SPAN>&gt;</SPAN>
+ <SPAN class="code-tag">&lt;implementation.bpel process=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN> <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- This should be removed --&gt;</SPAN></SPAN>
+ <SPAN class="code-tag">&lt;service name=<SPAN class="code-quote">&quot;...&quot;</SPAN> requires=<SPAN class="code-quote">&quot;...&quot;</SPAN> policySets=<SPAN class="code-quote">&quot;...&quot;</SPAN>&gt;</SPAN>
+ <SPAN class="code-tag">&lt;interface.wsdl interface=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN> <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- Is the interface needed? --&gt;</SPAN></SPAN>
+ <SPAN class="code-tag">&lt;binding.ws uri=<SPAN class="code-quote">&quot;...&quot;</SPAN> requires=<SPAN class="code-quote">&quot;...&quot;</SPAN> policySets=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN>
+ <SPAN class="code-tag">&lt;/service&gt;</SPAN>
+ <SPAN class="code-tag">&lt;/component&gt;</SPAN>
+<SPAN class="code-tag">&lt;/composite&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+
+<H3><A name="SerializationDeserializationofEndpointsandEndpointReferences-Howtoresolvethedeserializedendpointinthecontextoftheconsumingcomponent%3F"></A>How to resolve the deserialized endpoint in the context of the consuming component?</H3>
+<P>We keep the XML document from the Java serialization and load the XML into a composite model to rebuild the endpoint in the context of the consuming component. The currect scheme of XML serialization probably contains too much information and some of them cannot be practically resolvable on the client side. For example, the target component implementation or interface contracts.</P>
+
+<P><SPAN class="image-wrap" style=""><IMG src="serialization-deserialization-of-endpoints-and-endpointreferences.data/Deserialized%20Endpoint.jpg" style="border: 0px solid black"></SPAN></P>
+
+<H3><A name="SerializationDeserializationofEndpointsandEndpointReferences-EndpointReferenceserialization"></A>EndpointReference serialization </H3>
+<P>What information is needed on the consumer side?</P>
+<UL>
+ <LI>The binding structural URI</LI>
+ <LI>The binding type</LI>
+ <LI>The intents and policySets</LI>
+ <LI>The resolved target endpoint (including the endpoint address and/or structural URI)</LI>
+</UL>
+
+
+<P>What information is not needed on the consumer side?</P>
+<UL>
+ <LI>The component implementation behind the endpoint reference</LI>
+</UL>
+
+
+<P>I'm not sure if the componentType of the owning component or interface contracts are needed. Interface validation against a remote endpoint can be one only if the interface contract for the endpoint is resolvable in the context of the consuming component. But it can be too restrictive as it breaks the promise of decoupling between the SCA reference and service.</P>
+
+<P>The current code serializes the endpoint reference as a composite/component/reference/binding XML.</P>
+<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
+<PRE class="code-xml">
+<SPAN class="code-tag">&lt;composite name=<SPAN class="code-quote">&quot;endpointReference&quot;</SPAN> targetNamespace=<SPAN class="code-quote">&quot;...&quot;</SPAN>&gt;</SPAN>
+ <SPAN class="code-tag">&lt;component name=<SPAN class="code-quote">&quot;...&quot;</SPAN> uri=<SPAN class="code-quote">&quot;...&quot;</SPAN>&gt;</SPAN>
+ <SPAN class="code-tag">&lt;implementation.java class=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN> <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- This should be removed --&gt;</SPAN></SPAN>
+ <SPAN class="code-tag">&lt;reference name=<SPAN class="code-quote">&quot;...&quot;</SPAN> requires=<SPAN class="code-quote">&quot;...&quot;</SPAN> policySets=<SPAN class="code-quote">&quot;...&quot;</SPAN> target=<SPAN class="code-quote">&quot;...&quot;</SPAN>&gt;</SPAN> <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- reference/@target and binding.ws/@uri are exclusive --&gt;</SPAN></SPAN>
+ <SPAN class="code-tag">&lt;interface.java interface=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN> <SPAN class="code-tag"><SPAN class="code-comment">&lt;!-- Is the interface needed? --&gt;</SPAN></SPAN>
+ <SPAN class="code-tag">&lt;binding.ws uri=<SPAN class="code-quote">&quot;...&quot;</SPAN> requires=<SPAN class="code-quote">&quot;...&quot;</SPAN> policySets=<SPAN class="code-quote">&quot;...&quot;</SPAN>/&gt;</SPAN>
+ <SPAN class="code-tag">&lt;/reference&gt;</SPAN>
+ <SPAN class="code-tag">&lt;/component&gt;</SPAN>
+<SPAN class="code-tag">&lt;/composite&gt;</SPAN>
+</PRE>
+</DIV></DIV>
+
+<H3><A name="SerializationDeserializationofEndpointsandEndpointReferences-Howtoresolvethedeserializedendpointreferenceinthecontextoftheconsumingcomponent%3F"></A>How to resolve the deserialized endpoint reference in the context of the consuming component?</H3>
+<P>We keep the XML document from the Java serialization and load the XML into a composite model to rebuild the endpoint in the context of the consuming component. The currect scheme of XML serialization probably contains too much information and some of them cannot be practically resolvable on the client side. For example, the target component implementation or interface contracts.</P>
+
+<P><SPAN class="image-wrap" style=""><IMG src="serialization-deserialization-of-endpoints-and-endpointreferences.data/Deserialized%20EndpointReference.jpg" style="border: 0px solid black"></SPAN></P>
+ </DIV>
+
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+
+ <!-- footer -->
+ <TABLE border="0" cellpadding="2" cellspacing="0" width="100%">
+ <TR>
+ <TD align="left" valign="middle" class="footer">
+ &nbsp;&nbsp;
+ <IMG src="http://static.delicious.com/img/delicious.small.gif" height="10" width="10" alt="Delicious">
+ <A href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=550,height=550'); return false;">Bookmark this on Delicious</A>
+ &nbsp;&nbsp;
+ <IMG src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" alt="Digg!">
+ <A href="" onclick="window.open('http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&topic=programming');">Digg this</A>
+ <!-- Slicker, but no text
+ <script type="text/javascript">
+ digg_skin = 'icon';
+ digg_window = 'new';
+ digg_title = 'Apache Geronimo v2.2 Documentation : Serialization Deserialization of Endpoints and EndpointReferences';
+ digg_topic = 'programming';
+ </script>
+ <script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
+ -->
+ &nbsp;&nbsp;
+ </TD>
+ <TD align="right" valign="middle" class="footer">
+ <A href="http://cwiki.apache.org/GMOxPMGT/geronimo-privacy-policy.html">Privacy Policy</A>&nbsp;&nbsp;-&nbsp;&nbsp;
+ Copyright &copy; 2003-2010, The Apache Software Foundation, Licensed under <A href="http://www.apache.org/licenses/LICENSE-2.0">ASL 2.0.</A>&nbsp;&nbsp;
+ </TD>
+ </TR>
+ </TABLE>
+
+ </BODY>
+</HTML> \ No newline at end of file