OsidManagers made easy.
The OsidManager is the gateway into a domain. It is initialized by the OSID Runtime and then asked to open OsidSessions. With this family of classes, you override only the pieces your implementation supports to save on implementing methods your implementation does not support.
OsidManagers do not hold domain OsidObjects directly — they hold the configuration and credentials needed to open OsidSessions, and they delegate state to those sessions. Think of an OsidManager as a hub to OsidSessions.
The other method to override
is initialize(OsidRuntimeManager). This is where you
will put in your startup instructions such as acquiring and
setting your configuration. The
base AbstractOsidManager defines utility methods for
making queries to the built-in Configuration OSID.
This abstract class requires
a ServiceProvider which contains the service provider
identity. The runtime
calls initialize(OsidRuntimeManager) after
construction to pull in configuration.
AbstractOsidManager already
implements the identity methods — getId(),
getDisplayName(), getDescription(),
getVersion(), getReleaseDate(),
getLicense(), getProviderId(),
getProvider() and getBranding() — by
reading from the ServiceProvider passed through the
constructor, so a subclass rarely touches them. What a
subclass does reach for is the set of protected tools
below: profile declarations it calls once during setup, and
helpers it uses from initialize() and its session
factories.
Loading dependent managers.
Use these to obtain other OSID services your implementation builds on.
Both throw IllegalStateException if the manager has not
been initialized.
| Tool | Description |
|---|---|
getOsidManager(OSID, implClassName) |
Instantiates and initializes another OsidManager through the loader. |
getOsidProxyManager(OSID, implClassName) |
Instantiates and initializes an OsidProxyManager through the loader. |
Getting configuration. These
query the built-in Configuration OSID and are the everyday tools inside
initialize(). Each throws IllegalStateException
if the manager is not yet initialized.
| Tool | Description |
|---|---|
getConfigurationValue(Id) |
Returns the single most-preferred Value for a parameter; throws ConfigurationErrorException if none is set. |
getConfigurationValues(Id) |
Returns all applicable Values for a parameter as a ValueList. |
Typed configuration convenience getters.
Each has the form getXxxConfigurationValue(Id parameterId, Xxx defaultValue)
and returns the parameter's value coerced to that type, falling back to
defaultValue (which may be null) when the
parameter is absent. One exists for each configuration value type:
| Getter | Returns |
|---|---|
getBooleanConfigurationValue | Boolean |
getBytesConfigurationValue | byte[] |
getCardinalConfigurationValue | Long |
getCoordinateConfigurationValue | Coordinate |
getCurrencyConfigurationValue | Currency |
getDateTimeConfigurationValue | DateTime |
getDecimalConfigurationValue | BigDecimal |
getDisplayTextConfigurationValue | DisplayText |
getDurationConfigurationValue | Duration |
getHeadingConfigurationValue | Heading |
getIdConfigurationValue | Id |
getIntegerConfigurationValue | Long |
getObjectConfigurationValue | Object |
getSpeedConfigurationValue | Speed |
getStringConfigurationValue | String |
getTimeConfigurationValue | Time |
getTypeConfigurationValue | Type |
getVersionConfigurationValue | Version |
Runtime access. The
runtime captured at initialize() is the gateway to
the rest of the OSID installation. The above tools remove the need
for direct access to the runtime in most cases.
| Tool | Description |
|---|---|
getRuntime() |
Returns the OsidRuntimeManager stored during initialize(). |
setRuntime(OsidRuntimeManager) |
Replaces the runtime environment. |
Declaring what Proxy
the service supports..
| Tool | Description |
|---|---|
addProxyRecordType(Type) |
Declares support for a proxy record type for use
in OsidProxyManagers. |
removeProxyRecordType(Type) |
Withdraws support for a previously declared proxy record type. |