Published: February, 15th 2008 HiveMind Utilities
General utility modules for HiveMind
SourceForge.net Logo

Introduction

Welcome to the HiveMind Utilities (previously HiveTranse) Web site!

This project constitutes a repository of various Java libraries to help applications developers, using the HiveMind lightweight container, to focus on the business rather than on cross-cutting and technical concerns such as transaction management, security, export of services as web services...

All modules in the project are free to use according to the Apache License Version 2.0.

The current version is 0.8.0, it can be downloaded there. It is based on JSE 5 and HiveMind 1.1.1.

If you want to use the older J2SE 1.4, you can also use HiveMind Utilities 0.6.2. However, please note that this version will not evolve any more.

The following main components are part of the distribution:

  • HiveUtils: a general library containing several simple utility classes (collections, web, tests) and helpful HiveMind services.
  • HiveTranse: a simple transaction framework with support for several persistence layers (direct JDBC, iBATIS SqlMaps and Hibernate 3).
  • HiveLock: a simple, easy to use, security framework for HiveMind applications.
  • HiveRemoting: a simple, easy to use, library to enable distributed applications based on HiveMind and based upon simple "remoting" protocols (currently Caucho Hessian and Burlap are supported).
  • HiveEvents: a simple module to manage notification of any kind of events between components inside one JVM.
  • HiveGUI: a framework to ease the work of creating rich Swing clients.

Each module is described in more detail below.

Most of these modules are in use in the HiveBoard project on SourceForge and can be considered quite stable, although some of them may be extended in the future (according to the needs of the HiveBoard project). So you can already consider using them into your own projects.

Please note that these modules are quite independent of one another (except HiveUtils which is used by almost all other modules), so you can elect to use only some of them in your own projects.

Some of the modules here still lack documentation but the provided examples help show how to use them. In addition, the HiveBoard project is a very good "example" of usage of all these modules.

For an overview of the features to be added in future releases, check the Roadmap.

If you want to get started quickly (and if you already played a bit with HiveMind), you should have a look at the Quick start guide.

The HiveMind Utilities Team hopes that you will find these modules useful for your projects.

Should you discover a problem, need some help or wish for an enhancement or a new feature, please do not hesitate to use the SourceForge facilities (forums, trackers).

HiveUtils

HiveUtils provides the following:

  • Collection classes (Stack and Queue)
  • Web utility classes (log4j helpers, properties helpers, gzip filter...)
  • AdapterBuilderFactory to adapt an instance of any kind of class to be viewed as a HiveMind service (also allows remapping of exceptions)
  • ExceptionMappingInterceptorFactory to create interceptors that will map exceptions thrown by a service to different exception
  • PropertyFileSymbolSource service used to resolve symbols from property files (allows externalizing definition of some symbols outside of the jars/wars for an easy deployment without prior rebuild)
  • ObjectBuilder service to create -and optionally cache- any kind of objects defined in a configuration point. For all these objects, ObjectBuilder manages dependency injection
  • useful ObjectProviders: "object:" to inject objects created by ObjectBuilder, "contribution:" to inject one given contribution out of a configuration point, "literal:" to inject any Java primitive literal (String, int, boolean...)
  • Useful JUnit base classes for easier writing of test cases using jMock
  • PreferencesManager to ease management of user's preferences
  • Encryption utility classes

HiveTranse

In a nutshell, HiveTranse has the following features:

  • Generic framework for transactions management (TransactionService), completely configurable through HiveMind configuration modules
  • Declarative transaction demarcation (a la EJB) through an TransactionInterceptor with your own defined defaults, including for exception handling (contrarily to EJB, you can declare that ANY exception shall rollback transactions, not just RuntimeExceptions)
  • Programmatic transaction demarcation through the TransactionService API
  • TransactionService for JDBC DataSources with support for multiple DataSources (but outside JTA). Integrates with major DataSource pooling libraries (eg jakarta commons-dbcp). Your services can then be injected with the JDBC Connection(s) ready to use.
  • TransactionService for Hibernate Sessions with support for multiple SessionFactory -ie data sources- (but outside JTA). Your services can then be injected with the Hibernate Session(s) ready to use. The "Open Session In View" pattern is also supported. Custom Hibernate Interceptors are supported as well. HiveTranse supports only Hibernate 3.
  • Transparent support for iBATIS SqlMaps V2. Also supports "Open Session In View" pattern.
  • Support for transparently converting SQLExceptions into more specific, runtime, exceptions (hierarchy is defined in hivetranse.exceptions module).

HiveLock

HiveLock provides the following components:

  • SecurityService to centralize the currently connected users and notify listeners when users get connected or disconnected. Disconnection can be automatically enforced after a configurable period of inactivity.
  • HiveLockFilter is a ServletFilter to notify SecurityService about the user for the current request.
  • AuthorizationInterceptorFactory to add interceptors to your services in order to check if a method is authorized for the current caller.
  • UserContextStorage service to store and retrieve data depending on current user.
  • UserServiceModel (aka "user") to define stateful services (there is one service instance per connected user).

HiveRemoting

HiveRemoting provides the following features:

  • export any HiveMind service as a "web service" through Caucho's hessian or burlap protocols over http (exporting a service is just a matter of contributing to a configuration point)
  • get access to a remote service through a specific CauchoProxyFactory that will transparently return a proxy to the remote service
  • possibility to add specific serializers to the caucho protocols through configuration
  • enhancements to Caucho proxies to support cookies for authentication (this enables server authentication on first call only, later calls reuse the server-returned cookie to bypass further authentication)
  • support of gzip compression for exchanged messages
  • transparent support of https
  • extra context passing (though http headers)

HiveEvents

HiveEvents provides the following:

  • configuration point to define Event "Channels" (each channel must have a unique name) that can be used by other components (event suppliers and consumers)
  • support of push suppliers, and push or pull consumers
  • any kind of event is supported
  • dynamic event filtering is possible
  • special ConstraintFilter enables you to use boolean expressions to filter events (thanks to a simple but powerful Constraint Expression Language)
  • ObjectProvider "channel:" to directly inject a Channel into a service

HiveGUI

HiveGUI provides the following support:

  • full use and integration of future Sun "Swing Application Framework" (JSR-296)
  • easy docking (a la Eclipse)
  • dialog management
  • message box management
  • injection of actions (as defined by @Action annotation) through the new "action:" ObjectProvider
  • easy management of tables (default table models to handle a list of beans) through a configuration point (allows to define the list of columns, the renderer for each...)
  • definition of menus (including popups) and items in a configuration point. Menus can be injected into other objects through the new "menu:" ObjectProvider
  • miscellaneous tools for icons, cursors, fonts, colors, images...

Additionally, HiveGUI integrates well with DesignGridLayout (an easy-to-use LayoutManager that always provides visually clean look) and substance look & feel.