Search in sources :

Example 21 with Dumpable

use of com.swiftmq.tools.dump.Dumpable in project swiftmq-ce by iitsoftware.

the class InboundReader method dataAvailable.

public void dataAvailable(Connection c, InputStream inputStream) throws IOException {
    if (compression) {
        dbis.reset();
        dbos.rewind();
        dis.setInputStream(inputStream);
        int len = dis.readInt();
        byte[] b = new byte[len];
        dis.readFully(b);
        dbis.setBuffer(b);
        decompress();
        dbis.setBuffer(dbos.getBuffer(), 0, dbos.getCount());
        dis.setInputStream(dbis);
    } else
        dis.setInputStream(inputStream);
    Dumpable obj = Dumpalizer.construct(dis, dumpableFactory);
    if (traceSpace.enabled)
        traceSpace.trace("smqr", toString() + ": read object: " + obj);
    if (obj.getDumpId() != SMQRFactory.KEEPALIVE_REQ) {
        if (obj.getDumpId() == SMQRFactory.BULK_REQ) {
            BulkRequest bulkRequest = (BulkRequest) obj;
            for (int i = 0; i < bulkRequest.len; i++) {
                Request req = (Request) bulkRequest.dumpables[i];
                if (req.getDumpId() != SMQRFactory.KEEPALIVE_REQ) {
                    dispatch(req);
                } else {
                    keepaliveCount++;
                    if (traceSpace.enabled)
                        traceSpace.trace("smqr", toString() + ": incrementing keepaliveCount to: " + keepaliveCount);
                }
            }
        } else {
            dispatch((Request) obj);
        }
    } else {
        keepaliveCount = 5;
        if (traceSpace.enabled)
            traceSpace.trace("smqr", toString() + ": setting keepaliveCount to: " + keepaliveCount);
    }
}
Also used : BulkRequest(com.swiftmq.impl.routing.single.smqpr.BulkRequest) Request(com.swiftmq.tools.requestreply.Request) BulkRequest(com.swiftmq.impl.routing.single.smqpr.BulkRequest) Dumpable(com.swiftmq.tools.dump.Dumpable)

Example 22 with Dumpable

use of com.swiftmq.tools.dump.Dumpable in project swiftmq-ce by iitsoftware.

the class TopicInfoFactory method createDumpable.

protected Dumpable createDumpable(Versioned versioned) throws VersionedException {
    int version = versioned.getVersion();
    Dumpable d = null;
    switch(version) {
        case 400:
            d = new com.swiftmq.impl.topic.standard.announce.v400.TopicInfoImpl();
            break;
    }
    if (d != null) {
        try {
            dis.reset();
            dis.setBuffer(versioned.getPayload(), 0, versioned.getLength());
            // dumpid
            dis.readInt();
            d.readContent(dis);
        } catch (IOException e) {
            throw new VersionedException(e.toString());
        }
    }
    return d;
}
Also used : IOException(java.io.IOException) VersionedException(com.swiftmq.tools.versioning.VersionedException) Dumpable(com.swiftmq.tools.dump.Dumpable) VersionedDumpable(com.swiftmq.tools.versioning.VersionedDumpable)

Example 23 with Dumpable

use of com.swiftmq.tools.dump.Dumpable in project swiftmq-client by iitsoftware.

the class StreamMessageImpl method writeBody.

protected void writeBody(DataOutput out) throws IOException {
    out.writeInt(nElements);
    if (nElements > 0) {
        for (int i = 0; i < nElements; i++) {
            Dumpable d = (Dumpable) elements[i];
            out.writeInt(d.getDumpId());
            d.writeContent(out);
        }
    }
}
Also used : Dumpable(com.swiftmq.tools.dump.Dumpable)

Aggregations

Dumpable (com.swiftmq.tools.dump.Dumpable)23 Request (com.swiftmq.tools.requestreply.Request)8 IOException (java.io.IOException)6 Reply (com.swiftmq.tools.requestreply.Reply)4 LengthCaptureDataInput (com.swiftmq.tools.util.LengthCaptureDataInput)3 DataInput (java.io.DataInput)3 JMSSecurityException (javax.jms.JMSSecurityException)3 Endpoint (com.swiftmq.admin.mgmt.Endpoint)2 Data (com.swiftmq.amqp.v100.generated.messaging.message_format.Data)2 AMQPMessage (com.swiftmq.amqp.v100.messaging.AMQPMessage)2 BytesMessageImpl (com.swiftmq.jms.BytesMessageImpl)2 InvalidVersionException (com.swiftmq.jms.InvalidVersionException)2 SMQPBulkRequest (com.swiftmq.jms.smqp.v600.SMQPBulkRequest)2 SMQPBulkRequest (com.swiftmq.jms.smqp.v610.SMQPBulkRequest)2 SMQPBulkRequest (com.swiftmq.jms.smqp.v630.SMQPBulkRequest)2 SMQPBulkRequest (com.swiftmq.jms.smqp.v750.SMQPBulkRequest)2 BulkRequest (com.swiftmq.impl.routing.single.smqpr.BulkRequest)1 SMQPBulkRequest (com.swiftmq.jms.smqp.v400.SMQPBulkRequest)1 SMQPBulkRequest (com.swiftmq.jms.smqp.v500.SMQPBulkRequest)1 SMQPBulkRequest (com.swiftmq.jms.smqp.v510.SMQPBulkRequest)1