Posts tagged "gravity"

How to respond to close and open events for tiles within the Composite Application Framework (Mosaic)

Within the Composite Application Framework, responding to the closing of tiles can be problematic. A tile can detect its own closing. Problems arise if the tile attempts to notify other parts of the program that it is closing through calls to shared services or changing global values. Before the tile can dispatch Mosaic events to other tiles it is closed.

Underlying Mosaic is the Client Component Framework (Gravity). Gravity is an OSGi-inspired framework that allows for plugins or modules to be added and removed to Flash applications. When a tile closes, the Gravity BundleEvent.BUNDLE_UNINSTALLED event is dispatched.

Here is an example snippet passed to me that shows how to listen for Gravity-oriented events:

BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_INSTALLED, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_RESOLVED, bundleChange)
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_RESOLVING, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_STARTED, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_STARTING, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_STOPPED, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_STOPPING, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_UNINSTALLED, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_UNINSTALLING, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_UPDATED, bundleChange);
BundleContext.currentContext.addEventListener(BundleEvent.BUNDLE_UPDATING, bundleChange);

BundleContext.currentContext.addEventListener(ServiceEvent.SERVICE_MODIFIED, bundleChange);
BundleContext.currentContext.addEventListener(ServiceEvent.SERVICE_REGISTERED, bundleChange);
BundleContext.currentContext.addEventListener(ServiceEvent.SERVICE_UNREGISTERING, bundleChange);


Deconstructing Experience Services: the Composite Application Framework (Mosaic)

The Experience Services contains the Composite Application Framework (Mosaic). The framework has both a server component and a Flex component. Adding the ADEP tooling plugins will, among other things, provide Mosaic capabilities to Flash Builder.

Mosaic builds on the OSGi-inspired Gravity framework. It provides a Flex sdk and tools for creating Mosaic applications, functionality within Flash Builder to create catalogs and deploy applications to a server, and the Mosaic server to present the applications over the Internet.

Content, both Flash-based and HTML, can be brought to together into an application as individual tiles. The tiles can be existing content recompiled with Mosaic tags or it can be new content. The tiles do not all have to have been compiled with the same Flex SDK. The tiles can be developed independently of each other by separate team or at different times. And the tiles can be reused in other applications.

Deconstructing Experience Services: Client Component Framework (Gravity)

The ADEP Client Component Framework (codename Gravity) is an ActionScript library that takes the concepts of OSGi and applies them to ActionScript. It provides a module and/or plugin architecture in which individual pieces can be added and removed seamlessly. The Gravity SDK comes with the es-sdk package for Experience Services. The parts become much more independent of each other allowing easier integration of content from different teams or repurposing of existing content. It makes it easier to have a library of parts that are put together as needed for applications.

While Gravity can be used by itself, it is one of the foundations of the Client Application Framework (Mosaic).

An excellent sample application using Gravity has been posted along with supporting video tutorials at ADEP Client Component Framework blog.