Bean Packaging

   

If you want an application builder to access the Beans you develop, you have to package them in a JAR file (see Chapter 25, " JAR Files" ). When you create a JAR for this purpose, it must contain the class files that support your Beans and a manifest file that identifies each Bean included in the archive. The JAR might also include optional support files for each Bean. These optional files include any associated BeanInfo or PropertyEditor classes, HTML documentation that describes the Bean's use, a serialized instance that can be used to initialize the Bean, and any required resource files (for example, image or sound files).

For the example Beans, you might create a JAR with a manifest file like the following:

 Name: TextReader.class Java-Bean: True Name: TextDisplayer.class Java-Bean: True Name TextDisplayerBeanInfo.class Design-Time-Only: True Name: TextReaderInfo.class Design-Time-Only: True 

You identify each Bean in the JAR with an entry in the manifest that includes the Java-Bean tag. The Design-Time-Only tag identifies entries that are required only by the application builder and are not needed at runtime. This tag is shown used with the BeanInfo classes. If a Bean has dependencies on other class files or resources, you identify those with the Depends-On tag to make it known to the builder tool which files are required to deploy and use a Bean.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net