net.sourceforge.esw.collection
Class ATransducer

java.lang.Object
  |
  +--net.sourceforge.esw.collection.ATransducer
All Implemented Interfaces:
ITransducer, java.io.Serializable
Direct Known Subclasses:
AIOTransducer, AJDBCTransducer, DefaultTransducer, MailTransducer, SystemPropertiesTransducer, URLQueryTransducer

public abstract class ATransducer
extends java.lang.Object
implements ITransducer

Abstract base class that transduces data between a specific external data source and an IMetaCollection instance.

This transduction occurs both ways; put() takes data from the IMetaCollection instance to which this ITransducer instance is attached and places it into the data source represented by this ITransducer instance. The get() method takes data from the data source represented by this ITransducer instance and places it into the IMetaCollection instance to which this ITransducer instance is attached.

All ITransducer implementors should remain stateless in their interaction with the IMetaCollection instance to which this ITransducer implementor is attached. This insures that ITransducer implementors may be used in multi-threaded environments.

The INodeContextFactory instance attached to this ITransducer instance provides context from which to create the INode instances that are added to the IMetaCollection instances. This INodeContextFactory is only valid during the get operations of the ITransducer. The context determines how new INode instances are obtained during a get() operation. For instance, the context controls whether a new INode instance is created, or an entire subgraph of INode instances with a preset structure. Advanced uses may include returning a graph of INode instances that is reused from a previous transduction. The INodeContectFactory is intended to be the primary form of customization and extension to the creation and behavior of the IMetaCollection / ITransducer / INode framework.

The ATransducer is an abstract base class for the Transducer architecture. It provides a default implementation of the INodeContectFactory accessor methods, but still requires the implementors to implement the get() and put() methods for the ITransducer interface. It is suggested that all ITransducer implementors extend ATransducer.

By default, the INodeContextFactory instance is an DefaultNodeContextFactory instance.

See Also:
IMetaCollection, Serialized Form

Field Summary
protected  INodeContextFactory contextFactory
          The INodeContextFactory instance for this ATransducer.
 
Constructor Summary
ATransducer()
          Creates a new instance of this ITransducer instance setting the INodeContextFactory to be an instance of the DefaultNodeContectFactory.
 
Method Summary
 INodeContextFactory getContextFactory()
          Returns the INodeContextFactory instance used by this ITransducer instance during get operations.
 void setContextFactory(INodeContextFactory aContextFactory)
          Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.esw.collection.ITransducer
get, put
 

Field Detail

contextFactory

protected INodeContextFactory contextFactory
The INodeContextFactory instance for this ATransducer.
Constructor Detail

ATransducer

public ATransducer()
Creates a new instance of this ITransducer instance setting the INodeContextFactory to be an instance of the DefaultNodeContectFactory.
Method Detail

setContextFactory

public void setContextFactory(INodeContextFactory aContextFactory)
Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations.
Specified by:
setContextFactory in interface ITransducer
Parameters:
aContextFactory - the INodeContextFactory instance to provide context.
See Also:
getContextFactory()

getContextFactory

public INodeContextFactory getContextFactory()
Returns the INodeContextFactory instance used by this ITransducer instance during get operations.
Specified by:
getContextFactory in interface ITransducer
Returns:
the INodeContextFactory instance utilitied by this ITransducer instance.
See Also:
setContextFactory( INodeContextFactory )


Copyright 2002 Free Software Foundation. All Rights Reserved.