Class ClassicEngineBoot
- java.lang.Object
-
- org.pentaho.reporting.libraries.base.boot.AbstractBoot
-
- org.pentaho.reporting.engine.classic.core.ClassicEngineBoot
-
- All Implemented Interfaces:
org.pentaho.reporting.libraries.base.boot.SubSystem
public class ClassicEngineBoot extends org.pentaho.reporting.libraries.base.boot.AbstractBoot
An utility class to safely boot and initialize the Pentaho-Reporting library. This class should be called before using the Pentaho-Reporting classes, to make sure that all subsystems are initialized correctly and in the correct order. Application developers should make sure, that the booting is done before any Pentaho-Reporting functions are used. If the system has not be initialized by booting this class, anything can happen and the results of all functionality of this reporting engine will be undefined. Additional modules can be specified by defining the system property"org.pentaho.reporting.engine.classic .core.boot.Modules"
. The property expects a comma-separated list ofModule
implementations. Booting should be done by aquirering a new boot instance usinggetInstance()
and then starting the boot process withAbstractBoot.start()
.- Author:
- Thomas Morgner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassicEngineBoot.VersionValidity
-
Field Summary
Fields Modifier and Type Field Description static String
BUNDLE_TYPE
static String
DATASCHEMA_NAMESPACE
static String
INDEX_COLUMN_PREFIX
static String
METADATA_NAMESPACE
static int
VERSION_3_8
static int
VERSION_3_9
static int
VERSION_4_0
static int
VERSION_TRUNK
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
computeCurrentVersionId()
static int
computeVersionId(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
org.pentaho.reporting.libraries.base.config.ModifiableConfiguration
getEditableConfig()
Returns the current global configuration as modifiable instance.static ClassicEngineBoot
getInstance()
Returns the singleton instance of the boot utility class.protected org.pentaho.reporting.libraries.base.versioning.ProjectInformation
getProjectInfo()
Returns the project info.static org.pentaho.reporting.libraries.base.config.Configuration
getUserConfig()
Returns the user supplied global configuration.static boolean
isEnforceCompatibilityFor(int level, int prptVersionMajorRaw, int prptVersionMinorRaw)
static boolean
isEnforceCompatibilityFor(int level, int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
boolean
isModuleAvailable(String moduleClass)
A helper method that checks, whether a given module is available.static ClassicEngineBoot.VersionValidity
isValidVersion(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
protected ClassicEngineBoot.VersionValidity
isValidVersion(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw, org.pentaho.reporting.libraries.base.versioning.ProjectInformation info)
protected org.pentaho.reporting.libraries.base.config.Configuration
loadConfiguration()
Loads the configuration.static int
parseVersionId(String text)
protected void
performBoot()
Performs the actual boot process.static String
printVersion(int versionId)
static void
setUserConfig(org.pentaho.reporting.libraries.base.config.Configuration config)
Defines the global user configuration.-
Methods inherited from class org.pentaho.reporting.libraries.base.boot.AbstractBoot
createDefaultHierarchicalConfiguration, getBootFailureReason, getConfigurationDomain, getExtendedConfig, getGlobalConfig, getObjectFactory, getPackageManager, isBootDone, isBootFailed, isBootInProgress, loadBooter, loadBooter, start
-
-
-
-
Field Detail
-
VERSION_TRUNK
public static final int VERSION_TRUNK
-
VERSION_3_8
public static final int VERSION_3_8
-
VERSION_3_9
public static final int VERSION_3_9
-
VERSION_4_0
public static final int VERSION_4_0
-
INDEX_COLUMN_PREFIX
public static final String INDEX_COLUMN_PREFIX
- See Also:
- Constant Field Values
-
METADATA_NAMESPACE
public static final String METADATA_NAMESPACE
- See Also:
- Constant Field Values
-
DATASCHEMA_NAMESPACE
public static final String DATASCHEMA_NAMESPACE
- See Also:
- Constant Field Values
-
BUNDLE_TYPE
public static final String BUNDLE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ClassicEngineBoot getInstance()
Returns the singleton instance of the boot utility class.- Returns:
- the boot instance.
-
getEditableConfig
public org.pentaho.reporting.libraries.base.config.ModifiableConfiguration getEditableConfig()
Returns the current global configuration as modifiable instance. This is exactly the same as casting the global configuration into a ModifableConfiguration instance. This is a convinience function, as all programmers are lazy.- Returns:
- the global config as modifiable configuration.
-
getProjectInfo
protected org.pentaho.reporting.libraries.base.versioning.ProjectInformation getProjectInfo()
Returns the project info.- Specified by:
getProjectInfo
in classorg.pentaho.reporting.libraries.base.boot.AbstractBoot
- Returns:
- The project info.
-
loadConfiguration
protected org.pentaho.reporting.libraries.base.config.Configuration loadConfiguration()
Loads the configuration. This will be called exactly once.- Specified by:
loadConfiguration
in classorg.pentaho.reporting.libraries.base.boot.AbstractBoot
- Returns:
- The configuration.
-
performBoot
protected void performBoot()
Performs the actual boot process.- Specified by:
performBoot
in classorg.pentaho.reporting.libraries.base.boot.AbstractBoot
-
getUserConfig
public static org.pentaho.reporting.libraries.base.config.Configuration getUserConfig()
Returns the user supplied global configuration.- Returns:
- the user configuration, if any.
-
setUserConfig
public static void setUserConfig(org.pentaho.reporting.libraries.base.config.Configuration config)
Defines the global user configuration.- Parameters:
config
- the user configuration.
-
isModuleAvailable
public boolean isModuleAvailable(String moduleClass)
A helper method that checks, whether a given module is available. The result of this method is undefined if the system has no been booted yet.- Parameters:
moduleClass
- the class-name of the module that should be tested.- Returns:
- true, if the module is available and has been initialized correctly, false otherwise.
-
parseVersionId
public static int parseVersionId(String text)
-
printVersion
public static String printVersion(int versionId)
-
computeCurrentVersionId
public static int computeCurrentVersionId()
-
computeVersionId
public static int computeVersionId(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
-
isValidVersion
public static ClassicEngineBoot.VersionValidity isValidVersion(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
-
isValidVersion
protected ClassicEngineBoot.VersionValidity isValidVersion(int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw, org.pentaho.reporting.libraries.base.versioning.ProjectInformation info)
-
isEnforceCompatibilityFor
public static boolean isEnforceCompatibilityFor(int level, int prptVersionMajorRaw, int prptVersionMinorRaw)
-
isEnforceCompatibilityFor
public static boolean isEnforceCompatibilityFor(int level, int prptVersionMajorRaw, int prptVersionMinorRaw, int prptVersionPatchRaw)
-
-