|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.internal.baseadaptor.StateManager
public class StateManager
The StateManager manages the system state for the framework. It also provides the implementation to the PlatformAdmin service.
Clients may extend this class.
| Field Summary | |
|---|---|
static boolean |
DEBUG
General debug flag |
static boolean |
DEBUG_PLATFORM_ADMIN
PlatformAdmin debug flag |
static boolean |
DEBUG_PLATFORM_ADMIN_RESOLVER
PlatformAdmin resolver debug flag |
static boolean |
DEBUG_READER
Reader debug flag |
static boolean |
MONITOR_PLATFORM_ADMIN
Monitor PlatformAdmin debug flag |
static String |
PROP_LAZY_UNLOADING_TIME
System property used to specify to amount time before lazy data can be flushed from memory |
static String |
PROP_NO_LAZY_LOADING
System property used to disable lazy state loading |
| Constructor Summary | |
|---|---|
StateManager(File stateFile,
File lazyFile,
BundleContext context)
Constructs a StateManager using the specified files and context |
|
StateManager(File stateFile,
File lazyFile,
BundleContext context,
long expectedTimeStamp)
Constructs a StateManager using the specified files and context |
|
| Method Summary | |
|---|---|
void |
addDisabledInfo(DisabledInfo disabledInfo)
Adds the disabled info to the state managed by this platform admin. |
void |
commit(State state)
Commit the differences between the current state and the given state. |
Resolver |
createResolver()
Creates a new Resolver that is not associated with any State. |
State |
createSystemState()
Creates a new State used by the system. |
long |
getCachedTimeStamp()
Returns the cached time stamp of the system State. |
StateObjectFactory |
getFactory()
Returns a factory that knows how to create state objects, such as bundle descriptions and the different types of version constraints. |
Resolver |
getResolver()
Deprecated. |
State |
getState()
Returns a mutable state representing the current system. |
State |
getState(boolean mutable)
Returns a state representing the current system. |
StateHelper |
getStateHelper()
Returns a state helper object. |
State |
getSystemState()
Returns the State used by the system. |
State |
readSystemState()
Reads the State used by the system. |
void |
removeDisabledInfo(DisabledInfo disabledInfo)
Removes the disabled info from the state managed by this platform admin. |
void |
run()
|
boolean |
saveNeeded()
|
void |
shutdown(File saveStateFile,
File saveLazyFile)
Shutsdown the state manager. |
void |
stopDataManager()
Stops the active data manager thread which is used to unload unused state objects from memory. |
void |
update(File updateStateFile,
File updateLazyFile)
Update the given target files with the state data in memory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean DEBUG
public static boolean DEBUG_READER
public static boolean DEBUG_PLATFORM_ADMIN
public static boolean DEBUG_PLATFORM_ADMIN_RESOLVER
public static boolean MONITOR_PLATFORM_ADMIN
public static String PROP_NO_LAZY_LOADING
public static String PROP_LAZY_UNLOADING_TIME
| Constructor Detail |
|---|
public StateManager(File stateFile,
File lazyFile,
BundleContext context)
stateFile - a file with the data required to persist in memorylazyFile - a file with the data that may be lazy loaded and can be flushed from memorycontext - the bundle context of the system bundle
public StateManager(File stateFile,
File lazyFile,
BundleContext context,
long expectedTimeStamp)
stateFile - a file with the data required to persist in memorylazyFile - a file with the data that may be lazy loaded and can be flushed from memorycontext - the bundle context of the system bundleexpectedTimeStamp - the expected timestamp of the persisted system state. A negative
value indicates that no timestamp checking is done| Method Detail |
|---|
public void shutdown(File saveStateFile,
File saveLazyFile)
throws IOException
saveStateFile - saveLazyFile -
IOException
public void update(File updateStateFile,
File updateLazyFile)
throws IOException
updateStateFile - updateLazyFile -
IOExceptionpublic void stopDataManager()
public State createSystemState()
public State readSystemState()
null is returned.
null if the State
could not be read from a cache.public State getSystemState()
null is returned.
null if one
does not exist.public long getCachedTimeStamp()
State.getTimeStamp()public boolean saveNeeded()
public State getState(boolean mutable)
PlatformAdminjava.lang.UnsupportedOperationException.
If a mutable state is requested, the resulting state will not be resolved and the user objects from the system state bundle descriptions will not be copied.
getState in interface PlatformAdminmutable - whether the returned state should mutable
PlatformAdmin.getState(boolean)public State getState()
PlatformAdmin
This is a convenience method, fully equivalent to
getState(true).
getState in interface PlatformAdminPlatformAdmin.getState()public StateObjectFactory getFactory()
PlatformAdmin
getFactory in interface PlatformAdminPlatformAdmin.getFactory()
public void commit(State state)
throws BundleException
PlatformAdmin
commit in interface PlatformAdminstate - the future state of the framework
BundleExceptionPlatformAdmin.commit(State)public Resolver getResolver()
PlatformAdmin
getResolver in interface PlatformAdminPlatformAdmin.getResolver()public Resolver createResolver()
PlatformAdminResolver that is not associated with any State.
createResolver in interface PlatformAdminResolver.PlatformAdmin.createResolver()public StateHelper getStateHelper()
PlatformAdminA possible implementation for this method would provide the same single StateHelper instance to all clients.
getStateHelper in interface PlatformAdminPlatformAdmin.getStateHelper()public void run()
run in interface Runnablepublic void addDisabledInfo(DisabledInfo disabledInfo)
PlatformAdmin
addDisabledInfo in interface PlatformAdmindisabledInfo - the disabled info to add.public void removeDisabledInfo(DisabledInfo disabledInfo)
PlatformAdmin
removeDisabledInfo in interface PlatformAdmindisabledInfo - the disabled info to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||