net.sourceforge.esw.collection
Interface ITransducer

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IIOTransducer, ITransactionalTransducer
All Known Implementing Classes:
AJDBCTransducer, ATransducer, ATransducerAdapter, DefaultTransducer, MailTransducer, StringTransducerAdapter, SystemPropertiesTransducer, URLQueryTransducer, URLTransducerAdapter

public interface ITransducer
extends java.io.Serializable

Performs Transduction between a specific 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.

See Also:
IMetaCollection, INodeContextFactory

Method Summary
 void get(IMetaCollection aCollection)
          Gets the data source's data represented by this ITransducer instance into the referenced IMetaCollection instance.
 INodeContextFactory getContextFactory()
          Returns the INodeContextFactory instance used by this ITransducer instance during get operations.
 void put(IMetaCollection aCollection)
          Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.
 void setContextFactory(INodeContextFactory aContextFactory)
          Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations.
 

Method Detail

put

public void put(IMetaCollection aCollection)
         throws TransducerException
Puts the referenced IMetaCollection instance's data into the data source represented by this ITransducer instance.
Parameters:
aCollection - the IMetaCollection instance from which to take data.
Throws:
TransducerException - if an error occurs during transduction.
See Also:
get( IMetaCollection )

get

public void get(IMetaCollection aCollection)
         throws TransducerException
Gets the data source's data represented by this ITransducer instance into the referenced IMetaCollection instance.
Parameters:
aCollection - the IMetaCollection instance into which to read.
Throws:
TransducerException - if an error occurs during transduction.
See Also:
put( IMetaCollection )

setContextFactory

public void setContextFactory(INodeContextFactory aContextFactory)
Sets the INodeContextFactory instance to be used by this ITransducer instance during get operations.
Parameters:
aContextFactory - the INodeContextFactory instance from which to take data.
See Also:
getContextFactory()

getContextFactory

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


Copyright 2002 Free Software Foundation. All Rights Reserved.