原创 2006年06月14日 17:50:00
1.         The JAF is a data typing and registry technology that is a Standard Extension to the Java Platform.
2.         The JAF implements the following services:
       It determines the type of arbitrary data.
       It encapsulates access to data.
       It discovers the operations available on a particular type of data.
       It instantiates the software component that corresponds to the desired operation on a particular piece of data.
4.         javax.activation.DataHandler: provides a consistent interface between JAF-aware clients and other subsystems. The DataHandler class encapsulates a Data object, and provides methods which act on that data.
       The DataHandler can be instantiate with an object or a DataSource. The content is available through the DataHandler can be either an InputStream or an object in the Java.
5.         javax.activation.DataSource: encapsulates and object that contains data, and that can return both a stream providing data access, and a string defining the MIME type describing the data. The DataSource interface is used by DataHandler to access the underlying data. JAF includes two DataSource class implementations: FileDataSource & URLDataSource.
6.         javax.activation.DataContentHandler: extend the capabilities of the DataHandler’s implementation of the Transferable interface. The DataContentHandler interface is implemented by classes that are used by the DataHandler to convert InputStreams into object and vice versa. A DataHandler carries the content body and provides methods the client uses to handle the content.
       DataSource, DataHandler, DataContentHandler一起构成了Command设计模式的实现,DataSource为Command, 客户端产生DataSource实例,通过构造函数传递给DataHandler。但调用DataHandler方法时(例如getContent()),DataHandler在调用DataContentHandler实现类的相应方法并将DataSource实例作为参数传入(例如getContent(DataSource ds)),最后DataContentHandler的实现类在调用DataSource实例的相应方法进行处理。
7.         javax.activation.DataContentHandlerFactory: The interface defines a factory for DataContentHandler. DataContentHandlerFactory, DataContentHandler, DataHandler一起构成了Simple Factory设计模式的实现。
8.         javax.activation.CommandMap: provides a service that allows consumers of its interfaces to determine the ‘commands’ available on a particular MIME type as well as an interface to retrieve an object that can operate on an object of a particular MIME type(effectively a component registry).
       Javax.activation.MailCapCommandMap: implements a CommandMap whose configuration is based on mailcap files.
9.         javax.activation.CommandInfo: is used by CommandMap implementations to describe the results of command requests. The getCommandObject() is mostly useful. 通过DataHandler.getCommand(String cmdName)得到相应的CommandInfo,然后通过DataHandler.getBean(CommandInfo ci)得到相应的CommandObject.
10.     javax.activation.CommandObject: the interface which is been implemented when beans want to interact with JAF Services.
11.     The Transferable interface’s functionality can be extended via objects implementing the DataContentHandler interface, and then made available to the DataHandler either by a DataContentHandlerFactory object, or via a CommandMap.



  • 2017-08-07 08:58
  • 209KB
  • 下载


JavaBeans激活框架(JavaBeans Activation Framework)        JAF的目的在于统一处理不同数据格式的方法(不管数据格式为简单文本还是由图片、声音、视频甚至其...
  • kissqw
  • kissqw
  • 2011-06-20 11:27
  • 2903


  • 2016-08-11 07:36
  • 15KB
  • 下载


  • 2017-07-04 15:40
  • 12KB
  • 下载


JavaBeans激活框架(JavaBeans Activation Framework) JAF的目的在于统一处理不同数据格式的方法(不管数据格式为简单文本还是由图片、声音、视频甚至其它"活动...


  • 2017-08-22 08:58
  • 67KB
  • 下载


首先要引mail.jar和activation.jar包 下载地址为: javamail:http://java.sun.com/products/javamail/downloads/index.h...