package com.ashpool.continuity;

/**
 * ContRequest implements a series of static methods which window
 * into the Continuity server. The context for each method is the
 * currently executing transaction for this thread.
 */

public class ContRequest {
/** 
 * Log a message to the Continuity console.
 * @param level The log level to use. 0 OK 1 WARN 2 ERR 3 DIAG
 *        msg The message to log to the console.
 */
  public static native void logMessage(int level, String msg);

  public static native String getRequestTuple(String key);
  public static native String getResponseTuple(String key);
  public static native String getVarTuple(String key);

  public static native void setRequestTuple(String key, String value);
  public static native void setResponseTuple(String key, String value);
  public static native void setVarTuple(String key, String value);

  public static native void startResponse(int status);

  public static native void write(String str);
  public static native void write(byte[] b, int length);

  public static native byte[] read(int length);

  public static native void glueObject(Object obj, String method, String name);
}
