com.ibm.cics.server
Class AddressResource

java.lang.Object
  extended by com.ibm.cics.server.API
      extended by com.ibm.cics.server.SynchronizationResource
          extended by com.ibm.cics.server.AddressResource
All Implemented Interfaces:
java.io.Serializable

public class AddressResource
extends SynchronizationResource

This class provides the implementation of synchronization based on the address of a data area.

This class is intended for cases where integration with an existing application that uses an address to ENQ. New applications should use the NameResource class.

As Java does not expose the address of a variable, it is used explicitly as an array of bytes.

See Also:
Serialized Form
Since CICS TS version:
1.3
Since package version:
1.0

Constructor Summary
AddressResource()
          Construct a default AddressResource.
 
Method Summary
 void dequeue()
          Unlock the resource
 void enqueue()
          Attempt to lock the resource.
 byte[] getAddress()
          Return the address used for the synchronization resource.
 void setAddress(byte[] address)
          Sets the synchronization address.
 void tryEnqueue()
          Attempt to lock the resource without suspending.
 
Methods inherited from class com.ibm.cics.server.SynchronizationResource
getDescription, setDescription
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressResource

public AddressResource()
Construct a default AddressResource.

Since CICS TS version:
1.3
Since package version:
1.0
Method Detail

dequeue

public void dequeue()
Unlock the resource

Since CICS TS version:
1.3
Since package version:
1.0

enqueue

public void enqueue()
             throws ResourceUnavailableException
Attempt to lock the resource.

Throws:
ResourceUnavailableException - the resource is in use by another task
Since CICS TS version:
1.3
Since package version:
1.0

getAddress

public byte[] getAddress()
Return the address used for the synchronization resource.

Returns:
the synchronization address
Since CICS TS version:
1.3
Since package version:
1.0

setAddress

public void setAddress(byte[] address)
Sets the synchronization address. The address must be 4 bytes long. Values which are too short will be padded with null bytes, values that are too long will be truncated.

Parameters:
address - the synchronization address
Since CICS TS version:
1.3
Since package version:
1.0

tryEnqueue

public void tryEnqueue()
                throws ResourceUnavailableException
Attempt to lock the resource without suspending.

Throws:
ResourceUnavailableException - the resource is in use by another task
Since CICS TS version:
1.3
Since package version:
1.0