com.preemptive.instrumentation
Class J2MERuntimeIntelligence

java.lang.Object
  extended by com.preemptive.instrumentation.J2MERuntimeIntelligence

public final class J2MERuntimeIntelligence
extends Object

The PreEmptive Analytics System runtime functions (J2ME environments).

Related system properties:


Field Summary
static String COMMERCIAL_END_POINT
          Subscription end point.
static int EXCEPTION_CAUGHT
          Exception type : an exception that was caught.
static int EXCEPTION_THROWN
          Exception type : an exception that is being thrown.
static int EXCEPTION_UNCAUGHT
          Exception type : an exception that was not caught or thrown.
static String FREE_END_POINT
          Free end point.
 
Method Summary
static void featureStart(String feature)
          Indicate the start of a feature being used.
static void featureStart(String feature, BinaryInfo binary, Hashtable properties)
          Indicate the start of a feature being used.
static void featureStart(String feature, Hashtable properties)
          Indicate the start of a feature being used.
static void featureStop(String feature)
          Indicate the end of a feature being used.
static void featureStop(String feature, BinaryInfo binary, Hashtable properties)
          Indicate the end of a feature being used.
static void featureStop(String feature, Hashtable properties)
          Indicate the end of a feature being used.
static void featureTick(String feature)
          Indicate a feature has been used.
static void featureTick(String feature, BinaryInfo binary, Hashtable properties)
          Indicate a feature has been used.
static void featureTick(String feature, Hashtable properties)
          Indicate a feature has been used.
static boolean isApplicationStarted()
          Has the application been started?
static void performanceProbe(String name)
          Sends performance information.
static void performanceProbe(String name, BinaryInfo binary, Hashtable properties)
          Sends performance information.
static void performanceProbe(String name, Hashtable properties)
          Sends performance information.
static void reset()
          Reset the state of the system.
static void sendTamperMessage()
          Sends a tamper message to a PreEmptive Analytics server.
static void sendTamperMessage(BinaryInfo binary)
          Sends a tamper message to a PreEmptive Analytics server.
static void sendTamperMessage(BinaryInfo binary, Hashtable properties)
          Sends a tamper message to a PreEmptive Analytics server.
static void sendTamperMessage(Hashtable properties)
          Sends a tamper message to a PreEmptive Analytics server.
static void setApplicationId(String applicationId)
          Sets the application ID that accompanies the start message.
static void setApplicationInstance(String applicationInstance)
          Sets the optional instance identifier for the application.
static void setApplicationName(String applicationName)
          Sets the optional application name that accompanies the start message.
static void setApplicationType(String applicationType)
          Sets the optional application type.
static void setApplicationVersion(String applicationVersion)
          Sets the optional application version string.
static void setCompanyId(String companyId)
          Sets the comapny ID that accompanies the start message.
static void setCompanyName(String companyName)
          Sets the optional company name that accompanies the start message.
static void setFlowController(FlowController flowController)
          Set the flow controller for message transmission.
static void setFullDataMode(boolean fullDataMode)
          Sets the ammount of information to be sent about the user and host.
static void setOptIn(boolean optIn)
          Set whether the user has opted-in to sending messages.
static void setSendDisabled(boolean sendDisabled)
          Set whether messages are sent to the sever.
static void setSendInterval(int sendInterval)
          Set the interval between transmission of messages.
static void setServiceEndpoint(String endPoint)
          Set the location that will receive the generated messages.
static void setSupportOfflineMode(boolean supportOfflineMode)
          Set whether messages that cannot be immediately sent to the server are stored for later transmission.
static void setUseSsl(boolean useSsl)
          Set the method of communication.
static void startApplication()
          Start the application.
static void startApplication(Hashtable properties)
          Start the application.
static void startApplication(Object context, BinaryInfo binary, Hashtable properties)
          Start the application.
static void startApplication(Object context, Hashtable properties)
          Start the application.
static void stopApplication()
          Stop the application.
static void stopApplication(BinaryInfo binary, Hashtable properties)
          Stop the application.
static void stopApplication(Hashtable properties)
          Stop the application.
static void systemProfile()
          Send system profile information.
static void systemProfile(BinaryInfo binary, Hashtable properties)
          Send system profile information.
static void systemProfile(Hashtable properties)
          Send system profile information.
static Throwable trackException(Throwable exception, int type)
          Send exception information.
static Throwable trackException(Throwable exception, int type, BinaryInfo binary, Hashtable properties)
          Send exception information.
static Throwable trackException(Throwable exception, int type, Hashtable properties)
          Send exception information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPTION_THROWN

public static final int EXCEPTION_THROWN
Exception type : an exception that is being thrown.

See Also:
Constant Field Values

EXCEPTION_CAUGHT

public static final int EXCEPTION_CAUGHT
Exception type : an exception that was caught.

See Also:
Constant Field Values

EXCEPTION_UNCAUGHT

public static final int EXCEPTION_UNCAUGHT
Exception type : an exception that was not caught or thrown.

See Also:
Constant Field Values

COMMERCIAL_END_POINT

public static final String COMMERCIAL_END_POINT
Subscription end point.


FREE_END_POINT

public static final String FREE_END_POINT
Free end point.

Method Detail

reset

public static void reset()
Reset the state of the system. The reset is ignored if the the application is currently running. All values are set to their initial values.


isApplicationStarted

public static boolean isApplicationStarted()
Has the application been started?

Returns:
true if the application has been started, and is still running. If startApplication() has not yet been called or if stopApplication() has been called this will return false.

setSendInterval

public static void setSendInterval(int sendInterval)
Set the interval between transmission of messages. This value cannot be changed when the application is running. This is used by the default flow control mechanism.

Parameters:
sendInterval - the interval between transmission of messages in milliseconds.
See Also:
setFlowController(FlowController)

setFlowController

public static void setFlowController(FlowController flowController)
Set the flow controller for message transmission. This value cannot be changed when the application is running.

Parameters:
flowController - the new controller. If null, then a default flow controller will be used.

setSendDisabled

public static void setSendDisabled(boolean sendDisabled)
Set whether messages are sent to the sever. This state can be changed at any time even when the application is running. When set to true messages will not be sent to the server. If off-line support has been enabled then the messages may be stored locally and sent to the server. If off-line support is disabled then the messages will be discarded.

Parameters:
sendDisabled - the new value for controlling if messages are sent to the server.
See Also:
ris.send.disabled, setOptIn(boolean), setSupportOfflineMode(boolean)

setSupportOfflineMode

public static void setSupportOfflineMode(boolean supportOfflineMode)
Set whether messages that cannot be immediately sent to the server are stored for later transmission. This state can be changed at any time even when the application is running. When set to true meessages that cannot be sent to the server due to network failures or having send disabled are stored locally for later transmission. When false those messages that cannot be sent are discarded.

Parameters:
supportOfflineMode - the new value for controlling the storing of messages that cannot be immediately sent to the server.
Since:
6.4.1
See Also:
setSendDisabled(boolean)

setOptIn

public static void setOptIn(boolean optIn)
Set whether the user has opted-in to sending messages. This state can be changed at any time even when the application is running. When set to false messages will not be sent to the server. Setting the value to false does not end a running application - you must call stopApplication(). Setting the value to true does not start the application - you must call startApplication().

Parameters:
optIn - the new value for the opting-in to sending messages.
See Also:
ris.optin, setSendDisabled(boolean)

setUseSsl

public static void setUseSsl(boolean useSsl)
Set the method of communication. This value cannot be changed when the application is running.

Parameters:
useSsl - true if SSL should be used for transmission of messages.
See Also:
ris.ssl

setServiceEndpoint

public static void setServiceEndpoint(String endPoint)
Set the location that will receive the generated messages. This value cannot be changed when the application is running.

Parameters:
endPoint - the location that will receive the messages. This is a partial URL that includes the host and file portion but not the protocol. If null then the default end point is used.
Since:
6.4.1
See Also:
ris.endpoint

setCompanyName

public static void setCompanyName(String companyName)
Sets the optional company name that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
companyName - the optional company name.

setCompanyId

public static void setCompanyId(String companyId)
Sets the comapny ID that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
companyId - the ID for the company that produced the application. The format of the value is a GUID.

setApplicationName

public static void setApplicationName(String applicationName)
Sets the optional application name that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
applicationName - the optional name of the application.

setApplicationId

public static void setApplicationId(String applicationId)
Sets the application ID that accompanies the start message. This value cannot be changed when the application is running.

Parameters:
applicationId - the ID for the application. The format of the value is a GUID.

setApplicationVersion

public static void setApplicationVersion(String applicationVersion)
Sets the optional application version string. This value cannot be changed when the application is running.

Parameters:
applicationVersion - the version string for the application. This may take any user defined form.

setApplicationType

public static void setApplicationType(String applicationType)
Sets the optional application type. This value cannot be changed when the application is running.

Parameters:
applicationType - the type of the application. This may take any user defined form.

setApplicationInstance

public static void setApplicationInstance(String applicationInstance)
Sets the optional instance identifier for the application. This value is typically a serial or registration number. This value cannot be changed when the application is running.

Parameters:
applicationInstance - the instance identifier string for the application. This may take any user defined form.

setFullDataMode

public static void setFullDataMode(boolean fullDataMode)
Sets the ammount of information to be sent about the user and host. On some platforms the operations required to gather the full information on the user and host can be time consuming. By setting this value to false the gatering of ths optional information will be skipped.

Parameters:
fullDataMode - if true then all possible information about the user and host will be sent. If false then a minimal set of information will be sent.

startApplication

public static void startApplication()
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setOptIn(boolean)

startApplication

public static void startApplication(Hashtable properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

Parameters:
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setOptIn(boolean), setSendDisabled(boolean), ris.log.messages

startApplication

public static void startApplication(Object context,
                                    Hashtable properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

Parameters:
context - optional context object.
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setOptIn(boolean), setSendDisabled(boolean), ris.log.messages

startApplication

public static void startApplication(Object context,
                                    BinaryInfo binary,
                                    Hashtable properties)
Start the application. This causes a start message to be sent if the application is not already running. If the application and company IDs have not been set the application will not be started. If opt-in has been set to false application will not be started.

Parameters:
context - optional context object.
binary - optional information about the program element requesting the start
properties - optional properties to be sent with the message
See Also:
stopApplication(), setApplicationId(String), setApplicationName(String), setApplicationType(String), setApplicationVersion(String), setApplicationInstance(String), setCompanyId(String), setCompanyName(String), setOptIn(boolean), setSendDisabled(boolean), ris.log.messages

stopApplication

public static void stopApplication()
Stop the application. This causes a stop message to be sent if the application is running.

See Also:
startApplication()

stopApplication

public static void stopApplication(Hashtable properties)
Stop the application. This causes a stop message to be sent if the application is running.

Parameters:
properties - optional properties to be sent with the message
See Also:
startApplication()

stopApplication

public static void stopApplication(BinaryInfo binary,
                                   Hashtable properties)
Stop the application. This causes a stop message to be sent if the application is running.

Parameters:
binary - optional information about the program element requesting the stop
properties - optional properties to be sent with the message
See Also:
startApplication()

sendTamperMessage

public static void sendTamperMessage()
Sends a tamper message to a PreEmptive Analytics server.


sendTamperMessage

public static void sendTamperMessage(Hashtable properties)
Sends a tamper message to a PreEmptive Analytics server.

Parameters:
properties - optional properties to be sent with the message

sendTamperMessage

public static void sendTamperMessage(BinaryInfo binary)
Sends a tamper message to a PreEmptive Analytics server.

Parameters:
binary - optional information about the program element sending the message

sendTamperMessage

public static void sendTamperMessage(BinaryInfo binary,
                                     Hashtable properties)
Sends a tamper message to a PreEmptive Analytics server.

Parameters:
binary - optional information about the program element sending the message
properties - optional properties to be sent with the message

featureTick

public static void featureTick(String feature)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStart(String), featureStop(String)

featureTick

public static void featureTick(String feature,
                               Hashtable properties)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStart(String), featureStop(String)

featureTick

public static void featureTick(String feature,
                               BinaryInfo binary,
                               Hashtable properties)
Indicate a feature has been used. This sends a feature tick message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the tick
properties - optional properties to be sent with the message
See Also:
featureStart(String), featureStop(String)

featureStart

public static void featureStart(String feature)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStop(String)

featureStart

public static void featureStart(String feature,
                                Hashtable properties)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStop(String)

featureStart

public static void featureStart(String feature,
                                BinaryInfo binary,
                                Hashtable properties)
Indicate the start of a feature being used. This sends a feature start message if the application is running.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the feature start
properties - optional properties to be sent with the message
See Also:
featureStop(String)

featureStop

public static void featureStop(String feature)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that durration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
See Also:
featureStart(String)

featureStop

public static void featureStop(String feature,
                               Hashtable properties)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that durration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
properties - optional properties to be sent with the message
See Also:
featureStart(String)

featureStop

public static void featureStop(String feature,
                               BinaryInfo binary,
                               Hashtable properties)
Indicate the end of a feature being used. This sends a feature stop message if the application is running. The stop message must be paired with a previously sent start so that durration information can be computed.

Parameters:
feature - the name of the feature. If null or blank no message will be sent.
binary - optional information about the program element generating the feature stop
properties - optional properties to be sent with the message
See Also:
featureStart(String)

systemProfile

public static void systemProfile()
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.


systemProfile

public static void systemProfile(Hashtable properties)
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.

Parameters:
properties - optional properties to be sent with the message

systemProfile

public static void systemProfile(BinaryInfo binary,
                                 Hashtable properties)
Send system profile information. This sends a system profile message if the application is running. The profile contains information about the user and various aspects of the system.

Parameters:
binary - optional information about the program element requesting the profile
properties - optional properties to be sent with the message

performanceProbe

public static void performanceProbe(String name)
Sends performance information. This sends a preformance probe message if the applicationis running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to agregate performance information.

performanceProbe

public static void performanceProbe(String name,
                                    Hashtable properties)
Sends performance information. This sends a preformance probe message if the applicationis running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to agregate performance information.
properties - optional properties to be sent with the message

performanceProbe

public static void performanceProbe(String name,
                                    BinaryInfo binary,
                                    Hashtable properties)
Sends performance information. This sends a preformance probe message if the applicationis running. The information contains information about CPU and memory utilization.

Parameters:
name - the name for the location of the probe. This can be used to agregate performance information.
binary - optional information about the program element requesting the probe
properties - optional properties to be sent with the message

trackException

public static Throwable trackException(Throwable exception,
                                       int type)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be tracked
type - the context type of the exception:

trackException

public static Throwable trackException(Throwable exception,
                                       int type,
                                       Hashtable properties)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be tracked
type - the context type of the exception:
properties - optional properties to be sent with the message

trackException

public static Throwable trackException(Throwable exception,
                                       int type,
                                       BinaryInfo binary,
                                       Hashtable properties)
Send exception information. This sends information about an exception to the server.

Parameters:
exception - the exception to be tracked
type - the context type of the exception:
binary - optional information about the program element where the exception was encountered
properties - optional properties to be sent with the message


Copyright © 2013 PreEmptive Solutions, LLC. All Rights Reserved.