IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.wosabean
Class WOSADeviceBean

java.lang.Object
  extended bycom.ibm.dse.wosabean.WOSADeviceBean
All Implemented Interfaces:
java.lang.Runnable, WOSAConst

public class WOSADeviceBean
extends java.lang.Object
implements java.lang.Runnable, WOSAConst

This is the WOSA Services base class. It interfaces with WOSA/XFS (WOSA for short) via JNI, providing a subset of the WOSA asynchronous functions. The WOSA calls are issued in the caller thread, and any WOSA message is signalled by a waiting thread, using JavaBeans event mechanism.

See Also:
Service

Field Summary
protected  WOSACmdListener aWOSACmdListener
           
protected  WOSADevListener aWOSADevListener
           
 WOSACmdEvent lastCmdEvent
          Public variables used by the synchronous utilities
 WOSAResult lastResult
          Holds last 'command complete event'
protected  java.lang.Thread messageThread
          The thread that waits for Windows/PM WOSA messages
 
Fields inherited from interface com.ibm.dse.wosabean.WOSAConst
EXECUTE_EVENTS, SERVICE_EVENTS, SYSTEM_EVENTS, USER_EVENTS, WFS_CLOSE_COMPLETE, WFS_DEREGISTER_COMPLETE, WFS_ERR_ALREADY_STARTED, WFS_ERR_API_VER_TOO_HIGH, WFS_ERR_API_VER_TOO_LOW, WFS_ERR_CANCELED, WFS_ERR_CFG_INVALID_HKEY, WFS_ERR_CFG_INVALID_NAME, WFS_ERR_CFG_INVALID_SUBKEY, WFS_ERR_CFG_INVALID_VALUE, WFS_ERR_CFG_KEY_NOT_EMPTY, WFS_ERR_CFG_NAME_TOO_LONG, WFS_ERR_CFG_NO_MORE_ITEMS, WFS_ERR_CFG_VALUE_TOO_LONG, WFS_ERR_CONNECTION_LOST, WFS_ERR_DEV_NOT_READY, WFS_ERR_HARDWARE_ERROR, WFS_ERR_INTERNAL_ERROR, WFS_ERR_INVALID_ADDRESS, WFS_ERR_INVALID_APP_HANDLE, WFS_ERR_INVALID_BUFFER, WFS_ERR_INVALID_CATEGORY, WFS_ERR_INVALID_COMMAND, WFS_ERR_INVALID_DATA, WFS_ERR_INVALID_EVENT_CLASS, WFS_ERR_INVALID_HPROVIDER, WFS_ERR_INVALID_HSERVICE, WFS_ERR_INVALID_HWND, WFS_ERR_INVALID_HWNDREG, WFS_ERR_INVALID_POINTER, WFS_ERR_INVALID_REQ_ID, WFS_ERR_INVALID_RESULT, WFS_ERR_INVALID_SERVPROV, WFS_ERR_INVALID_TIMER, WFS_ERR_INVALID_TRACELEVEL, WFS_ERR_LOCKED, WFS_ERR_NO_BLOCKING_CALL, WFS_ERR_NO_SERVPROV, WFS_ERR_NO_SUCH_THREAD, WFS_ERR_NO_TIMER, WFS_ERR_NOT_LOCKED, WFS_ERR_NOT_OK_TO_UNLOAD, WFS_ERR_NOT_REGISTERED, WFS_ERR_NOT_STARTED, WFS_ERR_OP_IN_PROGRESS, WFS_ERR_OUT_OF_MEMORY, WFS_ERR_SERVICE_NOT_FOUND, WFS_ERR_SOFTWARE_ERROR, WFS_ERR_SPI_VER_TOO_HIGH, WFS_ERR_SPI_VER_TOO_LOW, WFS_ERR_SRVC_VER_TOO_HIGH, WFS_ERR_SRVC_VER_TOO_LOW, WFS_ERR_TIMEOUT, WFS_ERR_UNSUPP_CATEGORY, WFS_ERR_UNSUPP_COMMAND, WFS_ERR_VERSION_ERROR_IN_SRVC, WFS_EXECUTE_COMPLETE, WFS_EXECUTE_EVENT, WFS_GETINFO_COMPLETE, WFS_INDEFINITE_WAIT, WFS_LOCK_COMPLETE, WFS_OPEN_COMPLETE, WFS_REGISTER_COMPLETE, WFS_SERVICE_EVENT, WFS_STAT_DEVBUSY, WFS_STAT_DEVHWERROR, WFS_STAT_DEVNODEVICE, WFS_STAT_DEVOFFLINE, WFS_STAT_DEVONLINE, WFS_STAT_DEVPOWEROFF, WFS_STAT_DEVUSERERROR, WFS_SUCCESS, WFS_SYSE_APP_DISCONNECT, WFS_SYSE_DEVICE_STATUS, WFS_SYSE_HARDWARE_ERROR, WFS_SYSE_UNDELIVERABLE_MSG, WFS_SYSE_VERSION_ERROR, WFS_SYSTEM_EVENT, WFS_TIMER_EVENT, WFS_TRACE_ALL_API, WFS_TRACE_ALL_SPI, WFS_TRACE_API, WFS_TRACE_MGR, WFS_TRACE_SPI, WFS_UNLOCK_COMPLETE, WFS_USER_EVENT
 
Constructor Summary
WOSADeviceBean()
          This constructor creates a WOSADeviceBean object.
 
Method Summary
 void addWOSACmdListener(WOSACmdListener newListener)
           
 void addWOSADevListener(WOSADevListener newListener)
           
 WOSAResult cancelCmd()
          Cancels all outstanding requests
 WOSAResult cancelCmd(int requestID)
          Cancels a request
 int cleanup()
          Destroys the message thread and performs WOSA cleanup
 WOSAResult close()
          Closes a WOSA device
 boolean closeSync()
           
 WOSAResult execute(WOSAMessageRequest cmd, int timeout)
          Executes a WOSA service command
 boolean executeSync(WOSAMessageRequest cmd, int timeout)
           
protected  void fireHandleCmd(WOSACmdEvent event)
          Supports listener events.
protected  void fireHandleDevEvt(WOSADevEvent event)
          Supports listener events.
 boolean getConsoleTrace()
          Gets the externalizable parameter consoleTrace
 java.lang.String getDeviceType()
          Gets the externalizable parameter deviceType
 WOSAResult getInfo(WOSAMessageRequest info, int timeout)
          Queries device information
 boolean getInfoSync(WOSAMessageRequest info, int timeout)
           
 java.lang.String getLogicalName()
          Gets the externalizable parameter logicalName
 java.lang.String getSPMMaxVersion()
          Gets the externalizable parameter SPMMaxVersion
 java.lang.String getSPMMinVersion()
          Gets the externalizable parameter SPMMinVersion
 java.lang.String getWosaTraceLevel()
          Gets the externalizable parameter wosaTraceLevel
 WOSAResult lock(int timeout)
          Locks the device for exclusive access
 boolean lockSync(int timeout)
           
 WOSAResult open(int timeout)
          Opens a WOSA device
 boolean openSync(int timeout)
           
 void removeWOSACmdListener(WOSACmdListener newListener)
           
 void removeWOSADevListener(WOSADevListener newListener)
           
 void run()
          The WOSA message loop, runs in a separate thread
 void setConsoleTrace(boolean traceOn)
          Setter for the externalizable parameter consoleTrace
 void setDeviceType(java.lang.String n)
          Sets the externalizable parameter deviceType
 void setLogicalName(java.lang.String ln)
          Sets the externalizable parameter logicalName
 void setSPMMaxVersion(java.lang.String mv)
          Sets the externalizable parameter SPMMaxVersion
 void setSPMMinVersion(java.lang.String mv)
          Sets the externalizable parameter SPMMinVersion
 void setWosaTraceLevel(java.lang.String l)
          Sets for the externalizable parameter wosaTraceLevel
 int startup(int josaTrace)
          Instance control and WOSA startup if first instance
protected  void trace(java.lang.String s)
          Sends a string to a trace
 WOSAResult unlock()
          Unlocks access to the device
 boolean unlockSync()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastCmdEvent

public WOSACmdEvent lastCmdEvent
Public variables used by the synchronous utilities


lastResult

public WOSAResult lastResult
Holds last 'command complete event'


messageThread

protected java.lang.Thread messageThread
The thread that waits for Windows/PM WOSA messages


aWOSACmdListener

protected transient WOSACmdListener aWOSACmdListener

aWOSADevListener

protected transient WOSADevListener aWOSADevListener
Constructor Detail

WOSADeviceBean

public WOSADeviceBean()
This constructor creates a WOSADeviceBean object.

Method Detail

addWOSACmdListener

public void addWOSACmdListener(WOSACmdListener newListener)
Parameters:
newListener - WOSACmdListener

addWOSADevListener

public void addWOSADevListener(WOSADevListener newListener)
Parameters:
newListener - WOSADevListener

cancelCmd

public WOSAResult cancelCmd()
Cancels all outstanding requests


cancelCmd

public WOSAResult cancelCmd(int requestID)
Cancels a request

Parameters:
requestID - The requestID of a previous uncompleted request

cleanup

public int cleanup()
Destroys the message thread and performs WOSA cleanup


close

public WOSAResult close()
Closes a WOSA device


closeSync

public boolean closeSync()

execute

public WOSAResult execute(WOSAMessageRequest cmd,
                          int timeout)
Executes a WOSA service command

Parameters:
cmd - command request object, service dependant

executeSync

public boolean executeSync(WOSAMessageRequest cmd,
                           int timeout)

fireHandleCmd

protected void fireHandleCmd(WOSACmdEvent event)
Supports listener events.

Parameters:
event - WOSACmdEvent

fireHandleDevEvt

protected void fireHandleDevEvt(WOSADevEvent event)
Supports listener events.

Parameters:
event - WOSADevEvent

getConsoleTrace

public boolean getConsoleTrace()
Gets the externalizable parameter consoleTrace


getDeviceType

public java.lang.String getDeviceType()
Gets the externalizable parameter deviceType


getInfo

public WOSAResult getInfo(WOSAMessageRequest info,
                          int timeout)
Queries device information

Parameters:
info - information request object, service dependant

getInfoSync

public boolean getInfoSync(WOSAMessageRequest info,
                           int timeout)

getLogicalName

public java.lang.String getLogicalName()
Gets the externalizable parameter logicalName


getSPMMaxVersion

public java.lang.String getSPMMaxVersion()
Gets the externalizable parameter SPMMaxVersion


getSPMMinVersion

public java.lang.String getSPMMinVersion()
Gets the externalizable parameter SPMMinVersion


getWosaTraceLevel

public java.lang.String getWosaTraceLevel()
Gets the externalizable parameter wosaTraceLevel


lock

public WOSAResult lock(int timeout)
Locks the device for exclusive access


lockSync

public boolean lockSync(int timeout)

open

public WOSAResult open(int timeout)
Opens a WOSA device


openSync

public boolean openSync(int timeout)

removeWOSACmdListener

public void removeWOSACmdListener(WOSACmdListener newListener)
Parameters:
newListener - WOSACmdListener

removeWOSADevListener

public void removeWOSADevListener(WOSADevListener newListener)
Parameters:
newListener - WOSADevListener

run

public void run()
The WOSA message loop, runs in a separate thread

Specified by:
run in interface java.lang.Runnable

setConsoleTrace

public void setConsoleTrace(boolean traceOn)
Setter for the externalizable parameter consoleTrace


setDeviceType

public void setDeviceType(java.lang.String n)
Sets the externalizable parameter deviceType


setLogicalName

public void setLogicalName(java.lang.String ln)
Sets the externalizable parameter logicalName


setSPMMaxVersion

public void setSPMMaxVersion(java.lang.String mv)
Sets the externalizable parameter SPMMaxVersion


setSPMMinVersion

public void setSPMMinVersion(java.lang.String mv)
Sets the externalizable parameter SPMMinVersion


setWosaTraceLevel

public void setWosaTraceLevel(java.lang.String l)
                       throws java.lang.NumberFormatException
Sets for the externalizable parameter wosaTraceLevel

Throws:
java.lang.NumberFormatException

startup

public int startup(int josaTrace)
            throws DSEDLLNotFoundException
Instance control and WOSA startup if first instance

Throws:
DSEDLLNotFoundException - thrown when the DLL with the native code cannot be loaded

trace

protected void trace(java.lang.String s)
Sends a string to a trace


unlock

public WOSAResult unlock()
Unlocks access to the device


unlockSync

public boolean unlockSync()

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005