A Closer Look
Summary
The sample application contains an example OSID Consumer and an example OSID Provider using the Okapia OSID implementation framework.
Source Navigation
Resource OSID Consumer
net.okapia.osid.sample.Planets is the sample application. It performs the following:
- Starts up an OsidRuntimeManager via a Bootloader
- Gets the net.okapia.osid.sample.providers.resource.solarsystem.ResourceManager OSID Resource Provider via the OsidRuntimeManager.
- Gets a ResourceLookupSession via the ResourceManager.
- Gets a stream of Resources via the ResourceLookupSession.
- Iterates through the ResourceList and displays them.
- Shuts down the OSID Resource Provider and OSID Runtime.
Resource OSID Provider
The shaded rows indicate classes that directly implement an OSID. The others are supporting files.
file | purpose |
---|---|
net.okapia.osid.sample.providers.resource.solarsystem.ResourceManager | The entry point for OSID Providers. OsidManagers define what the OSID Provider supports and provides access to supported OsidSessions. |
net.okapia.osid.sample.providers.resource.solarsystem.ServiceProvider | Metadata for OsidManager implementations. |
net.okapia.osid.sample.providers.resource.solarsystem.ResourceLookupSession | The OsidSession for listing Resources. All the action happens in OsidSessions. |
net.okapia.osid.sample.providers.resource.solarsystem.Resource | An implementation of Resource. An example ResourceRecord is implemented in the same class because there is only one. |
net.okapia.osid.sample.providers.resource.solarsystem.Planet | An enumeration of planets from which to create Resources. |
net.okapia.osid.sample.providers.resource.solarsystem.Bin | An OsidCatalog for collections of Resources. This provider defines only one. |
net.okapia.osid.sample.providers.resource.compliance.ResourceManager.xml | A configuration file for this provider. The OsidRuntimeManager feeds configuration data to OsidManager implementations via the initialize() method. |
Package Dependencies
The OSID Java Language Binding is in a jar OSID-<version>.jar. Various package dependencies are part of the Okapia OSID implementation framework.
Looking at the class files in the OSID Resource Provider, you can see that they extend classes in this framework and often make use of other Okapia tools in them.Â
Package Prefix | Description |
---|---|
org.osid | OSID Specifications |
net.okapia | Okapia OSID implementation framework |
We have an old strange habit of fully qualifying Java classes in OSID Provider implementations. We get so many variant implementations that it helps to quickly identify what's what.
Methods annotated withÂ
@OSID @Override
directly implement an OSID method in an OSID (interface). If it is overridden without the @OSID annotation, then it is probably overriding a method in an Okapia class (implementation).Â
Â