isc.sensor.outputadaptor
Class OAObjectManager

java.lang.Object
  extended by isc.sensor.outputadaptor.OAHandle
      extended by isc.sensor.outputadaptor.OAObjectManager

public class OAObjectManager
extends OAHandle

This class is the main object handler for all of the DNA system output objects. A new object instance of this class should be created for each type of output. This class manages a cache (array of dataobject) for each object type. The cache will flush when filled or when the flush timeout has expired.

Configuration variables:
OA.ObjectBatchCount= [Integer] - size of object cache [default: 100]
OA.ObjectBatchFlushtime= [Long] - time in milliseconds to flush the cache [default: 60000]

Author:
John Casey
Project: DNA_sensor - Dec 2005

Nested Class Summary
(package private)  class OAObjectManager.FlushTask
          This timer class will flush the objectmanager cache when the specified time has expired.
 
Field Summary
protected static org.apache.log4j.Logger log
          log4j
protected static java.lang.String PROP_OA_BATCH_COUNT
          The OA Batch count specifies how many object to hold in cache before sending
protected static java.lang.String PROP_OA_BATCH_FLUSH_TIME
          The OA Flush time specifies how long to wait before flushing cache, when batch count has not been exceeded
protected  AppProperties props
          Application properties
(package private)  java.util.Timer timer
          Internal flush timer
 
Fields inherited from class isc.sensor.outputadaptor.OAHandle
adaptor, CONFIG_FILE, initialized, PROP_OA_ADAPTER_NAME, PROP_OA_SOURCE_NAME, source
 
Constructor Summary
OAObjectManager(java.lang.String OAType)
          Creates a new output adaptor object.
 
Method Summary
 void close()
          Close this object manager
 org.openadaptor.dataobjects.SimpleDataObject newObject()
          Create a new SimpleDataObject named by this object manager.
 void process(org.openadaptor.dataobjects.SimpleDataObject obj)
          Call process once the data object is filled in with attribute/value paire.
 
Methods inherited from class isc.sensor.outputadaptor.OAHandle
finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

protected AppProperties props
Application properties


log

protected static org.apache.log4j.Logger log
log4j


PROP_OA_BATCH_COUNT

protected static final java.lang.String PROP_OA_BATCH_COUNT
The OA Batch count specifies how many object to hold in cache before sending

See Also:
Constant Field Values

PROP_OA_BATCH_FLUSH_TIME

protected static final java.lang.String PROP_OA_BATCH_FLUSH_TIME
The OA Flush time specifies how long to wait before flushing cache, when batch count has not been exceeded

See Also:
Constant Field Values

timer

java.util.Timer timer
Internal flush timer

Constructor Detail

OAObjectManager

public OAObjectManager(java.lang.String OAType)
Creates a new output adaptor object.

Parameters:
OAType - The name of the data object to be managed
See Also:
SimpleDataObject
Method Detail

newObject

public org.openadaptor.dataobjects.SimpleDataObject newObject()
Create a new SimpleDataObject named by this object manager. Once created the caller can add attirbutes and values to the dataobject

Returns:
a new dataobject
See Also:


process

public void process(org.openadaptor.dataobjects.SimpleDataObject obj)
Call process once the data object is filled in with attribute/value paire. Process will cache and send the object out through the openadaptor subsystem.

Parameters:
obj - The data object
See Also:
newObject()

close

public void close()
Close this object manager