Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

The Tuscany Plugin for Geronimo is being developed and tested on Geronimo v2.1.3.

Setup the environment

Installing on Geronimo Tomcat server

...

Note

If you want latest plugin and tuscany dependency jars to be installed during plugin installation, make sure you delete <GERONIMO_HOME>/repository/org/apache/geronimo/plugins/geronimo-tuscany* folders and <GERONIMO_HOME>/repository/org/apache/tuscany/sca folder are deleted before you proceed with the installation.

Running sample applications

Deploy SCA contribution

We have a sample sca contribution (helloworld-service) that has three Helloworld service components. The JSP, Servlet and EJB samples access the services provided by this contribution.

...

  1. Download helloworld-service-1.0-SNAPSHOT.jar from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-service/1.0-SNAPSHOT/
  2. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  3. In the Archive field, select helloworld-service-1.0-SNAPSHOT.jar downloaded above.
  4. Click Install to install the sca contribution.

...

Access an SCA service from a JSP

The sample web application helloworld-jsp has a JSP that defines an SCA reference using SCA JSP tag library. The reference is wired in web.composite. The reference is injected at runtime.

...

  1. Download helloworld-jsp-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-jsp/1.0-SNAPSHOT/
  2. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  3. In the Archive field, select helloworld-jsp-1.0-SNAPSHOT.war downloaded above.
  4. Click Install to install the web application.
  5. Access http://localhost:8080/helloworld-jsp/

...

Access an SCA service from a Servlet

The sample web application helloworld-servlet has a HelloworldServlet with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime.

...

  1. Download helloworld-servlet-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-servlet/1.0-SNAPSHOT/
  2. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  3. In the Archive field, select helloworld-servlet-1.0-SNAPSHOT.war downloaded above.
  4. Click Install to install the web application.
  5. Access http://localhost:8080/helloworld-servlet/

...

Access an SCA service from a session EJB

The sample EJB application helloworld-ejb has a Stateless session bean HelloworldServiceBean with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in ejb-jar.composite. The annotated fields are injected at runtime. The sample web application helloworld-web has a HelloworldEjbServlet that invokes HelloworldServiceBean.

...

  1. Download helloworld-ejb-1.0-SNAPSHOT.jar from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-ejb/1.0-SNAPSHOT/
  2. Download helloworld-web-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-web/1.0-SNAPSHOT/
  3. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  4. In the Archive field, select helloworld-ejb-1.0-SNAPSHOT.jar downloaded above.
  5. Click Install to install the ejb application.
  6. In the Archive field, select helloworld-web-1.0-SNAPSHOT.war downloaded above.
  7. Click Install to install the web application.
  8. Access http://localhost:8080/helloworld-web/

...

Access an SCA service from an MDB

The sample EJB application helloworld-mdb-ejb has a message-driven-bean HelloworldMDB that listens on a JMS queue named NamesQueue. HelloworldMDB has @Reference, @Property, @Context and @ComponentName annotations. The references are wired in ejb-jar.composite. The annotated fields are injected at runtime. The sample web application helloworld-mdb-web has a HelloworldMdbServlet that sends the name entered in the webpage as a message to the NamesQueue. Output from HelloworldMDB can be seen in Geronimo console window.

...

  1. Download jms-resources.xml
  2. Download helloworld-mdb-ejb-1.0-SNAPSHOT.jar from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-mdb-ejb/1.0-SNAPSHOT/
  3. Download helloworld-mdb-web-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-mdb-web/1.0-SNAPSHOT/
  4. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  5. In the Archive field, select <GERONIMO_HOME>\repository\org\apache\geronimo\modules\geronimo-activemq-ra\2.1.3\geronimo-activemq-ra-2.1.3.rar
  6. In the Plan field, select jms-resources.xml downloaded above.
  7. Click Install to complete creating JMS resources.
  8. In the Archive field, select helloworld-mdb-ejb-1.0-SNAPSHOT.jar downloaded above.
  9. Click Install to install the ejb application.
  10. In the Archive field, select helloworld-mdb-web-1.0-SNAPSHOT.war downloaded above.
  11. Click Install to install the web application.
  12. Access http://localhost:8080/helloworld-mdb-web/

...

Access an SCA service from a Filter

The sample web application helloworld-filter has a filter HelloworldFilter with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime.

...

  1. Download helloworld-filter-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-filter/1.0-SNAPSHOT/
  2. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  3. In the Archive field, select helloworld-filter-1.0-SNAPSHOT.war downloaded above.
  4. Click Install to install the web application.
  5. Access http://localhost:8080/helloworld-filter/

...

Access an SCA service from an Event Listener

...

The sample web application helloworld-listener has a ServletContextListener, a ServletContextAttributeListener, a ServletRequestListener, a ServletRequestAttributeListener, an HttpSessionListener, and an HttpSessionAttributeListener with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime.

...

  1. Download helloworld-listener-1.0-SNAPSHOT.war from http://people.apache.org/repo/m2-snapshot-repository/org/apache/geronimo/plugins/helloworld-listener/1.0-SNAPSHOT/
  2. Access http://localhost:8080/console and navigate to "Deploy New" portlet.
  3. In the Archive field, select helloworld-listener-1.0-SNAPSHOT.war downloaded above.
  4. Click Install to install the web application.
  5. Access http://localhost:8080/helloworld-listener/

...

Access an SCA service from a JSF managed bean

The sample JSF application helloworld-jsf has a controller class HelloWorldController with @Reference, @Property, @Context and @ComponentName annotations. The references are wired in web.composite. The annotated fields are injected at runtime.

...