Essence Java Framework
This web site is being migrated to the Essence Wiki
Google
 
Web www.jtoolkit.org weblog.jtoolkit.org
Navigation
Home
SourceForge Home
Articles on Java
Getting Started
Essence Documentation
Download

Contact
Get rewarded for helping out
Email A Question
Weblog

Support This Project

SourceForge.net Logo

Welcome to the home of Essence Java Framework.

As a simple Java framework, Essence delivers simple and novel solutions to your complex problems. It draws from such products as Nano, Spring, Hibernate, JDO, ODMG, JMX and JMS. Essence 0.70 is 234 KB in size and around 330 KB including all dependent jars.

 

Why use Essence?

Essence contains a number of innovative features that simplify the configuration and management of components and data within your application. 

The purpose of Essence is to use top down design and manage the complexity of the application's configuration.  Many frameworks start with the simplest objects and attempt to assemble these together to make more complex high level components. Essence assumes you have a high level design for your system and attempts to hide the details of how each component is implemented.

These include:

  • High performance highly available clustering.  Essence 0.68 has been tested with 2-way and 4-way mastering (were each update is committed to both or all 4 servers) and persisted to disk in near real time.  On a Linux blade, Essence 0.68 has been tested with 2-way and 4-way mastering (were each update is committed to both or all 4 servers) and persisted to disk in near real time.  On a Linux blade, the tests performed 9,700 to 120,000 updates per second depending on the transaction size. The tests performed 60,000 updates per second and 6 million lookups per second concurrently in 2- way durable mastering mode. In 4-way durable mastering mode, the tests performed 24,000 updates per second and 2.4 million lookups per second.
    Performance test results
  • Explicit declaration of all dependencies. A central configuration which defines all dependencies between components. This is enforced by relying solely on Dependency Injection. Unlike other products, components have no access to the Container which created them so you will have no container-dependent code nor can the component have dependencies which were not given to it by the container.
  • Data sharing through Immutable data value objects and Event driven processing. Separation between logically stateless business objects and stateful data value objects.  This ensures the current state of the application is visible and well defined. The data model supports distributed data and event processing in a thread safe and durable way.  The data model supports replacement of one data storage type with another by configuration.  A JDBC table can be replaced with a tab separated file for the purpose of development or units tests.  This allows for complex canned data and data driven testing.
  • Binding of components to Managed Logical Process. Logical process act as if it were in a single threaded application. Components are bound to a logical process and can ensure it is only called by one thread. Each logical process has only one thread and components in different logical process are isolated from each other.
  • Distributed durable collections can be accessed as a Map, a Collection or a BlockingQueue. Collections can be in memory, on a remote server, embedded in the configuration file, in a tab separated file, a binary file, or in a JDBC database. An event listener can be added to any collection locally or remotely to hear changes. Bootstrapping is just an entrySet() or values() call. Persisted data can be updated synchronously, semi-synchronously or asynchronously.
  • Named parameters for constructors. Reflection based conventions are used rather than annotations, XML, setters or getters.
  • Multiple container unit tests support. Essence supports unit test with multiple containers to test connection failure, failover conditions and load balancing. In the JMS broker example, two client container connect to a broker which is killed and a second broker started.  This demonstrated successful restarting of the broker.  This means you can unit failover and load balancing scenarios even with complex applications.
  • JMX support for logical processes and durable collections
  • Base types are primitive types, their wrappers, String, Enum types, BigDecimal, BigInteger, Class, Date. List<String>, Map<String, String>, Set<String>. Also supported are Arrays of base types (but not collections)
  • A package path can be defined so that class names can be shortened to just the class name.

Essence Version 0.70 released

The latest version is Essence 0.70, and the online Javadoc is available at Getting started Javadoc . Essence 0.70 has around 7,000 lines of tests, whereas 0.68 had 2,500 lines.

What example programs exist?

A sample JMS broker is provided: Essence JMS Sample 0.70. The client and broker code produces a jar which is 39K, all required jars combined are 354K.

What is example of a simple data value object?

public class DestinationEntry extends DataValue {
    public final String destination;
    public final long messageId;

    public DestinationEntry(String destination, long messageId) {
        this.destination = destination;
        this.messageId = messageId;
    }
}

This is used in the JMS broker example. This is all the code you need to write. The constructor can be generated using an IDE. The container handles the rest. You don't have to extend DataValue class but it gives you a number of convenience methods such as equals(), hashCode(), toString(), asMap() to turn into a map of key/values, project() to convert into another data value and set() to create another immutable data value object except with one or more value changed.

What is example of a simple component?

The following component has one property value, a reference to a Map and one to another component.
public class CompTestWithRef extends CompTest {
    private final Map<String, TestEntity> map;
    private final CompTest testRef;

    public CompTestWithRef(long value, Map<String, TestEntity> map, CompTest testRef) {
        super(value);
        this.map = map;
        this.testRef = testRef;
    }
}

What collections features are supported?

  ReadMode | PersistMode | Object Types
    NONE     ALL    MINIMAL |   NONE    ASYNC   SEMI_SYNC   SYNC   READ_ONLY |   Any   Serializable Datable DataValue
In Memory | |
Tab sep file | |
Single File | |
Directory | |
JDBC | |
Remote (net) | |
Legend
Feature not planned
Feature available
Planned for release v1.0
Modes
ReadMode.NONE The store is not loaded from a persisted storage
ReadMode.ALL Read the entire store into memory on start up.
ReadMode.MINIMAL Read data as required.
PersistMode.NONE Do not persist any data changes.
PersistMode.ASYNC Write data asynchronously to disk. Every 0.5 - 5 seconds depending on the type
PersistMode.SEMI_SYNC Write data close to synchronously to disk. Every 25 - 250 ms depending on the type.
PersistMode.SYNC Write data synchronously to disk.
PersistMode.READ_ONLY Disable writing to the store and throw an exception if a write is attempted.
Object Type (Any) Any Object type
Object Type (Serializable) Java Serializable objects
Object Type (Datable) An Essence specific serialization based on DataInput and DataOutput streams.
Object Type (Data Value) Any object which can be reduced to a Map of String keys and base type values.

 

Suggested Tools

IDE IntelliJ 6.0
JDK Java 6, or Java 5 Update 10
Code Analysis Fisheye
Profiler Java Profiler
YourKit Review: Visualization is a key attribute of a profiler and YourKit is an excellent tool. I suggest profiling your application before releasing in case there is a performance issue which can be easily resolved. YourKit found a number of CPU and memory consumption issues I wasn't aware off but definitely worth fixing.

About the Developer

Peter Lawrey has been working with Java since 1999 and has worked for a number of Investment Banks in the London.
He worked for Sun Microsystems (Australia) for a number of years before moving to the UK.

Copyright 2006 Peter Lawrey Essence Email