ilog.cpl
Class IlpSystem

java.lang.Object
  extended by ilog.cpl.IlpSystem
Direct Known Subclasses:
IltSystem

public class IlpSystem
extends Object

This class is used to initialize an ILOG CPL application or applet.

In most cases, it will read a deployment descriptor file to obtain configuration settings such as search paths and style files. This class also provides access to some global constants and properties.

To increase the verbosity of operation of this class, you can set its logging level by adding the line
ilog.cpl.IlpSystem.level = level
to your logging.properties file.

Since:
JTGO 3.0

Constructor Summary
protected IlpSystem()
          This class should not be instantiated.
 
Method Summary
protected static IlpDefaultContext CreateDefaultContext()
          Creates a default context.
static void DontSetLocale()
          Makes an application run in a non-locale environment.
static long GetBuildNumber()
          Deprecated. Use IlpTGOProduct.getBuildNumber() instead.
static IlpContext GetDefaultContext()
          Returns the default service context.
static Font GetDefaultFont()
          Returns the default font.
static URL GetHome()
          Returns directory where ILOG JTGO is installed.
static String GetHostName()
          Returns the name of the host on which this process is running, if it can be determined.
static int GetMajorVersion()
          Deprecated. Use IlpTGOProduct.getVersion() instead.
static int GetMinorVersion()
          Deprecated. Use IlpTGOProduct.getMinorVersion() instead.
static int GetPatchLevel()
          Deprecated. Use IlpTGOProduct.getPatchLevel() instead.
static int GetReleaseDate()
          Deprecated. Use IlpTGOProduct.getBuildNumber() instead.
static int GetSubMinorVersion()
          Deprecated. Use IlpTGOProduct.getSubMinorVersion() instead.
static int GetVersion()
          Deprecated. Use IlpTGOProduct.getVersionNumber() instead.
static String GetVersionString()
          Deprecated. Use IlpTGOProduct.getVersionString() instead.
static void Init()
          Initializes a CPL process and creates a default context using a deployment descriptor.
static void Init(Applet applet)
          Initializes a CPL applet and creates a default context using a default deployment descriptor.
static void Init(Applet applet, String deploymentDescriptorName)
          Initializes a CPL applet and creates a default context using a deployment descriptor specified by a relative file name.
static void Init(IlpContext defaultContext)
          Initializes the system based on a service context.
static void Init(String deploymentDescriptorName)
          Initializes a CPL process and creates a default context using a deployment descriptor specified by a file name.
static void Init(URL documentBase, String deploymentDescriptorName)
          Initializes the system using a deployment descriptor specified by a relative URL, relative to a given base URL.
static void Init(URL deploymentDescriptorURL, URL defaultDocumentBase)
          Initializes the system using a deployment descriptor specified by an URL.
static boolean IsApplet()
          Returns true if application has been initialized as an applet.
static boolean IsDontSetLocale()
          Returns true if your program is running in a non-locale environment.
static boolean IsInitialized()
          Returns true if the application has been correctly initialized.
static boolean IsInitializing()
          Returns true if inside a call to Init() or one or its variants.
static void SetDefaultContext(IlpContext ctxt)
          Sets the default application context.
static void SetDefaultFont(Font font)
          Sets the specified font as the default font.
static void Shutdown()
          Shut down the system and remove the default context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpSystem

protected IlpSystem()
This class should not be instantiated. For initialization purposes, use Init().

Method Detail

Init

public static void Init()
Initializes a CPL process and creates a default context using a deployment descriptor.

The system looks for the deployment descriptor as follows:

The file is looked for:

To use a custom deployment descriptor you could also use one of the versions of this method that takes a deployment descriptor name as a parameter.

If no custom deployment descriptor is found, a default one of type IlpDefaultContext is created.

This method should not be used to initialize an applet. Use the versions of Init that take an Applet parameter or an absolute URL instead.

If this method is called more than once the initialization is performed only once.


Init

public static void Init(String deploymentDescriptorName)
                 throws FileNotFoundException,
                        IOException,
                        IlpDeploymentParsingException
Initializes a CPL process and creates a default context using a deployment descriptor specified by a file name.

The deployment descriptor name provided may be an absolute path, or relative to the current directory for the application. Under Windows, the drive letter in an absolute path is considered as the type of the file; to avoid confusion, you must specify "file:" at the very beginning of the path.

This method should not be used to initialize an applet. Use the versions of Init that take an Applet parameter or an absolute URL instead.

Parameters:
deploymentDescriptorName - Absolute or relative file name.
Throws:
FileNotFoundException
IOException
IlpDeploymentParsingException

Init

public static void Init(URL documentBase,
                        String deploymentDescriptorName)
                 throws FileNotFoundException,
                        IOException,
                        IlpDeploymentParsingException
Initializes the system using a deployment descriptor specified by a relative URL, relative to a given base URL.

Throws:
FileNotFoundException
IOException
IlpDeploymentParsingException
Internal method or field: do not use!

Init

public static void Init(URL deploymentDescriptorURL,
                        URL defaultDocumentBase)
                 throws FileNotFoundException,
                        IOException,
                        IlpDeploymentParsingException
Initializes the system using a deployment descriptor specified by an URL.

This method may be used to initialize either an application or an applet.

Parameters:
deploymentDescriptorURL - URL of deployment descriptor.
Throws:
FileNotFoundException
IOException
IlpDeploymentParsingException
Internal method or field: do not use!

Init

public static void Init(Applet applet)
Initializes a CPL applet and creates a default context using a default deployment descriptor.

The document base of the applet is used as the document base for the default URL access service created.

The default deployment descriptor is obtained from the CPL jar. To use a custom deployment descriptor, use one of the versions of this method that takes a deployment descriptor name as a parameter.


Init

public static void Init(Applet applet,
                        String deploymentDescriptorName)
                 throws FileNotFoundException,
                        IOException,
                        IlpDeploymentParsingException
Initializes a CPL applet and creates a default context using a deployment descriptor specified by a relative file name. Under Windows, the drive letter in a path is considered as the type of the file; to avoid confusion, you must specify "file:" at the very beginning of the path.

The document base of the applet is used as the document base for the default URL access service.

Throws:
FileNotFoundException
IOException
IlpDeploymentParsingException

Init

public static void Init(IlpContext defaultContext)
Initializes the system based on a service context.

The user should ensure that the context is properly configured for subsequent use.

Parameters:
defaultContext - The default service context used in the application.

Shutdown

public static void Shutdown()
Shut down the system and remove the default context.

Internal method or field: do not use!

IsInitialized

public static boolean IsInitialized()
Returns true if the application has been correctly initialized.


IsInitializing

public static boolean IsInitializing()
Returns true if inside a call to Init() or one or its variants.

Internal method or field: do not use!

IsApplet

public static boolean IsApplet()
Returns true if application has been initialized as an applet.


CreateDefaultContext

protected static IlpDefaultContext CreateDefaultContext()
Creates a default context. For example, it creates an ilog.tgo.context.IltDefaultContext if JTGO is available. Otherwise, it creates an IlpDefaultContext.

Internal method or field: do not use!

GetDefaultContext

public static IlpContext GetDefaultContext()
Returns the default service context.

Returns:
The default service context. If the initialization has not been done yet, it will be done before returning the context.
See Also:
Init()

SetDefaultContext

public static void SetDefaultContext(IlpContext ctxt)
Sets the default application context.

This method must not be called directly, instead it is only called inside IlpDefaultContext constructor.

Internal method or field: do not use!

GetHostName

public static String GetHostName()
Returns the name of the host on which this process is running, if it can be determined.

Internal method or field: do not use!

GetHome

public static URL GetHome()
Returns directory where ILOG JTGO is installed.

Internal method or field: do not use!

DontSetLocale

public static void DontSetLocale()
Makes an application run in a non-locale environment. This static method must be called at the beginning of the main procedure. It should not be called more than once in your program. Once you call this method, your program will run in a non-locale environment; by default, the English locale.


IsDontSetLocale

public static boolean IsDontSetLocale()
Returns true if your program is running in a non-locale environment.

See Also:
DontSetLocale()

GetDefaultFont

public static Font GetDefaultFont()
Returns the default font.

Returns:
null if there is no default font.
See Also:
SetDefaultFont(Font)

SetDefaultFont

public static void SetDefaultFont(Font font)
Sets the specified font as the default font.


GetVersion

public static int GetVersion()
Deprecated. Use IlpTGOProduct.getVersionNumber() instead.

Returns the version of ILOG JTGO.

Returns:
1000000 * major version + 10000 * minor version + 100 * subminor version + 1 * patch level
Since:
JTGO 1.0
See Also:
GetVersion()
Deprecated Since:
JTGO 7.5

GetVersionString

public static String GetVersionString()
Deprecated. Use IlpTGOProduct.getVersionString() instead.

Returns the textual representation of the ILOG JTGO product version.

Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5

GetMajorVersion

public static final int GetMajorVersion()
Deprecated. Use IlpTGOProduct.getVersion() instead.

Returns the ILOG JTGO major version number, for instance, in ILOG JTGO 4.0, this method returns 4.

Deprecated Since:
JTGO 7.5

GetMinorVersion

public static final int GetMinorVersion()
Deprecated. Use IlpTGOProduct.getMinorVersion() instead.

Returns the ILOG JTGO minor version number, for instance, in ILOG JTGO 3.5, this method returns 5.

Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5

GetSubMinorVersion

public static final int GetSubMinorVersion()
Deprecated. Use IlpTGOProduct.getSubMinorVersion() instead.

Returns the ILOG JTGO subminor version number. For instance, with ILOG JTGO 3.5 the method returns 0.

Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5

GetPatchLevel

public static final int GetPatchLevel()
Deprecated. Use IlpTGOProduct.getPatchLevel() instead.

Returns the ILOG JTGO patch level number. If the version does not includes patches, the method returns 0.

Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5

GetBuildNumber

public static final long GetBuildNumber()
Deprecated. Use IlpTGOProduct.getBuildNumber() instead.

Returns the ILOG JTGO build number. It is an integer which increases from one patch to the next.

Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5

GetReleaseDate

public static final int GetReleaseDate()
Deprecated. Use IlpTGOProduct.getBuildNumber() instead.

Returns the date of the ILOG JTGO release.

Returns:
an integer with the decimal representation YYYYMMDD
Since:
JTGO 4.0
Deprecated Since:
JTGO 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.