de.bea.domingo
Class DNotesFactoryFinder

java.lang.Object
  extended by de.bea.domingo.DNotesFactoryFinder

final class DNotesFactoryFinder
extends java.lang.Object

Implementation finder for the abstract factory DNotesFactory.

Author:
Kurt Riede

Nested Class Summary
(package private) static class DNotesFactoryFinder.ClassLoaderFinderConcrete
          Nested class that allows getContextClassLoader() to be called only on JDK 1.2 and yet run in older JDK 1.1 JVMs.
(package private) static class DNotesFactoryFinder.ConfigurationError
          Error class to indicate factory configuration errors.
 
Method Summary
static java.lang.Object find()
          Find the class name of the implementation of an abstract factory.
static java.lang.Object find(java.lang.String implementingClassName)
          Find the class name of the implementation of an abstract factory.
static java.lang.ClassLoader findClassLoader()
          Figure out which ClassLoader to use.
static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns the value of a property or returns the given default value if no configuration found.
static void setProperty(java.lang.String key, java.lang.String value)
          Sets a configuration value and overwrites any default or configuration settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

find

public static java.lang.Object find()
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException
Find the class name of the implementation of an abstract factory.

Returns:
instance the new instance
Throws:
java.lang.IllegalAccessException - if the class or initializer is not accessible.
java.lang.InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the instantiation fails for some other reason.

find

public static java.lang.Object find(java.lang.String implementingClassName)
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException
Find the class name of the implementation of an abstract factory.

Returns:
instance the new instance
Throws:
java.lang.IllegalAccessException - if the class or initializer is not accessible.
java.lang.InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the instantiation fails for some other reason.

findClassLoader

public static java.lang.ClassLoader findClassLoader()
Figure out which ClassLoader to use. For JDK 1.2 and later use the context ClassLoader if possible. Note: we defer linking the class that calls an API only in JDK 1.2 until runtime so that we can catch LinkageError so that this code will run in older non-Sun JVMs such as the Microsoft JVM in IE.

Returns:
Classloader

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String defaultValue)
Returns the value of a property or returns the given default value if no configuration found.

Parameters:
key - the key of the property
defaultValue - default value, if no configuration found
Returns:
the value of the property

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value)
Sets a configuration value and overwrites any default or configuration settings.

Parameters:
key - the key of the property
value - the new value


Domingo Java-API