Search in sources :

Example 21 with FilteringObjectInputStream

use of com.sun.messaging.jmq.util.io.FilteringObjectInputStream in project openmq by eclipse-ee4j.

the class DirectStreamPacket method _reset.

/**
 * Reset method for private use
 */
private void _reset(String methodName) throws JMSException {
    super._setReadOnlyBody(true);
    try {
        if (this.writePerformed) {
            this.objectOutputStream.flush();
            this.messageBody = this.byteArrayOutputStream.toByteArray();
            this.objectOutputStream.close();
            this.byteArrayOutputStream.close();
            this.writePerformed = false;
        }
        if (this.messageBody != null) {
            this.byteArrayInputStream = new ByteArrayInputStream(this.messageBody);
            this.objectInputStream = new FilteringObjectInputStream(this.byteArrayInputStream);
        }
    } catch (Exception e) {
        String errMsg = _lgrMID_EXC + ":Exception:StreamMessage." + methodName + ":message=" + e.getMessage();
        _loggerJM.severe(errMsg);
        JMSException jmse = new jakarta.jms.JMSException(errMsg);
        jmse.initCause(e);
        throw jmse;
    }
    // reset flag
    this.byteArrayReadState = false;
    this.notYetProcessedPrimitiveObject = null;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) JMSException(jakarta.jms.JMSException) FilteringObjectInputStream(com.sun.messaging.jmq.util.io.FilteringObjectInputStream) JMSException(jakarta.jms.JMSException) MessageNotWriteableException(jakarta.jms.MessageNotWriteableException) JMSException(jakarta.jms.JMSException) IOException(java.io.IOException) EOFException(java.io.EOFException) MessageNotReadableException(jakarta.jms.MessageNotReadableException) MessageEOFException(jakarta.jms.MessageEOFException) MessageFormatException(jakarta.jms.MessageFormatException)

Example 22 with FilteringObjectInputStream

use of com.sun.messaging.jmq.util.io.FilteringObjectInputStream in project openmq by eclipse-ee4j.

the class ReadChannel method getHashtableFromMessageBody.

protected static Hashtable getHashtableFromMessageBody(ReadOnlyPacket pkt) {
    Hashtable prop = null;
    try {
        InputStream is = pkt.getMessageBodyStream();
        ObjectInputStream ois = new FilteringObjectInputStream(is);
        prop = (Hashtable) ois.readObject();
        ois.close();
        is.close();
    } catch (Exception e) {
        ExceptionHandler.logCaughtException(e);
        Debug.printStackTrace(e);
    }
    return prop;
}
Also used : Hashtable(java.util.Hashtable) FilteringObjectInputStream(com.sun.messaging.jmq.util.io.FilteringObjectInputStream) FilteringObjectInputStream(com.sun.messaging.jmq.util.io.FilteringObjectInputStream) FilteringObjectInputStream(com.sun.messaging.jmq.util.io.FilteringObjectInputStream)

Aggregations

FilteringObjectInputStream (com.sun.messaging.jmq.util.io.FilteringObjectInputStream)22 ObjectInputStream (java.io.ObjectInputStream)13 ByteArrayInputStream (java.io.ByteArrayInputStream)12 DataInputStream (java.io.DataInputStream)5 Hashtable (java.util.Hashtable)5 BrokerException (com.sun.messaging.jmq.jmsserver.util.BrokerException)3 Destination (com.sun.messaging.jmq.jmsserver.core.Destination)2 PacketReference (com.sun.messaging.jmq.jmsserver.core.PacketReference)2 TransactionWork (com.sun.messaging.jmq.jmsserver.data.TransactionWork)2 JMSException (jakarta.jms.JMSException)2 MessageFormatException (jakarta.jms.MessageFormatException)2 MessageNotWriteableException (jakarta.jms.MessageNotWriteableException)2 IOException (java.io.IOException)2 ByteBuffer (java.nio.ByteBuffer)2 HashMap (java.util.HashMap)2 UpdateOpaqueDataCallback (com.sun.messaging.bridge.api.UpdateOpaqueDataCallback)1 BranchXid (com.sun.messaging.bridge.service.jms.tx.BranchXid)1 GlobalXid (com.sun.messaging.bridge.service.jms.tx.GlobalXid)1 DestinationUID (com.sun.messaging.jmq.jmsserver.core.DestinationUID)1 ClusterTransaction (com.sun.messaging.jmq.jmsserver.data.ClusterTransaction)1