|
FusionReactor API v3.0.1 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intergral.fusionreactor.api.FRAPI
public abstract class FRAPI
This class defines the public interface to FusionReactor.
All API calls internally check whether FusionReactor is available before proceding. Storing references to objects produced by this type any longer than strictly necessary (certainly not longer than the course of a single page request) is strongly discouraged, in order to reduce the scope for memory leaks. This object itself may be stored and reused if required.
This is a factory-type class; you must not instantiate it yourself, rather use the
getInstance()
method.
Field Summary | |
---|---|
static int |
KILL_STATUS_ALREADY_DISPOSED
Indicates this request has already been disposed of, i.e. |
static int |
KILL_STATUS_ALREADY_NOTIFIED
Indicates this request has already been notified of a kill action by some other mechanism. |
static int |
KILL_STATUS_KILLED
Indicates this request was killed. |
Method Summary | |
---|---|
abstract String |
explainKillStatus(int killStatus)
Explain a given kill result value. |
abstract long |
getAllocatedMemory()
Get the quantity of memory allocated to the JVM by the operating system. |
abstract short |
getCpuUsage()
Get the current CPU usage. |
abstract long |
getFreeMemory()
Get the quantity of free memory available to the VM, including any not yet allocated. |
static FRAPI |
getInstance()
Get a concrete instance of the FusionReactor API, on which further calls can be made. |
abstract ConfigurationSurrogate |
getRunningConfiguration()
Return a deep-clone of the currently running configuration. |
abstract FusionRequestSurrogate[] |
getRunningRequests()
Return an array containing objects representing all requests currently being tracked by FusionReactor. |
abstract long |
getStartTime()
Get the time in milliseconds since the epoch at which the server was started. |
abstract String |
getStartTimeString()
Get the system uptime as a date/time string of the form HH:mm:ss dd-MMM-yyyy |
abstract long |
getTotalMemory()
Get the quantity of memory availble to the JVM, including any not yet allocated to it by the JVM. |
abstract long |
getUptime()
Get the number of milliseconds since FusionReactor was last started. |
abstract long |
getUsedMemory()
Get the quantity of memory currently allocated by the JVM to Java objects. |
abstract boolean |
isFusionReactorRunning()
Attempt to locate FusionReactor in memory and return a boolean indicating success or failure. |
abstract int |
kill(long fusionRequestId,
String userTraceMarker)
Kill a running request. |
abstract void |
setPageTimeout(int seconds)
Reset the timeout value for this page. |
abstract void |
setRequestCaptureFolder(String fullPath)
Change the location to which Request Capture will store request and response data. |
abstract void |
setRunningConfiguration(ConfigurationSurrogate configurationSurrogate)
Set the running configuration to the passed ConfigurationSurrogate . |
abstract void |
trace(String traceString)
Attach a user trace string to this request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int KILL_STATUS_ALREADY_DISPOSED
public static final int KILL_STATUS_ALREADY_NOTIFIED
public static final int KILL_STATUS_KILLED
Method Detail |
---|
public static final FRAPI getInstance()
Get a concrete instance of the FusionReactor API, on which further calls can be made.
public abstract void trace(String traceString)
Attach a user trace string to this request. These strings are available within the FusionReactor GUI in the Request Details page, and also appear in the FusionReactor debug console.
If FusionReactor is not running, this method does nothing.
traceString
- The string to be attached to this request.public abstract boolean isFusionReactorRunning()
public abstract void setPageTimeout(int seconds)
Reset the timeout value for this page. If Timeout Protection is not active within FusionReactor, calls to this method have no effect. If Timeout Protection is active, the value passed to this method overrides the value configured in FusionReactor.
If FusionReactor is not running, this method does nothing.
seconds
- the timeout in seconds after which this page will be aborted.public abstract FusionRequestSurrogate[] getRunningRequests()
N.b. By the time your code uses the objects returned by this method, they may have completed.
FusionRequestSurrogate
objects representing all
running tracked requests, or a zero-length array if FusionReactor was not detected.public abstract ConfigurationSurrogate getRunningConfiguration()
ConfigurationSurrogate
object constructed as a deep-clone of the
running configuration, which may be manipulated safely.public abstract void setRunningConfiguration(ConfigurationSurrogate configurationSurrogate) throws ConfigurationInvalidExceptionSurrogate, FileNotFoundException, IOException
Set the running configuration to the passed ConfigurationSurrogate
. The
sequence of actions is as follows:
configurationSurrogate
- a ConfigurationSurrogate
object representing the required
configuration.
ConfigurationInvalidExceptionSurrogate
- if the configuration was invalid (examine the message of the exception to find
out more)
FileNotFoundException
- if the system could not find the file or folder into which the configuration
should be saved
IOException
- if the system encountered an IOException
whilst saving the
configuration to disk.public abstract void setRequestCaptureFolder(String fullPath) throws ConfigurationInvalidExceptionSurrogate, IOException
fullPath
- a full path specifying a folder which exists on the system.
ConfigurationInvalidExceptionSurrogate
- with a descriptive message, if FusionReactor could not adopt the new
configuration.
IOException
- if FusionReactor could not open write a new configuration prior to adopting it.public abstract int kill(long fusionRequestId, String userTraceMarker)
fusionRequestId
- the ID of the request which is to be killeduserTraceMarker
- if non-null and not an empty string, this trace marker will be stored with the
request.
KILL_STATUS_*
set of enumerations
defined in this type.public abstract String explainKillStatus(int killStatus)
killStatus
- the status to be explained.
public abstract long getFreeMemory()
OutOfMemoryError
. This value is commonly influenced using the
-Xmx
JVM parameter.
long
representing the quantity of unused memory in bytes.public abstract long getTotalMemory()
Get the quantity of memory availble to the JVM, including any not yet allocated to it by the
JVM. This value is commonly influenced using the -Xmx
JVM parameter.
long
representing the total quantity of memory available to the JVM
in bytes.public abstract long getUsedMemory()
long
representing the total quantity of memory allocated to Java
objects in bytes.public abstract long getAllocatedMemory()
public abstract short getCpuUsage()
Get the current CPU usage.
short
describing the JVMs processor occupancy in percent, accross
all cores. If CPU sampling is not supported on this platform, -1 is returned.public abstract long getStartTime()
public abstract String getStartTimeString()
HH:mm:ss dd-MMM-yyyy
public abstract long getUptime()
|
FusionReactor API v3.0.1 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |