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"

Line 5: Line 5:
  
 
<h1>Plugin description</h1>
 
<h1>Plugin description</h1>
InternalProxy acts as.
+
Example of InternalProxy usage:
At runtime it can be easy retrieved as OSGi service and
+
Example of 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="internalProxy"
Line 18: Line 16:
 
         p:proxy-ref="internalProxy"/>
 
         p:proxy-ref="internalProxy"/>
 
</pre>
 
</pre>
<li>Invocation of service:</li>
+
<li>invocation of target service:</li>
 
<pre>
 
<pre>
 
public class ASFRegistryProvider extends AbstractDocumentProvider {
 
public class ASFRegistryProvider extends AbstractDocumentProvider {
Line 49: Line 47:
 
</ul>
 
</ul>
 
<br/>
 
<br/>
<b>Current implementation assumes that outbound service endpoint is already registered within NMR.<b/>
+
<b>NOTE:<b/>Current implementation assumes that outbound endpoint of target service is already registered within ServiceMix NMR.
It is possible to
+

Revision as of 06:38, 26 October 2009

Component diagrams

Sketch of сomponent сlasses for Internal Service Proxy Plugin

Internal Proxy Classes.png

Plugin description

Example of InternalProxy usage:

  • proxy injection (at runtime available as OSGi service):
  •     <osgi:reference id="internalProxy"
        	interface="org.eclipse.swordfish.core.proxy.InternalProxy" />
    
        <bean id="ASFRegistryProvider"
            class="org.eclipse.swordfish.internal.resolver.backend.remote.ASFRegistryProvider"
            p:proxy-ref="internalProxy"/>
    
  • invocation of target service:
  • public class ASFRegistryProvider extends AbstractDocumentProvider {
    
        private InternalProxy 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(InternalProxy proxy) {
            this.proxy = proxy;
        }
    
    }
    


NOTE:<b/>Current implementation assumes that outbound endpoint of target service is already registered within ServiceMix NMR.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.