home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-04-03 | 3.8 KB | 99 lines |
- /*
- ** Sambar Server JAVA Engine Implementation
- **
- ** Confidential Property of Tod Sambar
- ** (c) Copyright Tod Sambar 1999
- ** All rights reserved.
- */
- package com.sambar.javaeng;
-
- import java.io.*;
- import java.net.*;
- import java.util.*;
- import java.util.Enumeration;
-
- /*
- ** Access to Sambar API via native methods
- */
- public class SambarAPI
- {
- static
- {
- System.out.println("Loading javaeng library");
-
- try
- {
- System.loadLibrary("sambarje");
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- System.out.println("Done loading javaeng library");
- }
-
- // -------------------- Internal codes --------------------
- public final static int FAIL = 0;
- public final static int SUCCEED = 1;
-
- // -------------------- Engine defines --------------------
- public final static String SESSION_ID = "JAVAENGID";
-
- // -------------------- Generic methods --------------------
- public static native void log(long req, String message);
- public static native void logctx(long javaeng, String message);
- public static native void putb(long req, int val);
- public static native void puts(long req, String text);
- public static native void flush(long req);
- public static native void close(long req);
- public static native void sendError(long req, int status, String msg);
-
- // -------------------- ServletContext methods --------------------
- public static native String getMimeType(long javaeng, String file);
- public static native String getInitParameter(long javaeng, String name);
- public static native String getRealPath(long javaeng, String path);
- public static native String getServerInfo(long javaeng);
- public static native String getServletsPath(long javaeng);
- public static native String getGenericServlet(long javaeng);
-
- // -------------------- ServletRequest methods --------------------
- public static native String getServletName(long req);
- public static native byte [] getContent(long req);
- public static native int getContentLength(long req);
- public static native String getContentType(long req);
- public static native String getParameter(long req, String name);
- public static native void setParameter(long req, String name, String val);
- public static native int getParameterCount(long req);
- public static native String getParameterName(long req, int pos);
- public static native String getParameterValue(long req, int pos);
- public static native String getProtocol(long req);
- public static native String getScheme(long req);
- public static native String getHostname(long req);
- public static native String getServerName(long req);
- public static native int getServerPort(long req);
- public static native String getRemoteAddr(long req);
- public static native String getRemoteHost(long req);
-
- // -------------------- HTTPServletRequest methods --------------------
- public static native String getAuthType(long req);
- public static native String getAuthPass(long req);
- public static native String getHeader(long req, String name);
- public static native int wasHeaderSent(long req);
- public static native String getMethod(long req);
- public static native String getPathInfo(long req);
- public static native String getPathTranslated(long req);
- public static native String getQueryString(long req);
- public static native String getRemoteUser(long req);
- public static native String getRequestURI(long req);
- public static native String getServletPath(long req);
- public static native String getContextPath(long req);
-
- // -------------------- SambarRequest methods --------------------
- public static native int isSambarAdmin(long req);
- public static native int isSambarUser(long req);
-
- // -------------------- SambarResponse methods --------------------
- public static native int setKeepAlive(long req);
- }
-