Hosted by Three Crickets

Prudence
Scalable REST Platform
For the JVM

Prudence logo: bullfinch in flight

Download

Ready-to-Run Distributions for Prudence 2.0-beta9

If you're experienced with Prudence, it is strongly recommended that you install it via Sincerity (see instructions below), a packaging tool that makes it easy to add exactly the features you want to your Prudence containers, as well as manage third-party libraries.

However, we also offer these ready-to-run distributions, which already include Sincerity, its most commonly used plugins, as well as the Prudence examples:

The only requirement for these distributions is a JVM. JVM version 8 (specifically version 8u40 and above) offers the best experience, as it will use the included Nashorn JavaScript engine and most advanced Jetty server. Prudence can also run on JVM version 7 via a simple modification.

Note that by default in JVM 8, Prudence will use the built-in Nashorn JavaScript engine, though Rhino is also included. You can switch JavaScript engines using the SINCERITY_JAVASCRIPT environment variable, setting it to either "Nashorn" or "Rhino".

Quick-Start

To start Prudence, open a terminal, change to the installation directory and run:

./sincerity start prudence

(In Windows: "sincerity.bat start prudence")

Browse to http://localhost:8080/ to see the Prudence Administration application, from where you can access the installed applications. Or, browse to http://localhost:8080/prudence-example/ to see the Prudence Example application.

If this is your first time using Prudence, continue to the tutorial to learn how to create your own Prudence applications.

Your distribution can be upgraded at any time by running "./sincerity install".


Installing Prudence Using Sincerity

Quick-Start

Assuming you have Sincerity installed, the following command line will install and start the Prudence example in a container named "prudence":

sincerity create prudence : add prudence.example : install : start restlet

Essential Components

Sincerity comes with friendly shortcuts for all Prudence core features and add-ons. The following table lists these shortcuts, as well as the full package identifier for which the shortcut is an alias.

All packages are hosted on the Three Crickets Repository, which is a Maven-compatible standard web site.

Shortcut Full Identifier Notes
Prudence Skeleton prudence com.threecrickets.prudence prudence-skeleton Everything you need to start writing your Prudence applications. The Prudence skeleton is an extension of Sincerity's Restlet skeleton.
Cluster Support prudence.cluster com.threecrickets.prudence prudence-cluster Adds support for application.distributedGlobals and for the distributed mode of application.task.
H2 Cache Backend prudence.cache.h2 com.threecrickets.prudence prudence-cache-h2 Adds a cache backend based on the H2 database. By default H2 will run in embedded mode, but it's possible to run H2 separate for a shared cache.
Hazelcast Cache Backend prudence.cache.hazelcast com.threecrickets.prudence prudence-cache-hazelcast Adds a distributed cache backend based on Hazelcast.
memcached Cache Backend prudence.cache.memcached com.threecrickets.prudence prudence-cache-memcached Adds a distributed cache backend based on memcached. You will need to install memached separately.
MongoDB Cache Backend prudence.cache.mongodb com.threecrickets.prudence prudence-cache-mongodb Adds a distributed cache backend based on MongoDB. You will need to install MongoDB separately.
Administration Application prudence.admin com.threecrickets.prudence prudence-admin Useful for live administration of your container.
Example Application prudence.example com.threecrickets.prudence prudence-example A demonstration of various features and aspects of Prudence. JavaScript is demonstrated by default, but you can add other languages separately (see below).
Prudence Library com.threecrickets.prudence prudence This is just the Prudence JVM library, which can be useful for building non-Prudence Restlet applications. It is installed as a dependency of the skeleton.
Prudence JavaScript Library com.threecrickets.prudence prudence-javascript-library The Prudence JavaScript Library makes it easier to use Prudence with the JavaScript language. It is installed as a dependency of the skeleton.

Additional Programming Languages

Prudence comes with JavaScript support, but also explicitly supports the following programming languages if you "sincerity add" them:

Shortcut Full Identifier Notes
Python python com.threecrickets.sincerity.plugin sincerity-python Based on the Jython engine. Note that Sincerity internally supports installing Python packages from PyPI ("The Cheese Factory").
Ruby ruby com.threecrickets.sincerity.plugin sincerity-ruby Based on the JRuby engine. Note that Sincerity internally supports installing Ruby gems.
PHP php com.threecrickets.sincerity.plugin sincerity-php Based on the Quercus engine. Note that Sincerity internally supports installing PHP modules from PEAR. In case you are planning on redistributing your application, also take note of Quercus' GPL license. Commercial licenses are also available.
Lua lua com.threecrickets.sincerity.plugin sincerity-lua Based on the Luaj engine.
Groovy groovy com.threecrickets.sincerity.plugin sincerity-groovy
Clojure clojure com.threecrickets.sincerity.plugin sincerity-clojure
JavaScript javascript com.threecrickets.sincerity.plugin sincerity-javascript JavaScript is already supported, but this small optional plugin adds support for a "javascript" Sincerity command, a useful command line interpreter.

Recommended Add-ons

The following Sincerity packages work well with Prudence:

Shortcut Full Identifier Notes
Restlet Logging Add-on restlet.logging com.threecrickets.sincerity.skeleton sincerity-restlet-logging Powerful logging based on log4j. This will also pull in the Sincerity logging plugin
Service Plugin service com.threecrickets.sincerity.plugin sincerity-service Lets you run Prudence as a background service/daemon using Tanuki's Java Service Wrapper. In case you are planning on redistributing your application, also take note of the Wrapper's GPL license. Commercial licenses are also available.
Redistribution Plugin redistribution com.threecrickets.sincerity.plugin sincerity-redistribution Makes it easy to package and redistribute your Prudence application for others to install.

Support for Legacy JVMs

The default Prudence skeleton depends on a few libraries that require JVM 8. However, it's possible to switch these to libraries compatible with JVM 7 using the following:

./sincerity add prudence.jvm7 : install

This will downgrade Jetty 9.3 to Jetty 9.2, and will use the included Rhino JavaScript engine instead of Nashorn.


Stickstick

Shared sticky notes on the web! Stickstick is provided as an example SQL data-driven, RESTful "AJAX" application based on Prudence. It is available rewritten in six different programming languages.

To install it in your Prudence container, run "sincerity add" with one of the following package identifiers:

Full Identifier
Stickstick (JavaScript) com.threecrickets.stickstick stickstick-javascript
Stickstick (Python) com.threecrickets.stickstick stickstick-python
Stickstick (Ruby) com.threecrickets.stickstick stickstick-ruby
Stickstick (PHP) com.threecrickets.stickstick stickstick-php
Stickstick (Groovy) com.threecrickets.stickstick stickstick-groovy
Stickstick (Clojue) com.threecrickets.stickstick stickstick-clojure

Documentation

The complete Prudence Manual, essentially a copy of this web site, is available for download as a PDF.


Development Snapshot

Latest, greatest, but probably not well-tested. Available via git. Easy, quick build with Ant.


Previous Releases