com.ibm.websphere.batch.devframework.datastreams.bdsadapter
Class AbstractBatchDataStream
- java.lang.Object
com.ibm.websphere.batch.devframework.datastreams.bdsadapter.AbstractBatchDataStream
All implemented interfaces:
com.ibm.batch.api.BatchDataStream
Direct known subclasses:
- public abstract class AbstractBatchDataStream
- extends java.lang.Object
- implements BatchDataStream
BatchDataStream
.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
jobStepKey
|
Constructor Summary
Constructor and Description |
---|
AbstractBatchDataStream()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
close()
Close underlying implementation stream.
|
|
externalizeCheckpointInformation()
This method is called just before a checkpoint is to be taken by the batch container.
|
|
getJobstepId()
|
|
getName()
|
|
getProperties()
|
|
getProperty(java.lang.String key)
Convenience method to return a property value.
|
|
getRequiredProperty(java.util.Properties props,java.lang.String key)
|
|
getRequiredProperty(java.lang.String key)
Convenience method to return a property value.
|
|
initialize(java.util.Properties props)
This method is invoked during stream initialization.
|
|
initialize(java.lang.String name,java.lang.String jobstepId)
Called during stream initialization.
|
|
intermediateCheckpoint()
LREE calls this method after a checkpoint is taken
This implementation does nothing; subclasses may override. |
|
internalizeCheckpointInformation(java.lang.String token)
Parse restart token supplied by LREE.
|
|
isRestart()
|
|
loadClass(java.lang.String className)
|
|
open()
Opens delegate stream.
|
|
positionAtInitialCheckpoint()
Positions the stream to the initial checkpoint (i.e., the beginning
of the stream).
|
|
setProperties(java.util.Properties props)
LREE calls this method to tell us our properties
as specified in the xJCL.
|
|
setRestart(boolean restart)
Sets the 'restarting' flag on this BDS.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.websphere.batch.BatchDataStream |
---|
positionAtCurrentCheckpoint |
Field Detail
jobStepKey
- protected java.lang.String jobStepKey
Constructor Detail
AbstractBatchDataStream
- public AbstractBatchDataStream( )
Method Detail
close
- public abstract void close()
- throws BatchContainerDataStreamException
Close underlying implementation stream.
Specified by:
close
in interface com.ibm.batch.api.BatchDataStream
Throws:
BatchContainerDataStreamException
- Underlying implementation stream threw an exception
in its close()
method. internalizeCheckpointInformation
- public abstract void internalizeCheckpointInformation( java.lang.String token)
- throws java.lang.RuntimeException
Parse restart token supplied by LREE.
This implementation assumes the restart token is a record cound, parseable as an integer.
This implementation assumes the restart token is a record cound, parseable as an integer.
Specified by:
internalizeCheckpointInformation
in interface com.ibm.batch.api.BatchDataStream
Parameters:
token
- - This is a string that was created by the
BDS that was returned to the Batch Execution Environment on the externalizeCheckpointInformation
method. This String is opaque to anyone but the BDS, so only the
BDS can interpret its content. Throws:
java.lang.RuntimeException
- Restart token could not be parsed as an integer. open
- public abstract void open()
- throws BatchContainerDataStreamException
Opens delegate stream.
Specified by:
open
in interface com.ibm.batch.api.BatchDataStream
Throws:
BatchContainerDataStreamException
- Error opening delegate stream. positionAtInitialCheckpoint
- public abstract void positionAtInitialCheckpoint( )
- throws BatchContainerDataStreamException
Positions the stream to the initial checkpoint (i.e., the beginning
of the stream).
This implementation simply sets the record counter to zero. Overriding subclasses should call the parent implementation.
This implementation simply sets the record counter to zero. Overriding subclasses should call the parent implementation.
Specified by:
positionAtInitialCheckpoint
in interface com.ibm.batch.api.BatchDataStream
Throws:
BatchContainerDataStreamException
- Error positioning the stream. initialize
- protected abstract void initialize( java.util.Properties props)
This method is invoked during stream initialization. Properties specified in the xJCL
are passed as input
Parameters:
props
- externalizeCheckpointInformation
- public abstract java.lang.String externalizeCheckpointInformation( )
This method is called just before a checkpoint is to be taken by the batch container.
This allows the stream to save any information that can be used by the container in
case of a restart.
Specified by:
externalizeCheckpointInformation
in interface com.ibm.batch.api.BatchDataStream
Returns:
- This is a string that is created to record the BDS's
position in the stream being processed. This String is opaque to
anyone but the BDS, so only the BDS can interpret its content.
getJobstepId
- public java.lang.String getJobstepId( )
Returns:
Our job/step id.
getName
- public java.lang.String getName( )
Description copied from interface:
BatchDataStream
The getName method returns the logical name of the BDS that was received in the initialize method.
Specified by:
getName
in interface com.ibm.batch.api.BatchDataStream
Returns:
Our logical name as specified in the xJCL.
getProperties
- public java.util.Properties getProperties( )
Description copied from interface:
BatchDataStream
The getProperties method returns the bds properties specified in the xJCL and received in the setProperties method.
Specified by:
getProperties
in interface com.ibm.batch.api.BatchDataStream
Returns:
Our properties as specified in the xJCL.
getProperty
- protected java.lang.String getProperty( java.lang.String key)
Convenience method to return a property value.
Parameters:
key
- Property key. Returns:
Property value.
getRequiredProperty
- protected java.lang.String getRequiredProperty( java.lang.String key)
Convenience method to return a property value.
Throws an exception if the property was not set, or was
set to an empty value.
Parameters:
key
- Property key. Returns:
Property value.
Throws:
java.lang.RuntimeException
- No value was specified for the given key. getRequiredProperty
- protected java.lang.String getRequiredProperty( java.util.Properties props,
- java.lang.String key)
initialize
- public void initialize(java.lang.String name,
- java.lang.String jobstepId)
- throws BatchContainerDataStreamException
Called during stream initialization.
Specified by:
initialize
in interface com.ibm.batch.api.BatchDataStream
Parameters:
name
- the logical name of the BDS, this name is used to
locate the resource in the job's xJCL. jobstepId
- an identifier that represents the step within the batch
job that is being run. This id is used to locate the resource in the job's
xJCL. Throws:
intermediateCheckpoint
- public void intermediateCheckpoint( )
LREE calls this method after a checkpoint is taken
This implementation does nothing; subclasses may override.
This implementation does nothing; subclasses may override.
Specified by:
intermediateCheckpoint
in interface com.ibm.batch.api.BatchDataStream
setProperties
- public void setProperties(java.util.Properties props)
LREE calls this method to tell us our properties
as specified in the xJCL.
Specified by:
setProperties
in interface com.ibm.batch.api.BatchDataStream
Parameters:
props
- Stream properties from xJCL. isRestart
- public java.lang.Boolean isRestart( )
Returns:
Boolean.FALSE
if we are not restartingBoolean.TRUE
if we are restartingnull
if not yet known
setRestart
- protected void setRestart(boolean restart)
Sets the 'restarting' flag on this BDS. Should be called by
subclasses, in their
BatchDataStream.positionAtCurrentCheckpoint()
(set to true
) or
BatchDataStream.positionAtInitialCheckpoint()
(set to false
)
methods, respectively.
Parameters:
restart
- loadClass
- protected java.lang.Object loadClass( java.lang.String className)