|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jadeworld.jade.rootschema.Object
com.jadeworld.jade.rootschema.Application
public class Application
The Application class provides a superclass of all user JADE application classes. Each user application is defined as an instance of the Application class. The Application class defines standard properties and methods for the running of any application.
Each time you create a new schema, an instance of the Application class is created for that schema. When you load a schema from a file and there is application data (in the .ddb forms definition file), JADE creates an instance of the Application class for each application defined in this file.
Each schema also has a subclass of the Application class. A transient instance of this class is automatically made available to the runtime copy of the application. To access this transient instance, use the app system variable in your method logic; for example, use app.name to access the name of the application. This transient instance is unique to a specific copy of the application. Changes made to the properties are retained until the application copy is terminated. (This data is therefore not available to other copies of the application.)
Transient objects that are automatically created by JADE cannot be shared, including the application object and exclusive collections. (For details about specifying the creation of transient objects that can be shared across threads, see create Instruction, in Chapter 1 of your JADE Developers Reference.)
| Field Summary |
|---|
| Fields inherited from class com.jadeworld.jade.rootschema.Object |
|---|
oid |
| Constructor Summary | |
|---|---|
Application()
|
|
| Method Summary | |
|---|---|
java.util.Calendar |
actualTime()
Returns the current date and time of the JADE node. |
java.util.Calendar |
actualTimeServer()
Returns the current date and time of the JADE server node. |
char |
applicationType()
This contains the type of the application. |
java.lang.String |
appVersion()
This is set at development time and serves only as documentation for the application. |
int |
clock()
Returns the relative time in milliseconds since the operating system was started on the workstation that is executing the method. |
java.lang.String |
computerName()
Returns the name of the device that executes the current method. |
int |
currentUTCBias(int location)
Returns the current bias, in minutes, for local time translation on the node specified in the location parameter. |
java.lang.String |
dbPath()
Returns the JADE database path. |
java.lang.String |
dbServerComputerName()
Returns the computer name of the JADE database server. |
java.lang.String |
getIniFileName()
Returns the full path and file name of the JADE initialization or configuration file for the current JADE node; for example: c:\jade62\system\jade.ini |
java.lang.String |
getJadeInstallDir()
Returns the directory in which the JADE binaries are installed; for example: c:\jade62\bin |
Application |
getPersistentApp()
Returns a reference to the persistent application from which the transient instance of the receiver was created. |
Process |
getProcess()
Returns a reference to the JADE Process object associated with the application |
java.lang.String |
getProfileString(java.lang.String fileName,
java.lang.String section,
java.lang.String keyName,
java.lang.String defaultValue)
Retrieves a string from the specified section in a JADE initialization file. |
java.lang.String |
getSystemVersion()
Returns a string containing the JADE system version; for example: 6.2.09 |
java.lang.String |
getTempDir()
Returns the temporary directory in which the JADE temporary files are located. |
java.util.Calendar |
getUTCTime()
Returns the current UTC time for the machine on which the JADE node executes. |
boolean |
isAppRunning(java.lang.String schemaName,
java.lang.String appName)
Returns true if the application specified by the schemaName and appName parameters is running on the standard (fat) client within the same copy of jade.exe and returns false if the specified application is not running in the same copy of jade.exe. |
boolean |
isMultiUser()
Returns true if the JADE application is running in multiuser mode. |
boolean |
isUnicode()
Returns true if the JADE application is running with Unicode characters and strings or it returns false if the application is running with ANSI characters and strings. |
boolean |
isValidObject(Object obj)
This is used to establish if the object specified in the obj parameter exists, by returning true. |
boolean |
isWebService()
Returns true if the JADE application is running as a Web service or it returns false if the application is not running as a Web service. |
java.lang.String |
name()
Contains the name specified in the Name text box of the Define Application dialog in the JADE development environment. |
boolean |
productionMode()
Returns true if the database from which the JADE application is running has production mode set. |
int |
random(int range)
Returns a random positive number in the range 0 through the value of the range parameter, inclusive. |
int |
random31(int seed,
int range)
Returns a random positive number in the range 0 through the value of the range parameter, inclusive. |
java.math.BigDecimal |
relativeMachineMicros()
Returns a high-accuracy machine-relative time in microseconds (that is, millionths of a second). |
java.math.BigDecimal |
relativeMachineTime()
Returns a high-accuracy machine-relative time in milliseconds. |
void |
repairCollection(ByRef<Collection> collRef)
Removes invalid object references and fixes up dictionary keys in the collection specified in the coll parameter. |
void |
seedRandom(int seed)
Initializes the random number generator. |
java.lang.String |
serverName()
Returns the name of the server that is in use for the JADE application. |
void |
setAppVersion(java.lang.String appVersion)
Sets the development-time application version. |
boolean |
setProfileString(java.lang.String fileName,
java.lang.String section,
java.lang.String keyName,
java.lang.String string)
Copies a string into the section of a JADE initialization file specified in the section parameter. |
java.lang.String |
userName()
Returns the name of the current user as a string. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Application()
| Method Detail |
|---|
public java.util.Calendar actualTime()
public java.util.Calendar actualTimeServer()
public java.lang.String appVersion()
setAppVersion(java.lang.String).
public void setAppVersion(java.lang.String appVersion)
appVersion - The application version.public char applicationType()
public int clock()
This method provides a mechanism to obtain deltas (or differences) in time, taken at different points of execution; for example, as a means of timing the execution of a logic sequence.
public java.lang.String computerName()
public int currentUTCBias(int location)
The bias is the difference in minutes between Coordinated Universal Time (UTC) and local time (that is, bias = UTC local time). As the bias is current, it includes any daylight saving adjustment in effect at the time the value is obtained. The location parameter values, provided by global constants in the ExecutionLocation category, are listed in the following table.
Global Constant Integer Value Method is executedThe current bias defaults to CurrentLocation (0) if you specify any value other than those listed in this table.
CurrentLocation 0 In the current location
DatabaseServer 1 On the database server node
PresentationClient 2 On the presentation client (applicable to applications running in thin client mode)
public java.lang.String dbPath()
public java.lang.String dbServerComputerName()
public java.lang.String getIniFileName()
This is the value to which the persistence.xml property jade.database.configuration needs to be set.
public java.lang.String getJadeInstallDir()
public Application getPersistentApp()
public Process getProcess()
public java.lang.String getProfileString(java.lang.String fileName,
java.lang.String section,
java.lang.String keyName,
java.lang.String defaultValue)
setProfileString(java.lang.String, java.lang.String, java.lang.String, java.lang.String), which copies the string into the specified section of
an initialization file.)The getProfileString method returns all sections if the value of the section parameter is null or an empty String, or all keys if the value of the keyName parameter is null or an empty String. The values are separated with a space.
You can use this method to retrieve a string from a two-level section name (prefixed with a unique identifier) within a JADE initialization file shared by multiple programs on the same host. For details, see Two-Level Section Names under Format of the JADE Initialization File, in your JADE Initialization File Reference. The following example shows the use of the getProfileString method to determine the server for the current JADE initialization file.
String server;
Application app = EntityAccess.getApp();
server = app.getProfileString(app.getIniFileName(), "JadeClient","ServerName", null);
System.out.println("server name is " + server);
fileName - Initialization file. If you set this parameter to windows, the win.ini file is used. If it does not contain a full
path to the file, Windows searches for the file in the Windows directory.section - Initialization file section containing the key (parameter) name.keyName - Name of the key (parameter) whose associated string is to be retrieved.defaultValue - Default value for the specified key if the key cannot be found in the initialization file.
public java.lang.String getSystemVersion()
public java.lang.String getTempDir()
public java.util.Calendar getUTCTime()
public boolean isAppRunning(java.lang.String schemaName,
java.lang.String appName)
schemaName - JADE schema name of the application.appName - JADE application name.
public boolean isMultiUser()
The persistence.xml property jade.database.multiuser determines this.
public boolean isUnicode()
public boolean isValidObject(Object obj)
obj - Java object with a matching JADE object.
public boolean isWebService()
public java.lang.String name()
This is the value to which the persistence.xml property jade.database.application needs to be set.
public boolean productionMode()
public int random(int range)
Note The sequence of generated random numbers is architecture-dependent.
range - The end of the range of random numbers to be produced.
public int random31(int seed,
int range)
Use this method to generate random numbers with a larger range of values compared to the
random(int) method. In addition, the random31 method enables you to generate
multiple sets of random numbers within a single application, by maintaining multiple values of the
seed parameter.
The valid values for the seed parameter are in the range 1 through Max_Integer, inclusive. The valid values for the range parameter are in the range 0 through Max_Integer 1, inclusive.
If the supplied value of the seed parameter is not valid, JADE selects a new random seed value.
If the supplied value of the range parameter exceeds Max_Integer - 1 (that is, 2,147,483,646),
it is internally reset to 2,147,483,646.
If the supplied value of the range parameter is less than zero (0), it is internally reset to zero (0),
which forces the random31 method to return zero.
seed - The initial number to start the random sequencerange - The end of the range of random numbers to be produced.
public java.math.BigDecimal relativeMachineMicros()
The time is relative to the machine that is executing the method. This relative time value can wrap around after a period of machine up-time. The period of up-time is hardware-dependent.
As the maximum precision of the timer is 19 digits, you should use a Decimal[19] (or higher) precision decimal for storage and computation.
public java.math.BigDecimal relativeMachineTime()
The time is relative to the machine that is executing the method. This relative time value can wrap around after a period of machine up-time. The period of up-time is hardware-dependent.
As the maximum precision of the timer is 19 digits, you should use a Decimal[19] (or higher) precision decimal for storage and computation.
public void repairCollection(ByRef<Collection> collRef)
No action is taken with arrays of primitive types.
Note. Use the Application::repairCollection method only when you know that the collection is structurally sound and that only the entries in that collection are invalid.
collRef - The collection to be repaired.public void seedRandom(int seed)
Note Each application starts with a random seed value.
See also the random(int) and random31(int, int) methods.
seed - The initail value to initialize the random number generator.public java.lang.String serverName()
public boolean setProfileString(java.lang.String fileName,
java.lang.String section,
java.lang.String keyName,
java.lang.String string)
To retrieve a stored string, use getProfileString(java.lang.String, java.lang.String, java.lang.String, java.lang.String).
To remove a key parameter (keyName) from an initialization file, set the string parameter to ProfileRemoveKey (a global constant in the JadeProfileString category). To remove an entire section in an initialization file, set the keyName parameter to ProfileRemoveSection (a global constant in the JadeProfileString category).
You can use this method to copy a string to a two-level section name (prefixed with a unique identifier) within a JADE initialization file shared by multiple programs on the host. For details, see Two-Level Section Names under Format of the JADE Initialization File, in your JADE Initialization File Reference. However, you cannot use this method to update JADE initialization file parameter values specified on the command line. Attempts to do so return a value of false and the parameter values are unchanged.
fileName - Specifies the initialization file. If you set this parameter to windows, the win.ini file is used. If this parameter
does not contain a full path to the file, Windows searches for the file in the Windows directory.section - Specifies the initialization file section containing the key (parameter) name.keyName - Specifies the name of the key (parameter) whose associated string is to be stored.string - Specifies the string that is to be written to the file.
public java.lang.String userName()
|
JADE Java Persistence API 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||