Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Summary

Use the BootLoader to bootstrap the OsidRuntimeManager.

Instantiating OSID Runtime

BootLoader bootstraps the runtime.

Getting an OSID 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. An OSID Provider that instantiates other OSID Providers should do so using the OsidRuntime passed to the initialize() method of its OsidManager.

public class MyCalendarManager
    implements org.osid.calendaring.CalendarManager {
 
    private org.osid.logging.LoggingManager logger;
 
    public void initialize(org.osid.OsidRuntimeManager runtime)
        throws org.osid.ConfigurationErrorException,
               org.osid.OperationFailedException {
 
        try {
            this.logger = runtime.getOsidManager(OSID.LOGGING, "my.calendar.impl",
                                                 net.okapia.osid.kilimanjaro.Versions.LATEST.getVersion());
        } catch (org.osid.NotFoundException nfe) {
            throw new org.osid.ConfigurationErrorException("calendaring impl not found", nfe);
        }
    }
}


  • No labels