org.shiftone.exq
Class QueryBuilder

java.lang.Object
  extended byorg.shiftone.exq.QueryBuilder
Direct Known Subclasses:
QueryBuilderImpl

public abstract class QueryBuilder
extends java.lang.Object

This interface provides application code with a way to obtain a Query instance.

Implementations of this interface are expected to be thread safe.

It is recommended that a reference be keep to an instance of concrete implementation of this interface rather than to call newInstance() each time an instance is needed.

Author:
Jeff Drost

Constructor Summary
QueryBuilder()
           
 
Method Summary
abstract  Query getQuery(java.lang.String resourcePath)
          Returns a new Query that was initialized with the meta-data at the given resource path.
static QueryBuilder newInstance()
          Method newInstance
static QueryBuilder newInstance(java.lang.ClassLoader classLoader)
          Returns a new instance of a QueryBuilder - this instance does not share state with any other QueryBuilders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBuilder

public QueryBuilder()
Method Detail

getQuery

public abstract Query getQuery(java.lang.String resourcePath)
                        throws QException
Returns a new Query that was initialized with the meta-data at the given resource path. The meta-data for the query may be obtained from the classpath, or the from cache - however it will alwayse be loaded from the classpath the first time a request for a particular resource path is made to an instance of a QueryBuilder.

To put it another way.. the meta-data cache, and other state is not shared from one QueryBuilder instance to another.

A resource path of aaa.bbb.ccc.ddd will be translated to /aaa/bbb/ccc/ddd.xml

Throws:
QException

newInstance

public static QueryBuilder newInstance()
                                throws QException
Method newInstance

Throws:
QException

newInstance

public static QueryBuilder newInstance(java.lang.ClassLoader classLoader)
                                throws QException
Returns a new instance of a QueryBuilder - this instance does not share state with any other QueryBuilders. It is not a singleton. Any caching that is managed by the concrete class is distinct for each instance.

Throws:
QException