Interface PlatformAdmin
-
public interface PlatformAdmin
Framework service which allows bundle programmers to inspect the bundles and packages known to the Framework. The PlatformAdmin service also allows bundles with sufficient privileges to update the state of the framework by committing a new configuration of bundles and packages. If present, there will only be a single instance of this service registered with the Framework.This interface is not intended to be implemented by clients.
- Since:
- 3.1
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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()
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.in favour ofcreateResolver()
.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.void
removeDisabledInfo(DisabledInfo disabledInfo)
Removes the disabled info from the state managed by this platform admin.
-
-
-
Method Detail
-
getState
State getState()
Returns a mutable state representing the current system.This is a convenience method, fully equivalent to
getState(true)
.- Returns:
- a state representing the current framework.
-
getState
State getState(boolean mutable)
Returns a state representing the current system. If there is need to make changes to the returned state, a mutable state must be requested. Otherwise, an immutable state should be requested. In this case, invoking any of the operations that could cause the state to be changed will throw anjava.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.
- Parameters:
mutable
- whether the returned state should mutable- Returns:
- a state representing the current framework.
-
getStateHelper
StateHelper getStateHelper()
Returns a state helper object. State helpers provide convenience methods for manipulating states.A possible implementation for this method would provide the same single StateHelper instance to all clients.
- Returns:
- a state helper
- See Also:
StateHelper
-
commit
void commit(State state) throws BundleException
Commit the differences between the current state and the given state. The given state must return true from State.isResolved() or an exception is thrown. The resolved state is committed verbatim, as-is.- Parameters:
state
- the future state of the framework- Throws:
BundleException
- if the id of the given state does not match that of the current state or if the given state is not resolved.
-
getResolver
Resolver getResolver()
Deprecated.in favour ofcreateResolver()
.Returns a resolver supplied by the system. The returned resolver will not be associated with any state.- Returns:
- a system resolver
-
createResolver
Resolver createResolver()
- Returns:
- the new
Resolver
. - Since:
- 3.5
-
getFactory
StateObjectFactory getFactory()
Returns a factory that knows how to create state objects, such as bundle descriptions and the different types of version constraints.- Returns:
- a state object factory
-
addDisabledInfo
void addDisabledInfo(DisabledInfo disabledInfo)
Adds the disabled info to the state managed by this platform admin. If a disable info already exists for the specified policy and the specified bundle then it is replaced with the given disabled info.- Parameters:
disabledInfo
- the disabled info to add.- Throws:
IllegalArgumentException
- if theBundleDescription
for the specified disabled info does not exist in the state managed by this platform admin.- Since:
- 3.4
-
removeDisabledInfo
void removeDisabledInfo(DisabledInfo disabledInfo)
Removes the disabled info from the state managed by this platform admin.- Parameters:
disabledInfo
- the disabled info to remove- Since:
- 3.4
-
-