HPSearch

cgl.hpsearch.engine.URIBindings
Class JMSStreamHandler

java.lang.Object
  extended byjava.io.OutputStream
      extended bycgl.hpsearch.engine.URIBindings.JMSStreamHandler
All Implemented Interfaces:
javax.jms.MessageListener, SystemConstants

Deprecated. Use NBNtiveStreamHandler NBNativeStreamHandler

public class JMSStreamHandler
extends OutputStream
implements SystemConstants, javax.jms.MessageListener

Handler for writing / reading to /from a Broker using JMS connectivity.

Policy for Handling EOF
The first byte in every "BytesMessage" message denotes the type of data
If the first byte is STX (byte 2) then the rest of the message is data, else if the first byte is EOT (byte 4) then it denotes end of transmission (or EOF) in our case

Author:
Harshawardhan S. Gadgil
See Also:
This class fetures connectivity using NB Native interface.

Field Summary
 
Fields inherited from interface cgl.hpsearch.common.SystemConstants
ABANDON_HANDLER, ABANDONED, BROKER_HOST, BROKER_PORT, BUF_SIZE, EOT, EXCEPTION, FAILURE, FILESEPARTOR, FLOW_LOGGING_MANAGER, FLOW_MANAGER, HPSEARCH_CONFIG, HPSEARCH_HOME, HPSEARCH_SHELL, HPSEARCH_WS, MARKER, NB_HOME, NB_PERFORMANCE_DATA_TOPIC, OS_TYPE, OS_UNIX, OS_WIN, PORT, PROTOCOL, READY, RESUME, RUNNING, SCRIPT_ARGS, SCRIPT_PATH, SHELLWS_PORT, START_HANDLER, STREAM_MARKER_DATA, STREAM_MARKER_EOF, STX, SUCCESS, SUSPEND, TASK_DEFINED, TASK_SCHEDULER_ENGINE, TASKSCHEDULER_AUTO_CONNECT_COMM_LINK, TASKSCHEDULER_ENGINE_COMM_LINK, THREAD_SLEEP_INTERVAL, UNKNOWN, WAITING, WSCONTEXT_RESULT_BIN, WSCONTEXT_SERVICE
 
Constructor Summary
JMSStreamHandler(String connectionURI)
          Deprecated. Writes/Reads to/from stream brokerStream
JMSStreamHandler(String hostName, int portNum, String transportType, String brokerStream)
          Deprecated.  
 
Method Summary
 void close()
          Deprecated.  
 void flush()
          Deprecated.  
 InputStream getInputStream()
          Deprecated. Get the file's input stream
 OutputStream getOutputStream()
          Deprecated.  
 void init(String hostName, int portNum, String transportType, String brokerStream)
          Deprecated.  
 void onMessage(javax.jms.Message message)
          Deprecated.  
 void write(byte[] buf)
          Deprecated. Writes buf to the topic to which this instance is subscribed to.
 void write(byte[] buf, int offset, int len)
          Deprecated. Writes a part of the byte buffer buf to the topic to which this instance is subscribed to.
 void write(int i)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSStreamHandler

public JMSStreamHandler(String connectionURI)
Deprecated. 
Writes/Reads to/from stream brokerStream

Parameters:
connectionURI - A string representing the stream to be written/read.

JMSStreamHandler

public JMSStreamHandler(String hostName,
                        int portNum,
                        String transportType,
                        String brokerStream)
Deprecated. 
Method Detail

init

public void init(String hostName,
                 int portNum,
                 String transportType,
                 String brokerStream)
Deprecated. 

getInputStream

public InputStream getInputStream()
Deprecated. 
Get the file's input stream

Returns:
The files's input stream, Null on error

getOutputStream

public OutputStream getOutputStream()
Deprecated. 

onMessage

public void onMessage(javax.jms.Message message)
Deprecated. 
Specified by:
onMessage in interface javax.jms.MessageListener

write

public void write(byte[] buf,
                  int offset,
                  int len)
Deprecated. 
Writes a part of the byte buffer buf to the topic to which this instance is subscribed to. This method calls the write(byte[] buf) method, that adds the 'MSG:' token before the message.

Parameters:
buf - A byte array containing the data to publish
offset - An int representing the offset in the buffer buf
len - An int representing the length of array to send.

write

public void write(byte[] buf)
Deprecated. 
Writes buf to the topic to which this instance is subscribed to. This method adds the 'MSG:' token before the message...

Parameters:
buf - A byte array containing the data to publish

write

public void write(int i)
           throws IOException
Deprecated. 
Throws:
IOException

flush

public void flush()
           throws IOException
Deprecated. 
Throws:
IOException

close

public void close()
Deprecated. 

HPSearch

For comments and suggestions please send e-mail to Harshawardhan Gadgil
Last updated: June 9 2006