|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object php.java.bridge.Util
public final class Util
Miscellaneous functions.
Nested Class Summary | |
---|---|
static class |
Util.Logger
Only for internal use. |
static class |
Util.Process
Starts a CGI process and returns the process handle. |
static class |
Util.ProcessWithErrorHandler
Starts a CGI process with an error handler attached and returns the process handle. |
static class |
Util.Thread
Convenience daemon thread class |
Field Summary | |
---|---|
static java.lang.String[] |
ALLOW_URL_INCLUDE
The PHP argument allow_url_include=On, passed to all JSR223 script engines |
static java.lang.String |
ASCII
ASCII encoding |
static int |
BACKLOG
Backlog for TCP and unix domain connections. |
static int |
BUF_SIZE
The default buffer size |
static java.util.HashMap |
COMMON_ENVIRONMENT
A map containing environment values not in ENVIRONMENT_BLACKLIST. |
static java.lang.String[] |
DEFAULT_CGI_LOCATIONS
The default CGI locations: "/usr/bin/php-cgi" , "c:/Program Files/PHP/php-cgi.exe |
static java.lang.String |
DEFAULT_ENCODING
DEFAULT currently UTF-8, will be changed when most OS support and use UTF-16. |
static java.lang.String[] |
DEFAULT_EXT_DIRS
The default extension directories. |
static java.lang.String |
DEFAULT_LOG_FILE
The default log file. |
static int |
DEFAULT_LOG_LEVEL
The default log level, java.log_level from php.ini overrides. |
static java.util.List |
ENVIRONMENT_BLACKLIST
Environment entries which should NOT be passed to PHP. |
static java.lang.String |
EXTENSION_NAME
The name of the extension, usually "JavaBridge" or "MonoBridge" |
static FCGIConnectionPool |
fcgiConnectionPool
Only for internal use. |
static byte[] |
HEX_DIGITS
Only for internal use |
static java.io.File |
HOME_DIR
Only for internal use |
static boolean |
IS_GNU_JAVA
Set to true if the VM is gcj, false otherwise |
static java.lang.Class |
JAVA_INC
The java/Java.inc code |
static java.lang.Class |
JAVA_PROXY
The java/JavaProxy.php code |
static java.lang.String |
JAVABRIDGE_BASE
The base directory of the PHP/Java Bridge. |
static boolean |
JAVABRIDGE_PROMISCUOUS
Set to true, if the Java VM has been started with -Dphp.java.bridge.promiscuous=true; |
static java.lang.Class |
LAUNCHER_UNIX
The launcher.sh code |
static java.lang.Class |
LAUNCHER_WINDOWS
The launcher.exe code |
static java.lang.Class |
LAUNCHER_WINDOWS2
The launcher.exe code |
static java.lang.Class |
LAUNCHER_WINDOWS3
The launcher.exe code |
static java.lang.Class |
LAUNCHER_WINDOWS4
The launcher.exe code |
static int |
logLevel
The loglevel: 0: log off 1: log fatal 2: log messages/exceptions 3: log verbose 4: log debug 5: log method invocations |
static int |
MAX_WAIT
Used by the watchdog. |
static java.lang.String |
osArch
Only for internal use |
static java.lang.String |
osName
Only for internal use |
static java.lang.String |
PHP_EXEC
Only for internal use |
static ThreadPool |
PHP_SCRIPT_ENGINE_THREAD_POOL
Script engines are started from this pool. |
static java.lang.Class |
PHPDEBUGGER_PHP
The java/Java.inc code |
static byte[] |
RN
Only for internal use |
static java.lang.String |
THREAD_POOL_MAX_SIZE
The max. |
static java.io.File |
TMPDIR
|
static boolean |
USE_SH_WRAPPER
True if /bin/sh exists, false otherwise |
static java.lang.String |
UTF8
UTF8 encoding |
static java.lang.String |
VERSION
Only for internal use |
static java.lang.String |
VM_NAME
The name of the VM, for example "1.4.2@http://java.sun.com/" or "1.4.2@http://gcc.gnu.org/java/". |
static java.lang.String |
X_JAVABRIDGE_CONTEXT
The standard Context ID used by the ContextFactory |
static java.lang.String |
X_JAVABRIDGE_INCLUDE
|
static java.lang.String |
X_JAVABRIDGE_INCLUDE_ONLY
|
static java.lang.String |
X_JAVABRIDGE_OVERRIDE_HOSTS
Used to re-direct back to the current VM |
static java.lang.String |
X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT
|
static java.lang.String |
X_JAVABRIDGE_REDIRECT
|
static java.lang.Object[] |
ZERO_ARG
Only for internal use |
static java.lang.Class[] |
ZERO_PARAM
Only for internal use |
Method Summary | |
---|---|
static void |
appendArgs(java.lang.Object[] args,
java.lang.Class[] params,
java.lang.StringBuffer buf)
Append function arguments and their types to a StringBuffer |
static void |
appendObject(java.lang.Object obj,
java.lang.StringBuffer buf)
Append an object to a StringBuffer |
static void |
appendParam(java.lang.Class c,
java.lang.StringBuffer buf)
Append a function parameter to a StringBuffer |
static void |
appendParam(java.lang.Object obj,
java.lang.StringBuffer buf)
Append a function parameter to a StringBuffer |
static void |
appendShortObject(java.lang.Object obj,
java.lang.StringBuffer buf)
Append a parameter object to a StringBuffer |
static void |
appendTrace(java.lang.Throwable throwable,
java.lang.String trace,
java.lang.StringBuffer buf)
Append a stack trace to buf. |
static java.lang.String |
argsToString(java.lang.Object[] args,
java.lang.Class[] params)
Return function arguments and their types as a String |
static java.lang.String[] |
checkCgiBinary(java.lang.String php)
Checks if the cgi binary buf-<os.arch>-<os.name>.sh or buf-<os.arch>-<os.name>.exe or buf-<os.arch>-<os.name> exists. |
static java.lang.String |
checkError(java.lang.String s)
Returns s if s contains "PHP Fatal error:"; |
static java.lang.Class |
classForName(java.lang.String name)
|
static AppThreadPool |
createThreadPool(java.lang.String name)
Create a new AppThreadPool. |
static void |
destroy()
Destroy the thread associated with util. |
static java.lang.String |
formatDateTime(long ms)
Return the time in GMT |
static java.lang.Class |
getClass(java.lang.Object obj)
Return the class or the object, if obj is already a class. |
static java.lang.String |
getClassName(java.lang.Object obj)
Return the class name |
static java.lang.ClassLoader |
getContextClassLoader()
Return the thread context class loader |
static java.lang.String |
getHostAddress(boolean promiscuous)
Returns the string "127.0.0.1". |
static ILogger |
getLogger()
|
static java.lang.String |
getShortClassName(java.lang.Object obj)
Return the short class name |
static java.lang.String |
getShortName(java.lang.Class clazz)
Return the short class name |
static java.lang.String |
getSimpleRedirectString(java.lang.String webPath,
java.lang.String socketName,
boolean isSecure)
|
static java.lang.String[] |
hashToStringArray(java.util.Map h)
Create a string array from a hashtable. |
static void |
logDebug(java.lang.String msg)
Display a debug message |
static void |
logError(java.lang.String msg)
Display an error or an exception |
static void |
logFatal(java.lang.String msg)
Display a fatal error |
static void |
logMessage(java.lang.String msg)
Display a message |
static void |
println(int level,
java.lang.String msg)
print a message on a given log level |
static void |
printStackTrace(java.lang.Throwable t)
Display a stack trace if logLevel >= 1 |
static void |
setDefaultLogger(ILogger logger)
Sets the fall back logger, used when no thread-local logger exists. |
static java.lang.String |
stringValueOf(java.lang.Object object)
This procedure should be used whenever object may be a dynamic proxy:
String.valueOf(object) returns null, if object is a proxy and returns null. |
static byte[] |
toBytes(java.lang.String s)
Locale-independent getBytes(), uses ASCII encoding |
static void |
warn(java.lang.String msg)
Display a warning if logLevel >= 1 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ThreadPool PHP_SCRIPT_ENGINE_THREAD_POOL
public static FCGIConnectionPool fcgiConnectionPool
public static int MAX_WAIT
php.java.bridge.max_wait
public static java.lang.Class JAVA_INC
public static java.lang.Class PHPDEBUGGER_PHP
public static java.lang.Class JAVA_PROXY
public static java.lang.Class LAUNCHER_UNIX
public static java.lang.Class LAUNCHER_WINDOWS
public static java.lang.Class LAUNCHER_WINDOWS2
public static java.lang.Class LAUNCHER_WINDOWS3
public static java.lang.Class LAUNCHER_WINDOWS4
public static final byte[] HEX_DIGITS
public static final boolean USE_SH_WRAPPER
public static final java.lang.String[] ALLOW_URL_INCLUDE
public static final java.lang.String X_JAVABRIDGE_OVERRIDE_HOSTS
public static final java.lang.String X_JAVABRIDGE_CONTEXT
public static final java.lang.String X_JAVABRIDGE_OVERRIDE_HOSTS_REDIRECT
public static final java.lang.String X_JAVABRIDGE_REDIRECT
public static final java.lang.String X_JAVABRIDGE_INCLUDE
public static final java.lang.String X_JAVABRIDGE_INCLUDE_ONLY
public static java.lang.String[] DEFAULT_CGI_LOCATIONS
"/usr/bin/php-cgi"
, "c:/Program Files/PHP/php-cgi.exe
public static final java.lang.String ASCII
public static final java.lang.String UTF8
public static final java.lang.String DEFAULT_ENCODING
public static final int BUF_SIZE
public static java.util.List ENVIRONMENT_BLACKLIST
public static java.util.HashMap COMMON_ENVIRONMENT
java -DPATH="$PATH" -DHOME="$HOME" -jar JavaBridge.jar
or
java -DPATH="%PATH%" -jar JavaBridge.jar
.
public static final java.lang.String[] DEFAULT_EXT_DIRS
public static final boolean IS_GNU_JAVA
public static java.lang.String EXTENSION_NAME
public static java.lang.String THREAD_POOL_MAX_SIZE
property php.java.bridge.threads
public static int DEFAULT_LOG_LEVEL
property php.java.bridge.default_log_level
public static final int BACKLOG
public static final java.lang.Object[] ZERO_ARG
public static final java.lang.Class[] ZERO_PARAM
public static final byte[] RN
public static java.io.File TMPDIR
public static java.lang.String VM_NAME
public static boolean JAVABRIDGE_PROMISCUOUS
public static java.lang.String DEFAULT_LOG_FILE
EXTENSION_NAME
.log,
if started via java -jar JavaBridge.jar.
property php.java.bridge.default_log_file
public static java.lang.String JAVABRIDGE_BASE
public static java.lang.String VERSION
public static java.lang.String osArch
public static java.lang.String osName
public static java.lang.String PHP_EXEC
public static java.io.File HOME_DIR
public static int logLevel
Method Detail |
---|
public static void println(int level, java.lang.String msg)
level
- The log levelmsg
- The messagepublic static void warn(java.lang.String msg)
msg
- The warn messagepublic static void printStackTrace(java.lang.Throwable t)
t
- The Throwablepublic static void logDebug(java.lang.String msg)
msg
- The messagepublic static void logFatal(java.lang.String msg)
msg
- The errorpublic static void logError(java.lang.String msg)
msg
- The error or the exceptionpublic static void logMessage(java.lang.String msg)
msg
- The messagepublic static java.lang.String getClassName(java.lang.Object obj)
obj
- The object
public static java.lang.String getShortClassName(java.lang.Object obj)
obj
- The object
public static java.lang.String getShortName(java.lang.Class clazz)
clazz
- The class
public static java.lang.Class getClass(java.lang.Object obj)
obj
- The object
public static void appendObject(java.lang.Object obj, java.lang.StringBuffer buf)
obj
- The objectbuf
- The StringBufferpublic static void appendTrace(java.lang.Throwable throwable, java.lang.String trace, java.lang.StringBuffer buf)
throwable
- The throwable objecttrace
- The trace from PHPbuf
- The current buffer.public static void appendShortObject(java.lang.Object obj, java.lang.StringBuffer buf)
obj
- The objectbuf
- The StringBufferpublic static void appendParam(java.lang.Class c, java.lang.StringBuffer buf)
c
- The parameterbuf
- The StringBufferpublic static void appendParam(java.lang.Object obj, java.lang.StringBuffer buf)
obj
- The parameter objectbuf
- The StringBufferpublic static java.lang.String argsToString(java.lang.Object[] args, java.lang.Class[] params)
args
- The argsparams
- The associated types
public static void appendArgs(java.lang.Object[] args, java.lang.Class[] params, java.lang.StringBuffer buf)
args
- The argsparams
- The associated typesbuf
- The StringBufferpublic static byte[] toBytes(java.lang.String s)
s
- The String
public static java.lang.String[] hashToStringArray(java.util.Map h)
h
- The hashtable
java.lang.NullPointerException
public static void setDefaultLogger(ILogger logger)
new Logger(new FileLogger())
.
logger
- the loggerlogDebug(java.lang.String)
public static ILogger getLogger()
public static java.lang.String getHostAddress(boolean promiscuous)
public static java.lang.String[] checkCgiBinary(java.lang.String php)
php
- the php binary or null
public static java.lang.String checkError(java.lang.String s)
s
- The error string
public static java.lang.String stringValueOf(java.lang.Object object)
object
may be a dynamic proxy:
String.valueOf(object) returns null, if object is a proxy and returns null.
object
- The object or dynamic proxy
public static AppThreadPool createThreadPool(java.lang.String name)
name
- The pool name
THREAD_POOL_MAX_SIZE
runnablespublic static java.lang.String formatDateTime(long ms)
ms
- the time in milliseconds
public static final java.lang.ClassLoader getContextClassLoader()
public static final java.lang.Class classForName(java.lang.String name) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public static java.lang.String getSimpleRedirectString(java.lang.String webPath, java.lang.String socketName, boolean isSecure)
public static void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |