In order to distribute software for installation on XOE devices, that software must be wrapped inside a XOE Package. XOE Packages are archives that contain Java classes, native libraries, and multimedia resources along with a machine readable XML description. Package Descriptions contain meta information describing the contents and functionality of a package and also describe any other packages that are required for proper operation. XOE Packages enable the development of products as multiple discreet components, each of which may be separately upgraded and maintained at runtime. By handling all the details of transferring, installing, uninstalling, and upgrading software components XOE Packages make it easy to distribute software to network enabled devices.
Packages are file archives that can contain any sort of data. The only restriction imposed is that they must contain an XML package description file called package.xml . This file describes the contents of the package, meta information such as the name, version, architecture (if native), author, etc., and also specifies other packages that are required for proper operation (or other packages that are incompatible with this one).
There are three steps involved in installing a package:
Resolve all dependencies: If a dependency is not satisfied by an installed package then a package server is queried for candidates. The dependendencies of the new package must also be resolved recursively.
Check for conflicts: Each new package is checked to make sure it does not conflict with another installed package.
Installation: Packages are processed one by one by a collection of Package Installer Services. Each of these Installers inspects the package and performs some specific task based on the files contained in the package.
The most important Installer Services are the Resource, Class, Service, and Native Library Installer Services. All of the core installer services, and how to use them, will be discussed in the Packaging Reference appendix. It's also possible to implement custom installer services - this will be discussed in Advanced Topics: Package Installer Implementation.
Let's imagine the design of a theoretical "Media Player" application. In order to build the application, we will need an application framework, in this case the XOE-Servlet framework. In addition, we want to support a number of media types (including ones that don't exist yet) so we need to be able to extend the media player at runtime. Finally, while the application itself is Java based, many of the media codecs must be implemented using native libraries that will be different for each supported platform. The following diagram shows a look at the packages that might make up this application, and the files they would contain.
Let's take a look at each of the packages shown.
XoeServlet . This package contains the XoeServlet application framework. In particular, the org.xoe.servlet.XoeServlet class is defined in this package. This class will be extended by the org.xoe.mediaplayer.MediaPlayerServlet in the MediaPlayer package. XoeServlet also depends on several other package but they have been left out here for clarity.
MediaPlayer . This package contains the MediaPlayer application and its related resource files. It also defines the IMediaCodec interface that enables the MediaPlayer to use MediaCodec plugins. IMediaCodec must extend the org.xoe.core.services.IService interface and should define all the methods necessary for using a MediaCodec plugin. The MediaPlayer can detect MediaCodec plugins by performing a Service Query for services implementing the IMediaCodec interface. MediaPlayer requires the XoeServlet package to build and run - this should be specified inside the package description (package-in.xml).
MpegMediaCodec. This package contains an implementation of IMediaCodec that provides support for Mpeg streams. The Java class should simply provide a wrapper to the native codec algorithms defined in the package MpegMediaCodec-native. MpegMediaCodec depends on MediaPlayer to build and run (for access to IMediaCodec) and also depends on MpegMediaCodec-native to run. These dependencies must be specified in the package description.
MpegMediaCodec-native. This package contains the native codec library. In particular, it should also define the native JNI methods declared in MpegMediaCodec. Because the code in this package is native a different version of the package must be distributed for each supported platform.
The XOE packaging system is the most effective way to distribute software to XOE devices. XOE packages enable flexibility, automated distribution, and eliminate the complexity of software installation. Through integration with the XOE Service architecture the package manager itself is completely customizable to suit virtually any software installation task.