Oracle9i Application Developer's Guide - Advanced Queuing Release 2 (9.2) Part Number A96587-01 |
|
In this chapter we describe the operational interface (shared interfaces) to Oracle Advanced Queuing in terms of use cases. That is, we discuss each operation (such as "Enqueue a Message") as a use case by that name. The table listing all the use cases is provided at the head of the chapter (see " Use Case Model: Operational Interface -- Basic Operations (Shared Interfaces)" ).
A summary figure, "Use Case Diagram: Operational Interface -- Basic Operations", locates all the use cases in a single drawing. If you are using the HTML version of this document, you can use this figure to navigate to the use case that interests you by clicking on the relevant use case title.
Each use case is laid out as follows:
See Also:
|
Start a JMS Connection for receiving messages.
The start method is used to start (or restart) the connection's delivery of incoming messages.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the JMS Connection from a Session
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.getJmsConnection
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Commit All Operations in a Session
This method commits all JMS and SQL operations performed in this session.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Rollback All Operations in a Session
This method aborts all JMS and SQL operations performed in this session.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.rollback
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Underlying JDBC Connection from a JMS session
This method is used to obtain the underlying JDBC connection from a JMS session. The JDBC connection may be used to perform SQL operations as part of the same transaction that the JMS operations are done.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.getDBConnection
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
java.sql.Connection db_conn; QueueSession jms_sess; db_conn = ((AQjmsSession)jms_sess).getDBConnection();
See Also:
|
Get the underlying OracleOCIConnectionPool
from a JMS connection.
This method is used to obtain the underlying OracleOCIConnectionPool
instance from a JMS connection. The settings of the OracleOCIConnectionPool
instance may be tuned by the user depending on the connection usage, for example, the number of sessions the user wants to create using the given connection. The user should not, however, close the OracleOCIConnectionPool
instance being used by the JMS connection.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConnection.getOCIConnectionPool
oracle.jdbc.pool.OracleOCIConnectionPool cpool; QueueConnection jms_conn; cpool = ((AQjmsConnection)jms_conn).getOCIConnectionPool();
See Also:
|
Create a Bytes Message
This method can be used only if the queue table that contains the destination queue/topic was created with the SYS.AQ$_JMS_BYTES_MESSAGE
or AQ$_JMS_MESSAGE
payload types.
Refer to Java Packages Reference for methods used to populate a BytesMessage.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createBytesMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Create a Map Message
This method can be used only if the queue table that contains the destination queue/topic was created with the SYS.AQ$_JMS_MAP_MESSAGE
or AQ$_JMS_MESSAGE
payload types.
Refer to Java Packages Reference for methods used to populate a MapMessage.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createMapMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Create a Stream Message
This method can be used only if the queue table that contains the destination queue/topic was created with the SYS.AQ$_JMS_STREAM_MESSAGE
or AQ$_JMS_MESSAGE
payload types.
Refer to Java Packages Reference for methods used to populate a StreamMessage.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createStreamMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Create an Object Message
This method can be used only if the queue table that contains the destination queue/topic was created with the SYS.AQ$_JMS_OBJECT_MESSAGE
or AQ$_JMS_MESSAGE
payload types.
Refer to Java Packages Reference for methods used to populate a ObjectMessage.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createObjectMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Create a Text Message
This method can be used only if the queue table that contains the destination queue/topic was created with the SYS.AQ$_JMS_TEXT_MESSAGE
or AQ$_JMS_MESSAGE
payload types.
Refer to Java Packages Reference for methods used to populate a Text Message.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createTextMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Create a JMS message
Use this ADT to store any or all of the JMS message types: bytes messages (JMSBytes
), map messages (JMSMap
), stream messages (JMSStream
), object messages (JMSObject
), or text messages (JMSText
).
You can use the AQ$_JMS_MESSAGE
construct message to construct messages of different types. The message type must be one of the following:
DBMS_AQ.JMS_TEXT_MESSAGE
DBMS_AQ.JMS_OBJECT_MESSAGE
DBMS_AQ.JMS_MAP_MESSAGE
DBMS_AQ.JMS_BYTES_MESSAGE
DBMS_AQ.JMS_STREAM_MESSAGE
See Also:
Oracle9i Supplied PL/SQL Packages and Types Reference for more information on JMS types. |
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Create a header-only JMS message
Use this ADT to store any or all of the JMS message types: bytes messages (JMSBytes
), map messages (JMSMap
), stream messages (JMSStream
), object messages (JMSObject
), or text messages (JMSText
).
See Also:
Oracle9i Supplied PL/SQL Packages and Types Reference for more information on JMS types. |
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Create an ADT Message
This method can be used only if the queue table that contains the queue/topic was created with an Oracle ADT payload_type (not one of the SYS.AQ$_JMS* types).
An ADT message must be populated with an object that implements the CustomDatum interface. This object must be the java mapping of the SQL ADT defined as the payload for the queue/topic. Java classes corresponding to SQL ADTs may be generated using the Jpublisher tool. Please refer to the JDBC documentation for details on CustomDatum interface and Jpublisher.
Refer to Java Packages Reference for methods used to populate AdtMessage
.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.createAdtMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available f.nctions in each programmatic environment.
See Also:
|
Specify message correlation ID.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setJMSCorrelationID
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Property names starting with JMS are provider specific. User-defined properties cannot start with JMS.
The following provider properties may be set by clients using Text, Stream, Object, Bytes or Map Message:
The following properties may be set on AdtMessage
Specify Message Property as Boolean
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setBooleanProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as String
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setStringProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as Int
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setIntProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as Double
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setDoubleProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as Float
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setFloatProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setByteProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setLongProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as Short
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setShortProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Specify Message Property as Object
Only objectified primitive values supported - Boolean, Byte, Short, Integer, Long, Float, Double and String.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.setObjectProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Set Default TimeToLive for All Messages Sent by a Message Producer
TimetoLive is specified in milliseconds. It is calculated after the message is in ready state (i.e after message delay has taken effect).
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsProducer.setTimeToLive
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
/* Set default timeToLive value to 100000 milliseconds for all messages sent by the QueueSender*/ QueueSender sender; sender.setTimeToLive(100000);
See Also:
|
Set Default Priority for All Messages Sent by a Message Producer
Priority values can be any integer. A smaller number indicates higher priority.
If a priority value is explicitly specified during the send operation, it overrides the producer's default value set by this method.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsProducer.setPriority
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
/* Set default priority value to 2 for all messages sent by the QueueSender*/ QueueSender sender; sender.setPriority(2);
/* Set default priority value to 2 for all messages sent by the TopicPublisher*/ TopicPublisher publisher; publisher.setPriority(1);
See Also:
|
Create an AQjms Agent
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsAgent
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Receive a Message Using a Message Consumer by Specifying Timeout
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConsumer.receive
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
TopicConnectionFactory tc_fact = null; TopicConnection t_conn = null; TopicSession t_sess = null; TopicSession jms_sess; Topic shipped_orders; int myport = 5521; /* create connection and session */ tc_fact = AQjmsFactory.getTopicConnectionFactory("MYHOSTNAME", "MYSID", myport, "oci8"); t_conn = tc_fact.createTopicConnection("jmstopic", "jmstopic"); jms_sess = t_conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE); shipped_orders = ((AQjmsSession )jms_sess).getTopic("WS", "Shipped_Orders_Topic"); /* create a subscriber, specifying the correct CustomDatumFactory and selector */ subscriber1 = jms_sess.createDurableSubscriber(shipped_orders, 'WesternShipping', " priority > 1 and tab.user_data.region like 'WESTERN %'", false,AQjmsAgent.getFactory()); /* receive, blocking for 30 seconds if there were no messages */ Message = subscriber.receive(30000);
See Also:
|
Receive a Message Using a Message Consumer Without Waiting
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConsumer.receiveNoWait
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Specify the navigation mode for receiving messages.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsQueueReceiver.setNavigationMode, AQjmsTopicReceiver.setNavigationMode, AQjmsTopicSubscriber.setNavigationMode
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
TopicConnectionFactory tc_fact = null; TopicConnection t_conn = null; TopicSession t_sess = null; TopicSession jms_sess; Topic shipped_orders; int myport = 5521; /* create connection and session */ tc_fact = AQjmsFactory.getTopicConnectionFactory("MYHOSTNAME", "MYSID", myport, "oci8"); t_conn = tc_fact.createTopicConnection("jmstopic", "jmstopic"); jms_sess = t_conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE); shipped_orders = ((AQjmsSession )jms_sess).getTopic("WS", "Shipped_Orders_Topic"); /* create a subscriber, specifying the correct CustomDatumFactory and selector */ subscriber1 = jms_sess.createDurableSubscriber(shipped_orders, 'WesternShipping', " priority > 1 and tab.user_data.region like 'WESTERN %'", false,AQjmsAgent.getFactory()); subscriber1.setNavigationMode(AQjmsConstants.NAVIGATION_FIRST_MESSAGE); /* get message for the subscriber, returning immediately if there was no message */ Message = subscriber.receive();
See Also:
|
Specify a Message Listener at the Message Consumer
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConsumer.setMessageListener
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
TopicConnectionFactory tc_fact = null; TopicConnection t_conn = null; TopicSession t_sess = null; TopicSession jms_sess; Topic shipped_orders; int myport = 5521; MessageListener mLis = null; /* create connection and session */ tc_fact = AQjmsFactory.getTopicConnectionFactory("MYHOSTNAME", "MYSID", myport, "oci8"); t_conn = tc_fact.createTopicConnection("jmstopic", "jmstopic"); jms_sess = t_conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE); shipped_orders = ((AQjmsSession )jms_sess).getTopic("WS", "Shipped_Orders_Topic"); /* create a subscriber, specifying the correct CustomDatumFactory and selector */ subscriber1 = jms_sess.createDurableSubscriber(shipped_orders, 'WesternShipping', " priority > 1 and tab.user_data.region like 'WESTERN %'", false,AQjmsAgent.getFactory()); mLis = new myListener(jms_sess, "foo"); /* get message for the subscriber, returning immediately if there was no message */ subscriber.setMessageListener(mLis); The definition of the myListener class import oracle.AQ.*; import oracle.jms.*; import javax.jms.*; import java.lang.*; import java.util.*; public class myListener implements MessageListener { TopicSession mySess; String myName; /* constructor */ myListener(TopicSession t_sess, String t_name) { mySess = t_sess; myName = t_name; } public onMessage(Message m) { System.out.println("Retrieved message with correlation: " || m.getJMSCorrelationID()); try{ /* commit the dequeue */ mySession.commit(); } catch (java.sql.SQLException e) {System.out.println("SQL Exception on commit"); } } }
See Also:
|
Specify a Message Listener at the Session
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.setMessageListener
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Correlation ID of a Message
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getJMSCorrelationID
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Message ID of a Message as Bytes
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getJMSMessageID
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Message ID of a Message as String
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getJMSMessageID
See Chapter 3, "AQ Programmatic Environments"for a list of available functions in each programmatic environment.
Get the Message Property as a Boolean
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getBooleanProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as a String
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getStringProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
TextMessage message; message.setStringProperty("JMS_OracleExcpQ", "scott.text_ecxcp_queue"); /*set exception queue for message*/ message.setStringProperty("color", "red"); /*set user-defined property - color */
Get the Message Property as Int
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getIntProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
StreamMessage message; message.setIntProperty("MMS_OracleDelay", 10); /*set message delay to 10 seconds*/ message.setIntProperty("empid", 1000); /*set user-defined property - empId*/
Get the Message Property as Double
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getDoubleProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as Float
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getFloatProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as Byte
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getByteProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as Long.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getLongProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as Short
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getShortProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
Get the Message Property as Object
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsMessage.getObjectProperty
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
TextMessage message; message.setObjectProperty("empid", new Integer(1000);
See Also:
|
Close a Message Producer
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsProducer.close
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Close a Message Consumer
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConsumer.close
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Stop a JMS Connection
This method is used to temporarily stop a Connection's delivery of incoming messages.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConnection.stop
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Close a JMS Session
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsSession.close
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Close a JMS Connection
This method closes the connection and releases all resources allocated on behalf of the connection. Since the JMS 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.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsConnection.close
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Error Code for the JMS Exception
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsException.getErrorCode
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Error Number for the JMS Exception
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsException.getErrorNumber
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Error Message for the JMS Exception
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsException.getMessage
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Get the Exception Linked to the JMS Exception
This method is used to get the Exception linked to this JMS exception. In general, this contains the SQL Exception raised by the database.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsException.getLinkedException
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Print the Stack Trace for the JMS Exception
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms, AQjmsException.printStackTrace
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment.
See Also:
|
Specify an Exception Listener for the connection.
If a serious problem is detected for the connection, the connection's ExceptionListener, if one has been registered, will be informed. This is done by calling the listener's onException()
method, passing it a JMSException
describing the problem. This allows a JMS client to be asynchronously notified of a problem. Some connections only consume messages, so they have no other way to learn the connection has failed.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms AQjmsConnection.setExceptionListener
//register an exception listener Connection jms_connection; jms_connection.setExceptionListener( new ExceptionListener() { public void onException (JMSException jmsException) { System.out.println("JMS-EXCEPTION: " + jmsException.toString()); } }; );
See Also:
|
Get the Exception Listener for the connection.
Not applicable.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms AQjmsConnection.getExceptionListener
//Get the exception listener Connection jms_connection; ExceptionListener el = jms_connection.getExceptionListener();
See Also:
|
Specify the ping period for the Exception Listener.
If an exception listener is set for the connection, the connection pings the database periodically to ensure that the database is accessible. The period is specified in milliseconds. The default value is 2 minutes. If an exception listener is not set for the connection, the database is not pinged. This method can be called before or after the exception listener is set.
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms AQjmsConnection.setPingPeriod
//set the ping period to 4 minutes Connection jms_connection; jms_connection.setPingPeriod(4*60*1000);
See Also:
|
Get the ping period for the Exception Listener.
If an exception listener is set for the connection, the connection pings the database periodically to ensure that the database is accessible. The period is specified in milliseconds. The default value is 2 minutes. If an exception listener is not set for the connection, the database is not pinged. This method will return the value of the period set by the last call to setPingPeriod
. If setPingPeriod
was never called, then the default value is returned
See Chapter 3, "AQ Programmatic Environments" for a list of available functions in each programmatic environment. Use the following syntax references for each programmatic environment:
See Java (JDBC): Oracle9i Supplied Java Packages Reference oracle.jms AQjmsConnection.getPingPeriod
//get the ping period Connection jms_connection; long pp = jms_connection.getPingPeriod();
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|