什么是JAF?它的目的是什么?

Man*_*noj 37 java activation

我无法理解JAF(Java Activation Framework)的目的.请用简单的语言向我解释,或者指出我的信息.

Java Mail API正在使用JAF.看起来JAF用于查找对象的支持数据类型.但我无法理解.

请教我!

cle*_*tus 51

The JavaBeans Activation Framework is a library for abstracting the operating system specific bindings/mappings between file types and applications that deal with them. This can be based on MIME types and/or file extensions. It's really nothing more than that.

Open up Windows explorer and right click on a file. Various actions may be there (eg Open, Edit, Play). What actions are associated with the file is associated with the file extension on Windows. JAF is a portable version of that. It's mainly intended for desktop applications to be able to interact with whatever programs can be used with files on that computer.


Ale*_*lli 11

It's actually the JavaBeans Activation Framework and I think the docs explain it well:

使用JavaBeans Activation Framework标准扩展,使用Java技术的开发人员可以利用标准服务来确定任意数据的类型,封装对它的访问,发现其上可用的操作,并实例化相应的bean来执行所说的操作.例如,如果浏览器获得JPEG图像,则该框架将使浏览器能够将该数据流识别为JPEG图像,并且从该类型,浏览器可以定位并实例化可以操纵或查看该图像的对象.

这一段的哪些部分对你不清楚?

  • 我认为有时 Oracle 文档中的概念是如此高度抽象,而作为开发人员,我们习惯于处理具体的语义,以至于需要阅读第二遍或第三遍。即便如此,还是要求某人用最简单的术语来说明。 (2认同)

Tom*_*ský 5

OT:JDK7中类似的功能(尽管当然不能视为完全替代)