18 of 21
type=application/x-wombat desc=”Wombat” exts=wom
All components are packaged in a JAR file.
ContentHandler Bean Only
Now that everyone is using Wombats, you’ve decided that it would be nice if you could notify people by email when new Wombats are created. You have designed a new WombatNotification class and a corresponding data format to be sent by email using the MIME type “application/x-wombat-notification”. Your server detects the presence of new Wombats, constructs a WombatNotification object, and constructs and sends an email message with the Wombat notification data as an attachment. Your customers run a program that scans their email INBOX for messages with Wombat notification attachments and use the WombatNotification class to notify their users of the new Wombats.
In addition to the server application and user application described, you’ll need a DataContentHandler to plug into the DataHandler infrastructure and construct the WombatNotification objects. The WombatNotification DataContentHandler is delivered as a class named WombatNotificationDataContentHandler and is delivered in a JAR file with the following mailcap file:
application/x-wombat-notification; \ WombatNotificationDataContentHandler
The server application creates DataHandlers for its WombatNotification objects. The email system uses the DataHandler to fetch a byte stream corresponding to the WombatNotification object. (The DataHandler uses the DataContentHandler to do this.)
The client application retrieves a DataHandler for the email attachment and uses the getContent method to get the corresponding WombatNotification object, which will then notify the user.
The JAF is implemented as a Standard Extension to the Java™ Platform and is also included in the J2SE 6.0 release. The following are some more details about the package:
The package name is javax.activation.
This release is included in J2SE 6.0 and J2EE 5.0, and is also available separately for use on earlier versions of J2SE.
The JAF Reference Implementation does not include DataContentHandlers for any MIME data types; applications must include the DataContentHandlers thy need.