Skip Headers

Oracle® C++ Call Interface Programmer's Guide
10g Release 1 (10.1)

Part Number B10778-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

Producer Class

The Producer enqueues Messages into a queue and defines the enqueue options.

Table 10-30 Constants of the Producer Class

Constant Description
ENQ_BEFORE
The message is enqueued before the message specified by the relatie message id.
ENQ_TOP
The message is enqueued before any other messages.
ENQ_ON_COMMIT
Default. The enqueue is part of the current transaction. The operation is complete when the transaction commits.
ENQ_IMMEDIATE
The enqueue is not part of the current transaction. The operation constitutes a transaction of its own.

For typical usage, please see Example 10-5 and Example 10-6 starting .

Table 10-31 Summary of Producer Methods

Method Summary
Producer()
Producer class constructor.
getQueueName()
Retrieves the name of a queue on which the Messages will be enqueued.
getRelativeMessageId()
Retrieves the Message id that is referenced in a sequence deviation operation.
getSequenceDeviation()
Retrieves information regarding whether the Message should be dequeued ahead of other Messages in the queue.
getTransformation()
Retrieves the transformation applied before a Message is enqueued.
getVisibility()
Retrieves the transactional behavior of the enqueue request.
isNull()
Tests whether the Producer is NULL.
send()
Enqueues and sends a Message.
setNull()
Frees memory if the scope of the Producer extends beyond the Connection on which it was created.
setQueueName()
Specifies the name of a queue on which the Messages will be enqueued.
setRelativeMessageId()
Specifies the Message id to be referenced in the sequence deviation operation.
setSequenceDeviation()
Specifies whether Message should be dequeued before other Messages already in the queue.
setTransformation()
Specify transformation applied before enqueuing a Message.
setVisibility()
Specify transaction behavior of the enqueue request.


Producer()

Producer object constructor.

Syntax Description
Producer(
   Connection *conn);
Creates a Producer object with the specified Connection handle.
Producer(
   Connection *conn,
   const string& queue);
Creates a Producer object with the specified Connection handle and queue name.

Parameter Description
conn
The connection of the new Producer object.
queue
The queue that will be used by the new Producer object.


getQueueName()

Retrieves the name of a queue on which the Messages will be enqueued.


Syntax
string getQueueName();


getRelativeMessageId()

Retrieves the Message id that is referenced in a sequence deviation operation. Used only if a sequence deviation is specified; ignored otherwise.


Syntax
Bytes getRelativeMessageId() const;


getSequenceDeviation()

Retrieves information regarding whether the Message should be dequeued ahead of other Messages in the queue. Valid return values are defined as constants of the Producer class in Table 10-30: ENQ_BEFORE and ENQ_TOP.


Syntax
Producer::EnqueueSequence getSequenceDeviation() const;


getTransformation()

Retrieves the transformation applied before a Message is enqueued.


Syntax
Producer::string getTransformation() const;


getVisibility()

Retrieves the transactional behavior of the enqueue request. Valid return values are defined as constants of the Producer class in Table 10-30: ENQ_ON_COMMIT and ENQ_IMMEDIATE.


Syntax
Producer::Visibility getVisibility() const;


isNull()

Tests whether the Producer is NULL. If the Producer is NULL, then TRUE is returned; otherwise, FALSE is returned.


Syntax
bool isNull() const;


send()

Enqueues and sends a Message.

Syntax Description
Bytes send(
   Message& message);
Used when queueName has been previously set by the setQueueName() method.
Bytes send(
   Message& message,
   string& queueName);
Enqueue the Message to the specified queueName.

Parameter Description
message
The Message that will be enqueued.
queueName
The name of a valid queue in the database.


setNull()

Frees memory associated with the Producer. Unless working in inner scope, this call should be made before terminating the Connection.


Syntax
void setNull();


setQueueName()

Specifies the name of a queue on which the Messages will be enqueued. Typically used when enqueuing multiple messages to the same queue.


Syntax
void setQueueName(
   const string& queueName);

Parameter Description
queueName
The name of a valid queue in the database, to which the Messages will be enqueued.


setRelativeMessageId()

Specifies the Message id to be referenced in the sequence deviation operation. If the sequence deviation is not specified, this parameter will be ignored. Can be set for each enqueuing of a Message.


Syntax
void setRelativeMessageId(
   const Bytes& id);

Parameter Description
id
The id of the relative Message.


setSequenceDeviation()

Specifies whether Message being enqueued should be dequeued before other Message(s) already in the queue. Can be set for each enqueuing of a Message.


Syntax
void setSequenceDeviation(
   unsigned int seqDev);
Parameter Description
seqDev
The sequence deviation being set. Valid values are:
  • ENQ_BEFORE --

  • ENQ_TOP --



setTransformation()

Specify transformation applied before enqueuing the Message.


Syntax
void setTransformation(
   string &transFunction);
Parameter Description
transFunction
SQL transformation function.


setVisibility()

Specify transaction behavior of the enqueue request. Can be set for each enqueuing of a Message.


Syntax
void setVisibility(
   Visibility vis);
Parameter Description
visibility
Visibility option being set. Valid values are:
  • ENQ_ON_COMMIT --

  • ENQ_IMMEDIATE --