From Repository to Runtime

Please make sure you read the Starting section before.

Now that you have a running environment, let's verify what is inside and see how the repositories content reflects what we see at runtime and vice versa.

Sample Applications

There are two sample web applications defined in the z2_base repository. Actually, it is more or less just one - depending on which way you want to look at it. The point of providing these applications is of course not their actual funtionality (which is storing images in a database), but rather a show case of framework integration with the z2-Environment.

Once the runtime is up, you can access the first application at http://localhost:8080/wickil:

The application at /wickil was realized using the Apache Wicket framework for rendering, Apache Derby as database, and Hibernate as an O-R-Mapper solution in between.

The other application is available at http://localhost:8080/wickilext:

This application is a simple Java Server Pages (JSP) based list application that uses dependency injection via the @Resource annotation to get the data source injected that is eventually retrieved via a JNDI name that points to a component definition in the repository. Note that data source are in fact component in the repository, just as web applications are.

Repository Structure

Let's have a look into the repositories. Use the Subversion perspective or the GIT perspective in Eclipse.

Remember that we installed the core runtime from the core subfolder (or repository), that contains a ready-to-run, binary distribution of the core runtime. Now we will look into the base and samples folders (or repositories), that contain everything else. They represents the main source of truth for the runtime - the runtime will autonomously synchronize with the content in these repository locations.

The general structure of the repository is

<project name>/<component in project>

You will find some com.zfabrik.* project. These make for the infrastructure of the environment. For example, com.zfabrik.servletjsp provides the web container functionality using Jetty. But also you will find the projects org.hibernate and org.apache.wicket that provide the frameworks used to build the applications defined the projects samples.jsp.imagelib and samples.wicket.imagelib that share a project samples.shared.service.

Take a little time and browse the projects.

Why is this important?

While there is a difference in purpose of application server infrastructure and application code, there is in general no convincing reason to treat these differently from a life cycle management perspective. The z2-Environment tries to apply the same structure and life cycle management to as much of its content as possible - be it configuration or code - regardless of whether it is more on the framework or more on the application side of things. That makes life cycle management simpler, more robust, more comprehensive, and easier to understand.

We will revisit this structure in the next section: Development