JAF学习笔记

原创 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.
3.        
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.
12.      

JAF简介

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

zynq fsbl 学习笔记

  • 2017年12月13日 11:25
  • 267KB
  • 下载

JavaEE2017最新版基础班学习笔记

  • 2017年12月08日 21:46
  • 20KB
  • 下载

javamail,java发email,发邮件,jaf,activation,j2ee5冲突问题解决

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

web开发学习笔记

  • 2017年12月06日 09:40
  • 549KB
  • 下载

JAF(JavaBeans Activation Framework)

--------http://blog.sina.com.cn/s/blog_61583c540100dw42.html JAF(JavaBeans Activation Framewo...

Flex学习笔记(flex必知必会).doc

  • 2017年12月02日 15:38
  • 734KB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:JAF学习笔记
举报原因:
原因补充:

(最多只允许输入30个字)