org.apache.activemq
Class ActiveMQInputStream
java.lang.Object
java.io.InputStream
org.apache.activemq.ActiveMQInputStream
- All Implemented Interfaces:
- java.io.Closeable, ActiveMQDispatcher
public class ActiveMQInputStream
- extends java.io.InputStream
- implements ActiveMQDispatcher
| Methods inherited from class java.io.InputStream |
available, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ActiveMQInputStream
public ActiveMQInputStream(ActiveMQConnection connection,
ConsumerId consumerId,
ActiveMQDestination dest,
java.lang.String selector,
boolean noLocal,
java.lang.String name,
int prefetch,
long timeout)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.InputStream
- Throws:
java.io.IOException
dispose
public void dispose()
getJMSProperties
public java.util.Map<java.lang.String,java.lang.Object> getJMSProperties()
throws java.io.IOException
- Return the JMS Properties which where used to send the InputStream
- Returns:
- jmsProperties
- Throws:
java.io.IOException
receive
public ActiveMQMessage receive()
throws javax.jms.JMSException,
ActiveMQInputStream.ReadTimeoutException
- This method allows the client to receive the Stream data as unaltered ActiveMQMessage
object which is how the split stream data is sent. Each message will contains one
chunk of the written bytes as well as a valid message group sequence id. The EOS
message will have a message group sequence id of -1.
This method is useful for testing, but should never be mixed with calls to the
normal stream receive methods as it will break the normal stream processing flow
and can lead to loss of data.
- Returns:
- an ActiveMQMessage object that either contains byte data or an end of strem
marker.
- Throws:
javax.jms.JMSException
ActiveMQInputStream.ReadTimeoutException
checkClosed
protected void checkClosed()
throws javax.jms.IllegalStateException
- Throws:
javax.jms.IllegalStateException
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
ActiveMQInputStream.ReadTimeoutException - if a timeout was given and the first chunk of the message could not read within the timeout
java.io.IOException- See Also:
InputStream.read()
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
ActiveMQInputStream.ReadTimeoutException - if a timeout was given and the first chunk of the message could not read within the timeout
java.io.IOException- See Also:
InputStream.read(byte[], int, int)
dispatch
public void dispatch(MessageDispatch md)
- Specified by:
dispatch in interface ActiveMQDispatcher
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Copyright © 2005-2015 Red Hat, Inc.. All Rights Reserved.