|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonicsw.stream.SonicStreamFactory
public class SonicStreamFactory
Instantiates Stream Controllers for input and output streams. Also provides accessor methods to set/get properties for controllers.
Field Summary | |
---|---|
static java.lang.String |
APPLICATION_NAME_PROPERTY
Property name used to define application name which will be included as header property of stream messages |
static java.lang.String |
DEBUG_FLAGS_PROPERTY
Property name used to define debug flags. |
static java.lang.String |
DELIVERY_MODE_PROPERTY
Property name used to define DeliveryMode of stream messages and notification messages. |
static int |
DELIVERY_MODE_PROPERTY_DEFAULT
Default DeliveryMode to be used for stream messages and notification messages. |
static java.lang.String |
READAHEAD_WINDOW_SIZE_PROPERTY
Property name used to specify "read ahead" window of stream controllers. |
static int |
READAHEAD_WINDOW_SIZE_PROPERTY_DEFAULT
Default "read ahead" window size (in KB). |
static java.lang.String |
SEGMENT_SIZE_PROPERTY
Property name used to specify size of segments used to transfer stream data. |
static int |
SEGMENT_SIZE_PROPERTY_DEFAULT
Default segment size value. |
static java.lang.String |
SEGMENT_TIMEOUT_PROPERTY
Property name used to specify value of time period that stream controller instances will wait for a given segment of stream data. |
static int |
SEGMENT_TIMEOUT_PROPERTY_DEFAULT
Default segment timeout value (in seconds). |
static java.lang.String |
STREAM_NOTIFICATION_TOPIC_PROPERTY
Property name used to define Topic to which stream notification messages will be sent/received |
static java.lang.String |
STREAM_TOPIC_PROPERTY
Property name used to define Topic to which stream messages will be sent/received. |
static java.lang.String |
USE_TEMP_STREAM_TOPIC_PROPERTY
Property name used to indicate if Sonic stream controllers created via factory instance will send/receive stream messages to/from a Temporary Topic. |
Constructor Summary | |
---|---|
SonicStreamFactory()
Construct a ConnectionFactory with default properties. |
|
SonicStreamFactory(java.lang.String streamTopic)
Construct a ConnectionFactory. |
|
SonicStreamFactory(java.lang.String streamTopic,
java.lang.String appName)
Construct a ConnectionFactory. |
Method Summary | |
---|---|
SonicInputStreamController |
createSonicInputStreamController(Connection con)
Creates an instance of a SonicInputStreamController object. |
SonicInputStreamController |
createSonicInputStreamController(Connection con,
Destination streamDest,
Destination notifyDest)
Creates an instance of a SonicInputStreamController object. |
SonicOutputStreamController |
createSonicOutputStreamController(Connection con)
Creates an instance of a SonicOutputStreamController object. |
SonicOutputStreamController |
createSonicOutputStreamController(Connection con,
Destination streamDest,
Destination notifyDest)
Creates an instance of a SonicOutputStreamController object. |
java.lang.String |
getApplicationName()
Returns value of APPLICATION_NAME_PROPERTY This name may be set uniquely for the application that makes use of a factory instance, and by default will be included as a property in the header of messages sent by Sonic stream controllers created via the factory instance. |
int |
getDebugFlags()
Returns current debug level setting of the factory instance. |
int |
getDeliveryMode()
Returns value of DELIVERY_MODE_PROPERTY. |
java.lang.String |
getNotificationTopic()
Gets value of STREAM_NOTIFICATION_TOPIC_PROPERTY. |
int |
getReadaheadWindowSize()
Gets the size (in KB) of the buffer used for buffering messages that have been received by the streams runtime but not yet read by the application. |
int |
getSegmentSize()
Returns the value of SEGMENT_SIZE_PROPERTY. |
int |
getSegmentTimeout()
Gets value of SEGMENT_TIMEOUT_PROPERTY property This timeout value represents the amount of time (in seconds) for which a SonicInputStreamController instance will
wait for a segment of the stream to arrive. |
java.lang.String |
getStreamTopic()
Returns value of STREAM_TOPIC_PROPERTY. |
void |
setApplicationName(java.lang.String appName)
Sets value for APPLICATION_NAME_PROPERTY property. |
void |
setDebugFlags(int flags)
Sets debug level for an application. |
void |
setDeliveryMode(int mode)
Sets the delivery mode for Sonic stream controller instances created via the factory instance. |
void |
setNotificationTopic(java.lang.String topic)
Sets name of topic to which all notification messages will be sent/received by stream controllers created via the factory instance. |
void |
setReadaheadWindowSize(int kbytes)
Sets the size (in KB) of the buffer used for buffering messages that have been received by the streams runtime but not yet read by the application. |
void |
setSegmentSize(int segmentSize)
Sets the value for SEGMENT_SIZE_PROPERTY. |
void |
setSegmentTimeout(int secs)
Sets the segment timeout value. |
void |
setStreamTopic(java.lang.String topic)
Sets value for STREAM_TOPIC_PROPERTY. |
void |
useTempStreamTopic(boolean value)
Sets factory to use a TemporaryTopic for stream messages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STREAM_TOPIC_PROPERTY
public static final java.lang.String USE_TEMP_STREAM_TOPIC_PROPERTY
public static final java.lang.String APPLICATION_NAME_PROPERTY
public static final java.lang.String SEGMENT_SIZE_PROPERTY
public static final int SEGMENT_SIZE_PROPERTY_DEFAULT
public static final java.lang.String STREAM_NOTIFICATION_TOPIC_PROPERTY
public static final java.lang.String SEGMENT_TIMEOUT_PROPERTY
public static final int SEGMENT_TIMEOUT_PROPERTY_DEFAULT
public static final java.lang.String DELIVERY_MODE_PROPERTY
public static final int DELIVERY_MODE_PROPERTY_DEFAULT
public static final java.lang.String READAHEAD_WINDOW_SIZE_PROPERTY
public static final int READAHEAD_WINDOW_SIZE_PROPERTY_DEFAULT
public static final java.lang.String DEBUG_FLAGS_PROPERTY
Constructor Detail |
---|
public SonicStreamFactory()
public SonicStreamFactory(java.lang.String streamTopic, java.lang.String appName)
streamTopic
- topic nameappName
- application namepublic SonicStreamFactory(java.lang.String streamTopic)
streamTopic
- topic nameMethod Detail |
---|
public void setNotificationTopic(java.lang.String topic)
The notification topic can be overridden by application code by having the application code set the JMSReplyTo property on the notification message.
The default is the temp topic specific to this instance of the application
topic
- topic name to be used by all stream controllers
created via this factory instancegetNotificationTopic()
,
SonicInputStreamController.buildSenderNotification(int, SonicStream, SonicStreamException)
,
SonicInputStreamController.buildSenderNotification(int, SonicStreamException)
public java.lang.String getNotificationTopic()
This is the Topic to which notification messages are published and from which notification messages are received.
setNotificationTopic(String)
public void setStreamTopic(java.lang.String topic)
This is the Topic to which stream messages are published and from which notification messages are received.
topic
- name of Topic to which stream messages are publishedgetStreamTopic()
public java.lang.String getStreamTopic()
This is the name of the Topic to which stream messages are published.
setStreamTopic(String)
public void useTempStreamTopic(boolean value)
TemporaryTopic
for stream messages.
If set, a unique TemporaryTopic
will be used to send/receive
stream messages by Sonic stream controller instances created via the factory instance.
value
- true if factory is to be set to use TemporaryTopics for streamspublic void setApplicationName(java.lang.String appName)
This name may be set uniquely for the application that makes use of a factory instance, and by default will be included as a property in the header of messages sent by Sonic stream controllers created via the factory instance. The default is "StreamsApp".
appName
- application name to be associated with factory instance
and objects (e.g. stream controllers) created via factory instancegetApplicationName()
public java.lang.String getApplicationName()
This name may be set uniquely for the application that makes use of a factory instance, and by default will be included as a property in the header of messages sent by Sonic stream controllers created via the factory instance.
setApplicationName(String)
public void setDebugFlags(int flags)
Allowable values for this method are 1 or 2; the value will be 0 if not explicitly specified. The meanings of the values are: 1 high level info 2 detail info (includes high level info)
flags
- value of debug levelgetDebugFlags()
public int getDebugFlags()
It returns 0 if the debug level hasn't been explicitly set.
setDebugFlags(int)
public void setSegmentTimeout(int secs)
This timeout value represents the amount of time (in seconds)
for which a SonicInputStreamController
instance will
wait for a segment of the stream to arrive. The default is 60 seconds.
secs
- segment timeout valuegetSegmentTimeout()
public int getSegmentTimeout()
This timeout value represents the amount of time (in seconds)
for which a SonicInputStreamController
instance will
wait for a segment of the stream to arrive.
setSegmentTimeout(int)
public void setSegmentSize(int segmentSize)
This value defines the size (in bytes) of each segment to be sent by
a SonicOutputStreamController
for a given stream. The defailt is 16384.
Note: Method applicable to output streams (senders).
segmentSize
- segment sizegetSegmentSize()
public int getSegmentSize()
This value defines the size (in bytes) of each segment to be sent by
a SonicOutputStreamController
for a given stream.
Note: Method applicable to output streams (senders).
setSegmentSize(int)
public void setReadaheadWindowSize(int kbytes)
The readahead window size limit helps to prevent excessive memory consumption by the Sonic stream controller.
The default is 500 (KB).
Note: Method applicable to receivers.
kbytes
- unread message buffer sizegetReadaheadWindowSize()
public int getReadaheadWindowSize()
The readahead window size limit helps to prevent excessive memory consumption by the Sonic stream controller.
Note: Method applicable to input streams (receivers).
setReadaheadWindowSize(int)
public void setDeliveryMode(int mode)
For Senders: delivery mode for stream segments For Receivers: delivery mode for sender notifications
Allowed values: javax.jms.DeliveryMode.NON_PERSISTENT (default) or progress.message.jclient.DeliveryMode.NON_PERSISTENT_SYNC
Note: Methods applicable to output streams (senders) and input streams (receivers).
mode
- delivery mode used for stream/notification messagesgetDeliveryMode()
public int getDeliveryMode()
Gets the delivery mode for Sonic stream controller instances created via the factory instance.
For Senders: delivery mode for stream segments For Receivers: delivery mode for sender notifications
setDeliveryMode(int)
public SonicOutputStreamController createSonicOutputStreamController(Connection con) throws SonicStreamException
SonicOutputStreamController
object.
This stream controller object is used to create instances of SonicStream
objects, and to send data via those stream instances. The stream controller object is
also used to receive notification messages from consumers of SonicStream
objects.
con
- reference to JMS Connection object to be used by stream controller
SonicStreamException
public SonicOutputStreamController createSonicOutputStreamController(Connection con, Destination streamDest, Destination notifyDest) throws SonicStreamException
SonicOutputStreamController
object.
This stream controller object is used to create instances of SonicStream
objects, and to send data via those stream instances. The stream controller object is
also used to receive notification messages from consumers of SonicStream
objects.
Specifying a non-null Destination
object for the stream destination or the
notify destination overrides the streamTopic or notificationTopic factory parameters.
con
- reference to JMS Connection object to be used by stream controllerstreamDest
- reference to JMS Destination to which stream messages will be sentnotifyDest
- reference to JMS Destination from which notification message will be received
SonicStreamException
public SonicInputStreamController createSonicInputStreamController(Connection con) throws SonicStreamException
SonicInputStreamController
object.
This stream controller object is used to create instances of SonicStream
objects, and to receive data via those stream instances. The stream controller object is
also used to send notification messages from consumersof SonicStream
objects
back to the sender.
con
- reference to JMS Connection object to be used by stream controller
SonicStreamException
public SonicInputStreamController createSonicInputStreamController(Connection con, Destination streamDest, Destination notifyDest) throws SonicStreamException
SonicInputStreamController
object.
This stream controller object is used to create instances of SonicStream
objects, and to receive data via those stream instances. The stream controller object is also used to send notification messages from consumers
of SonicStream
objects back to the sender.
Specifying a non-null Destination
object for the stream destination or the
notify destination overrides the streamTopic or notificationTopic factory parameters.
con
- reference to JMS Connection object to be used by stream controllerstreamDest
- reference to JMS Destination from which stream messages will be received.notifyDest
- reference to JMS Destination to which notification message will be sent
SonicStreamException
|
SonicMQ API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |