Package org.jpos.transaction

Examples of org.jpos.transaction.Context


        assertEquals ("ZERO", sp.rdp ("PUT"));
        assertEquals ("ZERO", sp.inp ("PUT"));
        assertNull (sp.rdp ("PUT"));
    }
    public void testPersistentContext() throws Exception {
        Context ctx = new Context();
        ctx.put("P", "ABC", true);
        ISOMsg m = new ISOMsg("0800");
        m.set(11, "000001");
        ctx.put("ISOMSG", m, true);
        sp.out("CTX", ctx);
        assertNotNull("entry should not be null", sp.in("CTX"));
    }
View Full Code Here


    while (running()) {

      Object o = sp.in(in, timeout);

              if (o != null) {
                    Context ctx = new Context();
                    ctx.put(contextName, o);
                   
                    if (contextValues != null) {
          for (Element e : contextValues) {
                        ctx.put(e.getName(),e.getValue());
                      }
        }
                   
                   sp.out(out, ctx);
      }
View Full Code Here

    public static final String UNKNOWN = "UNKNOWN";
    public int prepare (long id, Serializable o) {
        return PREPARED | NO_JOIN | READONLY;
    }
    public String select (long id, Serializable ser) {
        Context ctx = (Context) ser;
        String name = cfg.get ("name");
        String action = ctx.get (name) != null ? YES : NO;
        return cfg.get (action, UNKNOWN);
    }
View Full Code Here

import java.io.Serializable;

public class Trace implements AbortParticipant, Configurable {
    String trace;
    public int prepare (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("prepare:" + trace);
        return PREPARED | READONLY;
    }
View Full Code Here

        Context ctx = (Context) o;
        ctx.checkPoint ("prepare:" + trace);
        return PREPARED | READONLY;
    }
    public void commit (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("commit:" + trace);
    }
View Full Code Here

    public void commit (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("commit:" + trace);
    }
    public void abort  (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("abort:" + trace);
    }
View Full Code Here

    public void abort  (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("abort:" + trace);
    }
    public int prepareForAbort (long id, Serializable o) {
        Context ctx = (Context) o;
        ctx.checkPoint ("prepareForAbort:" + trace);
        return PREPARED | READONLY;
    }
View Full Code Here

TOP

Related Classes of org.jpos.transaction.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.