Oracle9i Supplied Java Packages Reference Release 2 (9.2) Part Number A96609-01 |
|
This chapter describes the Oracle Java Messaging Service (OJMS) interfaces and classes that are contained in package oracle.jms. The Oracle JMS interfaces extend the standard JMS interfaces to support the Oracle9i Advanced Queing (AQ) administrative operations and other AQ features that are not included in the public standard contained in the javax.jms package.
This chapter contains these sections:
The Oracle package oracle.jms provides a set of interfaces and associated semantics based on the Java Messaging Service (JMS) standard. These interfaces define how a JMS client accesses the facilities of an enterprise messaging product like Oracle9i Advanced Queuing. Advanced Queuing (AQ) is the unique database-integrated message queuing feature of the Oracle9i database. Oracle supports the standard JMS interfaces and has extensions to support the AQ administrative operations and other AQ features that are not included in the public standard.
Oracle JMS uses JDBC to connect to the database. Therefore, its applications can run as follows:
The standard JMS interfaces are contained in the javax.jms package (refer to Sun J2EE documentation for details). The Oracle JMS interfaces extend javax.jms and are contained in the oracle.jms package.
To use JMS interfaces with clients running outside the database, you must include the appropriate JDBC driver, JNDI jar files, and the following AQ jar files in your CLASSPATH
. (The CLASSPATH
is the operating system environmental variable that the JVM uses to find the classes it needs to run applications.)
For JDK 1.3 include:
$ORACLE_HOME/rdbms/jlib/jmscommon.jar $ORACLE_HOME/rdbms/jlib/aqapi13.jar $ORACLE_HOME/jdbc/lib/jndi.zip $ORACLE_HOME/jdbc/lib/classes13.zip
For JDK 1.2 include:
$ORACLE_HOME/rdbms/jlib/jmscommon.jar $ORACLE_HOME/rdbms/jlib/aqapi12.jar $ORACLE_HOME/jdbc/lib/jndi.zip $ORACLE_HOME/jdbc/lib/classes12.zip
For JDK 1.1 include:
$ORACLE_HOME/rdbms/jlib/jmscommon.jar $ORACLE_HOME/rdbms/jlib/aqapi11.jar $ORACLE_HOME/jdbc/lib/jndi.zip $ORACLE_HOME/jdbc/lib/classes11.zip
If your application is running inside the JServer, you should be able to access the Oracle JMS classes that have been automatically loaded when the JServer was installed. If these classes are not available, you may have to load jmscommon.jar followed by aqapi.jar using the loadjava utility.
Users must have EXECUTE privilege on DBMS_AQIN and DBMS_AQJMS packages in order to use the Oracle JMS interfaces. Users can also acquire these rights through the AQ_USER_ROLE or the AQ_ADMINSTRATOR_ROLE.
Users will also need the appropriate system and Queue or Topic privileges to send or receive messages.
public interface AdtMessage extends javax.jms.Message
javax.jms.Message
AQjmsAdtMessage
This interface extends the Message interface and represents messages containing Oracle object type payloads.
Member Summary | Description |
---|---|
Methods |
- |
Get the CustomDatum object containing this Adt message's data. |
|
Set the CustomDatum object containing this Adt message's data |
public oracle.sql.CustomDatum getAdtPayload()
Get the CustomDatum object containing this Adt message's data.
the object containing this message's data
JMSException
- if JMS fails to get object due to some internal JMS error.
public void setAdtPayload(oracle.sql.CustomDatum payload)
set the CustomDatum object containing this ADT message's data.
ADT is for Asynchronous Data Transfer.
payload
- the message's data (the object must implement the CustomDatum interface). This payload must be a Java object that represents the ADT that is defined as the queue/topic payload type.
JMSException
- if JMS fails to set the ADT payload
MessageNotWriteableException
- if message in read-only mode.
public class AQjmsAdtMessage extends AQjmsMessage implements AdtMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsAdtMessage
AdtMessage, javax.jms.Message
This class implements the AdtMessage interface. An AdtMessage is used to send a message containing Oracle object type payloads
public void clearBody()
Clear out the message body. All other parts of the message are left untouched.
javax.jms.Message.clearBody() in interface javax.jms.Message
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
JMSException
- if JMS fails to due to some internal JMS error.
public oracle.sql.CustomDatum getAdtPayload()
Get the CustomDatum object containing this Adt message's data.
getAdtPayload() in interface AdtMessage
the object containing this message's data
JMSException
- if JMS fails to get object due to some internal JMS error.
public boolean getBooleanProperty(java.lang.String name)
Return the boolean property value with the given name.
javax.jms.Message.getBooleanProperty(java.lang.String) in interface javax.jms.Message
getBooleanProperty(String) in class AQjmsMessage
name
- the name of the boolean property
the boolean property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public byte getByteProperty(java.lang.String name)
Return the byte property value with the given name.
javax.jms.Message.getByteProperty(java.lang.String) in interface javax.jms.Message
getByteProperty(String) in class AQjmsMessage
name
- the name of the byte property
the byte property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public double getDoubleProperty(java.lang.String name)
Return the double property value with the given name.
javax.jms.Message.getDoubleProperty(java.lang.String) in interface javax.jms.Message
getDoubleProperty(String) in class AQjmsMessage
name
- the name of the double property
the double property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public float getFloatProperty(java.lang.String name)
Return the float property value with the given name.
javax.jms.Message.getFloatProperty(java.lang.String) in interface javax.jms.Message
getFloatProperty(String) in class AQjmsMessage
name
- the name of the float property
the float property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public int getIntProperty(java.lang.String name)
Return the integer property value with the given name.
javax.jms.Message.getIntProperty(java.lang.String) in interface javax.jms.Message
getIntProperty(String) in class AQjmsMessage
name
- the name of the integer property
the integer property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public javax.jms.Destination getJMSReplyTo()
Get where a reply to this message should be sent. This method is not supported for AdtMessages in this release
javax.jms.Message.getJMSReplyTo() in interface javax.jms.Message
getJMSReplyTo() in class AQjmsMessage
JMSException
- NOT_SUPPORTED for AdtMessage
public java.lang.String getJMSType()
Get the message type.This method is not supported for AdtMessages in this release
javax.jms.Message.getJMSType() in interface javax.jms.Message
getJMSType() in class AQjmsMessage
the message type
JMSException
- NOT_SUPPORTED for AdtMessage
public long getLongProperty(java.lang.String name)
Return the long property value with the given name.
javax.jms.Message.getLongProperty(java.lang.String) in interface javax.jms.Message
getLongProperty(String) in class AQjmsMessage
name
- the name of the long property
the long property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public java.lang.Object getObjectProperty(java.lang.String name)
Return the Java object property value with the given name.
Note that this method can be used to return in objectified format, an object that had been stored as a property in the Message with the equivalent setObject
method call, or it's equivalent primitive set method.
javax.jms.Message.getObjectProperty(java.lang.String) in interface javax.jms.Message
getObjectProperty(String) in class AQjmsMessage
name
- the name of the Java object property
the Java object property value with the given name, in objectified format (i.e. if it set as an int, then a Integer is returned). If there is no property by this name, a null value is returned.
JMSException
- if JMS fails to get Property due to some internal JMS error.
public synchronized java.util.Enumeration getPropertyNames()
Return an Enumeration of all the property names.
javax.jms.Message.getPropertyNames() in interface javax.jms.Message
getPropertyNames() in class AQjmsMessage
an enumeration of all the names of property values.
JMSException
- if JMS fails to get Property names due to some internal JMS error.
public short getShortProperty(java.lang.String name)
Return the short property value with the given name.
javax.jms.Message.getShortProperty(java.lang.String) in interface javax.jms.Message
getShortProperty(String) in class AQjmsMessage
name
- the name of the short property
the short property value with the given name.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public java.lang.String getStringProperty(java.lang.String name)
Return the String property value with the given name.
javax.jms.Message.getStringProperty(java.lang.String) in interface javax.jms.Message
getStringProperty(String) in class AQjmsMessage
name
- the name of the String property
the String property value with the given name. If there is no property by this name, a null value is returned.
JMSException
- if JMS fails to get Property due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public boolean propertyExists(java.lang.String name)
Check if a property value exists.
javax.jms.Message.propertyExists(java.lang.String) in interface javax.jms.Message
propertyExists(String) in class AQjmsMessage
name
- the name of the property to test
true if the property does exist.
JMSException
- if JMS fails to check if property exists due to some internal JMS error.
public void setAdtPayload(oracle.sql.CustomDatum payload)
set the CustomDatum object containing this Adt message's data
setAdtPayload(CustomDatum) in interface AdtMessage
payload
- the message's data (the object must implement the CustomDatum interface). This payload must be a java object that represents the ADT that is defined as the queue/topic payload type
JMSException
- if JMS fails to set the adt payload
MessageNotWriteableException
- if message in read-only mode.
public void setBooleanProperty(java.lang.String name, boolean value)
Set a boolean property value with the given name, into the Message.
javax.jms.Message.setBooleanProperty(java.lang.String, boolean) in interface javax.jms.Message
setBooleanProperty(String, boolean) in class AQjmsMessage
name
- the name of the boolean property
value
- the boolean property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setByteProperty(java.lang.String name, byte value)
Set a byte property value with the given name, into the Message.
javax.jms.Message.setByteProperty(java.lang.String, byte) in interface javax.jms.Message
setByteProperty(String, byte) in class AQjmsMessage
name
- the name of the byte property
value
- the byte property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setDoubleProperty(java.lang.String name, double value)
Set a double property value with the given name, into the Message.
javax.jms.Message.setDoubleProperty(java.lang.String, double) in interface javax.jms.Message
setDoubleProperty(String, double) in class AQjmsMessage
name
- the name of the double property
value
- the double property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setFloatProperty(java.lang.String name, float value)
Set a float property value with the given name, into the Message.
javax.jms.Message.setFloatProperty(java.lang.String, float) in interface javax.jms.Message
setFloatProperty(String, float) in class AQjmsMessage
name
- the name of the float property
value
- the float property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setIntProperty(java.lang.String name, int value)
Set an integer property value with the given name, into the Message.
javax.jms.Message.setIntProperty(java.lang.String, int) in interface javax.jms.Message
setIntProperty(String, int) in class AQjmsMessage
name
- the name of the integer property
value
- the integer property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setJMSReplyTo(javax.jms.Destination replyTo)
Set where a reply to this message should be sent. This method is not supported for AdtMessage in this release
javax.jms.Message.setJMSReplyTo(javax.jms.Destination) in interface javax.jms.Message
setJMSReplyTo(Destination) in class AQjmsMessage
JMSException
- NOT_SUPPORTED for AdtMessage
public void setJMSType(java.lang.String type)
Set the message type. This method is not supported for AdtMessages in this release
javax.jms.Message.setJMSType(java.lang.String) in interface javax.jms.Message
setJMSType(String) in class AQjmsMessage
type
- of the message
JMSException
- NOT_SUPPORTED for AdtMessage
public void setLongProperty(java.lang.String name, long value)
Set a long property value with the given name, into the Message.
javax.jms.Message.setLongProperty(java.lang.String, long) in interface javax.jms.Message
setLongProperty(String, long) in class AQjmsMessage
name
- the name of the long property
value
- the long property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setObjectProperty(java.lang.String name, java.lang.Object value)
Set a Java object property value with the given name, into the Message.
Note that this method only works for the objectified primitive object types (Integer, Double, Long ...) and String's.
javax.jms.Message.setObjectProperty(java.lang.String, java.lang.Object) in interface javax.jms.Message
setObjectProperty(String, Object) in class AQjmsMessage
name
- the name of the Java object property.
value
- the Java object property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageFormatException
- if object is invalid
MessageNotWriteableException
- if properties are read-only
public void setShortProperty(java.lang.String name, short value)
Set a short property value with the given name, into the Message.
javax.jms.Message.setShortProperty(java.lang.String, short) in interface javax.jms.Message
setShortProperty(String, short) in class AQjmsMessage
name
- the name of the short property
value
- the short property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public void setStringProperty(java.lang.String name, java.lang.String value)
Set a String property value with the given name, into the Message.
javax.jms.Message.setStringProperty(java.lang.String, java.lang.String) in interface javax.jms.Message
setStringProperty(String, String) in class AQjmsMessage
name
- the name of the String property
value
- the String property value to set in the Message.
JMSException
- if JMS fails to set Property due to some internal JMS error.
MessageNotWriteableException
- if properties are read-only
public class AQjmsAgent implements javax.jms.Destination oracle.jms.AQjmsAgent
javax.jms.Destination
This class implements the Destination interface. It is used to define remote subscribers and ReplyTo Destinations
public AQjmsAgent(java.lang.String name, java.lang.String address)
Constructor
name
- Name of the agent
address
- Address of the agent
SQLException
- if it fails to create an agent
public AQjmsAgent(java.lang.String name, java.lang.String address, int protocol)
Constructor
name
- Name of the agent
address
- Address of the agent
protocol
- Protocol of the agent
SQLException
- if it fails to create an agent
public java.lang.String getAddress()
Get the address of the agent
the address of the agent
SQLException
- if there was an error in getting the address
public java.lang.String getName()
Get the name of the agent
the name of the agent
SQLException
- if there was an error in getting the name
public int getProtocol()
Get the protocol of the agent
the protocol of the agent
SQLException
- if there was an error in getting the protocol
public void setAddress(java.lang.String address)
Set the address of the agent
address
- the address of the agent
SQLException
- if there was an error in setting the address
public void setName(java.lang.String name)
Set the name of the agent
name
- the name of the agent
SQLException
- if there was an error in setting the name
public void setProtocol(int protocol)
Set the protocol of the agent
protocol
- the protocol of the agent
SQLException
- if there was an error in setting the address
public java.lang.String toString()
Convert the agent to its string representation which is of the form: "[AQjmsAgent] \n name: NAME \n address: ADDRESS \n protocol: PROTOCOL"
the string representation of the agent
SQLException
- if there was an error in setting the address
public class AQjmsBytesMessage extends AQjmsMessage implements javax.jms.BytesMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsBytesMessage
javax.jms.BytesMessage, javax.jms.Message
This class implements the BytesMessage interface. A BytesMessage is used to send a message containing a stream of uninterpreted bytes
public void clearBody()
Clear out the message body. All other parts of the message are left untouched.
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
JMSException
- if JMS fails to due to some internal JMS error.
public void clearProperties()
Clear a message's properties.
javax.jms.Message.clearProperties() in interface javax.jms.Message
clearProperties() in class AQjmsMessage
JMSException
- if JMS fails to clear JMS message properties due to some internal JMS error.
public boolean readBoolean()
Read a boolean
from the stream message.
javax.jms.BytesMessage.readBoolean() in interface javax.jms.BytesMessage
the boolean
value read.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public byte readByte()
Read a signed 8-bit value from the stream message.
javax.jms.BytesMessage.readByte() in interface javax.jms.BytesMessage
the next byte from the stream message as a signed 8-bit byte
.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public int readBytes(byte[] value)
Read a byte array from the stream message.
javax.jms.BytesMessage.readBytes(byte[]) in interface javax.jms.BytesMessage
value
- the buffer into which the data is read.
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public int readBytes(byte[] value, int length)
Read a portion of the bytes message.
javax.jms.BytesMessage.readBytes(byte[], int) in interface javax.jms.BytesMessage
value
- the buffer into which the data is read.
length
- the number of bytes to read.
the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public char readChar()
Read a Unicode character value from the stream message.
javax.jms.BytesMessage.readChar() in interface javax.jms.BytesMessage
the next two bytes from the stream message as a Unicode character.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public double readDouble()
Read a double
from the stream message.
javax.jms.BytesMessage.readDouble() in interface javax.jms.BytesMessage
the next eight bytes from the stream message, interpreted as a double
.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public float readFloat()
Read a float from the stream message.
javax.jms.BytesMessage.readFloat() in interface javax.jms.BytesMessage
the next four bytes from the stream message, interpreted as a float
.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public int readInt()
Read a signed 32-bit integer from the stream message.
javax.jms.BytesMessage.readInt() in interface javax.jms.BytesMessage
the next four bytes from the stream message, interpreted as an int
.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public long readLong()
Read a signed 64-bit integer from the stream message.
javax.jms.BytesMessage.readLong() in interface javax.jms.BytesMessage
the next eight bytes from the stream message, interpreted as a long
.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public short readShort()
Put the message in read-only mode, and reposition the stream of bytes to the beginning. ThrowsMessageNotWriteableException - if message in write-only mode. JMSException - if JMS fails to read message due to some internal JMS error.
javax.jms.BytesMessage.readShort() in interface javax.jms.BytesMessage
public int readUnsignedByte()
Read an unsigned 8-bit number from the stream message.
javax.jms.BytesMessage.readUnsignedByte() in interface javax.jms.BytesMessage
the next byte from the stream message, interpreted as an unsigned 8-bit number.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public int readUnsignedShort()
Read an unsigned 16-bit number from the stream message.
javax.jms.BytesMessage.readUnsignedShort() in interface javax.jms.BytesMessage
the next two bytes from the stream message, interpreted as an unsigned 16-bit integer.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public java.lang.String readUTF()
Read in a string that has been encoded using a modified UTF-8 format from the stream message.
javax.jms.BytesMessage.readUTF() in interface javax.jms.BytesMessage
a Unicode string from the stream message.
MessageNotReadableException
- if message in write-only mode.
MessageEOFException
- if end of message stream
JMSException
- if JMS fails to read message due to some internal JMS error.
public void reset()
Put the message in read-only mode, and reposition the stream of bytes to the beginning.
javax.jms.BytesMessage.reset() in interface javax.jms.BytesMessage
JMSException
- if JMS fails to reset the message due to some internal JMS error.
MessageFormatException
- if message has an invalid format
public void writeBoolean(boolean value)
Write a boolean
to the stream message as a 1-byte value. The value true
is written out as the value (byte)1
; the value false
is written out as the value (byte)0
.
javax.jms.BytesMessage.writeBoolean(boolean) in interface javax.jms.BytesMessage
value
- the boolean value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeByte(byte value)
Write out a byte
to the stream message as a 1-byte value.
javax.jms.BytesMessage.writeByte(byte) in interface javax.jms.BytesMessage
value
- the byte
value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeBytes(byte[] value)
Write a byte array to the stream message.
javax.jms.BytesMessage.writeBytes(byte[]) in interface javax.jms.BytesMessage
value
- the byte array to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeBytes(byte[] value, int offset, int length)
Write a portion of a byte array to the stream message.
javax.jms.BytesMessage.writeBytes(byte[], int, int) in interface javax.jms.BytesMessage
value
- the byte array value to be written.
offset
- the initial offset within the byte array.
length
- the number of bytes to use.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeChar(char value)
Write a char
to the stream message as a 2-byte value, high byte first.
javax.jms.BytesMessage.writeChar(char) in interface javax.jms.BytesMessage
value
- the char
value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeDouble(double value)
Convert the double argument to a long
using the doubleToLongBits
method in class Double
, and then writes that long
value to the stream message as an 8-byte quantity, high byte first.
javax.jms.BytesMessage.writeDouble(double) in interface javax.jms.BytesMessage
value
- the double
value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeFloat(float value)
Convert the float argument to an int
using the floatToIntBits
method in class Float
, and then writes that int
value to the stream message as a 4-byte quantity, high byte first.
javax.jms.BytesMessage.writeFloat(float) in interface javax.jms.BytesMessage
value
- the float
value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeInt(int value)
Write an int
to the stream message as four bytes, high byte first.
javax.jms.BytesMessage.writeInt(int) in interface javax.jms.BytesMessage
value
- the int
to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeLong(long value)
Write a long
to the stream message as eight bytes, high byte first.
javax.jms.BytesMessage.writeLong(long) in interface javax.jms.BytesMessage
value
- the long
to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeObject(java.lang.Object value)
Write a Java object to the stream message.
Note that this method only works for the objectified primitive object types (Integer, Double, Long ...), String's and byte arrays.
javax.jms.BytesMessage.writeObject(java.lang.Object) in interface javax.jms.BytesMessage
value
- the Java object to be written.
MessageNotWriteableException
- if message in read-only mode.
MessageFormatException
- if object is invalid type.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeShort(short value)
Write a short
to the stream message as two bytes, high byte first.
javax.jms.BytesMessage.writeShort(short) in interface javax.jms.BytesMessage
value
- the short
to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public void writeUTF(java.lang.String value)
Write a string to the stream message using UTF-8 encoding in a machine-independent manner.
javax.jms.BytesMessage.writeUTF(java.lang.String) in interface javax.jms.BytesMessage
value
- the String
value to be written.
MessageNotWriteableException
- if message in read-only mode.
JMSException
- if JMS fails to write message due to some internal JMS error.
public class AQjmsConnection extends java.lang.Object implements javax.jms.QueueConnection, javax.jms.TopicConnection java.lang.Object | +--oracle.jms.AQjmsConnection
javax.jms.Connection, javax.jms.QueueConnection, javax.jms.TopicConnection
This class implements the Connection interface. This is an active connection to the JMS provider
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public void close()
Since a provider typically allocates significant resources outside the JVM on behalf of a Connection, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
javax.jms.Connection.close() in interface javax.jms.Connection
javax.jms.Connection.close() in interface javax.jms.Connection
JMSException
- if JMS implementation fails to close the connection due to internal error. For example, a failure to release resources or to close socket connection can lead to throwing of this exception.
public javax.jms.QueueSession createQueueSession(boolean transacted, int ack_ mode)
create a queue session
javax.jms.QueueConnection.createQueueSession(boolean, int) in interface javax.jms.QueueConnection
transacted
- is session transacted?
ack_mode
- acknowledgement mode
QueueSession. A A QueueSession provides methods for creating QueueReceiver's, QueueSender's, QueueBrowser's.
JMSException
- if JMS fails to create queue session
public javax.jms.TopicSession createTopicSession(boolean transacted, int ack_ mode)
Create a TopicSession
javax.jms.TopicConnection.createTopicSession(boolean, int) in interface javax.jms.TopicConnection
transacted
- if true, the session is transacted.
acknowledgeMode
- indicates whether the consumer or the client will acknowledge any messages it receives. This parameter will be ignored if the session is transacted.
a newly created topic session.
JMSException
- if JMS Connection fails to create a session due to some internal error or lack of support for specific transaction and acknowledgement mode.
public java.lang.String getClientID()
Get the client identifier for this connection.
javax.jms.Connection.getClientID() in interface javax.jms.Connection
the unique client identifier.
JMSException
- if JMS implementation fails to return the client ID for this Connection due to some internal error.
public javax.jms.Session getCurrentJmsSession()
gets the current session
Session The current JMS session
public javax.jms.ConnectionMetaData getMetaData()
Get the meta data for this connection.
javax.jms.Connection.getMetaData() in interface javax.jms.Connection
the connection meta data.
JMSException
- general exception if JMS implementation fails to get the Connection meta-data for this Connection.
javax.jms.ConnectionMetaData
public void setClientID(java.lang.String clientID)
Set the client identifier for this connection.
The preferred way to assign a Client's client identifier is for it to be configured in a client-specific ConnectionFactory and transparently assigned to the Connection it creates. Alternatively, a client can set a Connections's client identifier using a provider-specific value.
The purpose of client identifier is to associate a session and its objects with a state maintained on behalf of the client by a provider. The only such state identified by JMS is that required to support durable subscriptions
javax.jms.Connection.setClientID(java.lang.String) in interface javax.jms.Connection
clientID
- the unique client identifier
JMSException
- general exception if JMS implementation fails to set the client ID for this Connection due to some internal error.
InvalidClientIDException
- if JMS client specifies an invalid or duplicate client id.
public void start()
Start (or restart) a Connection's delivery of incoming messages. Restart begins with the oldest unacknowledged message. Starting a started session is ignored.
javax.jms.Connection.start() in interface javax.jms.Connection
JMSException
- if JMS implementation fails to start the message delivery due to some internal error.
javax.jms.Connection.stop()
public void stop()
Used to temporarily stop a Connection's delivery of incoming messages. It can be restarted using its start
method. When stopped, delivery to all the Connection's message consumers is inhibited: synchronous receive's block and messages are not delivered to message listeners.
After stop is called there may still be some messages delivered.
Stopping a Session has no affect on its ability to send messages. Stopping a stopped session is ignored.
javax.jms.Connection.stop() in interface javax.jms.Connection
JMSException
- if JMS implementation fails to stop the message delivery due to some internal error.
javax.jms.Connection.start()
public void setExceptionListener(javax.jms.ExceptionListener listener)
Set an exception listener for this connection.
If a JMS provider detects a serious problem with a connection it will inform the connection's ExceptionListener if one has been registered. It does this by calling the listener's onException() method passing it a JMSException describing the problem.
This allows a client to be asynchronously notified of a problem. Some connections only consume messages so they would have no other way to learn their connection has failed.
A Connection serializes execution of its ExceptionListener.
javax.jms.Connection.setExceptionListener(javax.jms.ExceptionListener listener) in interface javax.jms.Connection.
listener
- the exception listener.
JMSException
- general exception if JMS implementation fails to set the Exception listener for this Connection.
public javax.jms.ExceptionListener getExceptionListener()
Get the ExceptionListener for this Connection.
javax.jms.Connection.getExceptionListener() in interface javax.jms.Connection
The ExceptionListener for this Connection if registered, else null
JMSException
- general exception if JMS implementation fails to get the Exception listener for this Connection.
public void setPingPeriod(long period)
Set the sleep period (in milliseconds) between each 'ping' of the exception listener for this connection.
If a exception listener is registered, the connection 'pings' the server periodically to ensure that the server is alive. These 'pings' can result in performance degradation. A trade-off has to be made in selecting a good 'ping' period value. The greater the value the larger the time period an asynchronous client may have to wait before it is aware of a fatal exception. The smaller the value, more the overhead of the 'pings'. If an exception listener is not registered for this connection, then 'ping' period is of no relevance. The default value of the ping period is 2 minutes.
period
- the sleep period between each 'ping' in milliseconds.
public long getPingPeriod()
Get the sleep period (in milliseconds) between each 'ping' of the exception listener for this connection.
This method Returnsthe value set by a previous call to setPingPeriod()
or the default value (2 minutes) if setPingPeriod is not calle.
The sleep period between each 'ping' in milliseconds.
public class AQjmsConnectionMetaData extends java.lang.Object implements javax.jms.ConnectionMetaData java.lang.Object | +--oracle.jms.AQjmsConnectionMetaData
javax.jms.ConnectionMetaData
This class represents the Meta Data information available for a JMS Connection.
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public AQjmsConnectionMetaData()
public int getJMSMajorVersion()
Get the JMS major version number.
javax.jms.ConnectionMetaData.getJMSMajorVersion() in interface javax.jms.ConnectionMetaData
the JMS major version number.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public int getJMSMinorVersion()
Get the JMS minor version number.
javax.jms.ConnectionMetaData.getJMSMinorVersion() in interface javax.jms.ConnectionMetaData
the JMS minor version number.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public java.lang.String getJMSProviderName()
Get the JMS provider name.
javax.jms.ConnectionMetaData.getJMSProviderName() in interface javax.jms.ConnectionMetaData
the JMS provider name.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public java.lang.String getJMSVersion()
Get the JMS version.
javax.jms.ConnectionMetaData.getJMSVersion() in interface javax.jms.ConnectionMetaData
the JMS version.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public int getProviderMajorVersion()
Get the JMS provider major version number.
javax.jms.ConnectionMetaData.getProviderMajorVersion() in interface javax.jms.ConnectionMetaData
the JMS provider major version number.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public int getProviderMinorVersion()
Get the JMS provider minor version number.
javax.jms.ConnectionMetaData.getProviderMinorVersion() in interface javax.jms.ConnectionMetaData
the JMS provider minor version number.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public java.lang.String getProviderVersion()
Get the JMS provider version.
javax.jms.ConnectionMetaData.getProviderVersion() in interface javax.jms.ConnectionMetaData
the JMS provider version.
JMSException
- if some internal error occurs in JMS implementation during the meta-data retrieval.
public class AQjmsConstants oracle.jms.AQjmsConstants
This class defines the constants used in the oracle.jms package
Members |
---|
Fields |
Constructors |
Methods |
public static final int EXCEPTION
public static final int NONE
public static final int NORMAL
public static final int STATE_EXPIRED
public static final int STATE_PROCESSED
public static final int STATE_READY
public static final int STATE_WAITING
public static final int TRANSACTIONAL
public static final int WAIT_FOREVER
public static final int WAIT_NONE
public AQjmsConstants()
Returnstrue
if the JMS client is run in the J2EE/JMS 1.3 compliance mode and false
otherwise.
The client can define the j2EE compliance mode used by OJMS by setting the java property "oracle.jms.j2eeCompliant" to either true or false at run time. When running with the j2eeCompliant flag set to false, OJMS clients will support older (non j2ee compliant) OJMS behavior for priority, expiration and non durable subscriber semantics. This allows older clients to run without code modifications.
public class AQjmsConsumer extends java.lang.Object implements AQjmsQueueReceiver, AQjmsTopicSubscriber, AQjmsTopicReceiver java.lang.Object | +--oracle.jms.AQjmsConsumer
AQjmsQueueReceiver, AQjmsTopicReceiver, AQjmsTopicSubscriber, javax.jms.MessageConsumer, javax.jms.QueueReceiver, TopicReceiver, javax.jms.TopicSubscriber
This class implements the MessageConsumer interface
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public void close()
Since a provider may allocate some resources on behalf of a MessageConsumer outside the JVM, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
javax.jms.MessageConsumer.close() in interface javax.jms.MessageConsumer
javax.jms.MessageConsumer.close() in interface javax.jms.MessageConsumer
JMSException
- if JMS fails to close the consumer due to some error.
public synchronized javax.jms.MessageListener getMessageListener()
Get the message consumer's MessageListener.
javax.jms.MessageConsumer.getMessageListener() in interface javax.jms.MessageConsumer
javax.jms.MessageConsumer.getMessageListener() in interface javax.jms.MessageConsumer
the listener for the message consumer, or null if this isn't one set.
JMSException
- if JMS fails to get message listener due to some JMS error
public synchronized java.lang.String getMessageSelector()
Get the message consumer's message selector expression.
javax.jms.MessageConsumer.getMessageSelector() in interface javax.jms.MessageConsumer
javax.jms.MessageConsumer.getMessageSelector() in interface javax.jms.MessageConsumer
this message consumer's message selector
JMSException
- if JMS fails to get message selector due to some JMS error
public synchronized int getNavigationMode()
Get the navigation mode for the consumer
getNavigationMode() in interface AQjmsTopicSubscriber
getNavigationMode() in interface AQjmsTopicReceiver
the navigation mode of the consumer
if
- the navigation mode could not be got
public synchronized boolean getNoLocal()
Get the NoLocal attribute for this TopicSubscriber. The default value for this attribute is false.
javax.jms.TopicSubscriber.getNoLocal() in interface javax.jms.TopicSubscriber
set to true if locally published messages are being inhibited.
JMSException
- if JMS fails to get noLocal attribute for this topic subscriber due to some internal error.
public synchronized javax.jms.Queue getQueue()
Get the queue associated with this queue receiver.
javax.jms.QueueReceiver.getQueue() in interface javax.jms.QueueReceiver
the queue associated with the receiver
JMSException
- if JMS fails to get queue for this queue receiver due to some internal error.
public synchronized javax.jms.Topic getTopic()
Get the topic associated with this subscriber.
javax.jms.TopicSubscriber.getTopic() in interface javax.jms.TopicSubscriber
getTopic() in interface TopicReceiver
this subscriber's topic
JMSException
- if JMS fails to get topic for this topic subscriber due to some internal error.
public synchronized javax.jms.Message receive()
Receive the next message produced for this message consumer.
This call blocks indefinitely until a message is produced.
javax.jms.MessageConsumer.receive() in interface javax.jms.MessageConsumer
the next message produced for this message consumer.
JMSException
- if JMS fails to receive the next message due to some error.
public synchronized javax.jms.Message receive(long timeout)
Receive the next message that arrives within the specified timeout interval.
This call blocks until either a message arrives or the timeout expires.
javax.jms.MessageConsumer.receive(long) in interface javax.jms.MessageConsumer
timeout
- the timeout value (in milliseconds)
the next message produced for this message consumer, or null if one is not available.
JMSException
- if JMS fails to receive the next message due to some error.
public synchronized void receiveNoData()
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database. It can be used as an optimization by jms clients who have already read the message, for example using a queue browser.
receiveNoData() in interface AQjmsQueueReceiver
JMSException
- if the message could not be received due to an error
public synchronized void receiveNoData(long timeout)
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database. It can be used as an optimization by jms clients who have already read the message, for example using a queue browser. This call will block until a message arrives or the timeout expires
receiveNoData(long) in interface AQjmsQueueReceiver
timeout
- the timeout value in milliseconds
JMSException
- if the message could not be received due to an error
public synchronized javax.jms.Message receiveNoWait()
Receive the next message if one is immediately available.
javax.jms.MessageConsumer.receiveNoWait() in interface javax.jms.MessageConsumer
the next message produced for this message consumer, or null if one is not available.
JMSException
- if JMS fails to receive the next message due to some error.
public synchronized void setMessageListener(javax.jms.MessageListener myListener)
Set the message consumer's MessageListener. The onMessage method of this object is called when there are messages for this consumer.
javax.jms.MessageConsumer.setMessageListener(javax.jms.MessageListener) in interface javax.jms.MessageConsumer
myListener
- set the consumer's message listener
JMSException
- if JMS fails to get message listener due to some JMS error
public synchronized void setNavigationMode(int mode)
Set the navigation mode for the consumer
setNavigationMode(int) in interface AQjmsQueueReceiver
mode
- the navigation mode of the consumer
if
- the navigation mode could not be set
public class AQjmsDestination extends java.lang.Object implements javax.jms.Queue, javax.jms.Topic java.lang.Object | +--oracle.jms.AQjmsDestination
javax.jms.Destination, javax.jms.Queue, javax.jms.Topic
This class implements administered objects, Queue and Topic
Member Summary | Description |
---|---|
Methods |
- |
alter the properties of the queue/topic |
|
|
alter propagation schedule between the topic and the destination database |
Deletes a temporary destination and makes it unusable for further operations. |
|
disable propagation schedule |
|
drop the queue/topic |
|
enable propagation schedule |
|
Get the complete name of the queue/topic, of the form, [schema].name |
|
Get the complete name of the queue table of the queue/topic of the form, [schema].name |
|
Get the name of the queue |
|
Get the owner of the queue |
|
Get the name of the Topic |
|
Get the schema of the topic |
|
Grant enqueue or dequeue privilege on the queue to a database user |
|
Grant a topic privilege |
|
Revoke a queue privilege |
|
Revoke a topic privilege |
|
|
Schedule propagation from the topic for the given destination database |
start the queue/topic for enqueue or dequeue or both |
|
stop the queue/topic for enqueue or dequeue or both |
|
Get the queue/topic as a string, of the form [schema].name |
|
Unschedule propagation between the topic and the specified destination |
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public void alter(javax.jms.Session session, AQjmsDestinationProperty dest_ property)
alter the properties of the queue/topic
session
- the jms session
dest_property
- the new properties of the queue/topic
public void alterPropagationSchedule(javax.jms.Session session, java.lang.String destination, java.lang.Double duration, java.lang.String next_time, java.lang.Double latency)
alter propagation schedule between the topic and the destination database
session
- the jms session
destination
- the dblink of the destination database
duration
- the new duration
next_time
- the new next_time for propagation
latency
- the new latency
public void delete()
Deletes a temporary destination and makes it unusable for further operations.
javax.jms.TemporaryQueue.delete() in interface javax.jms.TemporaryQueue
and javax.jms.TemporaryTopic.delete() in interface javax.jms.TemporaryTopic.
JMSException
- if OJMS fails to delete the temporary queue/topic due to some internal error or if there are existing receivers still using the temporary destination.
public void disablePropagationSchedule(javax.jms.Session session, java.lang.String destination)
disable propagation schedule
session
- the jms session
destination
- the dblink to the destination database
JMSException
- if the propagation schedule could not be disabled
public void drop(javax.jms.Session session)
drop the queue/topic
session
- the jms session
JMSException
- if the queue/topic could not be dropped
public void enablePropagationSchedule(javax.jms.Session session, java.lang.String destination)
enable propagation schedule
session
- the JMS session
destination
- the dblink of the destination database
JMSException
- if the propagation could not be enabled
public java.lang.String getCompleteName()
Get the complete name of the queue/topic, of the form, [schema].name
the complete name of the queue/topic
public java.lang.String getCompleteTableName()
Get the complete name of the queue table of the queue/topic of the form, [schema].name
the complete name of the queue/topic's queue table
public java.lang.String getQueueName()
Get the name of the queue
javax.jms.Queue.getQueueName() in interface javax.jms.Queue
the name of the queue
JMSException
- if the queue is not a single consumer queue
public java.lang.String getQueueOwner()
Get the owner of the queue
the schema of the queue
JMSException
- if the schema could not be retrieved
public java.lang.String getTopicName()
Get the name of the Topic
javax.jms.Topic.getTopicName() in interface javax.jms.Topic
the name of the topic
JMSException
- if the queue is not a multi consumer queue (topic)
public java.lang.String getTopicOwner()
Get the schema of the topic
the schema of the topic
JMSException
- if the schema could not be retrieved
public void grantQueuePrivilege(javax.jms.Session session, java.lang.String privilege, java.lang.String grantee, boolean grant_option)
Grant enqueue or dequeue privilege on the queue to a database user
session
- the jms session
privilege
- the privilege (ENQUEUE or DEQUEUE)
grantee
- the user being granted the privilege
grant_option
- whether the grantee can grant the privilege to others
JMSException
- if the privilege could not be granted
public void grantTopicPrivilege(javax.jms.Session session, java.lang.String privilege, java.lang.String grantee, boolean grant_option)
Grant a topic privilege
session
- the jms session
privilege
- the privilege (ENQUEUE or DEQUEUE) being granted
grantee
- the database user being granted the privilege
grant_option
- whether the grantee can grant the privilege to other users
JMSException
- if the privilege could not be granted
public void revokeQueuePrivilege(javax.jms.Session session, java.lang.String privilege, java.lang.String grantee)
Revoke a queue privilege
session
- the jms session
privilege
- the privilege (ENQUEUE or DEQUEUE) being revoked
grantee
- the database user from whom the privilege is being revoked
JMSException
- if the privilege could not be revoked
public void revokeTopicPrivilege(javax.jms.Session session, java.lang.String privilege, java.lang.String grantee)
Revoke a topic privilege
session
- the jms session
privilege
- the privilege (ENQUEUE or DEQUEUE) being revoked
grantee
- the database user from whom the privilege is being revoked
JMSException
- if the privilege could not be revoked
public void schedulePropagation(javax.jms.Session session, java.lang.String destination, java.util.Date start_time, java.lang.Double duration, java.lang.String next_time, java.lang.Double latency)
Schedule propagation from the topic for the given destination database
session
- the JMS session
destination
- the dblink of the remote database for which propagation is being scheduled. A null string means that propagation will be scheduled for all subscribers in the database of the topic
start_time
- the time propagation must be started
duration
- the duration of propagation
next_time
- the next time propagation must be done
latency
- the latency in seconds that can be tolerated latency is the difference between the time a message was enqueued and the time it was propagated
JMSException
- if propagation could not be scheduled
public void start(javax.jms.Session session, boolean enqueue, boolean dequeue)
start the queue/topic for enqueue or dequeue or both
session
- the jms session
enqueue
- whether enqueue should be enabled
dequeue
- whether dequeue should be enabled
JMSException
- if failed to start the queue/topic
public void stop(javax.jms.Session session, boolean enqueue, boolean dequeue, boolean wait)
stop the queue/topic for enqueue or dequeue or both
session
- the jms session
enqueue
- whether enqueue should be disabled
dequeue
- whether dequeue should be disabled
wait
- whether to wait for pending transactions on the queue/topic to complete
JMSException
- if failed to stop the queue/topic
public java.lang.String toString()
Get the queue/topic as a string, of the form [schema].name
javax.jms.Queue.toString() in interface javax.jms.Queue
java.lang.Object.toString() in class java.lang.Object
the queue/topic as a string
public void unschedulePropagation(javax.jms.Session session, java.lang.String destination)
Unschedule propagation between the topic and the specified destination
session
- the jms session
destination
- the dblink of the destination database for which propagation must be unscheduled
JMSException
- if propagation could not be unscheduled
public class AQjmsDestinationProperty oracle.jms.AQjmsDestinationProperty
This class defines Destination properties
public static final int NORMAL_QUEUE public static final int EXCEPTION_QUEUE public static final int INFINITE /* infinite retention */
public AQjmsDestinationProperty()
Constructor - initializes object with default destination properties
public int getQueueType() throws AQException
This method gets the queue type.
NORMAL_QUEUE
or EXCEPTION_QUEUE
public void setQueueType(int q_type) throws AQException
This method is used to set the queue type.
Parameter | Meaning |
---|---|
|
|
public int getMaxRetries() throws AQException
This method gets the maximum retries for dequeue with REMOVE
mode.
public void setMaxRetries(int retries) throws AQException public void setMaxRetries(Integer retries) throws AQException
This method sets the maximum retries for dequeue with REMOVE
mode.
public void setRetryInterval(double interval) throws AQException public void setRetryInterval(Double interval) throws AQException
This method sets the retry interval, that is the time before this message is scheduled for processing after an application rollback. Default is 0.
Parameter | Meaning |
---|---|
|
retry interval; specifying |
public double getRetryInterval() throws AQException
This method gets the retry interval.
public double getRetentionTime() throws AQException
This method gets the retention time.
public void setRetentionTime(double r_time) throws AQException public void setRetentionTime(Double r_time) throws AQException
This method gets the retention time.
Parameter | Meaning |
---|---|
|
retention time; specifying |
public java.lang.String getComment() throws AQException
This method gets the queue comment.
public void setComment(java.lang.String qt_comment) throws AQException
This method sets the queue comment.
Parameter | Meaning |
---|---|
qt_comment |
queue comment |
public class AQjmsException extends javax.jms.JMSException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--oracle.jms.AQjmsException
java.io.Serializable
This exception extends JMSException - adds Oracle error codes. This is the root of all JMS exceptions
Member Summary | Description |
---|---|
Methods |
- |
Get the Oracle Error code for the exception |
public int getErrorNumber()
Get the Oracle Error code for the exception
public class AQjmsFactory extends java.lang.Object java.lang.Object | +--oracle.jms.AQjmsFactory
This class is used for accessing administered ConnectionFactory objects in Oracle's implementation of JMS
Member Summary | Description |
---|---|
Methods |
- |
get a Queue Connection Factory |
|
get a Queue Connection Factory |
|
get a Topic Connection Factory |
|
get a Topic Connection Factory |
|
registerConnectionFactory(java.sql.Connection, String, String, String, int, String, String) |
Register a Queue or Topic Connection Factory in LDAP through the database |
registerConnectionFactory(java.sql.Connection, String, String, java.util.Properties, String) |
Register a Queue or Topic Connection Factory in LDAP through the database |
registerConnectionFactory(java.util.Hashtable, String, String, String, int, String, String) |
Register a Queue or Topic Connection Factory to LDAP |
registerConnectionFactory(java.util.Hashtable, String, String, java.util.Properties, String) |
Register a Queue or Topic Connection Factory in LDAP |
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public static javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String jdbc_url, java.util.Properties info)
Get a Queue Connection Factory
jdbc_url
- url to connect to
info - properties information
a Queue Connection Factory
JMSException
- if JMS fails to get a queue connection factory due to some JMS error
public static javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String hostname, java.lang.String oracle_ sid, int portno, java.lang.String driver)
Get a Queue Connection Factory
hostname
- the name of the host running Oracle
oracle_sid - the oracle system identifier
portno - the port number
driver - the type of jdbc driver (thin or oci8)
a Queue Connection Factory
JMSException
- if JMS fails to get a queue connection factory due to some JMS error
public static javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String jdbc_url, java.util.Properties info)
get a Topic Connection Factory
jdbc_url
- url to connect to
info - properties information
a Topic Connection Factory
JMSException
- if JMS fails to get a queue connection factory due to some JMS error
public static javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String hostname, java.lang.String oracle_ sid, int portno, java.lang.String driver)
get a Topic Connection Factory
hostname
- the name of the host running Oracle
oracle_sid - the oracle system identifier
portno - the port number
driver - the type of jdbc driver (thin or oci8)
a Topic Connection Factory
JMSException
- if JMS fails to get a queue connection factory due to some JMS error
public static void registerConnectionFactory( java.sql.Connection connection, String conn_name, String hostname, String oracle_sid, int portno, String driver, String type) throws JMSException
Register a Queue or Topic Connection Factory in the LDAP server associated with the Oracle database. The user can log on to the Oracle9i database first and then have the database update the LDAP entry. The user that logs on to the database must have the AQ_ADMINISTRATOR_ROLE to perform this operation.
connection
- a valid database connection
conn_name
- the name of the Connection Factory to be registered
hostname
- host name of the machine which hosts the database that the connection factory represents
oracle_sid - the oracle SID of the database that the connection factory represents
portno - the port number of the database
driver - the type of jdbc driver ("thin" or "oci8") to be used to connect to the database (JMS provider)
type - Specify "queue" to register a QueueConnectionFactory. Specify "topic" to register a TopicConnectionFactory
JMSException
- if JMS fails to register connection factory due to some JMS error
public static void registerConnectionFactory( java.sql.Connection connection, String conn_name, String jdbc_url, Properties info, String type) throws JMSException
Register a Queue or Topic Connection Factory in the LDAP server associated with the Oracle database. The user can log on to the Oracle9i database first and then have the database update the LDAP entry. The user that logs on to the database must have the AQ_ADMINISTRATOR_ROLE to perform this operation.
connection
- a valid database connection
conn_name
- the name of the Connection Factory to be registered
jdbc_url
- the JDBC URL to connect to the database that this factory represents
info
- JDBC connection properties
type - Specify "queue" to register a QueueConnectionFactory. Specify "topic" to register a TopicConnectionFactory
JMSException
- if JMS fails to register connection factory due to some JMS error
public static void registerConnectionFactory( java.util.Hashtable env, String conn_name, String hostname, String oracle_sid, int portno, String driver, String type) throws JMSException
Register a Queue or Topic Connection Factory in LDAP server. This method allows you to register a connection factory in LDAP directly without connecting to the database.
The user must have the GLOBAL_AQ_USER_ROLE to register connection factories in LDAP
env
- a valid LDAP environment
conn_name
- the name of the Connection Factory to be registered
hostname
- host name of the machine which hosts the database that the connection factory represents
oracle_sid - the oracle SID of the database that the connection factory represents
portno - the port number of the database
driver - the type of jdbc driver ("thin" or "oci8") to be used to connect to the database (JMS provider)
type - Specify "queue" to register a QueueConnectionFactory. Specify "topic" to register a TopicConnectionFactory
JMSException
- if JMS fails to register connection factory due to some JMS error
public static void registerConnectionFactory( java.util.Hashtable env, String conn_name, String jdbc_url, Properties info, String type) throws JMSException
Register a Queue or Topic Connection Factory in LDAP server. This method allows you to register a connection factory in LDAP directly without connecting to the database.
The user must have the GLOBAL_AQ_USER_ROLE to register connection factories in LDAP
env
- a valid LDAP environment
conn_name
- the name of the Connection Factory to be registered
jdbc_url
- the JDBC URL to connect to the database that this factory represents
info
- JDBC connection properties
type - Specify "queue" to register a QueueConnectionFactory. Specify "topic" to register a TopicConnectionFactory
JMSException
- if JMS fails to register connection factory due to some JMS error
public class AQjmsInvalidDestinationException extends javax.jms.InvalidDestinationException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.InvalidDestinationException | +--oracle.jms.AQjmsInvalidDestinationException
java.io.Serializable
This exception extends InvalidDestinationException. It is thrown when a Destination is not valid
public class AQjmsInvalidSelectorException extends javax.jms.InvalidSelectorException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.InvalidSelectorException | +--oracle.jms.AQjmsInvalidSelectorException
java.io.Serializable
This exception extends InvalidSelectorException. It is thrown when the specified MessageSelector is not valid
public class AQjmsMapMessage extends AQjmsMessage implements javax.jms.MapMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsMapMessage
javax.jms.MapMessage, javax.jms.Message
This class implements the MapMessage interface. A MapMessage is used to send a set of name-value pairs where names are Strings and values are java primitive types
public void clearBody()
Clear out the message body. All other parts of the message are left untouched. The message can now be both read and written to.
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
JMSException
- if JMS fails to due to some internal JMS error.
public void clearProperties()
Clear a message's properties.
javax.jms.Message.clearProperties() in interface javax.jms.Message
clearProperties() in class AQjmsMessage
JMSException
- if JMS fails to clear JMS message properties due to some internal JMS error.
public boolean getBoolean(java.lang.String name)
Return the boolean value with the given name.
javax.jms.MapMessage.getBoolean(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the boolean
the boolean value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public byte getByte(java.lang.String name)
Return the byte value with the given name.
javax.jms.MapMessage.getByte(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the byte
the byte value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public byte[] getBytes(java.lang.String name)
Return the byte array value with the given name.
javax.jms.MapMessage.getBytes(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the byte array
the byte array value with the given name. If there is no item by this name, a null value is returned.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public char getChar(java.lang.String name)
Return the Unicode character value with the given name.
javax.jms.MapMessage.getChar(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the Unicode character
the Unicode character value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public double getDouble(java.lang.String name)
Return the double value with the given name.
javax.jms.MapMessage.getDouble(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the double
the double value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public float getFloat(java.lang.String name)
Return the float value with the given name.
javax.jms.MapMessage.getFloat(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the float
the float value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public int getInt(java.lang.String name)
Return the integer value with the given name.
javax.jms.MapMessage.getInt(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the integer
the integer value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public long getLong(java.lang.String name)
Return the long value with the given name.
javax.jms.MapMessage.getLong(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the long
the long value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public java.util.Enumeration getMapNames()
Return an Enumeration of all the Map message's names.
javax.jms.MapMessage.getMapNames() in interface javax.jms.MapMessage
an enumeration of all the names in this Map message.
JMSException
- if JMS fails to read message due to some internal JMS error.
public java.lang.Object getObject(java.lang.String name)
Return the Java object value with the given name.
Note that this method can be used to return in objectified format, an object that had been stored in the Map with the equivalent setObject
method call, or it's equivalent primitive set method.
javax.jms.MapMessage.getObject(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the Java object
the Java object value with the given name, in objectified format (i.e. if it set as an int, then a Integer is returned). If there is no item by this name, a null value is returned.
JMSException
- if JMS fails to read message due to some internal JMS error.
public short getShort(java.lang.String name)
Return the short value with the given name.
javax.jms.MapMessage.getShort(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the short
the short value with the given name.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageFormatException
- if this type conversion is invalid.
public java.lang.String getString(java.lang.String name)
Set a String value with the given name, into the Map.
javax.jms.MapMessage.getString(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the String
value
- the String value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public boolean itemExists(java.lang.String name)
Check if an item exists in this MapMessage.
javax.jms.MapMessage.itemExists(java.lang.String) in interface javax.jms.MapMessage
name
- the name of the item to test
true if the item does exist.
JMSException
- if a JMS error occurs.
public void setBoolean(java.lang.String name, boolean value)
Set a boolean value with the given name, into the Map.
javax.jms.MapMessage.setBoolean(java.lang.String, boolean) in interface javax.jms.MapMessage
name
- the name of the boolean
value
- the boolean value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setByte(java.lang.String name, byte value)
Set a byte value with the given name, into the Map.
javax.jms.MapMessage.setByte(java.lang.String, byte) in interface javax.jms.MapMessage
name
- the name of the byte
value
- the byte value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setBytes(java.lang.String name, byte[] value)
Set a byte array value with the given name, into the Map.
javax.jms.MapMessage.setBytes(java.lang.String, byte[]) in interface javax.jms.MapMessage
name
- the name of the byte array
value
- the byte array value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setBytes(java.lang.String name, byte[] value, int offset, int length)
Set a portion of the byte array value with the given name, into the Map.
javax.jms.MapMessage.setBytes(java.lang.String, byte[], int, int) in interface javax.jms.MapMessage
name
- the name of the byte array
value
- the byte array value to set in the Map.
offset
- the initial offset within the byte array.
length
- the number of bytes to use.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setChar(java.lang.String name, char value)
Set a Unicode character value with the given name, into the Map.
javax.jms.MapMessage.setChar(java.lang.String, char) in interface javax.jms.MapMessage
name
- the name of the Unicode character
value
- the Unicode character value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setDouble(java.lang.String name, double value)
Set a double value with the given name, into the Map.
javax.jms.MapMessage.setDouble(java.lang.String, double) in interface javax.jms.MapMessage
name
- the name of the double
value
- the double value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setFloat(java.lang.String name, float value)
Set a float value with the given name, into the Map.
javax.jms.MapMessage.setFloat(java.lang.String, float) in interface javax.jms.MapMessage
name
- the name of the float
value
- the float value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setInt(java.lang.String name, int value)
Set an integer value with the given name, into the Map.
javax.jms.MapMessage.setInt(java.lang.String, int) in interface javax.jms.MapMessage
name
- the name of the integer
value
- the integer value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setLong(java.lang.String name, long value)
Set a long value with the given name, into the Map.
javax.jms.MapMessage.setLong(java.lang.String, long) in interface javax.jms.MapMessage
name
- the name of the long
value
- the long value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setObject(java.lang.String name, java.lang.Object value)
Set a Java object value with the given name, into the Map.
Note that this method only works for the objectified primitive object types (Integer, Double, Long ...), String's and byte arrays.
javax.jms.MapMessage.setObject(java.lang.String, java.lang.Object) in interface javax.jms.MapMessage
name
- the name of the Java object
value
- the Java object value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageFormatException
- if object is invalid
MessageNotWriteableException
- if message in read-only mode.
public void setShort(java.lang.String name, short value)
Set a short value with the given name, into the Map.
javax.jms.MapMessage.setShort(java.lang.String, short) in interface javax.jms.MapMessage
name
- the name of the short
value
- the short value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public void setString(java.lang.String name, java.lang.String value)
Set a String value with the given name, into the Map.
javax.jms.MapMessage.setString(java.lang.String, java.lang.String) in interface javax.jms.MapMessage
name
- the name of the String
value
- the String value to set in the Map.
JMSException
- if JMS fails to write message due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
public class AQjmsMessage extends java.lang.Object implements javax.jms.Message java.lang.Object | +--oracle.jms.AQjmsMessage
AQjmsAdtMessage, AQjmsBytesMessage, AQjmsMapMessage, AQjmsObjectMessage, AQjmsStreamMessage, AQjmsTextMessage
javax.jms.Message
This class implements the Message interface. This is the superclass of all JMS messages
public void acknowledge()
Used to acknowlege message receipt when using the CLIENT_ACKNOWLEDGE mode.
javax.jms.Message.acknowledge() in interface javax.jms.Message
JMSException
- if internal exceptions occur during message acknowledge.
public void clearBody()
Clear out the message body. All other parts of the message are left untouched.
javax.jms.Message.clearBody() in interface javax.jms.Message
JMSException
- if JMS fails to clear message
public void clearProperties()
Clear a message's properties.
javax.jms.Message.clearProperties() in interface javax.jms.Message
JMSException
- if JMS fails to clear JMS message properties due to some internal JMS error.
public boolean getBooleanProperty(java.lang.String name)
Return the boolean property value with the given name.
javax.jms.Message.getBooleanProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the boolean property
the boolean property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public byte getByteProperty(java.lang.String name)
Return the byte property value with the given name.
javax.jms.Message.getByteProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the byte property
the byte property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public double getDoubleProperty(java.lang.String name)
Return the double property value with the given name.
javax.jms.Message.getDoubleProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the double property
the double property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public float getFloatProperty(java.lang.String name)
Return the float property value with the given name.
javax.jms.Message.getFloatProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the float property
the float property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public int getIntProperty(java.lang.String name)
Return the integer property value with the given name.
javax.jms.Message.getIntProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the integer property
the integer property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public java.lang.String getJMSCorrelationID()
Get the correlation ID for the message.
javax.jms.Message.getJMSCorrelationID() in interface javax.jms.Message
the correlation ID of a message as a String.
JMSException
- if JMS fails to get correlationId due to some internal JMS error.
public byte[] getJMSCorrelationIDAsBytes()
Get the correlation ID as an array of bytes for the message.
javax.jms.Message.getJMSCorrelationIDAsBytes() in interface javax.jms.Message
the correlation ID of a message as an array of bytes.
JMSException
- if JMS fails to get correlationId due to some internal JMS error.
public int getJMSDeliveryMode()
Get the delivery mode for this message.
javax.jms.Message.getJMSDeliveryMode() in interface javax.jms.Message.
The delivery mode of this message, which is either DeliverMode.PERSISTENT or DeliveryMode.NON_PERSISTENT.
JMSException
- if JMS fails to get JMS DeliveryMode due to some internal JMS error.
public javax.jms.Destination getJMSDestination()
Get the destination for this message. The destination field contains the destination to which the message is being sent. When a message is sent this value is ignored. After completion of the send method it holds the destination specified by the send. When a message is received, its destination value must be equivalent to the value assigned when it was sent.
javax.jms.Message.getJMSDestination() in interface javax.jms.Message
the destination of this message.
JMSException
- if JMS fails to get JMS Destination due to some internal JMS error.
public long getJMSExpiration()
Get the message's expiration value. When a message is sent, expiration is left unassigned. After completion of the send method, it holds the expiration time of the message. This is the sum of the time-to-live value specified by the client and the GMT at the time of the send. If the time-to-live is specified as zero, expiration is set to zero which indicates the message does not expire. When a message's expiration time is reached, the message is moved to the exception queue corresponding to the destination queue/topic
javax.jms.Message.getJMSExpiration() in interface javax.jms.Message
the time the message expires. It is the sum of the time-to-live value specified by the client, and the GMT at the time of the send.
JMSException
- if JMS fails to get JMS message expiration due to some internal JMS error.
javax.jms.Message#setJMSExpiration()
public java.lang.String getJMSMessageID()
Get the message ID. The messageID header field contains a value that uniquely identifies each message sent by a provider. When the send method Returnsit contains a provider-assigned value. All JMSMessageID string values start with the prefix `ID:'
javax.jms.Message.getJMSMessageID() in interface javax.jms.Message
the message ID as a string (prefixed with 'ID:')
JMSException
- if JMS fails to get the message Id due to internal JMS error.
public byte[] getJMSMessageIDAsBytes()
Get the message ID.
the message ID as a byte array
JMSException
- if JMS fails to get the message Id due to internal JMS error.
public int getJMSPriority()
Get the message priority. JMS defines a ten level priority value with 0 as the lowest priority and 9 as the highest.
javax.jms.Message.getJMSPriority() in interface javax.jms.Message
the default message priority
public boolean getJMSRedelivered()
Get an indication of whether this message is being redelivered.
If a client receives a message with the redelivered indicator set, it is likely, but not guaranteed, that this message was delivered to the client earlier but the client did not commit the transaction
javax.jms.Message.getJMSRedelivered() in interface javax.jms.Message
set to true if this message is being redelivered.
JMSException
- if JMS fails to get JMS Redelivered flag due to some internal JMS error.
public javax.jms.Destination getJMSReplyTo()
Get the replyTo field for this message
javax.jms.Message.getJMSReplyTo() in interface javax.jms.Message
replyTo destination (the format is a AQjmsAgent)
public long getJMSTimestamp()
Get the message timestamp. The JMSTimestamp header field contains the time a message was handed off to a provider to be sent. When a message is sent, JMSTimestamp is ignored. When the send is complete - this method will contain the time the message was enqueued.
javax.jms.Message.getJMSTimestamp() in interface javax.jms.Message
JMSException
- if JMS fails to get the Timestamp
public java.lang.String getJMSType()
Get the message type.
javax.jms.Message.getJMSType() in interface javax.jms.Message
the message type
JMSException
- if JMS fails to get JMS message type due to some internal JMS error.
public long getLongProperty(java.lang.String name)
Return the long property value with the given name.
javax.jms.Message.getLongProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the long property
the long property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public java.lang.Object getObjectProperty(java.lang.String name)
Return the Java object property value with the given name. Note that this method can be used to return in objectified format, an object that had been stored as a property in the Message with the equivalent setObject
method call, or it's equivalent primitive set method.
javax.jms.Message.getObjectProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the Java object property
the Java object property value with the given name, in objectified format (i.e. if it set as an int, then a Integer is returned). If there is no property by this name, a null value is returned.
JMSException
- if JMS fails to get Property due to some internal JMS error.
public synchronized java.util.Enumeration getPropertyNames()
Return an Enumeration of all the property names.
javax.jms.Message.getPropertyNames() in interface javax.jms.Message
an enumeration of all the names of property values.
JMSException
- if JMS fails to get Property names due to some internal JMS error.
public AQjmsAgent getSenderID()
Get the message's senderID. This value is available only if it was set by the sender before sending the message
JMSException
- if JMS fails to get SenderID
public short getShortProperty(java.lang.String name)
Return the short property value with the given name.
javax.jms.Message.getShortProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the short property
the short property value with the given name.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public java.lang.String getStringProperty(java.lang.String name)
Return the String property value with the given name.
javax.jms.Message.getStringProperty(java.lang.String) in interface javax.jms.Message
name
- the name of the String property
the String property value with the given name. If there is no property by this name, a null value is returned.
JMSException
- if JMS fails to get Property
MessageFormatException
- if this type conversion is invalid.
public boolean propertyExists(java.lang.String name)
Check if a property value exists.
javax.jms.Message.propertyExists(java.lang.String) in interface javax.jms.Message
name
- the name of the property to test
true if the property does exist.
JMSException
- if JMS fails to check if property exists due to some internal JMS error.
public void setBooleanProperty(java.lang.String name, boolean value)
Set a boolean property value with the given name, into the Message.
javax.jms.Message.setBooleanProperty(java.lang.String, boolean) in interface javax.jms.Message
name
- the name of the boolean property
value
- the boolean property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setByteProperty(java.lang.String name, byte value)
Set a byte property value with the given name, into the Message.
javax.jms.Message.setByteProperty(java.lang.String, byte) in interface javax.jms.Message
name
- the name of the byte property
value
- the byte property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setDoubleProperty(java.lang.String name, double value)
Set a double property value with the given name, into the Message.
javax.jms.Message.setDoubleProperty(java.lang.String, double) in interface javax.jms.Message
name
- the name of the double property
value
- the double property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setFloatProperty(java.lang.String name, float value)
Set a float property value with the given name, into the Message.
javax.jms.Message.setFloatProperty(java.lang.String, float) in interface javax.jms.Message
name
- the name of the float property
value
- the float property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setIntProperty(java.lang.String name, int value)
Set an integer property value with the given name, into the Message.
javax.jms.Message.setIntProperty(java.lang.String, int) in interface javax.jms.Message
name
- the name of the integer property
value
- the integer property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setJMSCorrelationID(java.lang.String correlationID)
Set the correlation ID for the message. A client can use the JMSCorrelationID header field to link one message with another.
javax.jms.Message.setJMSCorrelationID(java.lang.String) in interface javax.jms.Message
correlationID
- the message ID of a message being referred to.
JMSException
- if JMS fails to set correlationId due to some internal JMS error.
public void setJMSCorrelationIDAsBytes(byte[] correlationID)
Set the correlation ID as an array of bytes for the message.
javax.jms.Message.setJMSCorrelationIDAsBytes(byte[]) in interface javax.jms.Message
correlationID
- the correlation ID value as an array of bytes.
JMSException
- if JMS fails to set correlationId due to some internal JMS error.
public void setJMSDeliveryMode(int deliveryMode)
Used to set the delivery mode for the current mode. The delivery mode could be either PERSISTENT or NON_PERSISTENT.
javax.jms.Message.setJMSDeliveryMode(java.lang.int) in interface javax.jms.Message
public void setJMSDestination(javax.jms.Destination destination)
Set the destination for this message. Providers set this field when a message is sent.
javax.jms.Message.setJMSDestination(javax.jms.Destination) in interface javax.jms.Message
destination
- the destination for this message.
JMSException
- if JMS fails to set JMS Destination due to some internal JMS error.
public void setJMSExpiration(long expiration)
Set the message's expiration value Providers set this field when a message is sent.
javax.jms.Message.setJMSExpiration(long) in interface javax.jms.Message
expiration
- the message's expiration time
JMSException
- if JMS fails to set JMS message expiration due to some internal JMS error.
public void setJMSMessageID(java.lang.String id)
Set the message ID. Providers set this field when a message is sent.
javax.jms.Message.setJMSMessageID(java.lang.String) in interface javax.jms.Message
id
- the ID of the message
JMSException
- if JMS fails to set the message Id due to internal JMS error.
public void setJMSPriority(int priority)
Set the priority for this message. Providers set this field when a message is sent.
javax.jms.Message.setJMSPriority(int) in interface javax.jms.Message
priority
- the priority of this message
JMSException
- if JMS fails to set JMS message priority due to some internal JMS error.
public void setJMSRedelivered(boolean redelivered)
Set to indicate whether this message is being redelivered. This field is set at the time the message is delivered.
javax.jms.Message.setJMSRedelivered(boolean) in interface javax.jms.Message
redelivered
- an indication of whether this message is being redelivered.
JMSException
- if JMS fails to set JMS Redelivered flag due to some internal JMS error.
public void setJMSReplyTo(javax.jms.Destination replyTo)
Set where a reply to this message should be sent.
javax.jms.Message.setJMSReplyTo(javax.jms.Destination) in interface javax.jms.Message
replyTo
- where to send a response to this message. The destination must be specified as an AQjmsAgent (with consumer_name and queue/topic address)
JMSException
- if JMS fails to set ReplyTo Destination due to some internal JMS error.
public void setJMSTimestamp(long timestamp)
Set the message timestamp. Providers set this field when a message is sent.
javax.jms.Message.setJMSTimestamp(long) in interface javax.jms.Message
timestamp
- the timestamp for this message
JMSException
- if JMS fails to set the timestamp due to some internal JMS error.
public void setJMSType(java.lang.String type)
Set the message type.
javax.jms.Message.setJMSType(java.lang.String) in interface javax.jms.Message
type
- of the message
JMSException
- if JMS fails to set JMS message type due to some internal JMS error.
public void setLongProperty(java.lang.String name, long value)
Set a long property value with the given name, into the Message.
javax.jms.Message.setLongProperty(java.lang.String, long) in interface javax.jms.Message
name
- the name of the long property
value
- the long property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setObjectProperty(java.lang.String name, java.lang.Object value)
Set a Java object property value with the given name, into the Message. Note that this method only works for the objectified primitive object types (Integer, Double, Long ...) and String's.
javax.jms.Message.setObjectProperty(java.lang.String, java.lang.Object) in interface javax.jms.Message
name
- the name of the Java object property.
value
- the Java object property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageFormatException
- if object is invalid
MessageNotWriteableException
- if properties are read-only
public void setSenderID(AQjmsAgent sender)
Set the message's senderID.
JMSException
- if JMS fails to set SenderID
public void setShortProperty(java.lang.String name, short value)
Set a short property value with the given name, into the Message.
javax.jms.Message.setShortProperty(java.lang.String, short) in interface javax.jms.Message
name
- the name of the short property
value
- the short property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public void setStringProperty(java.lang.String name, java.lang.String value)
Set a String property value with the given name, into the Message.
javax.jms.Message.setStringProperty(java.lang.String, java.lang.String) in interface javax.jms.Message
name
- the name of the String property
value
- the String property value to set in the Message.
JMSException
- if JMS fails to set Property
MessageNotWriteableException
- if properties are read-only
public class AQjmsMessageEOFException extends javax.jms.MessageEOFException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.MessageEOFException | +--oracle.jms.AQjmsMessageEOFException
java.io.Serializable
This exception extends MessageEOFException. It is thrown when an unexpected end of stream has been reached when a StreamMessage or BytesMessage is being read
public class AQjmsMessageFormatException extends javax.jms.MessageFormatException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.MessageFormatException | +--oracle.jms.AQjmsMessageFormatException
java.io.Serializable
This exception extends MessageFormatException. It is thrown when a client attempts to use a datatype not supported by a message or attempts to read data in the message as the wrong type
public class AQjmsMessageNotReadableException extends javax.jms.MessageNotReadableException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.MessageNotReadableException | +--oracle.jms.AQjmsMessageNotReadableException
java.io.Serializable
This exception extends MessageNotReadableException. It is thrown when a client attempts to read a write-only message
public class AQjmsMessageNotWriteableException extends javax.jms.MessageNotWriteableException java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.MessageNotWriteableException | +--oracle.jms.AQjmsMessageNotWriteableException
java.io.Serializable
This exception extends MessageNotWriteableException. It is thrown when a client attempts to write a read-only message
public class AQjmsObjectMessage extends AQjmsMessage implements javax.jms.ObjectMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsObjectMessage
javax.jms.Message, javax.jms.ObjectMessage
This class implements the ObjectMessage interface. An ObjectMessage is used to send a message that contains a serializable java object
public void clearBody()
Clear out the message body. All other parts of the message are left untouched.
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
JMSException
- if JMS fails to due to some internal JMS error.
public void clearProperties()
Clear a message's properties.
javax.jms.Message.clearProperties() in interface javax.jms.Message
clearProperties() in class AQjmsMessage
JMSException
- if JMS fails to clear JMS message properties due to some internal JMS error.
public java.io.Serializable getObject()
Get the serializable object containing this message's data. The default value is null.
javax.jms.ObjectMessage.getObject() in interface javax.jms.ObjectMessage
the serializable object containing this message's data
JMSException
- if JMS fails to get object due to some internal JMS error.
MessageFormatException
- if object deserialization fails
public void setObject(java.io.Serializable object)
Set the serializable object containing this message's data.
javax.jms.ObjectMessage.setObject(java.io.Serializable) in interface javax.jms.ObjectMessage
object
- the message's data
JMSException
- if JMS fails to set object due to some internal JMS error.
MessageFormatException
- if object serialization fails
MessageNotWriteableException
- if message in read-only mode.
public class AQjmsOracleDebug extends java.lang.Object java.lang.Object | +--oracle.jms.AQjmsOracleDebug
AQ Oracle Debug class - Do not use unless instructed by Oracle Support
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public static java.io.OutputStream getLogStream()
Get log stream
public static void setLogStream(java.io.OutputStream output_stream)
Set log stream
output
- log stream
public static void setTraceLevel(int level)
Set trace level 0 - no tracing (default) 1 - fatal errors 2 - other errors, imp messages 3 - exception trace, other trace info 4 - method entry/exit 5 - print stack traces, variables
public class AQjmsProducer extends java.lang.Object implements AQjmsQueueSender, AQjmsTopicPublisher java.lang.Object | +--oracle.jms.AQjmsProducer
AQjmsQueueSender, AQjmsTopicPublisher, javax.jms.MessageProducer, javax.jms.QueueSender, javax.jms.TopicPublisher
This class implements the MessageProducer interface. A MessageProducer is used to send messages to a Destination
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public void close()
Since a provider may allocate some resources on behalf of a MessageProducer outside the JVM, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
javax.jms.MessageProducer.close() in interface javax.jms.MessageProducer
JMSException
- if JMS fails to close the producer due to some error.
public synchronized int getDeliveryMode()
Get the producer's default delivery mode.
javax.jms.MessageProducer.getDeliveryMode() in interface javax.jms.MessageProducer
the message delivery mode for this message producer.
JMSException
- if JMS fails to get delivery mode due to some internal error.
public synchronized boolean getDisableMessageID()
Get an indication of whether message IDs are disabled.
javax.jms.MessageProducer.getDisableMessageID() in interface javax.jms.MessageProducer
an indication of whether message IDs are disabled.
JMSException
- if JMS fails to get disabled message Id due to some internal error.
public synchronized boolean getDisableMessageTimestamp()
Get an indication of whether message timestamps are disabled.
javax.jms.MessageProducer.getDisableMessageTimestamp() in interface javax.jms.MessageProducer
an indication of whether message IDs are disabled.
JMSException
- if JMS fails to get disabled message timestamp due to some internal error.
public synchronized int getPriority()
Get the producer's default priority.
javax.jms.MessageProducer.getPriority() in interface javax.jms.MessageProducer
the message priority for this message producer.
JMSException
- if JMS fails to get priority due to some internal error.
public synchronized javax.jms.Queue getQueue()
Get the queue associated with this queue sender.
javax.jms.QueueSender.getQueue() in interface javax.jms.QueueSender
the queue
JMSException
- if JMS fails to get queue for this queue sender due to some internal error.
public synchronized int getTimeToLive()
Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
javax.jms.MessageProducer.getTimeToLive() in interface javax.jms.MessageProducer
the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to get Time to Live due to some internal error.
public synchronized javax.jms.Topic getTopic()
Get the topic associated with this publisher.
javax.jms.TopicPublisher.getTopic() in interface javax.jms.TopicPublisher
this publisher's topic
JMSException
- if JMS fails to get topic for this topic publisher due to some internal error.
public synchronized void publish(javax.jms.Message message)
Publish a Message to the topic
javax.jms.TopicPublisher.publish(javax.jms.Message) in interface javax.jms.TopicPublisher
message
- The message to be published
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Message message, AQjmsAgent recipient_list)
Publish a Message to a specific list of recipients
publish(Message, AQjmsAgent[]) in interface AQjmsTopicPublisher
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Message message, AQjmsAgent recipient_list, int deliveryMode, int priority, long timeToLive)
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
publish(Message, AQjmsAgent[], int, int, long) in interface AQjmsTopicPublisher
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode
- The delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
Publish a Message to the topic specifying delivery mode, priority and time to live to the topic.
javax.jms.TopicPublisher.publish(javax.jms.Message, int, int, long) in interface javax.jms.TopicPublisher
message
- The message to be published
deliveryMode
- The message delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Topic topic, javax.jms.Message message)
Publish a Message to a topic for an unidentified message producer. Use the producer's default delivery mode, timeToLive and priority.
javax.jms.TopicPublisher.publish(javax.jms.Topic, javax.jms.Message) in interface javax.jms.TopicPublisher
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Topic topic, javax.jms.Message message, AQjmsAgent recipient_list)
Publish a Message to a topic by specifying a list of recipients
publish(Topic, Message, AQjmsAgent[]) in interface AQjmsTopicPublisher
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Topic topic, javax.jms.Message message, AQjmsAgent recipient_list, int deliveryMode, int priority, long timeToLive)
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
publish(Topic, Message, AQjmsAgent[], int, int, long) in interface AQjmsTopicPublisher
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode
- The delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void publish(javax.jms.Topic topic, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
Publish a Message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
javax.jms.TopicPublisher.publish(javax.jms.Topic, javax.jms.Message, int, int, long) in interface javax.jms.TopicPublisher
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
deliveryMode
- The message delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public synchronized void send(javax.jms.Message message)
Send a message
javax.jms.QueueSender.send(javax.jms.Message) in interface javax.jms.QueueSender
message
- The message that has to be sent
JMSException
- if JMS fails to send the message due to some internal error.
public synchronized void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
Send a message.
javax.jms.QueueSender.send(javax.jms.Message, int, int, long) in interface javax.jms.QueueSender
message
- The message that has to be sent
deliverMode
- The message delivery mode - persistent or non_persistent
JMSException
- if JMS fails to send the message due to some internal error.
public synchronized void send(javax.jms.Queue queue, javax.jms.Message message)
Send a message.
javax.jms.QueueSender.send(javax.jms.Queue, javax.jms.Message) in interface javax.jms.QueueSender
queue
- The destination queue where the message has to be sent. This overrides the default queue of the Message Producer.
message
- The message that has to be sent
JMSException
- if JMS fails to send the message due to some internal error.
public synchronized void send(javax.jms.Queue queue, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
Send a message.
javax.jms.QueueSender.send(javax.jms.Queue, javax.jms.Message, int, int, long) in interface javax.jms.QueueSender
queue
- The destination queue where the message has to be sent. This overrides the default queue of the Message Producer.
message
- The message that has to be sent
deliveryMode
- The message delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to send the message due to some internal error.
public synchronized void setDeliveryMode(int deliveryMode)
Set the producer's default delivery mode.
Delivery mode is set to PERSISTENT by default.
javax.jms.MessageProducer.setDeliveryMode(int) in interface javax.jms.MessageProducer
deliveryMode
- the message delivery mode for this message producer.
JMSException
- if JMS fails to set delivery mode due to some internal error.
public synchronized void setDisableMessageID(boolean value)
Set whether message IDs are disabled.
Since message ID's take some effort to create and increase a message's size, some JMS providers may be able to optimize message overhead if they are given a hint that message ID is not used by an application. JMS message Producers provide a hint to disable message ID. When a client sets a Producer to disable message ID they are saying that they do not depend on the value of message ID for the messages it produces. These messages must either have message ID set to null or, if the hint is ignored, messageID must be set to its normal unique value.
Message IDs are enabled by default.
javax.jms.MessageProducer.setDisableMessageID(boolean) in interface javax.jms.MessageProducer
value
- indicates if message IDs are disabled.
JMSException
- if JMS fails to set disabled message Id due to some internal error.
public synchronized void setDisableMessageTimestamp(boolean value)
Set whether message timestamps are disabled.
javax.jms.MessageProducer.setDisableMessageTimestamp(boolean) in interface javax.jms.MessageProducer
value
- indicates if message timestamps are disabled.
JMSException
- if JMS fails to set disabled message timestamp due to some internal error.
public synchronized void setPriority(int priority)
Set the producer's default priority.
Priority is set to 4, by default.
javax.jms.MessageProducer.setPriority(int) in interface javax.jms.MessageProducer
priority
- the message priority for this message producer.
JMSException
- if JMS fails to set priority due to some internal error.
public synchronized void setTimeToLive(int timeToLive)
Set the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
Time to live is set to zero by default.
javax.jms.MessageProducer.setTimeToLive(int) in interface javax.jms.MessageProducer
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to set Time to Live due to some internal error.
public class AQjmsQueueBrowser extends java.lang.Object implements javax.jms.QueueBrowser, java.util.Enumeration java.lang.Object | +--oracle.jms.AQjmsQueueBrowser
java.util.Enumeration, javax.jms.QueueBrowser
This class implements the QueueBrowser interface. A QueueBrowser is used to look at messages in a Queue without removing them
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public void close()
Since a provider may allocate some resources on behalf of a QueueBrowser outside the JVM, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
javax.jms.QueueBrowser.close() in interface javax.jms.QueueBrowser
public java.util.Enumeration getEnumeration()
Get an enumeration for browsing the current queue messages in the order they would be received.
javax.jms.QueueBrowser.getEnumeration() in interface javax.jms.QueueBrowser
an enumeration for browsing the messages
JMSException
- if JMS fails to get the enumeration for this browser due to some JMS error.
public java.lang.String getMessageSelector()
Get this queue browser's message selector expression.
javax.jms.QueueBrowser.getMessageSelector() in interface javax.jms.QueueBrowser
this queue browser's message selector
JMSException
- if JMS fails to get message selector due to some JMS error
public javax.jms.Queue getQueue()
Get the queue associated with this queue browser.
javax.jms.QueueBrowser.getQueue() in interface javax.jms.QueueBrowser
the queue
JMSException
- if JMS fails to get the queue associated with this Browser due to some JMS error.
public String getTransformation()
Get the transformation for this browser
the transformation
JMSException
- if there was an error in getting the transformation
public boolean hasMoreElements()
Tests if this enumeration contains more elements.
java.util.Enumeration.hasMoreElements() in interface java.util.Enumeration
true if more elements exist in the enumeration false otherwise.
public java.lang.Object nextElement()
Returnsthe next element of this enumeration.
java.util.Enumeration.nextElement() in interface java.util.Enumeration
the next element of this enumeration
NoSuchElementException
- if no more elements exist.
public void setTransformation(String transformation)
Set transformation for this browser. This transformation will be applied before the message is returned to the user.
transformation
- transformation to be applied before returning the message
JMSException
- if there was an error in setting the transformation
public class AQjmsQueueConnectionFactory extends java.lang.Object implements javax.jms.QueueConnectionFactory java.lang.Object | +--oracle.jms.AQjmsQueueConnectionFactory
javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, java.lang.Referenceable, java.lang.Serializable
This class implements the QueueConnectionFactory interface. A QueueConnectionFactory is used to create QueueConnections
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public javax.jms.QueueConnection createQueueConnection()
create a Queue Connection to the JMS Server hosting this Queue- ConnectionFactory.
javax.jms.QueueConnectionFactory.createQueueConnection() in interface javax.jms.QueueConnectionFactory
a Queue Connection
JMSException
- if JMS fails to get a queue connection due to some JMS error
public static javax.jms.QueueConnection createQueueConnection(java.sql.Connection jdbc_connection)
create a Queue Connection using the already open JDBC connection. This creation does NOT result in creation of another connection to the database. Instead JMS binds to the given connection to the database and provides an interface to the Queuing mechanism defined by JMS.
jdbc_connection
- a valid open connection to the database.
a Queue Connection
JMSException
- if JMS fails to get a queue connection due to some JMS error
public javax.jms.QueueConnection createQueueConnection(java.lang.String username, java.lang.String password)
create a Queue Connection using the given username and password for authentication during creation of the Connection.
javax.jms.QueueConnectionFactory.createQueueConnection(java.lang.String, java.lang.String) in interface javax.jms.QueueConnectionFactory
username
- name of the user connecting to the DB for Queueing. password password for the creating the connection to server.
a Queue Connection
JMSException
- if JMS fails to get a queue connection due to some JMS error
public interface AQjmsQueueReceiver extends javax.jms.QueueReceiver
javax.jms.MessageConsumer, javax.jms.QueueReceiver
AQjmsConsumer
This interface extends javax.jms.QueueReceiver and defines AQ extensions to JMS. A client uses a QueueReceiver for receiving messages that have been delivered to a Queue
public int getNavigationMode()
get the navigation mode used for receiving messages
the navigation mode
JMSException
- if there was an error in getting the navigation mode
public String getTransformation()
Get the transformation for this receiver
the transformation
JMSException
- if there was an error in getting the transformation
public void receiveNoData()
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser.
JMSException
- if the message could not be received due to an error
public void receiveNoData(long timeout)
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser. This call will block until a message arrives or the timeout expires
timeout
- the timeout value in milliseconds
JMSException
- if the message could not be received due to an error
public void setNavigationMode(int mode)
set the navigation mode used for receiving messages
mode
- the new value of the navigation mode
JMSException
- if there was an error in getting the navigation mode
public void setTransformation(String transformation)
Set transformation for this receiver. This transformation will be applied before the message is returned to the user.
transformation
- transformation to be applied before returning the message
JMSException
- if there was an error in setting the transformation
public interface AQjmsQueueSender extends javax.jms.QueueSender
javax.jms.MessageProducer, javax.jms.QueueSender
AQjmsProducer
This interface extends QueueSender and defines AQ extensions to JMS. A client uses a QueueSender to send messages to a Queue
Member Summary | Description |
---|---|
Methods |
- |
get the transformation for this sender |
|
set the transformation for this sender |
public String getTransformation()
Get the transformation for this sender
the transformation
JMSException
- if there was an error in getting the transformation
public void setTransformation(String transformation)
Set transformation for this sender. This transformation will be applied before the message is inserted in the queue
transformation
- transformation to be applied before sending the message
JMSException
- if there was an error in setting the transformation
public class AQjmsSession extends java.lang.Object implements javax.jms.QueueSession, javax.jms.TopicSession java.lang.Object | +--oracle.jms.AQjmsSession
javax.jms.QueueSession, java.lang.Runnable, javax.jms.Session, javax.jms.TopicSession
This class implements the javax.jms.Session interface. A JMS Session is a single threaded context for producing and consuming messages.
Member Summary | Description |
---|---|
Methods |
- |
Close a JMS session Since a provider may allocate some resources on behalf of a Session outside the JVM, clients should close them when they are not needed. |
|
Commit all messages done in this transaction and releases any locks currently held. |
|
Create an AdtMessage. |
|
Create an initialized AdtMessage. |
|
Create a QueueBrowser to peek at the messages on the specified queue. |
|
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. |
|
Create a QueueBrowser to peek at the messages on the specified queue. |
|
Create a QueueBrowser to peek at the messages on the specified queue. |
|
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. |
|
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. |
|
Create a BytesMessage. |
|
Create a durable Subscriber to the specified topic. |
|
Create a durable Subscriber to the specified topic. |
|
Create a durable Subscriber to the specified topic. |
|
|
Create a durable Subscriber to the specified topic. Specify transformation for the subscriber |
|
Create a durable Subscriber to the specified Oracle Object (ADT) topic. |
|
Create a durable Subscriber to the specified Oracle Object (ADT) topic. Specify transformation for the subscriber |
Create a MapMessage. |
|
Create an ObjectMessage. |
|
Create an initialized ObjectMessage. |
|
Create a Publisher for the specified topic. |
|
Create a queue. |
|
Create a Queue Table. |
|
Create a QueueReceiver to receive messages from the specified queue. |
|
Create a QueueReceiver to receive messages from the specified queue containing ADT messages. |
|
Create a QueueReceiver to receive messages from the specified queue. |
|
Create a QueueReceiver to receive messages from the specified queue containing ADT messages. |
|
Create a remote subscriber for a topic. |
|
Create a remote subscriber for a topic. Specify transformation for the remote subscriber |
|
|
Create a remote subscriber for a topic. |
|
Create a remote subscriber for a Oracle Object (ADT) topic. Specify transformation for the remote subscriber |
|
Create a QueueSender to send messages to the specified queue. |
Create a StreamMessage. |
|
Create a non-durable Subscriber to the specified topic. |
|
Create a non-durable Subscriber to the specified topic. |
|
Create a TextMessage. |
|
Create an initialized TextMessage. |
|
Create a topic |
|
Create a TopicReceiver to receive messages from the specified topic. |
|
|
|
Return the session's distinguished message listener. |
|
Get an existing queue. |
|
Get a handle to an existing queue-table If owner of queue-table is not the same as the user which opened the connection, the caller must have AQ enqueue/dequeue privileges on queues/topics in the queue table. |
|
Get an existing topic. |
|
Checks if the session in transacted mode? |
|
Grant AQ system privileges to users/roles. |
|
Revoke AQ system privilege from user/roles |
|
Rollback any messages done in this transaction and releases any locks currently held. |
|
Set the session's distinguished message listener. |
|
Unsubscribe a remote durable subscription that has been created by a client on the specified topic |
|
Unsubscribe a durable subscription that has been created by a client on the specified topic |
public void close()
Close a JMS session Since a provider may allocate some resources on behalf of a Session outside the JVM, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough. This call may take a couple of minutes if there are receivers blocked on a receive call with infinite timeout
javax.jms.Session.close() in interface javax.jms.Session
javax.jms.Session.close() in interface javax.jms.Session
JMSException
- if JMS implementation fails to close a Session due to some internal error.
public synchronized void commit()
Commit all messages done in this transaction and releases any locks currently held.
javax.jms.Session.commit() in interface javax.jms.Session
JMSException
- if JMS implementation fails to commit the transaction due to some internal error. The linked SQL exception has more info about the error
public synchronized AdtMessage createAdtMessage()
Create an AdtMessage. An AdtMessage is used to send a message that containing an Java object that maps to a Oracle SQL ADT. This object must support the OracleCustomDatum interface.
JMSException
- if some error occurs during message creation
public synchronized AQjmsAdtMessage createAdtMessage(oracle.sql.CustomDatum payload)
Create an initialized AdtMessage. An AQjmsAdtMessage is used to send a message that containing an Java object that maps to a Oracle SQL ADT. This object must support the OracleCustomDatum interface.
payload
- the object to use to initialize this message.
JMSException
- if some error occurs during message creation
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
Create a QueueBrowser to peek at the messages on the specified queue. This method can be used to create browsers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
javax.jms.QueueSession.createBrowser(javax.jms.Queue) in interface javax.jms.QueueSession
queue
- the queue to access
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, oracle.sql.CustomDatumFactory payload_factory)
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. This method is used to create receivers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
queue
- the queue to access
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector)
Create a QueueBrowser to peek at the messages on the specified queue. This method can be used to create browsers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
javax.jms.QueueSession.createBrowser(javax.jms.Queue, java.lang.String) in interface javax.jms.QueueSession
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered. The selector can be any expression that has a combination of one or more of the following:
JMSMessageID = 'ID:23452345
' to retrieve messages that have a specified message IDJMSPriority < 3 AND JMSCorrelationID = 'Fiction'
color IN ('RED', BLUE', 'GREEN') AND price < 30000
All message IDs must be prefixed with "ID:"
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector, boolean locked)
Create a QueueBrowser to peek at the messages on the specified queue. This method can be used to create browsers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered
The selector can be any expression that has a combination of one or more of the following:
JMSMessageID = 'ID:23452345
' to retrieve messages that have a specified message IDJMSPriority < 3 AND JMSCorrelationID = 'Fiction'
color IN ('RED', BLUE', 'GREEN') AND price < 30000
All message IDs must be prefixed with "ID:"
locked
- if true then messages are locked as they are browsed (similar to a SELECT for UPDATE)
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_factory)
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. This method is used to create browsers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered. For queues containing AdtMessages
the selector for QueueBrowser can be a SQL expression on the message payload contents or messageID or priority or correlationID
.
msgid = '23434556566767676'
Note: in this case message IDs must NOT be prefixed with 'ID:'
priority < 3 AND corrid = 'Fiction'
tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_factory, boolean locked)
Create a QueueBrowser to peek at the messages on the specified queue containing ADT messages. This method is used to create browsers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered. For queues containing AdtMessages
the selector for QueueBrowser can be a SQL expression on the message payload contents or messageID or priority or correlationID
.
msgid = '23434556566767676'
Note: in this case message IDs must NOT be prefixed with 'ID:'
priority < 3 AND corrid = 'Fiction'
tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
locked
- if true then messages are locked as they are browsed (similar to a SELECT for UPDATE)
JMSException
- if a session fails to create a browser due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.BytesMessage createBytesMessage()
Create a BytesMessage. A BytesMessage is used to send a message containing a stream of uninterpreted bytes.
javax.jms.Session.createBytesMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation
public synchronized javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String subs_name)
Create a durable Subscriber to the specified topic. This method can be used to create subscribers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and message selector.
javax.jms.TopicSession.createDurableSubscriber(javax.jms.Topic, java.lang.String) in interface javax.jms.TopicSession
topic
- the topic to subscribe to
name
- the name used to identify this subscription.
JMSException
- if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public synchronized javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String subs_name, oracle.sql.CustomDatumFactory payload_factory)
Create a durable Subscriber to the specified topic. This method is used to create browsers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads) A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and message selector.
topic
- the topic to subscribe to
name
- the name used to identify this subscription.
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
JMSException
- if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public synchronized javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String subs_name, java.lang.String messageSelector, boolean noLocal)
Create a durable Subscriber to the specified topic. This method can be used to create subscribers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and message selector.
javax.jms.TopicSession.createDurableSubscriber(javax.jms.Topic, java.lang.String, java.lang.String, boolean) in interface javax.jms.TopicSession
topic
- the topic to subscribe to
name
- the name used to identify this subscription.
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null.
The selector can contain any SQL92 expression which has a combination of one or more of the following:
a. JMS Message header fields or properties: JMSPriority (int), JMSCorrelationID (string), JMSType (string), JMSXUserID (string), JMSXAppID (string), JMSXGroupID (string) JMSXGroupSeq (int)
Example: JMSPriority < 3 AND JMSCorrelationID = 'Fiction'
b. User defined message properties
Example: color IN ('RED', BLUE', 'GREEN') AND price < 30000
Operators allowed are:
-- logical operators in precedence order NOT, AND, OR
-- comparison operators =, >, >=, <, <=, <>, ! (both <> and ! can be used for not equal)
-- arithmetic operators in precedence order +,- unary, *,/, +,-
-- identifier [NOT] IN (string-literal1, string-literal2, ..)
-- arithmetic-expr1 [NOT] BETWEEN arithmetic-expr2 and arithmetic-expr3
-- identifier [NOT] LIKE pattern-value [ESCAPE escape-character] pattern-value is a string literal where % refers to any sequence of characters and and _ refers to any single character. The optional escape-character is used to escape the special meaning of the '-' and '%' in pattern-value
-- identifier IS [NOT] NULL
noLocal
- - must be set to false. nolocal=true not supported.
JMSException
- if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String subs_name, java.lang.String messageSelector, boolean noLocal, String transformation)
Create a durable Subscriber to the specified topic and specify a transformation for the subscriber
This method can be used to create subscribers for topics that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and message selector.
javax.jms.TopicSession.createDurableSubscriber(javax.jms.Topic, java.lang.String, java.lang.String, boolean) in interface javax.jms.TopicSession
topic
- the topic to subscribe to
name
- the name used to identify this subscription.
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null.
The selector can contain any SQL92 expression which has a combination of one or more of the following:
a. JMS Message header fields or properties: JMSPriority (int), JMSCorrelationID (string), JMSType (string), JMSXUserID (string), JMSXAppID (string), JMSXGroupID (string) JMSXGroupSeq (int)
Example: JMSPriority < 3 AND JMSCorrelationID = 'Fiction'
b. User defined message properties
Example: color IN ('RED', BLUE', 'GREEN') AND price < 30000
Operators allowed are:
-- logical operators in precedence order NOT, AND, OR
-- comparison operators =, >, >=, <, <=, <>, ! (both <> and ! can be used for not equal)
-- arithmetic operators in precedence order +,- unary, *,/, +,-
-- identifier [NOT] IN (string-literal1, string-literal2, ..)
-- arithmetic-expr1 [NOT] BETWEEN arithmetic-expr2 and arithmetic-expr3
-- identifier [NOT] LIKE pattern-value [ESCAPE escape-character] pattern-value is a string literal where % refers to any sequence of characters and and _ refers to any single character. The optional escape-character is used to escape the special meaning of the '-' and '%' in pattern-value
-- identifier IS [NOT] NULL
noLocal
- - must be set to false. nolocal=true not supported.
transformation
- - transformation associated with this subscriber. This transformation is applied before messages are delivered to this subscriber
JMSException
- if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String subs_name, java.lang.String messageSelector, boolean noLocal, oracle.sql.CustomDatumFactory payload_factory, String transformation)
Create a durable Subscriber to the specified topic and specify a transformation for the subscriber.
This method is used to create subsccribers for topics that contain Oracle ADT payloads (instead of the standard JMS defined payloads) A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and message selector.
topic
- the topic to subscribe to
name
- the name used to identify this subscription.
messageSelector
- only messages with attributes matching the message selector expression are delivered. This value may be null.
The syntax for the selector for queues containing ADT messages is different from the syntax for selectors on queues containing standard JMS payloads (text, stream, object, bytes, map) The selector is similar to the AQ rules syntax
a. Selector on priority or correlation is specified as follows. Example: priority < 3 AND corrid = 'Fiction'
b. Selector on message payload is specified as follows. The attribute name must be prefixed with tab.user_data. Example: tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000
noLocal
- must be set to false. nolocal=true not supported
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT messages do not contain any user defined properties.
transformation
- transformation associated with this subscriber. This transformation is applied before messages are delivered to this subscriber
JMSException
- if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public synchronized javax.jms.Message createMessage()
Create a generic header only Message.
javax.jms.Session.createMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation.
public synchronized javax.jms.MapMessage createMapMessage()
Create a MapMessage. A MapMessage is used to send a self-defining set of name-value pairs where names are Strings and values are Java primitive types.
javax.jms.Session.createMapMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation
public synchronized javax.jms.ObjectMessage createObjectMessage()
Create an ObjectMessage. An ObjectMessage is used to send a message that containing a serializable Java object.
javax.jms.Session.createObjectMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation
public synchronized javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object)
Create an initialized ObjectMessage. An ObjectMessage is used to send a message that containing a serializable Java object.
javax.jms.Session.createObjectMessage(java.io.Serializable) in interface javax.jms.Session
object
- the object to use to initialize this message.
JMSException
- if some error occurs during message creation
public synchronized javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
Create a Publisher for the specified topic. A client uses a TopicPublisher for publishing messages on a topic.
javax.jms.TopicSession.createPublisher(javax.jms.Topic) in interface javax.jms.TopicSession
topic
- the topic to publish to, or null if this is an unidentified producer.
JMSException
- if a session fails to create a publisher due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public synchronized javax.jms.Queue createQueue(String)
Create a queue given a Queue name. This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable. Note that this method is not for creating the physical
queue. The physical creation of queues is an administrative task.
The Queue name is of the form "[schema].name". If "schema" is not specified, current session "user", is utilised.
javax.jms.QueueSession.createQueue() in interface javax.jms.QueueSession.
JMSException
- if the queue could not be created
public synchronized javax.jms.Queue createQueue(oracle.jms.AQQueueTable q_table, java.lang.String queue_name, AQjmsDestinationProperty dest_property)
Create a queue.
q_table
- Queue-Table in which the queue is to be created. The queue-table must not be multiconsumer enabled
queue_name
- name of the queue to be created
dest_property
- Queue properties.
JMSException
- if the queue could not be created
public synchronized oracle.jms.AQQueueTable createQueueTable(java.lang.String owner, java.lang.String name, oracle.jms.AQQueueTableProperty property)
Create a Queue Table. A QueueTable holds both queues or topics
owner
- the queue table owner (schema)
name
- queue table name
property
- queue table properties. If the queuetable will be used to hold queues, then the queuetable must not be multiconsumer enabled (default). If the queue table will be used to hold topics the queuetable must be multiconsumer enabled
JMSException
- if the QueueTable cannot be created
oracle.AQ.AQQueueTableProperty
public synchronized javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
Create a QueueReceiver to receive messages from the specified queue. This method can be used to create receivers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
javax.jms.QueueSession.createReceiver(javax.jms.Queue) in interface javax.jms.QueueSession
queue
- the queue to access
JMSException
- if a session fails to create a receiver due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, oracle.sql.CustomDatumFactory payload_factory)
Create a QueueReceiver to receive messages from the specified queue containing ADT messages. This method is used to create receivers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
queue
- the queue to access
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
JMSException
- if a session fails to create a receiver due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, java.lang.String messageSelector)
Create a QueueReceiver to receive messages from the specified queue. This method can be used to create receivers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
javax.jms.QueueSession.createReceiver(javax.jms.Queue, java.lang.String) in interface javax.jms.QueueSession
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered. The selector can be any expression that has a combination of one or more of the following:
JMSMessageID = 'ID:23452345
' to retrieve messages that have a specified message IDJMSPriority < 3 AND JMSCorrelationID = 'Fiction'
color IN ('RED', BLUE', 'GREEN') AND price < 30000
All message IDs must be prefixed with "ID:"
JMSException
- if a session fails to create a receiver due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_ factory)
Create a QueueReceiver to receive messages from the specified queue containing ADT messages. This method is used to create receivers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
queue
- the queue to access
messageSelector
- only messages with properties matching the message selector expression are delivered. For queues containing AdtMessages
the selector for QueueReceiver can be a SQL expression on the message payload contents or messageID or priority or correlationID
.
msgid = '23434556566767676'
Note: in this case message IDs must NOT be prefixed with 'ID:'
priority < 3 AND corrid = 'Fiction'
tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
JMSException
- if a session fails to create a receiver due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized void createRemoteSubscriber(javax.jms.Topic topic, AQjmsAgent remote_subscriber, java.lang.String messageSelector)
Create a remote subscriber for a topic. This method can be used to remote subscribers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE.
AQ allows topics to have remote subscribers, ie subscribers at other topics in the same or different database. In order to use remote subscribers, you must set up propagation between the two local and remote topic.
topic
- the topic to subscribe to
remote_subscriber
- AQjmsAgent that refers to the remote subscriber
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null.
The selector syntax is the same as that for createDurableSubscriber Remote subscribers may be a specific consumer at the remote topic or all subscribers at the remote topic.
A remote subscriber is defined using the AQjmsAgent structure. An AQjmsAgent consists of a name and address. The name refers to the consumer_name at the remote topic. The address refers to the remote topic - the syntax is (schema).(topic_name)[@dblink].
1. To publish messages to a particular consumer at the remote topic, the subscription_name of the recipient at the remote topic must be specified in the name field of AQjmsAgent. The remote topic must be specified in the address field of AQjmsAgent.
2. To publish messages to all subscribers of the remote topic, the name field of AQjmsAgent must be set to null. The remote topic must be specified in the address field of AQjmsAgent.
public synchronized void createRemoteSubscriber(javax.jms.Topic topic, AQjmsAgent remote_subscriber, java.lang.String messageSelector, java.lang.String transformation)
Create a remote subscriber for a topic and specify a transformation for the subscriber. This method can be used to remote subscribers for queues that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE.
AQ allows topics to have remote subscribers, ie subscribers at other topics in the same or different database. In order to use remote subscribers, you must set up propagation between the two local and remote topic.
topic
- the topic to subscribe to
remote_subscriber
- AQjmsAgent that refers to the remote subscriber
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null.
The selector syntax is the same as that for createDurableSubscriber Remote subscribers may be a specific consumer at the remote topic or all subscribers at the remote topic.
tranformation
- the transformation for this subscriber. This transformation will be applied before the message is delivered to this subscriber.
A remote subscriber is defined using the AQjmsAgent structure. An AQjmsAgent consists of a name and address. The name refers to the consumer_name at the remote topic. The address refers to the remote topic - the syntax is (schema).(topic_name)[@dblink].
1. To publish messages to a particular consumer at the remote topic, the subscription_name of the recipient at the remote topic must be specified in the name field of AQjmsAgent. The remote topic must be specified in the address field of AQjmsAgent.
2. To publish messages to all subscribers of the remote topic, the name field of AQjmsAgent must be set to null. The remote topic must be specified in the address field of AQjmsAgent.
public synchronized void createRemoteSubscriber(javax.jms.Topic topic, AQjmsAgent remote_subscriber, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_factory)
Create a remote subscriber for a topic. This method is used to create browsers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads).
AQ allows topics to have remote subscribers, ie subscribers at other topics in the same or different database. In order to use remote subscribers, you must set up propagation between the two local and remote topic.
topic
- the topic to subscribe to
remote_subscriber
- AQjmsAgent that refers to the remote subscriber
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null. The selector syntax is the same as that for createDurableSubscriber for topics with ADT messages
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT.
Remote subscribers may be a specific consumer at the remote topic or all subscribers at the remote topic A remote subscriber is defined using the AQjmsAgent structure. An AQjmsAgent consists of a name and address. The name refers to the consumer_name at the remote topic. The address refers to the remote topic - the syntax is (schema).(topic_name)[@dblink].
1. To publish messages to a particular consumer at the remote topic, the subscription_name of the recipient at the remote topic must be specified in the name field of AQjmsAgent. The remote topic must be specified in the address field of AQjmsAgent.
2. To publish messages to all subscribers of the remote topic, the name field of AQjmsAgent must be set to null. The remote topic must be specified in the address field of AQjmsAgent
public synchronized void createRemoteSubscriber(javax.jms.Topic topic, AQjmsAgent remote_subscriber, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_factory, String transformation)
Create a remote subscriber for a topic and specify a transformation for this subscriber. This method is used to create browsers for queues that contain Oracle ADT payloads (instead of the standard JMS defined payloads).
AQ allows topics to have remote subscribers, ie subscribers at other topics in the same or different database. In order to use remote subscribers, you must set up propagation between the two local and remote topic.
topic
- the topic to subscribe to
remote_subscriber
- AQjmsAgent that refers to the remote subscriber
messageSelector
- only messages with properties matching the message selector expression are delivered. This value may be null. The selector syntax is the same as that for createDurableSubscriber for topics with ADT messages
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT.
tranformation
- the transformation for this subscriber. This transformation will be applied before the message is delivered to this subscriber.
Remote subscribers may be a specific consumer at the remote topic or all subscribers at the remote topic A remote subscriber is defined using the AQjmsAgent structure. An AQjmsAgent consists of a name and address. The name refers to the consumer_name at the remote topic. The address refers to the remote topic - the syntax is (schema).(topic_name)[@dblink].
1. To publish messages to a particular consumer at the remote topic, the subscription_name of the recipient at the remote topic must be specified in the name field of AQjmsAgent. The remote topic must be specified in the address field of AQjmsAgent.
2. To publish messages to all subscribers of the remote topic, the name field of AQjmsAgent must be set to null. The remote topic must be specified in the address field of AQjmsAgent
public synchronized javax.jms.QueueSender createSender(javax.jms.Queue queue)
Create a QueueSender to send messages to the specified queue.
javax.jms.QueueSession.createSender(javax.jms.Queue) in interface javax.jms.QueueSession
queue
- the queue to access, or null if this is an unidentified producer.
JMSException
- if a session fails to create a sender due to some JMS error.
InvalidDestinationException
- if invalid Queue specified.
public synchronized javax.jms.StreamMessage createStreamMessage()
Create a StreamMessage. A StreamMessage is used to send a self-defining stream of Java primitives.
javax.jms.Session.createStreamMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation
public synchronized javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
Create a non-durable Subscriber to the specified topic.
javax.jms.TopicSession.createSubscriber(javax.jms.Topic) in interface javax.jms.TopicSession
JMSException
- if some error occurs during non durable subscriber creation.
public synchronized javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic, java.lang.String messageSelector, boolean noLocal)
Create a non-durable Subscriber to the specified topic.
javax.jms.TopicSession.createSubscriber(javax.jms.Topic, java.lang.String, boolean) in interface javax.jms.TopicSession
JMSException
- if some error occurs during non durable subscriber creation.
public synchronized javax.jms.TemporaryQueue createTemporaryQueue()
Create a temporary queue. Its lifetime will be that of the QueueConnection unless it is deleted earlier Specified By javax.jms.Session.createTemporaryQueue() in interface javax.jms.Session.
JMSException
- if the temporary queue could not be created.
public synchronized javax.jms.TemporaryTopic createTemporaryTopic()
Create a temporary topic. Its lifetime will be that of the TopicConnection unless it is deleted earlier.
javax.jms.Session.createTemporaryTopic() in interface javax.jms.Session.
JMSException
- if the temporary topic could not be created.
public synchronized javax.jms.TextMessage createTextMessage()
Create a TextMessage. A TextMessage is used to send a message containing a StringBuffer.
javax.jms.Session.createTextMessage() in interface javax.jms.Session
JMSException
- if some error occurs during message creation
public synchronized javax.jms.TextMessage createTextMessage(java.lang.StringBuffer stringBuffer)
Create an initialized TextMessage. A TextMessage is used to send a message containing a StringBuffer.
javax.jms.Session.createTextMessage(java.lang.StringBuffer) in interface javax.jms.Session
stringBuffer
- the string buffer used to initialize this message.
JMSException
- if some error occurs during message creation
public synchronized javax.jms.Topic createTopic(String)
Create a Topic given a Topic name. This facility is provided for the rare cases where clients need to dynamically manipulate topic identity. It allows the creation of a topic identity with a provider-specific name. Clients that depend on this ability are not portable. Note that this method is not for creating the physical topic. The physical creation of topic is an administrative task.
The Topic name is of the form "[schema].name." If "schema" is not specified, current session "user," is utilized.
javax.jms.QueueSession.createQueue() in interface javax.jms.QueueSession.
JMSException
- if the queue could not be created.
public synchronized javax.jms.Topic createTopic(oracle.jms.AQQueueTable q_table, java.lang.String topic_name, AQjmsDestinationProperty dest_property)
Create a topic
q_table
- Queue-Table in which the topic is to be created. The queue-table must be multiconsumer enabled
topic_name
- name of the topic to be created
dest_property
- Topic properties.
JMSException
- if the topic could not be created
public synchronized TopicReceiver createTopicReceiver(javax.jms.Topic topic, java.lang.String receiver_name, java.lang.String messageSelector)
Create a TopicReceiver to receive messages from the specified topic. AQ allows messages to be sent to all subscribers of a topic or to specified recipients. These receivers may or may not be subscribers of the topic. If the receiver is not a subscriber to the topic, it will receive only those messages that are explicitly This method must be used order to create a TopicReceiver object for consumers that are not durable subscribers of the topic
This method can be used to create TopicReceivers for topics that contain payloads of type AQ$_JMS_TEXT_MESSAGE, AQ$_JMS_STREAM_MESSAGE, AQ$_JMS_BYTES_MESSAGE, AQ$_JMS_MAP_MESSAGE or AQ$_JMS_OBJECT_MESSAGE
topic
- the topic to access
receiver_name
- the name of the recipient (or subscriber)
messageSelector
- only messages with properties matching the message selector expression are delivered. The selector can be any expression that has a combination of one or more of the following:
JMSMessageID = 'ID:23452345
' to retrieve messages that have a specified message IDJMSPriority < 3 AND JMSCorrelationID = 'Fiction'
color IN ('RED', BLUE', 'GREEN') AND price < 30000
All message IDs must be prefixed with "ID:"
JMSException
- if a session fails to create a receiver due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
InvalidSelectorException
- if the message selector is invalid.
public synchronized TopicReceiver createTopicReceiver(javax.jms.Topic topic, java.lang.String receiver_name, java.lang.String messageSelector, oracle.sql.CustomDatumFactory payload_factory)
Create a TopicReceiver to receive messages from the specified topic containing ADT messages. AQ allows messages to be sent to all subscribers of a topic or to specified recipients. These receivers may or may not be subscribers of the topic. If the receiver is not a subscriber to the topic, it will receive only those messages that are explicitly This method must be used order to create a TopicReceiver object for consumers that are not durable subscribers of the topic
This method is used to create TopicReceivers for topics that contain Oracle ADT payloads (instead of the standard JMS defined payloads)
topic
- the topic to access
receiver_name
- the name of the recipient (or subscriber)
messageSelector
- only messages with properties matching the message selector expression are delivered. For queues containing AdtMessages
the selector can be a SQL expression on the message payload contents or messageID or priority or correlationID
.
msgid = '23434556566767676'
Note: in this case message IDs must NOT be prefixed with 'ID:'
priority < 3 AND corrid = 'Fiction'
tab.user_data.color = 'GREEN' AND tab.user_data.price < 30000
payload_factory
- CustomDatumFactory for the java class that maps to the Oracle ADT
public synchronized java.sql.Connection getDBConnection()
public AQjmsConnection getJmsConnection()
public synchronized javax.jms.MessageListener getMessageListener()
Return the session's distinguished message listener.
javax.jms.Session.getMessageListener() in interface javax.jms.Session
the message listener associated with this session.
JMSException
- if JMS fails to get the message listener due to an internal error in JMS Provider.
public synchronized javax.jms.Queue getQueue(java.lang.String owner, java.lang.String name)
Get an existing queue. The Queue is returned only if the user has created the queue or as enqueue/dequeue privileges on the specified queue
owner
- queue owner (schema)
name
- queue name
JMSException
- if the queue could not be returned due to some error
public synchronized oracle.jms.AQQueueTable getQueueTable(java.lang.String owner, java.lang.String name)
Get a handle to an existing queue-table If owner of queue-table is not the same as the user which opened the connection, the caller must have AQ enqueue/dequeue privileges on queues/topics in the queue table. Otherwise the queue-table will not be returned
owner
- the owner (schema) of the queue-table
name
- queue-table name
JMSException
- if the queue table does not exist or if the user does not have privileges on any queue/topic in the queue-table
public synchronized javax.jms.Topic getTopic(java.lang.String owner, java.lang.String name)
Get an existing topic. The Topic is returned only if the user has created the topic or as enqueue/dequeue privileges on the specified topic
owner
- topic owner (schema)
name
- topic name
JMSException
- if the topic could not be returned due to some error
public synchronized boolean getTransacted()
Checks if the session in transacted mode?
javax.jms.Session.getTransacted() in interface javax.jms.Session
true if in transacted mode
JMSException
- if session is closed
public void grantSystemPrivilege(java.lang.String privilege, java.lang.String grantee, boolean admin_option)
Grant AQ system privileges to users/roles. Initially only SYS and SYSTEM can use this procedure successfully
privilege
- options are ENQUEUE_ANY, DEQUEUE_ANY and MANAGE_ANY
ENQUEUE_ANY - users with this privilege are allowed to enqueue messages to any queue/topic in the database.
DEQUEUE_ANY - users with this privilege are allowed to dequeue messages from any queue/topic in the database.
MANAGE_ANY - users with this privilege are allowed to access and make admin calls on any queue/topic in the database.
grantee
- specifies the grantee. The grantee can be a user, role or the PUBLIC role
admin_option
- if this is set to true, the grantee is allowed to use this procedure to grant the system privilege to other users or roles
JMSException
- if the system privilege could not be granted.
public synchronized void recover()
Stops message delivery in this session, and restarts message deliverycwith the oldest unacknowledged message.
All consumers deliver messages in a serial order. Acknowledging acreceived message automatically acknowledges all messages that havecbeen delivered to the client.
Restarting a session causes it to take the following actions:
javax.jms.Session.recover() in interface javax.jms.Session
JMSException - if JMS implementation fails to stop and restart message
delivery due to some internal error.
IllegalStateException-if the method is called by a transacted session.
public void revokeSystemPrivilege(java.lang.String privilege, java.lang.String grantee)
Revoke AQ system privilege from user/roles
privilege
- options are ENQUEUE_ANY, DEQUEUE_ANY and MANAGE_ANY
grantee
- specifies the grantee. The grantee can be a user, role or the PUBLIC role
JMSException
- if the system privilege could not be revoked
public synchronized void rollback()
Rollback any messages done in this transaction and releases any locks currently held.
javax.jms.Session.rollback() in interface javax.jms.Session
JMSException
- if JMS implementation fails to rollback the the transaction due to some internal error.
public void run()
java.lang.Runnable.run() in interface java.lang.Runnable
public synchronized void setMessageListener(javax.jms.MessageListener listener)
Set the session's distinguished message listener. When it is set no other form of message receipt in the session can be used; however, all forms of sending messages are still supported.
javax.jms.Session.setMessageListener(javax.jms.MessageListener) in interface javax.jms.Session
listener
- the message listener to associate with this session.
JMSException
- if JMS fails to set the message listener due to an internal error in JMS Provider.
public synchronized void unsubscribe(String subs_name)
Unsubscribe a durable subscription with a given subscriber name that has been created by a client.
subs_name
- name of the durable subscriber that need to be unsubscribed.
JMSException - if JMS fails to unsubscribe to durable subscription due to some JMS error.
public synchronized void unsubscribe(javax.jms.Topic topic, AQjmsAgent remote_ subscriber)
Unsubscribe a remote durable subscription that has been created by a client on the specified topic
topic
- the topic subscribed to
remote_subscriber
- AQjmsAgent that refers to the remote subscriber. the address field of the AQjmsAgent cannot be null
JMSException
- if JMS fails to unsubscribe to durable subscription due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public synchronized void unsubscribe(javax.jms.Topic topic, java.lang.String subs_name)
Unsubscribe a durable subscription that has been created by a client on the specified topic
topic
- the topic subscribed to
subs_name
- the name used to identify this subscription.
JMSException
- if JMS fails to unsubscribe to durable subscription due to some JMS error.
InvalidDestinationException
- if invalid Topic specified.
public class AQjmsStreamMessage extends AQjmsMessage implements javax.jms.StreamMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsStreamMessage
javax.jms.Message, javax.jms.StreamMessage
This class implements the StreamMessage interface. A StreamMessage is used to send a stream of java primitives
public void clearBody()
Clear out the message body. All other parts of the message are left untouched.
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
JMSException
- if JMS fails to due to some internal JMS error.
public void clearProperties()
javax.jms.Message.clearProperties() in interface javax.jms.Message
clearProperties() in class AQjmsMessage
public boolean readBoolean()
Reads a boolean from the stream message
javax.jms.StreamMessage.readBoolean() in interface javax.jms.StreamMessage
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public byte readByte()
Reads a signed 8-bit value from the stream message
javax.jms.StreamMessage.readByte() in interface javax.jms.StreamMessage
the next byte from the stream message as a signed 8-bit byte
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public int readBytes(byte[] value)
Read a byte array from the stream message
javax.jms.StreamMessage.readBytes(byte[]) in interface javax.jms.StreamMessage
value
- the buffer into which the data is read
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public char readChar()
Read a Unicode character value from the stream message
javax.jms.StreamMessage.readChar() in interface javax.jms.StreamMessage
the next two bytes from the stream message as a Unicode character.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public double readDouble()
Read a double from the stream message
javax.jms.StreamMessage.readDouble() in interface javax.jms.StreamMessage
the next eight bytes from the stream message, interpreted as a double.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public float readFloat()
Read a float from the stream message
javax.jms.StreamMessage.readFloat() in interface javax.jms.StreamMessage
the next four bytes from the stream message, interpreted as a float.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public int readInt()
Read a signed 32 bit integer from the stream message
javax.jms.StreamMessage.readInt() in interface javax.jms.StreamMessage
the next four bytes from the stream message, interpreted as a int.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public long readLong()
Read a signed 64 bit integer from the stream message
javax.jms.StreamMessage.readLong() in interface javax.jms.StreamMessage
the next eight bytes from the stream message, interpreted as a long.
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public java.lang.Object readObject()
Read a Java object from the stream message.
Note that this method can be used to return in objectified format, an object that had been written to the Stream with the equivalent writeObject
method call, or it's equivalent primitive write method.
javax.jms.StreamMessage.readObject() in interface javax.jms.StreamMessage
a Java object from the stream message, in objectified format (ie. if it set as an int, then a Integer is returned).
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if an end of message stream
MessageNotReadableException
- if message in write-only mode.
public short readShort()
Reads a signed 16-bit value from the stream message
javax.jms.StreamMessage.readShort() in interface javax.jms.StreamMessage
the next two bytes from the stream message, interpreted as a 16-bit number
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public java.lang.String readString()
Read a string from the stream message
javax.jms.StreamMessage.readString() in interface javax.jms.StreamMessage
string from the stream message
MessageNotReadableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
MessageEOFException
- if end of message stream
public void reset()
Put the message in read-only mode, and reposition the stream of bytes to the beginning.
javax.jms.StreamMessage.reset() in interface javax.jms.StreamMessage
MessageNotWriteableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeBoolean(boolean value)
Write a boolean to the stream message as a 1-byte value. The value true is written out as the value (byte)1; the value false is written out as the value (byte)0.
javax.jms.StreamMessage.writeBoolean(boolean) in interface javax.jms.StreamMessage
value
- the boolean value to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeByte(byte value)
Write out a byte to the stream message as a 1-byte value.
javax.jms.StreamMessage.writeByte(byte) in interface javax.jms.StreamMessage
value
- the byte value to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeBytes(byte[] value)
Write a byte array to the stream message
javax.jms.StreamMessage.writeBytes(byte[]) in interface javax.jms.StreamMessage
value
- The byte array to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeBytes(byte[] value, int offset, int length)
Write a portion of byte array to the stream message
javax.jms.StreamMessage.writeBytes(byte[], int, int) in interface javax.jms.StreamMessage
value
- the byte array to be written
offset
- the initial offset within the byte array
length
- the number of bytes to use
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeChar(char value)
Write a char to the stream as a 2-byte, high byte first
javax.jms.StreamMessage.writeChar(char) in interface javax.jms.StreamMessage
value
- the char to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeDouble(double value)
Write a double to the stream as a 8-byte, high byte first
javax.jms.StreamMessage.writeDouble(double) in interface javax.jms.StreamMessage
value
- The double to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeFloat(float value)
Write a float to the stream as a 4-byte, high byte first
javax.jms.StreamMessage.writeFloat(float) in interface javax.jms.StreamMessage
value
- the float to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeInt(int value)
Write a int to the stream as a 4-byte, high byte first
javax.jms.StreamMessage.writeInt(int) in interface javax.jms.StreamMessage
value
- the int to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeLong(long value)
Write a int to the stream as a 4-byte, high byte first
javax.jms.StreamMessage.writeLong(long) in interface javax.jms.StreamMessage
value
- the int to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeObject(java.lang.Object value)
Write a java object to the stream message
javax.jms.StreamMessage.writeObject(java.lang.Object) in interface javax.jms.StreamMessage
value
- the java object to be written.
MessageNotWritableException
- if message in write-only mode.
MessageFormatException
- if object is invalid type
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeShort(short value)
Write a short to the stream as a 2-byte, high byte first
javax.jms.StreamMessage.writeShort(short) in interface javax.jms.StreamMessage
value
- the short to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public void writeString(java.lang.String value)
Writes a string to the underlying output stream
javax.jms.StreamMessage.writeString(java.lang.String) in interface javax.jms.StreamMessage
value
- The string to be written
MessageNotWritableException
- if message in write-only mode.
JMSException
- if JMS fails to read message due to some internal JMS error.
public class AQjmsTextMessage extends AQjmsMessage implements javax.jms.TextMessage java.lang.Object | +--AQjmsMessage | +--oracle.jms.AQjmsTextMessage
javax.jms.Message, javax.jms.TextMessage
This class implements the TextMessage interface. A TextMessage is used to send a message containing a java.lang.StringBuffer
Member Summary | Description |
---|---|
Methods |
- |
Clear the body |
|
Clear a message's properties. |
|
Get the string containing this message's data. |
|
Set the string containing this message's data. |
public void clearBody()
javax.jms.Message.clearBody() in interface javax.jms.Message
clearBody() in class AQjmsMessage
public void clearProperties()
Clear a message's properties.
javax.jms.Message.clearProperties() in interface javax.jms.Message
clearProperties() in class AQjmsMessage
JMSException
- if JMS fails to clear JMS message properties due to some internal JMS error.
public java.lang.String getText()
Get the string containing this message's data. The default value is null.
javax.jms.TextMessage.getText() in interface javax.jms.TextMessage
the String containing the message's data
JMSException
- if JMS fails to get text due to some internal JMS error.
public void setText(java.lang.String string)
Set the string containing this message's data.
javax.jms.TextMessage.setText(java.lang.String) in interface javax.jms.TextMessage
string
- the String containing the message's data
JMSException
- if JMS fails to set text due to some internal JMS error.
MessageNotWriteableException
- if message in read-only mode.
java.lang.Object | + -- oracle.jms.AQjmsTopicBrowser
A client uses an instance of AQjmsTopicBrowser to look at messages on a topic without removing them. This implementation is an Oracle-specific extension to JMS.
public void close()
Close the topic browser. Since OJMS allocates resources on behalf of a TopicBrowser outside the JVM, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough
All errors during the operations will be silently ignored.
public Topic getTopic()
Get the topic associated with this topic browser
the topic associated with this topic browser
JMSException-if JMS fails to get the topic associated with this Browser due to some JMS error.
public Enumeration getEnumeration()
Get an enumeration for browsing the current topic messages in the order they would be received. If getEnumeration() is called twice on the same TopicBrowser, the same enumeration object is returned. Hence the nextElement() call on one enumeration object would modify the state second enumeration object too
an enumeration for browsing the messages
public String getMessageSelector()
Get this topic browser's message selector expression.
this topic browser's message selector
JMSException-if JMS fails to get message selector due to some JMS error.
public Object nextElement()
Returnsthe next element of this enumeration. Attempt to use cached messages (if one is available from a previous call to hasMoreElements(). If the browser's selector used message ID, only one message can ever be returned during the browse
the next element of this enumerationn
NoSuchElementException-if no more elements exist
public boolean hasMoreElements()
Check if this enumeration contains more elements.
true if more elements exist in the enumeration false otherwise.
public void purgeSeen()
Purge messages seen so far during browse. A message is considered seen if it was returned to the client via a call to nextElement() during the browse. Thus, it is possible for a client to create a topic browser, call purge immediately, and not change the state of the topic (since no messages were seen as specified by this method).
JMSException
- if a JMS error occurred during the purge operation.
public void setTransformation(String transformation)
Set transformation for the browser. This transformation will becapplied before the message is returned to the user.
transformation
- transformation name
public String getTransformation()
Get the transformation for the Consumer.
the transformation for the Consumer
public class AQjmsIllegalStateException extends javax.jms.IllegalStateException
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--javax.jms.JMSException | +--javax.jms.IllegalStateException | +--oracle.jms.AQjmsIllegalStateException
java.io.Serializable
This exception extends IlegalStateException. It is thrown when a method is invoked at an illegal or inappropriate time or if OJMS is not in an appropriate state for the requested operation. For example, this exception must be thrown if Session.commit is called on a non-transacted session.
public class AQjmsTopicConnectionFactory extends java.lang.Object implements javax.jms.TopicConnectionFactory java.lang.Object | +--oracle.jms.AQjmsTopicConnectionFactory
javax.jms.ConnectionFactory, javax.jms.TopicConnectionFactory, java.lang.Referenceable, java.lang.Serializable
This class implements the TopicConnectionFactory interface. A TopicConnectionFactory is used to create TopicConnections
Inherited Member Summary |
---|
Methods inherited from class java.lang.Object |
|
public javax.jms.TopicConnection createTopicConnection()
create a Topic Connection to the JMS Server hosting this Topic- connection factory.
javax.jms.TopicConnectionFactory.createTopicConnection() in interface javax.jms.TopicConnectionFactory
a Topic Connection
JMSException
- if JMS fails to get a topic connection due to some JMS error.
public static javax.jms.TopicConnection createTopicConnection(java.sql.Connection jdbc_connection)
create a TopicConnection using the already open JDBC connection. This creation does NOT result in creation of another connection to the database. Instead JMS binds to the given connection to the database and provides an interface to the Pub/Sub mechanism defined by JMS.
jdbc_connection
- a valid open connection to the database.
a TopicConnection
JMSException
- if JMS fails to get a topic connection due to some JMS error
public javax.jms.TopicConnection createTopicConnection(java.lang.String username, java.lang.String password)
create a Topic Connection using the given username and password for authentication during creation of the Connection.
javax.jms.TopicConnectionFactory.createTopicConnection(java.lang.String, java.lang.String) in interface javax.jms.TopicConnectionFactory
username
- name of the user connecting to the DB for Queueing. password password for the user creating the connection.
a Topic Connection
JMSException
- if JMS fails to get a topic connection due to some JMS error
public interface AQjmsTopicPublisher extends javax.jms.TopicPublisher
javax.jms.MessageProducer, javax.jms.TopicPublisher
AQjmsProducer
This interface extends TopicPublisher and defines AQ extensions to JMS. A client uses a TopicPublisher for publishing messages to a Topic
public String getTransformation()
Get the transformation for this publisher
the transformation
JMSException
- if there was an error in getting the transformation
public void publish(javax.jms.Message message, AQjmsAgent recipient_list)
Publish a Message to a specific list of recipients
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
JMSException
- if JMS fails to publish the message due to some internal error.
public void publish(javax.jms.Message message, AQjmsAgent recipient_list, int deliveryMode, int priority, long timeToLive)
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode
- The delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public void publish(javax.jms.Topic topic, javax.jms.Message message, AQjmsAgent recipient_list)
Publish a Message to a topic by specifying a list of recipients
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
JMSException
- if JMS fails to publish the message due to some internal error.
public void publish(javax.jms.Topic topic, javax.jms.Message message, AQjmsAgent recipient_list, int deliveryMode, int priority, long timeToLive)
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
topic
- The topic to which to publish the message. This overrides the default topic of the Message Producer
message
- The message to be published
recipient_list
- The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode
- The delivery mode - persistent or non_persistent
priority
- The priority of the message
timeToLive
- the message time to live in milliseconds; zero is unlimited
JMSException
- if JMS fails to publish the message due to some internal error.
public void setTransformation(String transformation)
Set transformation for this sender. This transformation will be applied before the message is published to the topic
transformation
- transformation to be applied before publishing the message
JMSException
- if there was an error in setting the transformation
public interface AQjmsTopicReceiver extends TopicReceiver
javax.jms.MessageConsumer, TopicReceiver
AQjmsConsumer
This interface extends the TopicReceiver interface that defines AQ extensions for remote subscribers and explicitly specified recipients (in point-to-mulitpoint communication). A TopicReceiver is used to receive messages from a Topic.
public int getNavigationMode()
get the navigation mode used for receiving messages
the navigation mode
JMSException
- if there was an error in getting the navigation mode
public String getTransformation()
Get the transformation for this receiver
the transformation
JMSException
- if there was an error in getting the transformation
public void receiveNoData()
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser.
JMSException
- if the message could not be received due to an error
public void receiveNoData(long tomeOut)
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser. This call will block until a message arrives or the timeout expires
timeout
- the timeout value in milliseconds
JMSException
- if the message could not be received due to an error
public void setTransformation(String transformation)
Set transformation for this receiver. This transformation will be applied before the message is returned to the user.
transformation
- transformation to be applied before returning the message
JMSException
- if there was an error in setting the transformation
public void setNavigationMode(int mode)
set the navigation mode used for receiving messages
mode
- the new value of the navigation mode
JMSException
- if there was an error in getting the navigation mode
public interface AQjmsTopicSubscriber extends javax.jms.TopicSubscriber
javax.jms.MessageConsumer, javax.jms.TopicSubscriber
AQjmsConsumer
This interface extends TopicSubscriber and defines AQ extensions to JMS. A client uses a TopicSubscriber to receive messages published on a Topic
public int getNavigationMode()
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser. This call will block until a message arrives or the timeout expires
timeout
- the timeout value in milliseconds
JMSException
- if the message could not be received due to an error
public void receiveNoData()
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser.
JMSException
- if the message could not be received due to an error
public void receiveNoData(long tomeOut)
Consume the message without returning it to the user. This call will avoid the overhead of fetching the message from the database and hence can be used as an optimization by jms clients who have already got the message for example using a queue browser. This call will block until a message arrives or the timeout expires
timeout
- the timeout value in milliseconds
JMSException
- if the message could not be received due to an error
public void setNavigationMode(int mode)
set the navigation mode used for receiving messages
mode
- the new value of the navigation mode
JMSException
- if there was an error in getting the navigation mode
public interface TopicBrowser extends javax.jms.MessageConsumer
AQjmsTopicBrowser
javax.jms.MessageConsumer
This interface extends MessageConsumer to allow remote subscribers to look at messages on a topic without removing them.
public interface TopicReceiver extends javax.jms.MessageConsumer
AQjmsTopicReceiver
javax.jms.MessageConsumer
This interface extends MessageConsumer to allow remote subscribers and explicitly specified recipients (in point-to-multipoint communication) to receive messages.
Member Summary | Description |
---|---|
Methods |
- |
Get the topic associated with this receiver. |
Inherited Member Summary |
---|
Methods inherited from interface javax.jms.MessageConsumer |
|
public javax.jms.Topic getTopic()
Get the topic associated with this receiver.
this subscriber's topic
JMSException
- if JMS fails to get topic for this topic receiver due to some internal error.
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|