|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.eclipse.hyades.logging.events.cbe.impl.AbstractEventFactoryHome
An abstract event factory home implementation for working with event factories.
This abstract class provides resolution of named
EventFactory instances, persistence of retrieved
EventFactory instances, configuration updates based on a
specific type of configuration template for the EventFactory
instances and releasing cached named EventFactory instances.
This abstract class also provides an anonymous EventFactory
for retrieving an unnamed EventFactory for component independent
event creation. The anonymous EventFactory may be retrieved and
potentially updated based on a specific type of configuration template for the
EventFactory instances, if one exists for unnamed
EventFactory instances. Note, the anonymous
EventFactory instance cannot be released once created.
Concrete implementations of this abstract class implement the
createContentHandler(String factoryName) and
resolveContentHandler() APIs to provide a ContentHandler
implementation tightly coupled to the type of concrete implementation of
this abstract class. The resolveContentHandler() API permits
an alternative ContentHandler to be associated with an instance
of a concrete implementation of this abstract class. This is achieved by extending
the concrete implementation of this abstract class and extend the
resolveContentHandler() API. Concrete implementations that do not require a
ContentHandler nor configuration template, simply return null
for each API.
For example, a concrete implementation of this abstract class may provide the
an implementation of the createContentHandler(String factoryName)
API that creates a specialized ContentHandler pre-configured with
an event template resolved from a local event property file. The concrete
implementation of this abstract class would also provide an implementation
of the resolveContentHandler() API that retrieves a new instance
of the specialized ContentHandler used in the implementation of
the createContentHandler(String factoryName) API.
It is assumed that implementations of the createContentHandler(String factoryName)
API would reference the implementation of the resolveContentHandler() API in the
same concrete implementation of this abstract class when creating the returned ContentHandler.
EventFactoryHome,
EventPermission| Constructor Summary | |
|---|---|
AbstractEventFactoryHome()
|
|
| Method Summary | |
|---|---|
void |
checkAccess()
Checks the system's SecurityManager for the context of the
currently executing thread to see if the caller has permission to create,
retrieve, update and release Event Factory instances from the Event
Factory Home. |
abstract ContentHandler |
createContentHandler(java.lang.String factoryName)
Creates an instance of the ContentHandler implementation which
is tightly coupled to the type of the concrete implementation of
this abstract class.
|
EventFactory |
getAnonymousEventFactory()
Retrieves an instance of the anonymous EventFactory.
|
EventFactory |
getEventFactory(java.lang.String factoryName)
Retrieves an instance of the named EventFactory.
|
void |
releaseEventFactory(java.lang.String factoryName)
Releases the reference to the instance of the named EventFactory.
|
abstract ContentHandler |
resolveContentHandler()
Resolves an instance of the ContentHandler implementation which
is tightly coupled to the type of the concrete implementation of
this abstract class.
|
void |
updateAnonymousEventFactory()
Updates the configuration on the instance of the anonymous EventFactory.
|
void |
updateEventFactory(java.lang.String factoryName)
Updates the configuration on the instance of the named EventFactory.
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractEventFactoryHome()
| Method Detail |
public abstract ContentHandler createContentHandler(java.lang.String factoryName)
ContentHandler implementation which
is tightly coupled to the type of the concrete implementation of
this abstract class.
The returned instance of the ContentHandler implementation is
pre-configured with a event properties resolved from a source tightly coupled
to the type of the concrete implementation of this abstract class.
It is assumed that implementations of this method would reference the implementation of the
resolveContentHandler() method in the same concrete implementation of this
abstract class when creating the returned ContentHandler.
factoryName - The name of the event factory associated with the returned ContentHandler implementation.
ContentHandler pre-configured with a event properties.public abstract ContentHandler resolveContentHandler()
ContentHandler implementation which
is tightly coupled to the type of the concrete implementation of
this abstract class.
It is assumed that implementations of the createContentHandler(String factoryName)
method would reference the implementation of this method in the same concrete implementation of this
abstract class when creating the returned ContentHandler.
ContentHandler tightly coupled with this type of this event factory home implementation.
public void checkAccess()
throws java.lang.SecurityException
SecurityException.
EventFactoryHomeSecurityManager for the context of the
currently executing thread to see if the caller has permission to create,
retrieve, update and release Event Factory instances from the Event
Factory Home. The caller has permission if the
EventPermission("factory") permission has been explicitly
granted to the caller.
If the caller has been granted permission the method quietly returns.
Otherwise, the method throws a SecurityException.
checkAccess in interface EventFactoryHomejava.lang.SecurityException - If the SecurityManager exists and if the
caller does not have permission (e.g.
EventPermission("factory")).EventFactoryHome.checkAccess()public EventFactory getAnonymousEventFactory()
EventFactoryHomeEventFactory.
An instance of the anonymous EventFactory is created if
the anonymous EventFactory instance currently does not exist.
Once the anonymous EventFactory is created, the instance
is cached for future calls to retrieve the same anonymous
EventFactory.
The anonymous EventFactory is used to for component
independent event creation and is unnamed. The anonymous
EventFactory may be assigned a ContentHandler
for configuration updates based on a specific type of configuration
template for the EventFactory instances, if one exists for
unnamed EventFactory instances.
getAnonymousEventFactory in interface EventFactoryHomeEventFactory.EventFactoryHome.getAnonymousEventFactory()public EventFactory getEventFactory(java.lang.String factoryName)
EventFactoryHomeEventFactory.
An instance of a named EventFactory is created if no named
instance current exists or a named instance is released.
Once a named EventFactory is created, the instance is
cached for future calls to retrieve the same named
EventFactory.
The name of the EventFactory uniquely identifies an
instance of an EventFactory. All subsequent calls will
return the same instance of the named EventFactory.
EventFactory names are hierarchal represented using the
standard Java dot-delimited name-space naming conventions.
Passing a null EventFactory name parameter
in will be equivalent to calling the
EventFactoryHome.getAnonymousEventFactory() API.
getEventFactory in interface EventFactoryHomefactoryName - The name of the EventFactory.
EventFactory.EventFactoryHome.getEventFactory(java.lang.String)public void updateAnonymousEventFactory()
EventFactoryHomeEventFactory.
If the EventFactoryHome instance does not support
ContentHandler s for unnamed EventFactory
instances, no update occurs.
The anonymous EventFactory is used to for component
independent event creation and is unnamed. The anonymous
EventFactory may be assigned a ContentHandler
for configuration updates based on a specific type of configuration
template for the EventFactory instances, if one exists for
unnamed EventFactory instances.
updateAnonymousEventFactory in interface EventFactoryHomeEventFactoryHome.updateAnonymousEventFactory()public void updateEventFactory(java.lang.String factoryName)
EventFactoryHomeEventFactory.
If no named EventFactory instance exists, no update
occurs.
The name of the EventFactory uniquely identifies an
instance of an EventFactory. All calls will update the
configuration on the same named instance of the EventFactory.
EventFactory names are hierarchal represented using the
standard Java dot-delimited name-space naming conventions.
Passing a null EventFactory name parameter
in will be equivalent to calling the
EventFactoryHome.updateAnonymousEventFactory() API.
Passing an empty string (e.g. "") with or without white space or a single
asterisk (e.g. *) as the name parameter updates the configuration
on all cached EventFactory instances.
updateEventFactory in interface EventFactoryHomefactoryName - The name of the EventFactory.EventFactoryHome.updateEventFactory(java.lang.String)public void releaseEventFactory(java.lang.String factoryName)
EventFactoryHomeEventFactory.
If no named EventFactory instance exists, no release
occurs.
The name of the EventFactory uniquely identifies an
instance of an EventFactory.
EventFactory names are hierarchal represented using the
standard Java dot-delimited name-space naming conventions.
Passing an empty string (e.g. "") with or without white space or a single
asterisk (e.g. *) as the name parameter releases all cached
EventFactory instances.
releaseEventFactory in interface EventFactoryHomefactoryName - The name of the EventFactory.EventFactoryHome.releaseEventFactory(java.lang.String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||