|
Verastream Transaction Integrator 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.attachmate.transaction.runtime.common.taskbean.BaseTaskBean
public abstract class BaseTaskBean
Implements the ITask interface and is to be used as the super class for all generated task beans. Responsible for implementing all details common to all client operation task beans
ITask
,
Serialized FormField Summary |
---|
Fields inherited from interface com.attachmate.tasks.ITask |
---|
PRESERVE_ALWAYS, PRESERVE_NEVER, PRESERVE_ON_ERROR |
Constructor Summary | |
---|---|
BaseTaskBean()
Zero-arg constructor for use with scripting engines and other containers |
Method Summary | |
---|---|
void |
addTaskListener(ITaskListener listener)
Adds a new task listener to this bean. |
void |
cancel()
Cancels the currently executing client operation. |
void |
clearContext()
Note: this product does not currently participate in Context management as described in the documentation for ITask. |
void |
copyContext(ITask source)
Note: this product does not currently participate in Context management as described in the documentation for ITask. |
void |
executeAsync()
Asynchronously executes the client operation using the current property settings. |
void |
executeSync()
Synchronously executes the client operation using the current property settings. |
java.lang.String |
getInstanceName()
Note: This property is only passed through - this product does not currently act upon the supplied value. |
java.lang.String |
getJobName()
Note: This property is only passed through - this product does not currently act upon the supplied value. |
java.util.Locale |
getLocale()
Note: The Locale property is only passed through - this product does not currently act upon the supplied value. |
int |
getPreserveContext()
Note: this product does not currently participate in Context management as described in the documentation for ITask. |
java.lang.String |
getResourceName()
Retrieves the name of the resource configuration in use by this bean Note: This property is only passed through - this product does not currently act upon the supplied value. |
TaskStatusChangeEvent |
getStatus()
Returns the current client operation execution status. |
long |
getTimeout()
Retrieves the current client operation timeout in milliseconds. |
ITaskTransaction |
getTransaction()
Note: this product does not currently support Transaction management |
java.lang.String |
getVersion()
Retrieves the version of the Attachmate tool used to generate this bean. |
void |
removeTaskListener(ITaskListener listener)
Removes the specified task listener from this bean. |
void |
setInstanceName(java.lang.String name)
Note: This property is only passed through - this product does not currently act upon the supplied value. |
void |
setJobName(java.lang.String name)
Note: This property is only passed through - this product does not currently act upon the supplied value. |
void |
setLocale(java.util.Locale tlocale)
Note: This property is only passed through - this product does not currently act upon the supplied value. |
void |
setPreserveContext(int mode)
Note: this product does not currently participate in Context management as described in the documentation for ITask. |
void |
setRemoteServer(java.lang.String server)
Note: This product does not currently act upon the supplied server value. |
void |
setResourceName(java.lang.String name)
Sets the name of the resource to use with this bean. |
void |
setTimeout(long milliseconds)
Sets the client operation timeout in milliseconds. |
void |
transferContext(ITask source)
Note: this product does not currently participate in Context management as described in the documentation for ITask. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseTaskBean()
Method Detail |
---|
public void setPreserveContext(int mode) throws java.lang.IllegalArgumentException
setPreserveContext
in interface ITask
mode
- one of the preserve context mode constants.
PRESERVE_NEVER
-- Do not preserve context after client operation execution (default)PRESERVE_ON_ERROR
-- Preserve context on client operation execution errors onlyPRESERVE_ALWAYS
-- Always preserve context after client operation execution java.lang.IllegalArgumentException
- if mode
is out of rangegetPreserveContext( )
,
transferContext( ITask )
,
copyContext( ITask )
,
clearContext( )
public int getPreserveContext()
getPreserveContext
in interface ITask
PRESERVE_NEVER
if not set.setPreserveContext( int )
,
transferContext( ITask )
,
copyContext( ITask )
,
clearContext( )
public void transferContext(ITask source) throws ResourceInUseException
transferContext
in interface ITask
source
- the bean to transfer the context from
ResourceInUseException
- if another client operation is using the contextcopyContext( ITask )
,
setPreserveContext( int )
,
clearContext( )
public void copyContext(ITask source) throws UnsupportedOperationException
copyContext
in interface ITask
source
- the bean to copy the context from
UnsupportedOperationException
- if the implementation does not
support this method.transferContext( ITask )
,
setPreserveContext( int )
,
clearContext( )
public void clearContext() throws ResourceInUseException
clearContext
in interface ITask
ResourceInUseException
- if the client operation is using the contexttransferContext( ITask )
,
copyContext( ITask )
,
setPreserveContext( int )
public ITaskTransaction getTransaction() throws UnsupportedOperationException
ITaskTransaction
implementation
UnsupportedOperationException
public TaskStatusChangeEvent getStatus()
event.status
-- one of the event status
constants defined in TaskStatusChangeEvent
event.exception
-- optional exception
information. May be null
.
getStatus
in interface ITask
null
if the client operation has never been executed.public void setTimeout(long milliseconds)
TASK_TIMEOUT
completion
status.
setTimeout
in interface ITask
milliseconds
- the maximum time to wait for client operation execution to
complete. Default is Long.MAX_VALUE
.getTimeout( )
,
ITaskListener
,
TaskStatusChangeEvent
public long getTimeout()
getTimeout
in interface ITask
Long.MAX_VALUE
.setTimeout( long )
,
ITaskListener
,
TaskStatusChangeEvent
public void executeSync() throws ResourceInUseException, HostResponseFormatException
executeSync
in interface ITask
ResourceInUseException
- if no resource can be obtained
for execution
ResourceInUseException
- if client operation is already executing
HostResponseFormatException
- if client operation execution response from
the Host contains content that cannot be successfully parsed using
the copybook format specified as expected client operation output when the client operation was designed.executeAsync( )
,
cancel( )
,
ITaskListener
,
TaskStatusChangeEvent
public void executeAsync() throws ResourceInUseException, HostResponseFormatException
executeSync
. This method returns
without waiting for the client operation to complete. Listeners will be notified of
client operation progress and completion status via the client operation status change events.
Uses the currently owned context, or creates one if none has been set.
executeAsync
in interface ITask
ResourceInUseException
- if no resource can be obtained
for execution
ResourceInUseException
- if client operation is already executing
HostResponseFormatException
- if client operation execution response from
the Host contains content that cannot be successfully parsed using
the copybook format specified as expected client operation output when the client operation was designed.executeSync( )
,
cancel( )
,
ITaskListener
,
TaskStatusChangeEvent
public void cancel()
executeSync
which subsequently fires a
task status change event with a TASK_CANCELED
completion
status.
Issues/Limitations:
cancel
must be able to interrupt
executeSync
.executeSync
blocks, cancel
must be
capable of being called from a separate thread.cancel
may have far-reaching design implications, if
underlying objects must be made interruptable.
cancel
in interface ITask
executeSync( )
,
executeAsync( )
,
ITaskListener
,
TaskStatusChangeEvent
public void addTaskListener(ITaskListener listener)
addTaskListener
in interface ITask
listener
- the new listener to addpublic void removeTaskListener(ITaskListener listener)
removeTaskListener
in interface ITask
listener
- the new listener to removepublic java.lang.String getVersion()
getVersion
in interface ITask
public void setInstanceName(java.lang.String name)
Issues/Limitations:
setInstanceName
in interface ITask
name
- optional instance namegetInstanceName( )
,
setResourceName( String )
,
setJobName( String )
public java.lang.String getInstanceName()
getInstanceName
in interface ITask
setInstanceName( String )
,
getResourceName( )
,
getJobName( )
public void setResourceName(java.lang.String name)
Issues/Limitations:
setResourceName
in interface ITask
name
- the name of the resource to usegetResourceName( )
,
setInstanceName( String )
,
setJobName( String )
public java.lang.String getResourceName()
getResourceName
in interface ITask
setResourceName( String )
,
getInstanceName( )
,
getJobName( )
public void setJobName(java.lang.String name)
setJobName
in interface ITask
name
- user-defined job namegetJobName( )
,
setInstanceName( String )
,
setResourceName( String )
public java.lang.String getJobName()
getJobName
in interface ITask
setJobName( String )
,
getInstanceName( )
,
getResourceName( )
public void setLocale(java.util.Locale tlocale)
setLocale
in interface ITask
tlocale
- the locale to be used by this beangetLocale( )
public java.util.Locale getLocale()
getLocale
in interface ITask
setLocale(java.util.Locale)
public void setRemoteServer(java.lang.String server)
server
- the name of the server to use for client operation execution
|
Verastream Transaction Integrator 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |