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: Launching Service Registry"

(Local and Remote Service Resolvers)
(Prerequisites)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Prerequisites==
 
==Prerequisites==
Eclipse Galileo M7 build or later.
+
Eclipse Galileo (Eclipse 3.5) build or later. The examples described here are based on Eclipse 3.5.
The examples described here are based on Eclipse Galileo M7.
+
  
This "How To" assumes that user have downloaded and activated Swordfish Target Platform with Swordfish Runtime (core) bundles and Swordfish Registry bundles included.
+
This "How To" assumes that user has  downloaded and activated Swordfish Target Platform with Swordfish Runtime (core) bundles and Swordfish Registry bundles included in the installation.
Follow steps from:
+
To complete the prerequisites, follow steps described here:
*[[Swordfish_Documentation:_Running_Target_Platform|Running Target Platform]] - to set up Target platform from local machine  
+
*[[Swordfish_Documentation:_Running_Target_Platform|Running Target Platform]] - to set up a target platform on your local machine  
*[[Swordfish_Documentation:_Setting_Up_Registry_From_Galileo_Update_Site|Setting Up Registry From the Galileo Update Site]] - to set up target platform from Update Site.
+
*[[Swordfish_Documentation:_Setting_Up_Registry_From_Galileo_Update_Site|Setting Up Registry From the Galileo Update Site]] - to set up a target platform from an update site.
 
+
== Local and Remote Service Resolvers ==
+
Swordfish uses service resolvers retrieve service description (wsdl and agreed policy). Currently Swordfish supports local and remote resolvers:
+
* <b>org.eclipse.swordfish.plugins.resolver.backend.remote</b> - remote resolver communicate with remote Swordfish registry using REST http calls.
+
* <b>org.eclipse.swordfish.plugins.resolver.backend.local</b> - local resolver not executes remote calls and retrieves service descriptions for local folder. By default this is org.eclipse.swordfish.plugins.resolver.backend.local\src\main\resources\wsdl folder.
+
Remote resolver perfect for production environment and Local resolver convenient for local development and testing, for example out of box Swordfish Samples (also available for Download from Galileo Update Site) by default work Local resolver.
+
  
 
== Launching Service Registry ==
 
== Launching Service Registry ==
 
Service registry expose its interface as http REST service.  
 
Service registry expose its interface as http REST service.  
  
 +
<ol>
 
<li>In the <b>Run Configurations...</b> dialog create a new OSGi configuration based on Swordfish target platform.<br/>
 
<li>In the <b>Run Configurations...</b> dialog create a new OSGi configuration based on Swordfish target platform.<br/>
 
[[Image:Launch_configuration.png]]</li><br/>
 
[[Image:Launch_configuration.png]]</li><br/>
</ol>
+
 
 
<li>Switch to the <b>Arguments</b> tab and type the following VM arguments:<br/>
 
<li>Switch to the <b>Arguments</b> tab and type the following VM arguments:<br/>
 
<pre>
 
<pre>
Line 43: Line 37:
 
org.omg.PortableServer,org.omg.PortableServer.POAPackage,javax.swing.border,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ranges"
 
org.omg.PortableServer,org.omg.PortableServer.POAPackage,javax.swing.border,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ranges"
 
</pre>
 
</pre>
 +
First 2 arguments related to Swordfish registry:
 
<ol>
 
<ol>
<li>The value of <tt>org.osgi.service.http.port</tt> must be set to 9001 - the default port that the remote resolver uses to connect to the Swordfish registry.</li>
+
  <li><tt>org.osgi.service.http.port</tt> - the port number witch will be used to expose Service Registry as http service. 9001 - the default port that the remote resolver uses to connect to the Swordfish registry.</li>
<li>The next property <tt>org.eclipse.swordfish.registry.fileLocation</tt> must point to the directory where all the WSDL files that need to be loaded by the registry are placed.</li>
+
  <li>The next property <tt>org.eclipse.swordfish.registry.fileLocation</tt> must point to the directory where all the WSDL files that need to be loaded by the registry are placed. </li>
<li>The property <tt>osgi.noShutdown</tt> is the Eclipse Equinox (OSGI) specific container. Its value must be set to <tt>true</tt> because Equinox shuts down by default after starting up if it does not find an Eclipse application.  For details on this issue, see [[http://www.eclipse.org/equinox/documents/quickstart.php|Equinox Quick Start]].</li>
+
</ol>
 
+
<li>
 +
Create folder for Swordfish Registry File Location and change corresponding  <tt>org.eclipse.swordfish.registry.fileLocation</tt> property in launch configuration.</li>
 +
<li>Run new Launch Configuration ant go to http://localhost:9001/registry/wsdl/ URL in your browser.<br>
 +
You'll see page with empty table and Swordfish Logo, thats fine because org.eclipse.swordfish.registry.fileLocation property probably points to empty folder. Copy some arbitrary wsdl files to above mentioned folder and refresh web page.<br>
 +
[[Image:Swordfish_registry_page.png]]<br>
 +
</li>
 
</ol>
 
</ol>
  
==Launching Service Registry==
+
== Local and Remote Service Resolvers ==  
Service Registry JAR files are built together with the Swordfish Runtime JAR files.  
+
Swordfish uses service resolvers retrieve service description (wsdl and agreed policy). Currently Swordfish supports local and remote resolvers:
 
+
* <b>org.eclipse.swordfish.plugins.resolver.backend.remote</b> - remote resolver communicate with remote Swordfish registry using REST http calls.  
To launch the Service Registry JAR files, specify the following environment variables:
+
* <b>org.eclipse.swordfish.plugins.resolver.backend.local</b> - local resolver not executes remote calls and retrieves service descriptions for local folder. By default this is org.eclipse.swordfish.plugins.resolver.backend.local\src\main\resources\wsdl folder.
  <ul>
+
Remote resolver perfect for production environment and Local resolver convenient for local development and testing, for example out of box Swordfish Samples (also available for Download from Galileo Update Site) by default work with Remote resolver. To switch between resolver type you can simply enable resolver type you need in Runtime configuration and disable other. For example, on the picture below you see Local resolver activated:<br>
  <li>'''org.osgi.service.http.port''' - port for HTTP interface to SR
+
[[Image:Swordfish_registry_local.png]]
  <li>'''org.eclipse.swordfish.registry.fileLocation''' - a path to the directory where SR will store WSDL files<br>
+
----------------
  </ul>
+
 
+
You can specify value of these environment variables, using '''-D''' parameters when you are launching equinox.<br>
+
Here is an example script that shows you how to launch it:
+
 
+
<pre>
+
#!/bin/bash
+
cd ./target/bundles
+
java -Dorg.osgi.service.http.port=8080 \
+
  -Dorg.eclipse.swordfish.registry.fileLocation=/tmp/swordfish-sr \
+
  org.eclipse.osgi_3.5.0.v20090311-1300.jar -console -clean
+
</pre>
+
 
+
The option '''-console''' starts equinox in the console mode. In this mode you can type commands.  
+
When the option'''-clean''' is used, equinox will clean up the caches before starting up.
+
 
+
 
+
-----------------
+
 
[[Swordfish_Documentation |Swordfish Documentation Home]] <br/>
 
[[Swordfish_Documentation |Swordfish Documentation Home]] <br/>
 
[[Swordfish | Swordfish Wiki Home]] <br/>
 
[[Swordfish | Swordfish Wiki Home]] <br/>

Latest revision as of 08:42, 14 August 2009

Prerequisites

Eclipse Galileo (Eclipse 3.5) build or later. The examples described here are based on Eclipse 3.5.

This "How To" assumes that user has downloaded and activated Swordfish Target Platform with Swordfish Runtime (core) bundles and Swordfish Registry bundles included in the installation. To complete the prerequisites, follow steps described here:

Launching Service Registry

Service registry expose its interface as http REST service.

  1. In the Run Configurations... dialog create a new OSGi configuration based on Swordfish target platform.
    Launch configuration.png

  2. Switch to the Arguments tab and type the following VM arguments:
    -Dorg.osgi.service.http.port=9001
    -Dorg.eclipse.swordfish.registry.fileLocation="C:\swordfish\repository"
    -Dosgi.noShutdown=true
    -Dservicemix.base=.
    -Dorg.osgi.framework.system.packages="com.sun.jimi.core,com.sun.net.ssl,com.sun.net.ssl.internal.ssl,
    com.sun.org.apache.xalan.internal,com.sun.org.apache.xalan.internal.res,com.sun.org.apache.xalan.internal.xsltc.trax,
    com.sun.org.apache.xerces.internal.dom,com.sun.org.apache.xerces.internal.jaxp,com.sun.org.apache.xerces.internal.xni,
    com.sun.org.apache.xml.internal,com.sun.org.apache.xml.internal.utils,com.sun.org.apache.xpath.internal,
    com.sun.org.apache.xpath.internal.jaxp,com.sun.org.apache.xpath.internal.objects,com.sun.xml.fastinfoset.dom,
    com.sun.xml.fastinfoset.sax,com.sun.xml.fastinfoset.stax,javax.annotation,javax.annotation.security,javax.crypto,
    javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.metadata,javax.imageio.stream,javax.jms,
    javax.management,javax.management.loading,javax.management.modelmbean,javax.management.remote,javax.naming,
    javax.naming.directory,javax.naming.spi,javax.net,javax.net.ssl,javax.rmi,javax.security.auth,
    javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,
    javax.security.cert,javax.security.sasl,javax.sql,javax.swing,javax.swing.event,javax.xml.datatype,javax.xml.parsers,
    javax.xml.namespace,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,
    javax.xml.validation,javax.xml.xpath,org.jvnet.fastinfoset,org.jvnet.staxex,org.omg.CORBA,org.omg.CosNaming,
    org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.ls,org.w3c.dom.traversal,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,
    sun.misc,sun.security.provider,javax.activation,org.omg.CORBA.TypeCodePackage,org.omg.CORBA.portable,
    org.omg.PortableServer,org.omg.PortableServer.POAPackage,javax.swing.border,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ranges"
    

    First 2 arguments related to Swordfish registry:

    1. org.osgi.service.http.port - the port number witch will be used to expose Service Registry as http service. 9001 - the default port that the remote resolver uses to connect to the Swordfish registry.
    2. The next property org.eclipse.swordfish.registry.fileLocation must point to the directory where all the WSDL files that need to be loaded by the registry are placed.
  3. Create folder for Swordfish Registry File Location and change corresponding org.eclipse.swordfish.registry.fileLocation property in launch configuration.
  4. Run new Launch Configuration ant go to http://localhost:9001/registry/wsdl/ URL in your browser.
    You'll see page with empty table and Swordfish Logo, thats fine because org.eclipse.swordfish.registry.fileLocation property probably points to empty folder. Copy some arbitrary wsdl files to above mentioned folder and refresh web page.
    Swordfish registry page.png

Local and Remote Service Resolvers

Swordfish uses service resolvers retrieve service description (wsdl and agreed policy). Currently Swordfish supports local and remote resolvers:

  • org.eclipse.swordfish.plugins.resolver.backend.remote - remote resolver communicate with remote Swordfish registry using REST http calls.
  • org.eclipse.swordfish.plugins.resolver.backend.local - local resolver not executes remote calls and retrieves service descriptions for local folder. By default this is org.eclipse.swordfish.plugins.resolver.backend.local\src\main\resources\wsdl folder.

Remote resolver perfect for production environment and Local resolver convenient for local development and testing, for example out of box Swordfish Samples (also available for Download from Galileo Update Site) by default work with Remote resolver. To switch between resolver type you can simply enable resolver type you need in Runtime configuration and disable other. For example, on the picture below you see Local resolver activated:
Swordfish registry local.png


Swordfish Documentation Home
Swordfish Wiki Home

Back to the top