Search in sources :

Example 1 with JNDIRequest

use of com.swiftmq.jndi.protocol.v400.JNDIRequest in project swiftmq-ce by iitsoftware.

the class QueueJNDIProcessor method run.

public void run() {
    try {
        t.commit();
        try {
            Versionable versionable = Versionable.toVersionable(msg);
            int version = versionable.selectVersions(JNDISwiftletImpl.VERSIONS);
            switch(version) {
                case 400:
                    {
                        JNDIRequest r = (JNDIRequest) versionable.createVersionedObject();
                        com.swiftmq.impl.jndi.standard.v400.RequestVisitor visitor = new com.swiftmq.impl.jndi.standard.v400.RequestVisitor(ctx, (QueueImpl) msg.getJMSReplyTo(), true);
                        r.accept(visitor);
                    }
                    break;
                default:
                    throw new Exception("Invalid version: " + version);
            }
        } catch (Exception e) {
            if (closed)
                return;
            if (ctx.traceSpace.enabled)
                ctx.traceSpace.trace(ctx.jndiSwiftlet.getName(), "QueueJNDIProcessor: exception occurred: " + e);
            ctx.logSwiftlet.logError(ctx.jndiSwiftlet.getName(), "QueueJNDIProcessor: exception occurred: " + e);
        }
        msg = null;
        if (closed)
            return;
        t = receiver.createTransaction(false);
        t.registerMessageProcessor(this);
    } catch (Exception e) {
        if (closed)
            return;
        if (ctx.traceSpace.enabled)
            ctx.traceSpace.trace(ctx.jndiSwiftlet.getName(), "QueueJNDIProcessor: exception occurred: " + e + ", EXITING!");
    }
}
Also used : JNDIRequest(com.swiftmq.jndi.protocol.v400.JNDIRequest) QueueImpl(com.swiftmq.jms.QueueImpl) Versionable(com.swiftmq.tools.versioning.Versionable)

Example 2 with JNDIRequest

use of com.swiftmq.jndi.protocol.v400.JNDIRequest in project swiftmq-ce by iitsoftware.

the class TopicJNDIProcessor method run.

public void run() {
    try {
        t.commit();
        try {
            Versionable versionable = Versionable.toVersionable(msg);
            int version = versionable.selectVersions(JNDISwiftletImpl.VERSIONS);
            switch(version) {
                case 400:
                    {
                        JNDIRequest r = (JNDIRequest) versionable.createVersionedObject();
                        com.swiftmq.impl.jndi.standard.v400.RequestVisitor visitor = new com.swiftmq.impl.jndi.standard.v400.RequestVisitor(ctx, (QueueImpl) msg.getJMSReplyTo());
                        r.accept(visitor);
                    }
                    break;
                default:
                    throw new Exception("Invalid version: " + version);
            }
        } catch (Exception e) {
            if (closed)
                return;
            if (ctx.traceSpace.enabled)
                ctx.traceSpace.trace(ctx.jndiSwiftlet.getName(), "TopicJNDIProcessor: exception occurred: " + e);
            ctx.logSwiftlet.logError(ctx.jndiSwiftlet.getName(), "TopicJNDIProcessor: exception occurred: " + e);
        }
        msg = null;
        if (closed)
            return;
        t = receiver.createTransaction(false);
        t.registerMessageProcessor(this);
    } catch (Exception e) {
        if (closed)
            return;
        if (ctx.traceSpace.enabled)
            ctx.traceSpace.trace(ctx.jndiSwiftlet.getName(), "TopicJNDIProcessor: exception occurred: " + e + ", EXITING!");
    }
}
Also used : JNDIRequest(com.swiftmq.jndi.protocol.v400.JNDIRequest) QueueImpl(com.swiftmq.jms.QueueImpl) Versionable(com.swiftmq.tools.versioning.Versionable)

Aggregations

QueueImpl (com.swiftmq.jms.QueueImpl)2 JNDIRequest (com.swiftmq.jndi.protocol.v400.JNDIRequest)2 Versionable (com.swiftmq.tools.versioning.Versionable)2