0 Replies Latest reply on Jan 8, 2003 3:35 AM by Ricardo Arguello

    Enterprise Media Beans

    Ricardo Arguello Newbie


      I've been working on an implementation of the Enterprise Media Beans API since July of last year, but I haven't found enough time to finish it.

      The Enterprise Media Beans specification is described in the Java Specification Request 086 (JSR-86):

      The Enterprise Media Beans architecture allows the integration of rich media (image, audio and video) into the J2EE programming model. This means your media could take advantage of all the capabilities of the Java2 Enterprise Edition: transactionality, security, scalability, availability, just to name a few.

      The specification divides the architecture in two parts: Media Foundation Beans and Media Entity Beans.

      Media Foundation Beans let you represent your media independently of its kind. It represents media in a uniform way, letting you program against interfaces representing the media and its metadata (width, height, color dept, frame rate, etc.) instead of programming against a particular media format (GIF or MPEG video for example).

      You could use Media Foundation Beans to transcode from one format to another, for example to convert your GIF files to PNG (due to patent problems) when serving them from a Servlet. You could resize your media to certain needed dimensions, or add digital watermarks to the stock photographs you sell online. All these media transformations are represented with interfaces, this allows to implement transformation chains of any kind, from any media to any media.

      Media formats and media converters are designed in a pluggable fashion. In my implementation I'm using Java2 1.4's new Image I/O API (javax.imageio.*) to represent image media (PNG, GIF and JPG) and it's metadata, but since the architecture is pluggable, anybody could implement a new TIFF media format using Image I/O and it could be used to represent that type of image with Media Foundation Beans (TIFF format is not available in Sun's Java2 Standard Edition SDK 1.4).

      I could have implemented every media format available using third party libraries found on the Internet, to read media headers (mostly magic numbers) and extract metadata information by hand, but the Java2 1.4 SDK has a whole API to represent graphics (javax.imageio.*), so I decided to use it. The only problem is that I'm only representing graphics, not audio or video yet. But since the API is designed to be pluggable, new media could be more or less easily supported, depending on the availability of utility libraries to decode media formats and their metadata. One thing that is remarkable is that the javax.imageio.* formats are represented internally as an XML document.

      According to the spec, Media Entity Beans (MEB) integrate the services provided by Media Foundation Beans into the Enterprise JavaBeans architecture, adding additional services that require media persistence. That means MEBs could participate in relationships with Entity Beans in J2EE! Imagine your Emmy Awards Enterprise JavaBean System (EAWEJB) representing media clips and domain objects (Artist --> Video Clip) in a transparent "CMP style" way. No more BLOB nonsense!

      I'm planning to incorporate my work into JBoss in the next months (JBossMedia is a cool name, isn't it?).

      I have most of the *only image-format support* Media Foundation Beans API implemented. The most important part, Media Entity Beans, is still missing.

      If you'd like to help, please drop me a line.

      Ricardo Argüello
      ricardoarguello at andinanet dot net