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.
...
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-service-1.0-SNAPSHOT.jar downloaded above.
- 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.
...
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-jsp-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-servlet-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...
- 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/
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-ejb-1.0-SNAPSHOT.jar downloaded above.
- Click Install to install the ejb application.
- In the Archive field, select helloworld-web-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...
- Download jms-resources.xml
- 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/
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- 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
- In the Plan field, select jms-resources.xml downloaded above.
- Click Install to complete creating JMS resources.
- In the Archive field, select helloworld-mdb-ejb-1.0-SNAPSHOT.jar downloaded above.
- Click Install to install the ejb application.
- In the Archive field, select helloworld-mdb-web-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-filter-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...
- 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/
- Access http://localhost:8080/console and navigate to "Deploy New" portlet.
- In the Archive field, select helloworld-listener-1.0-SNAPSHOT.war downloaded above.
- Click Install to install the web application.
- 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.
...