Class PackageState
java.lang.Object
org.pentaho.reporting.libraries.base.boot.PackageState
The package state class is used by the package manager to keep track of the activation level of the installed or
errornous packages.
This is an internal class used by the PackageManager.
- Author:
- Thomas Morgner
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A constant defining that the package has been loaded and configured.static final int
A constant defining that the package produced an error and is not available.static final int
A constant defining that the package was initialized and is ready to use.static final int
A constant defining that the package is new. -
Constructor Summary
ConstructorDescriptionPackageState
(Module module) Creates a new package state for the given module.PackageState
(Module module, int state) Creates a new package state for the given module. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Configures the module and raises the state to STATE_CONFIGURED if the module is not yet configured.boolean
Compares this object with the given other object for equality.Returns the module managed by this state implementation.int
getState()
Returns the current state of the module.int
hashCode()
Computes a hashcode for this package state.boolean
initialize
(SubSystem subSystem) Initializes the contained module and raises the set of the module to STATE_INITIALIZED, if the module was not yet initialized.void
Marks this package state as invalid.
-
Field Details
-
STATE_NEW
public static final int STATE_NEWA constant defining that the package is new.- See Also:
-
STATE_CONFIGURED
public static final int STATE_CONFIGUREDA constant defining that the package has been loaded and configured.- See Also:
-
STATE_INITIALIZED
public static final int STATE_INITIALIZEDA constant defining that the package was initialized and is ready to use.- See Also:
-
STATE_ERROR
public static final int STATE_ERRORA constant defining that the package produced an error and is not available.- See Also:
-
-
Constructor Details
-
PackageState
Creates a new package state for the given module. The module state will be initialized to STATE_NEW.- Parameters:
module
- the module.
-
PackageState
Creates a new package state for the given module. The module state will be initialized to the given initial state.- Parameters:
module
- the module.state
- the initial state
-
-
Method Details
-
configure
Configures the module and raises the state to STATE_CONFIGURED if the module is not yet configured.- Parameters:
subSystem
- the sub-system.- Returns:
- true, if the module was configured, false otherwise.
-
getModule
Returns the module managed by this state implementation.- Returns:
- the module.
-
getState
public int getState()Returns the current state of the module. This method returns either STATE_NEW, STATE_CONFIGURED, STATE_INITIALIZED or STATE_ERROR.- Returns:
- the module state.
-
initialize
Initializes the contained module and raises the set of the module to STATE_INITIALIZED, if the module was not yet initialized. In case of an error, the module state will be set to STATE_ERROR and the module will not be available.- Parameters:
subSystem
- the sub-system.- Returns:
- true, if the module was successfully initialized, false otherwise.
-
equals
Compares this object with the given other object for equality. -
hashCode
public int hashCode()Computes a hashcode for this package state. -
markError
public void markError()Marks this package state as invalid.
-