Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Swordfish Documentation: Architecture: Internal Service Proxy
Revision as of 21:01, 8 November 2009 by Unnamed Poltroon (Talk)
Component diagrams
Sketch of сomponent сlasses for internal Service Proxy Plugin
Plugin description
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"/>
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;
- lookups 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.