web application configuration system

Pow2toolkit provides a simple system to configure:

  • JDBC connectivity
  • LDAP connectivity
  • User data provider
  • Application log system
  • Cactus integration unit test
using a simple Java properties file.

data access facilities

connection pool factory system

The ConnectionFactory class provides JDBC connection objects to the clients. It gives a common interface to retrieve connection objects, but defer the database interaction to specialized connectionProvider classes.

The connectionFactory package provides tree connectionProvider classes:

connection provider classdescription
JakartaConnectionProvider Provides connection objects using the Jakarta commons-dbcp Connection Pool library.

class name: com.pow2.dao.JakartaConnectionProvider
ProtomatterConnectionProvider Provides connection objects using the Protomatter Connection Pool library.

class name: com.pow2.dao.ProtomatterConnectionProvider
SimpleConnectionProvider Provides connection objects, but does not use connection pool components.

class name: com.pow2.dao.SimpleConnectionProvider

JDBC 2.0 data list handler implementation

The com.pow2.dao.datalist package provides a JDBC 2.0 implementation of the Data List Handler pattern by Claudio Fratarcangeli.

"The the DataListHandler design pattern represents a substantial improvement over traditional methods for efficiently processing Internet searches and quickly displaying the results to the user. The DataListHandler design pattern addresses the problem of processing Internet search queries that return large result sets in an efficient manner. It provides a set of interfaces, DataListHandler, DataList, and DataListIterator, that insulate the client from the underlying details of the search and retrieval implementation."

Read the PDF here.

ID generator class with HIGH / LOW startegy

The com.pow2.dao.IdGenerator class provides the generation of ID values using the HIGH / LOW strategy described by Scott W. Ambler into his Mapping Objects To Relational Databases white paper.

singleton dao objects

The package com.pow2.dao provides some useful singleton classes for JDBC data access.

User management and authentication

The com.pow2.user package provides simple User management (geUser, deleteUser, createUser) and authentication via the UserManager class. UserManager is a facade to the UserDAOFactory, that provides data access to relational databases or LDAP servers.

Jakarta Struts integration

The com.pow2.struts package provides the integration with Jakarta Struts framework.

action classdescription
ActionServlet the custom ActionServlet class extends org.apache.struts.action.ActionServlet and override the processActionPerform method.

It checks if the input action is a subclass of BaseAction; then execute its validateSession method
BaseAction provides the validateSession hook method; developers could override this method to implement their own user validation rule
DispatcherAction Ted Husted's DispatcherAction class. See his Struts Catalog for more Struts' patterns
UserValidationAction check for a valid com.pow2.user.User object reference into the session context
UserValidationDispatcherAction extends DispatcherAction class and provides simple User validation rule

Data structures


The com.pow2.structures.tree package provides the implementation of Binary tree and Binary search tree.