This project includes some examples that makes use of an embedded Jetty servers and several others that are packaged into WAR files and can be deployed to servlet containers.
In the shell:
gradle :comsat-examples-embeddedjetty:runA Jetty web actors example can be run with:
gradle :comsat-examples-jetty-webactor:runA Dropwizard example can be run with:
gradle :comsat-examples-dropwizard:runSimplegradle :comsat-examples-db:runSimple
gradle :comsat-examples-retrofit:runSimpleFor convenience, we've included a tiny program (embedded-tomcat) that runs a Tomcat server, creates a database, and compiles and deploys all WAR examples.
In the shell, type:
gradle :embedded-tomcat:runThen, in a web browser, access any of the following links:
- http://localhost:8080/comsat-examples-servlet/fiberservlet - a servlet that runs in a fiber.
- http://localhost:8080/comsat-examples-jaxrs/rest/myresource - a JAX-RS REST service that runs in a fiber (the first time this is accessed, it will take a while as Jersey is initialized).
- http://localhost:8080/comsat-examples-webactors/webactor - a WebActors example
- Open an new shell and build the upgrade module:
gradle :comsat-examples-webactors-codeswap:jar-
Run and access http://localhost:8080/comsat-examples-webactors/webactor as explained above.
-
Copy the upgrade module jar file into the
modules/directory:
cp comsat-examples-webactors-codeswap/build/libs/comsat-examples-webactors-codeswap.jar modulesYou will now see the new actor behave differently in the test web page.
Stop the server if running and uncomment the following line in embedded-tomcat/build.gradle:
from project(":comsat-examples-spaceships").war
Restart the server with:
gradle :embedded-tomcat:runThen, open http://localhost:8080/comsat-examples-spaceships/login in your browser.
These examples are released under the MIT license.
Copyright (c) 2014-2015 Parallel Universe