org.apache.env
Class WhichFactory

java.lang.Object
  |
  +--org.apache.env.WhichFactory

public abstract class WhichFactory
extends java.lang.Object

Simple factory class for WhichProject implementations. A list of 'installed' WhichProject impls is kept in our matching org/apache/env/WhichFactory.properties file.

Version:
$Id: WhichFactory.html,v 1.4 2003/12/30 03:55:19 crossley Exp $
Author:
shane_curcuru@us.ibm.com

Field Summary
static java.lang.String DEFAULT_WHICHCLASS
          org.apache.env.Which, prepended to unknown projectnames.
protected static java.util.Properties installedWhichers
          List of 'installed' WhichProject implementations.
static java.lang.String SERVICE_NAME
          'WhichFactory'.
 
Constructor Summary
WhichFactory()
           
 
Method Summary
static WhichProject newWhichProject(java.lang.String name, java.lang.String options)
          Factory method to get a WhichProject implementation for the name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WHICHCLASS

public static final java.lang.String DEFAULT_WHICHCLASS
org.apache.env.Which, prepended to unknown projectnames.

See Also:
Constant Field Values

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
'WhichFactory'.

See Also:
Constant Field Values

installedWhichers

protected static java.util.Properties installedWhichers
List of 'installed' WhichProject implementations.

Constructor Detail

WhichFactory

public WhichFactory()
Method Detail

newWhichProject

public static WhichProject newWhichProject(java.lang.String name,
                                           java.lang.String options)
                                    throws java.lang.ClassNotFoundException,
                                           java.lang.InstantiationException,
                                           java.lang.IllegalAccessException
Factory method to get a WhichProject implementation for the name.

Returns a WhichProject using the name as an FQCN; or looks up the name in WhichFactory.properties; or assuming it's a simple name and appends DEFAULT_WHICHCLASS on the front.

Parameters:
name - FQCN, simple name, or installed name of a WhichProject implementation class
options - to use when getting the class
Returns:
a WhichProject object
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException


Copyright © 2001 Apache Software Foundation. All Rights Reserved.