org.eclipse.hyades.logging.events.cbe.impl
Class EventFactoryContext

java.lang.Object
  |
  +--org.eclipse.hyades.logging.events.cbe.impl.EventFactoryContext

public class EventFactoryContext
extends java.lang.Object

Generic look-up service for locating EventFactoryHome instances.

This class is implemented as a Singleton design pattern.

EventFactoryHome instances may be directly retrieved by passing the EventFactoryHome's fully qualified package and class name as a parameter to the getEventFactoryHome(String eventFactoryHomeType) API. Alternatively, the EventFactoryContext may be configured to retrieve the context-specific EventFactoryHome instance by calling the getEventFactoryHome() API. The EventFactoryContext may be configured using the setter to set its EventFactoryHome type.

The EventFactoryContext'sEventFactoryHome type property contains an EventFactoryHome's fully qualified package and class name.

The desired EventFactoryHome must be on the classpath and accessible by this class. Otherwise, the desired EventFactoryHome should be on the classpath and accessible by the user specified class loader. Users may supply a class loader for scenarios where the EventFactoryHome is not on the classpath and accessible by this class. Users may pass a reference to their class loader to allow loading EventFactoryHome implementation outside of the scope of this class' class loader. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The user specified class loader, if provided.
  2. The EventFactoryContext class' class loader.
  3. The system's class loader.
  4. The current thread's context class loader.

This class also provides a singleton reference to simple EventFactoryHome as a convenient mechanism to retrieve an EventFactory for template independent event creation. As such, the EventFactory retrieved from this EventFactoryHome has no associated ContentHandler and are used to create events that do not have an associated ContentHandler nor a configuration template.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly. This look-up service is optional and is not required to create an EventFactoryHome.

Since:
1.0.1
Version:
1.0.1
Author:
Paul E Slauenwhite
See Also:
EventFactoryHome

Field Summary
static java.lang.String EVENT_FACTORY_HOME_TYPE_SYSTEM_PROPERTY
          Deprecated. As of Hyades M10, system properties for configuration purposes are no longer supported.
 
Method Summary
 EventFactoryHome getEventFactoryHome()
          Retrieves the an EventFactoryHome instance based on the EventFactoryContext'sEventFactoryHome type property as an EventFactoryHome's fully qualified package and class name.
 EventFactoryHome getEventFactoryHome(java.lang.ClassLoader classLoader)
          Retrieves the an EventFactoryHome instance based on the EventFactoryContext'sEventFactoryHome type property as an EventFactoryHome's fully qualified package and class name, as loaded by the parameter class loader.
 EventFactoryHome getEventFactoryHome(java.lang.String eventFactoryHomeType)
          Retrieves the an EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name.
 EventFactoryHome getEventFactoryHome(java.lang.String eventFactoryHomeType, java.lang.ClassLoader classLoader)
          Retrieves the an EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name, as loaded by the parameter class loader.
 java.lang.String getEventFactoryHomeType()
          Gets the EventFactoryContext's EventFactoryHome type property.
static EventFactoryContext getInstance()
          Retrieves the context-specific EventFactoryHome instance.
 EventFactoryHome getSimpleEventFactoryHome()
          Retrieves a singleton reference to simple EventFactoryHome as a convenient mechanism to retrieve an EventFactory for template independent event creation.
 void setEventFactoryHomeType(java.lang.String eventFactoryHomeType)
          Sets the EventFactoryContext's EventFactoryHome type property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_FACTORY_HOME_TYPE_SYSTEM_PROPERTY

public static final java.lang.String EVENT_FACTORY_HOME_TYPE_SYSTEM_PROPERTY
Deprecated. As of Hyades M10, system properties for configuration purposes are no longer supported.

The value of the context-specific EventFactoryHome system property.

See Also:
Constant Field Values
Method Detail

getInstance

public static EventFactoryContext getInstance()
Retrieves the context-specific EventFactoryHome instance.

The desired EventFactoryHome must be on the classpath and accessible by this class. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The EventFactoryContext class' class loader.
  2. The system's class loader.
  3. The current thread's context class loader.

The EventFactoryContext may be configured to retrieve a context-specific EventFactoryHome using the setter to set its EventFactoryHome type.

The EventFactoryContext'sEventFactoryHome type property contains an EventFactoryHome's fully qualified package and class name.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Returns:
The context-specific EventFactoryHome instance.

getEventFactoryHome

public EventFactoryHome getEventFactoryHome(java.lang.String eventFactoryHomeType)
Retrieves the an EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name.

The desired EventFactoryHome must be on the classpath and accessible by this class. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The EventFactoryContext class' class loader.
  2. The system's class loader.
  3. The current thread's context class loader.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Parameters:
eventFactoryHomeType - An EventFactoryHome's fully qualified package and class name
Returns:
The EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name, otherwise null.

getEventFactoryHome

public EventFactoryHome getEventFactoryHome(java.lang.String eventFactoryHomeType,
                                            java.lang.ClassLoader classLoader)
Retrieves the an EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name, as loaded by the parameter class loader.

This API is used for scenarios where the EventFactoryHome is not on the classpath and accessible by this class. Users may pass a reference to their class loader to allow loading EventFactoryHome implementation outside of the scope of this class' class loader.

The desired EventFactoryHome should be on the classpath and accessible by the parameter class loader. Otherwise, the desired EventFactoryHome must be on the classpath and accessible by this class. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The parameter class loader.
  2. The current class' (e.g. EventFactoryContext) class loader.
  3. The system's class loader.
  4. The current thread's context class loader.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Parameters:
eventFactoryHomeType - An EventFactoryHome's fully qualified package and class name
classLoader - A class loader used for loading the EventFactoryHome instance.
Returns:
The EventFactoryHome instance based on the parameter EventFactoryHome's fully qualified package and class name, otherwise null.

getEventFactoryHome

public EventFactoryHome getEventFactoryHome()
Retrieves the an EventFactoryHome instance based on the EventFactoryContext'sEventFactoryHome type property as an EventFactoryHome's fully qualified package and class name.

The desired EventFactoryHome must be on the classpath and accessible by this class. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The EventFactoryContext class' class loader.
  2. The system's class loader.
  3. The current thread's context class loader.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Returns:
The EventFactoryHome instance based on the EventFactoryContext's EventFactoryHome type property as an EventFactoryHome's fully qualified package and class name, otherwise null.

getEventFactoryHome

public EventFactoryHome getEventFactoryHome(java.lang.ClassLoader classLoader)
Retrieves the an EventFactoryHome instance based on the EventFactoryContext'sEventFactoryHome type property as an EventFactoryHome's fully qualified package and class name, as loaded by the parameter class loader.

This API is used for scenarios where the EventFactoryHome is not on the classpath and accessible by this class. Users may pass a reference to their class loader to allow loading EventFactoryHome implemenation outside of the scope of this class' class loader.

The desired EventFactoryHome should be on the classpath and accessible by the parameter class loader. Otherwise, the desired EventFactoryHome must be on the classpath and accessible by this class. The EventFactoryHome is attempted to be instantiated using the following class loader hierarchy:

  1. The parameter class loader.
  2. The EventFactoryContext class' class loader.
  3. The system's class loader.
  4. The current thread's context class loader.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Parameters:
classLoader - A class loader used for loading the EventFactoryHome instance.
Returns:
The EventFactoryHome instance based on the EventFactoryContext's EventFactoryHome type property as an EventFactoryHome's fully qualified package and class name, otherwise null.

getSimpleEventFactoryHome

public EventFactoryHome getSimpleEventFactoryHome()
Retrieves a singleton reference to simple EventFactoryHome as a convenient mechanism to retrieve an EventFactory for template independent event creation.

As such, the EventFactory retrieved from this EventFactoryHome has no associated ContentHandler and are used to create events that do not have an associated ContentHandler nor a configuration template.

Returns:
A singleton reference to simple EventFactoryHome, otherwise null.
See Also:
SimpleEventFactoryHomeImpl

setEventFactoryHomeType

public void setEventFactoryHomeType(java.lang.String eventFactoryHomeType)
Sets the EventFactoryContext's EventFactoryHome type property.

The EventFactoryContext may be configured to retrieve a context-specific EventFactoryHome using this method to set its EventFactoryHome type.

The EventFactoryContext'sEventFactoryHome type property contains an EventFactoryHome's fully qualified package and class name.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Parameters:
eventFactoryHomeType - The EventFactoryContext's EventFactoryHome type property as an EventFactoryHome's fully qualified package and class name.

getEventFactoryHomeType

public java.lang.String getEventFactoryHomeType()
Gets the EventFactoryContext's EventFactoryHome type property.

The EventFactoryContext may be configured to retrieve a context-specific EventFactoryHome using this method to set its EventFactoryHome type.

The EventFactoryContext'sEventFactoryHome type property contains an EventFactoryHome's fully qualified package and class name.

The benefit of this look-up service is that application code does not have to import or invoke typed EventFactoryHome s directly.

Returns:
The EventFactoryContext's EventFactoryHome type property as an EventFactoryHome's fully qualified package and class name.