Getting the OsidRuntime
Summary
Use the BootLoader to bootstrap the OsidRuntimeManager to get the ball rolling.
Instantiating OSID Runtime
BootLoader bootstraps the runtime.
net.okapia.osid.kilimanjaro.BootLoader loader = new net.okapia.osid.kilimanjaro.BootLoader(); org.osid.OsidRuntimeManager runtime = loader.getRuntimeManager("myApp");
The BootLoader handles the startup of the OSID Runtime. The OSID Runtime is instantiated once. Once the OSID Runtime has been acquired, it is kept for the life of the application. The OSID Runtime is responsible for both the location and operation of other OSID Providers. Shutting down the OSID Runtime shuts down all services accessible through the OSID Runtime.Â
OSID Providers using other OSID Providers
The Bootloader is only used once in any application environment. OSID Providers access the OSID Runtime through their initialize() methods.
public interface org.osidOsidManager implements org.osid.OsidProfile { Â public void initialize(org.osid.OsidRuntimeManager runtime) throws org.osid.ConfigurationErrorException, org.osid.OperationFailedException; Â .... }
Unless overidden, the default initialize() method for classes extending net.okapia.osid.jamocha.spi.AbstractOsidManager in the Jamocha package provides access to the OSID Runtime.
public abstract class net.okapia.osid.jamocha.spi.AbstractOsidManager implements org.osid.OsidManager, org.osid.OsidProxyManager { Â /** * Initializes this manager. A manager is initialized once at the time of * creation. * * @param runtime the runtime environment * @throws org.osid.ConfigurationErrorException an error with * implementation configuration * @throws org.osid.IllegalStateException this manager has already been * initialized by the <code> OsidLoader </code> * @throws org.osid.NullArgumentException <code> runtime </code> is * <code> null </code> * @throws org.osid.OperationFailedException unable to complete request */ @OSID @Override public void initialize(org.osid.OsidRuntimeManager runtime) throws org.osid.ConfigurationErrorException, org.osid.OperationFailedException { this.runtime = runtime; return; } /** * Gets the runtime environment. * * @return the runtime */ protected org.osid.OsidRuntimeManager getRuntime() { return (this.runtime); } Â .... }