Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Swordfish Documentation: Architecture: Internal Service Proxy"

(See also)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<h1>Component diagrams</h1>
+
== Overview ==
 +
The internal service proxy allows plugins to access the NMR inside Swordfish.
  
== Sketch of сomponent сlasses for Internal Service Proxy Plugin ==
+
== Description ==
[[Image:Internal_Proxy_Classes.png]]
+
=== Component diagrams ===
  
<h1>Plugin description</h1>
+
==== Sketch of сomponent сlasses for internal Service Proxy Plugin ====
Example of InternalProxy usage:
+
[[Image:Service_Proxy_Classes.png]]
 +
 
 +
Example of ServiceProxy usage:
 
<ul>
 
<ul>
 
<li>proxy injection (at runtime available as OSGi service):</li>
 
<li>proxy injection (at runtime available as OSGi service):</li>
 
<pre>
 
<pre>
     <osgi:reference id="internalProxy"
+
     <osgi:reference id="serviceProxy"
     interface="org.eclipse.swordfish.core.proxy.InternalProxy" />
+
     interface="org.eclipse.swordfish.core.proxy.ServiceProxy" />
  
 
     <bean id="ASFRegistryProvider"
 
     <bean id="ASFRegistryProvider"
 
         class="org.eclipse.swordfish.internal.resolver.backend.remote.ASFRegistryProvider"
 
         class="org.eclipse.swordfish.internal.resolver.backend.remote.ASFRegistryProvider"
         p:proxy-ref="internalProxy"/>
+
         p:proxy-ref="serviceProxy"/>
 
</pre>
 
</pre>
 
<li>invocation of target service:</li>
 
<li>invocation of target service:</li>
Line 20: Line 23:
 
public class ASFRegistryProvider extends AbstractDocumentProvider {
 
public class ASFRegistryProvider extends AbstractDocumentProvider {
  
     private InternalProxy proxy;
+
     private ServiceProxy proxy;
  
 
     @Override
 
     @Override
Line 39: Line 42:
 
     }
 
     }
  
     public void setProxy(InternalProxy proxy) {
+
     public void setProxy(ServiceProxy proxy) {
 
         this.proxy = proxy;
 
         this.proxy = proxy;
 
     }
 
     }
Line 47: Line 50:
 
</ul>
 
</ul>
 
<br/>
 
<br/>
During invocation InternalProxy performs the following steps:
+
During invocation ServiceProxy performs the following steps:
<ul>
+
* creates new NMR Exchange for provided operation;
<li>creates new NMR Exchange for provided operation</li>
+
* looks up outbound endpoint from the NMR using provided service name;
<li>lookups outbound endpoint from the NMR using provided service name</li>
+
* sends exchange to NMR according to selected message exchange pattern (e.g. "http://www.w3.org/ns/wsdl/in-out").
<li> sends exchange to NMR according to selected message exchange pattern (IoOut or InOnly)</li>
+
 
</ul>
+
'''NOTE: '''Current version of proxy assumes that outbound endpoint of target service is already registered within ServiceMix NMR.
<b>NOTE:</b>Current implementation assumes that outbound endpoint of target service is already registered within ServiceMix NMR.
+
<br/><br/>
 +
 
 +
== See also ==
 +
[http://www.eclipse.org/swordfish/docs/apidocs Swordfish JavaDoc]
 +
<br/><br/>
 +
----
 +
[[Swordfish_Documentation:_Architecture | Architecture overview ]]

Latest revision as of 05:19, 20 November 2009

Overview

The internal service proxy allows plugins to access the NMR inside Swordfish.

Description

Component diagrams

Sketch of сomponent сlasses for internal Service Proxy Plugin

Service Proxy Classes.png

Example of ServiceProxy usage:

  • proxy injection (at runtime available as OSGi service):
  •     <osgi:reference id="serviceProxy"
        	interface="org.eclipse.swordfish.core.proxy.ServiceProxy" />
    
        <bean id="ASFRegistryProvider"
            class="org.eclipse.swordfish.internal.resolver.backend.remote.ASFRegistryProvider"
            p:proxy-ref="serviceProxy"/>
    
  • invocation of target service:
  • public class ASFRegistryProvider extends AbstractDocumentProvider {
    
        private ServiceProxy proxy;
    
        @Override
        public Collection<ServiceDescription<?>> getServiceProviderDescriptions(QName interfaceName) {
            String res = null;
            try {
                res = proxy.invokeRequestResponseOperation(
                    QName.valueOf("{http://services.sopware.org/registry/ServiceRegistryProvider/1.0}ServiceRegistryProvider"),
                    QName.valueOf("{http://services.sopware.org/registry/ServiceRegistryProvider/1.0}xlookUp_serviceProvider"),
                    "<inMessage/>");
            } catch (Exception e) {
                e.printStackTrace();
            }
    
            // further processing...
    
            return null;
        }
    
        public void setProxy(ServiceProxy proxy) {
            this.proxy = proxy;
        }
    
    }
    


During invocation ServiceProxy performs the following steps:

  • creates new NMR Exchange for provided operation;
  • looks up outbound endpoint from the NMR using provided service name;
  • sends exchange to NMR according to selected message exchange pattern (e.g. "http://www.w3.org/ns/wsdl/in-out").

NOTE: Current version of proxy assumes that outbound endpoint of target service is already registered within ServiceMix NMR.

See also

Swordfish JavaDoc


Architecture overview

Back to the top