com.candle.roma.kxc
Class RomaStorageQueue

java.lang.Object
  |
  +--com.candle.roma.kxc.RomaStorageQueue

public class RomaStorageQueue
extends java.lang.Object

The RomaStorageQueue class enables the storing and retrieval of message from a Roma storage queue.


Constructor Summary
RomaStorageQueue(RomaBusinessElement be, java.lang.String name)
          Contruct and open the named storage queue using a given business element.
RomaStorageQueue(RomaBusinessElement be, java.lang.String name, int opts)
          Contruct and open the named storage queue using a given business element.
RomaStorageQueue(RomaBusinessElement be, java.lang.String name, int opts, java.lang.String modelQName)
          Contruct and open the named storage queue using a given business element.
RomaStorageQueue(RomaClient client, java.lang.String name)
          Construct and open the named storage queue using a given client.
RomaStorageQueue(RomaClient client, java.lang.String name, int opts)
          Construct and open the named storage queue using a given client.
RomaStorageQueue(RomaClient client, java.lang.String name, int opts, java.lang.String modelQName)
          Construct and open the named storage queue using a given client.
 
Method Summary
 void close()
          Close the storage queue.
protected  RomaStorable createStorable(RomaStorable msg)
          Invoked when a message is successfully retrieved from the storage queue, this method unmarshalls the recovered message.
 boolean isOpen()
          Check whether the storage queue is open.
 void open(RomaBusinessElement be, java.lang.String name)
          Open the named storage queue using a given business element.
 void open(RomaBusinessElement be, java.lang.String name, int opts)
          Open the named storage queue using a given business element.
 void open(RomaBusinessElement be, java.lang.String name, int opts, java.lang.String modelQName)
          Open the named storage queue using a given business element.
 void open(RomaClient client, java.lang.String name)
          Open the named storage queue using a given client.
 void open(RomaClient client, java.lang.String name, int opts)
          Open the named storage queue using a given client.
 void open(RomaClient client, java.lang.String name, int opts, java.lang.String modelQName)
          Open the named storage queue using a given client.
 RomaStorable retrieve()
          Retrieves a message from the storage queue according to defaulted options.
 RomaStorable retrieve(RomaRetrieveOptions opt)
          Retrieves a message from the storage queue according to the supplied options.
 RomaStorable retrieve(RomaRetrieveOptions opt, byte[] buffer, RomaInteger bufSize)
          Retrieves a message from the storage queue according to the supplied options into user defined buffer.
 void store(RomaStorable msg)
          Store a message on the storage queue according to the defaulted options.
 void store(RomaStorable msg, RomaStoreOptions opts)
          Store a message on the storage queue according to the supplied options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaStorageQueue

public RomaStorageQueue(RomaClient client,
                        java.lang.String name,
                        int opts,
                        java.lang.String modelQName)
                 throws RomaError
Construct and open the named storage queue using a given client.
Parameters:
context - should specify a valid and connected Roma Client
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
modelQName - model queue name
Throws:
RomaError - if the queue open fails.

RomaStorageQueue

public RomaStorageQueue(RomaClient client,
                        java.lang.String name,
                        int opts)
                 throws RomaError
Construct and open the named storage queue using a given client.
Parameters:
context - should specify a valid and connected Roma Client
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
Throws:
RomaError - if the queue open fails.

RomaStorageQueue

public RomaStorageQueue(RomaClient client,
                        java.lang.String name)
                 throws RomaError
Construct and open the named storage queue using a given client. Use OPEN_DEFAULT option.
Parameters:
context - should specify a valid and connected Roma Client
name - name of the storage queue to open
Throws:
RomaError - if the queue open fails.

RomaStorageQueue

public RomaStorageQueue(RomaBusinessElement be,
                        java.lang.String name,
                        int opts,
                        java.lang.String modelQName)
                 throws RomaError
Contruct and open the named storage queue using a given business element.
Parameters:
be - should specify a valid and connected Roma Business Element
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
modelQName - model queue name
Throws:
RomaError - if the queue open fails.

RomaStorageQueue

public RomaStorageQueue(RomaBusinessElement be,
                        java.lang.String name,
                        int opts)
                 throws RomaError
Contruct and open the named storage queue using a given business element.
Parameters:
be - should specify a valid and connected Roma Business Element
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
Throws:
RomaError - if the queue open fails.

RomaStorageQueue

public RomaStorageQueue(RomaBusinessElement be,
                        java.lang.String name)
                 throws RomaError
Contruct and open the named storage queue using a given business element. Use OPEN_DEFAULT option.
Parameters:
be - should specify a valid Roma and connected Business Element
name - name of the storage queue to open
Throws:
RomaError - if the queue open fails.
Method Detail

open

public void open(RomaClient client,
                 java.lang.String name,
                 int opts,
                 java.lang.String modelQName)
          throws RomaError
Open the named storage queue using a given client.
Parameters:
client - should specify a valid and connected Roma Client
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
modelQName - model queue name
Throws:
RomaError - if the queue open fails.

open

public void open(RomaClient client,
                 java.lang.String name,
                 int opts)
          throws RomaError
Open the named storage queue using a given client.
Parameters:
client - should specify a valid and connected Roma Client
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
Throws:
RomaError - if the queue open fails.

open

public void open(RomaClient client,
                 java.lang.String name)
          throws RomaError
Open the named storage queue using a given client. Use OPEN_DEFAULT option.
Parameters:
client - should specify a valid and connected Roma Client
name - name of the storage queue to open
Throws:
RomaError - if the queue open fails.

open

public void open(RomaBusinessElement be,
                 java.lang.String name,
                 int opts,
                 java.lang.String modelQName)
          throws RomaError
Open the named storage queue using a given business element.
Parameters:
be - should specify a valid and connected Roma Business Element
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
modelQName - model queue name
Throws:
RomaError - if the queue open fails.

open

public void open(RomaBusinessElement be,
                 java.lang.String name,
                 int opts)
          throws RomaError
Open the named storage queue using a given business element.
Parameters:
be - should specify a valid and connected Roma Business Element
name - name of the storage queue to open
options - open options. Either the constant OPEN_DEFAULT or a combination of the following flag constants :-
  • OPEN_NON_XACTIONAL
  • OPEN_EXCLUSIVE
  • OPEN_DELETE_ON_CLOSE
  • OPEN_MUST_EXIST
  • OPEN_OUTPUT
  • OPEN_INPUT
  • OPEN_PEEK
Throws:
RomaError - if the queue open fails.

open

public void open(RomaBusinessElement be,
                 java.lang.String name)
          throws RomaError
Open the named storage queue using a given business element. Use OPEN_DEFAULT option.
Parameters:
be - should specify a valid and connected Roma Business Element
name - name of the storage queue to open
Throws:
RomaError - if the queue open fails.

close

public void close()
           throws RomaError
Close the storage queue.
Throws:
RomaError - if the close queue call fails.

store

public void store(RomaStorable msg)
           throws RomaError
Store a message on the storage queue according to the defaulted options.
Parameters:
msg - message to put on the storage queue.
Throws:
RomaError - thrown if the store operation fails.

store

public void store(RomaStorable msg,
                  RomaStoreOptions opts)
           throws RomaError
Store a message on the storage queue according to the supplied options.
Parameters:
msg - message to put on the storage queue.
opt - options for the store action.
Throws:
RomaError - thrown if the store operation fails.

retrieve

public RomaStorable retrieve()
                      throws RomaError
Retrieves a message from the storage queue according to defaulted options.

Derived classes may override this method and return other, more application-specific types of RomaStorable objects.

Throws:
RomaError - thrown if retrieve operation fails.

retrieve

public RomaStorable retrieve(RomaRetrieveOptions opt)
                      throws RomaError
Retrieves a message from the storage queue according to the supplied options.

Derived classes may override this method and return other, more application-specific types of RomaStorable objects.

Parameters:
opt - retrieve options.
Throws:
RomaError - thrown if retrieve operation fails.

retrieve

public RomaStorable retrieve(RomaRetrieveOptions opt,
                             byte[] buffer,
                             RomaInteger bufSize)
                      throws RomaError
Retrieves a message from the storage queue according to the supplied options into user defined buffer.

Derived classes may override this method and return other, more application-specific types of RomaStorable objects.

Parameters:
opt - retrieve options.
buffer - buffer to receive data
bufSize - length of buffer, actual data length on return.
Throws:
RomaError - thrown if retrieve operation fails.

isOpen

public boolean isOpen()
Check whether the storage queue is open.
Returns:
true if still open, otherwise false

createStorable

protected RomaStorable createStorable(RomaStorable msg)
Invoked when a message is successfully retrieved from the storage queue, this method unmarshalls the recovered message.

It is intended that subclasses of RomaStorageQueue override this method so that custom data unmarshalling can be achieved.

This implementation returns a RomaStorable object. containing

Parameters:
msg - a newly-retrieved RomaStorable object.