public class PackageState extends Object
Modifier and Type | Field and Description |
---|---|
static int |
STATE_CONFIGURED
A constant defining that the package has been loaded and configured.
|
static int |
STATE_ERROR
A constant defining that the package produced an error and is not available.
|
static int |
STATE_INITIALIZED
A constant defining that the package was initialized and is ready to use.
|
static int |
STATE_NEW
A constant defining that the package is new.
|
Constructor and Description |
---|
PackageState(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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
configure(SubSystem subSystem)
Configures the module and raises the state to STATE_CONFIGURED if the
module is not yet configured.
|
boolean |
equals(Object o)
Compares this object with the given other object for equality.
|
Module |
getModule()
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 |
markError()
Marks this package state as invalid.
|
public static final int STATE_NEW
public static final int STATE_CONFIGURED
public static final int STATE_INITIALIZED
public static final int STATE_ERROR
public PackageState(Module module)
module
- the module.public PackageState(Module module, int state)
module
- the module.state
- the initial statepublic boolean configure(SubSystem subSystem)
subSystem
- the sub-system.public Module getModule()
public int getState()
public boolean initialize(SubSystem subSystem)
subSystem
- the sub-system.public boolean equals(Object o)
equals
in class Object
o
- the other object to be comparedObject.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void markError()