public final class ProcessManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISABLE_THREAD_INTERRUPT
Allow the thread.interrupt() as part of the cancel of the thread to be disabled
as not correctly handling the exception caused in the running SQL can cause a
problem.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
abortProcess(long processID)
abort a process
MODE: multi thread.
|
static java.lang.String |
abortProcess(ProcessHandler handler)
abort a process
MODE: multi thread.
|
static java.lang.String |
abortProcess(ServerProcess process)
abort a process
MODE: multi thread.
|
static java.lang.String |
cancelProcess(long processID)
cancel a process
MODE: multi thread.
|
static java.lang.String |
cancelProcess(ProcessHandler handler)
cancel a process
MODE: multi thread.
|
static java.lang.String |
cancelProcess(ServerProcess process)
cancel a process
MODE: multi thread.
|
static void |
check()
check that we are not terminated or paused.
|
static void |
check(ServerProcess process)
check that we are not terminated or paused.
|
static void |
endProcess()
end a process on the current thread
MODE: Single thread.
|
static java.lang.String |
getCurrentLoginID()
Get the owner login of a current process.
|
static ProcessHandler |
getHandler(long processId)
Is this connection terminated ?
TODO: This should be notified so that we don't sleep for 59 seconds after the connection has been resumed.
|
static ProcessHandler[] |
getHandler(ServerProcess process)
returns the currently running process by a unique process id
|
static ProcessHandler |
getHandler(java.lang.Thread thread)
returns the currently running process by a unique process id
|
static long |
getHitsDB(ServerProcess process)
The database hits
|
static long |
getLargeHitsDB(ServerProcess process)
The database large hits
|
static java.lang.String |
getLoginID(ServerProcess process)
Get the owner login of a process.
|
static int |
getPID()
Get the process ID
|
static long |
getProcessID(ServerProcess process)
get the process id
|
static java.lang.String |
getProgressMsg(ServerProcess process)
get the progress message
|
static long |
getStartMS(ServerProcess process)
get the process start time in ms
|
static <T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
static boolean |
isProcessTerminated(ServerProcess process)
Is this process terminated ?
|
static boolean |
isProcessTimedOut(ServerProcess process)
Is this process timed out?
|
static void |
leaveThreadNameOnEnd(boolean flag)
do not restore the name of the thread when the process for this thread ends.
|
static ServerProcess[] |
listProcesses()
returns a list of currently running connections
|
static void |
parkAndWait(ServerProcess process)
park and wait if the process is paused.
|
static java.lang.String |
pauseProcess(long processID)
pause this connection.
|
static <T> T |
result(java.util.concurrent.Future<T> task)
get the result
|
static java.lang.String |
resumeProcess(long processID)
resume this connection
|
static void |
startProcess(ServerProcess process,
Login owner)
start a process on the current thread
MODE: Single thread.
|
static void |
startProcess(ServerProcess process,
Login owner,
long timeout)
start a process on the current thread with timeout time
MODE: Single thread.
|
static <T> java.util.concurrent.ForkJoinTask<T> |
submit(java.util.concurrent.Callable<T> call) |
public static final java.lang.String DISABLE_THREAD_INTERRUPT
public static int getPID()
@CheckReturnValue @Nonnull public static <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
T
- the expected typetasks
- the tasks to runjava.lang.NullPointerException
java.util.concurrent.RejectedExecutionException
@CheckReturnValue @Nonnull public static <T> java.util.concurrent.ForkJoinTask<T> submit(java.util.concurrent.Callable<T> call)
T
- the typecall
- the calljava.lang.NullPointerException
- if the task is nulljava.util.concurrent.RejectedExecutionException
- if the task cannot be
scheduled for execution@CheckReturnValue @Nonnull public static <T> T result(java.util.concurrent.Future<T> task) throws java.lang.Exception
T
- the type expected.task
- the taskjava.lang.Exception
- A problem@CheckReturnValue @Nonnull public static java.lang.String pauseProcess(long processID)
processID
- the process ID@CheckReturnValue @Nonnull public static java.lang.String resumeProcess(long processID)
processID
- the process IDpublic static void check()
public static void check(@Nullable ServerProcess process)
process
- the processpublic static void parkAndWait(@Nonnull ServerProcess process)
process
- the process to check.@CheckReturnValue public static boolean isProcessTerminated(@Nonnull ServerProcess process)
process
- the process to check if terminated.@CheckReturnValue public static boolean isProcessTimedOut(@Nonnull ServerProcess process)
process
- the process to check if timed out@CheckReturnValue public static long getProcessID(@Nonnull ServerProcess process)
process
- the process to get the process id for@CheckReturnValue @Nullable public static ProcessHandler getHandler(long processId)
processId
- The process id@CheckReturnValue @Nullable public static ProcessHandler[] getHandler(@Nonnull ServerProcess process)
process
- the process to get the handler of@CheckReturnValue @Nullable public static ProcessHandler getHandler(@Nonnull java.lang.Thread thread)
thread
- The thread to get the current handler for.@CheckReturnValue @Nonnull public static java.lang.String getProgressMsg(@Nonnull ServerProcess process)
process
- the process to get the process message of@CheckReturnValue public static long getStartMS(@Nonnull ServerProcess process)
process
- the process to get the start ms of@CheckReturnValue public static long getHitsDB(@Nonnull ServerProcess process)
process
- the process@CheckReturnValue public static long getLargeHitsDB(@Nonnull ServerProcess process)
process
- the process@CheckReturnValue @Nonnull public static java.lang.String getLoginID(ServerProcess process)
process
- the process to get the owner login ofpublic static void leaveThreadNameOnEnd(boolean flag)
flag
- TRUE to leave the name as is.@CheckReturnValue @Nonnull public static ServerProcess[] listProcesses()
@CheckReturnValue @Nullable public static java.lang.String getCurrentLoginID()
public static void startProcess(ServerProcess process, Login owner) throws java.lang.Exception
process
- the process to startowner
- the owner login.java.lang.Exception
- A serious problempublic static void startProcess(ServerProcess process, Login owner, long timeout) throws java.lang.Exception
process
- the process to startowner
- the owner login.timeout
- timeout of this process in MSjava.lang.Exception
- A serious problempublic static void endProcess()
@Nonnull public static java.lang.String cancelProcess(@Nonnull ServerProcess process) throws java.lang.Exception
process
- the process to canceljava.lang.Exception
- A serious problem@Nonnull public static java.lang.String cancelProcess(long processID) throws java.lang.Exception
processID
- the process to canceljava.lang.Exception
- A serious problem@Nonnull public static java.lang.String cancelProcess(@Nullable ProcessHandler handler) throws java.lang.Exception
handler
- the process to canceljava.lang.Exception
- A serious problem@Nonnull public static java.lang.String abortProcess(@Nonnull ServerProcess process) throws java.lang.Exception
process
- the process to abortjava.lang.Exception
- A serious problem@Nonnull public static java.lang.String abortProcess(long processID) throws java.lang.Exception
processID
- the process to abortjava.lang.Exception
- A serious problem@Nonnull public static java.lang.String abortProcess(@Nullable ProcessHandler handler) throws java.lang.Exception
handler
- the process to abortjava.lang.Exception
- A serious problemstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.