Chapter 3. Deploying a Restlet application

This chapter covers

  • Background on Restlet components
  • Deploying in standalone Java SE virtual machines
  • Configuring virtual hosts and log and status services
  • Declarative XML configuration
  • Deploying in Java EE application servers and OSGi environments

In chapter 2 you learned how to develop a Restlet application, the basic unit of reuse in the Restlet Framework. Your goal now is to deploy those applications to local machines in your organization and to make sure that they can be properly used and tested.

In this chapter you’ll learn the purpose of a Restlet component and how it’s structured in four layers. You’ll then see how to set up a Restlet component in a Java SE environment, adding server and client connectors, exploring virtual hosting and internal routing, and configuring logging and default status messages.

As an alternative to using the Restlet API with Java code, we introduce two ways to use XML for more declarative configuration of Restlet components—one built in the Restlet Framework and another relying on the Spring Framework. Then we explain how to deploy the same Restlet application to a pre-existing Java EE server. Finally we mention a third deployment approach based on OSGi.

This chapter isn’t the last one covering deployment; chapter 8 shows how Restlet applications can be easily deployed in cloud computing infrastructures such as Google App Engine, Amazon EC2, or Microsoft Azure.

3.1. The purpose of Restlet components

3.2. The structure of Restlet components

3.3. Standalone deployment with Java SE

3.4. Declarative configuration in XML

3.5. Deployment in an existing Java EE server

3.6. Summary