Just before the holidays, we managed to roll a new release, version 0.9.8, of Project Darkstar. Officially announced today, this release features a major packaging improvement that greatly simplifies deployment, startup, and shutdown of Darkstar applications. Let's take a look at how this works.
At the heart of a deployment, is the Project Darkstar container itself. Unlike past releases, installing the server package is as simple as unzipping the distribution zip file. No additional steps are required. The extracted archive will leave a directory structure as follows:
- sgs-server-dist-0.9.8
- API-CHANGES
- CHANGELOG
- NOTICE.txt
- README
- bin
- conf
- deploy
- doc
- lib
- license
- src
- tutorial
The README file has a decent introductory explanation of this structure, but the main directories that you want to concentrate on are bin, conf, deploy, and lib:- bin - The bin directory contains two executable JAR files, sgs-boot.jar and sgs-stop.jar which are respectively used to startup and shutdown the container. Executing the command "java -jar /path/to/sgs-server-dist-0.9.8/bin/sgs-boot.jar" will startup the container and initialize the deployed application according to the configuration in the directories below.
- conf - The conf directory contains three configuration files used for the runtime configuration of the system. The sgs-boot.properties file is used to configure the system environment and JVM configuration, the sgs-server.properties file represents the application configuration file which is fed to the Darkstar Kernel, and the sgs-logging.properties file is used as the java.util.logging.config.file during runtime.
- deploy - The deploy directory contains all application-specific JAR files. When the container is booted up, these JAR files are automatically included in the JVM's classpath. Additionally, a single one of these JAR files can optionally include an embedded META-INF/app.properties file which is combined with the sgs-server.properties file from the conf directory to make up the set of properties used by the Darkstar Kernel. Out of the box, the deploy directory is empty and so booting up the container will immediately fail since there is no application to run.
- lib - The lib directory suitably contains all of the JAR files required for any Project Darkstar application. These are automatically included in the JVM's classpath upon bootup of the container.
- An additional feature of the 0.9.8 release of Project Darkstar is the explicit decoupling of the API interfaces from the implementation classes. The only compile-time dependency required when developing an app now is the sgs-server-api JAR file (found in the lib directory as well as the Maven repository). Simple.
- Application specific Darkstar properties (e.g. com.sun.sgs.app.listener, etc.) can be bundled directly with the application by embedding a META-INF/app.properties Darkstar configuration file directly into your application JAR file. Simple. Consistent.
- A Project Darkstar application is a JAR file or set of JAR files, one of which optionally contains a META-INF/app.properties Darkstar configuration file. Consistent.
- A Project Darkstar application can be deployed into any Project Darkstar container by simply dropping the application JAR files into the deploy directory of the container and suitably tweaking the configuration files in the conf directory for your needs. Simple. Consistent.
It is really very useful
ReplyDeleteHi Rick,
ReplyDeleteThe hands on lab given at JavaOne this year may be of interest to you: http://projectdarkstar.com/handsonlab/
Also note that the website is currently undergoing some work that should help in the organization of some of the documentation. This should be rolled out pretty soon. Also, I would recommend the Project Darkstar forums as a very good resource for any questions you might have.
Hope this helps.