JBoss Embedded and the JSR-299 Test Harness both have requirements for
representing archives, collections of Classes and resources, in an
object model. We've taken some ideas initially put forth by Bill and
Adrian and reworked them into a standalone project with *no* outside
dependencies, called "ShrinkWrap".
http://www.jboss.org/community/wiki/ShrinkWrap
Example:
// Make a name for the JAR
String name = "slsb.jar";
// Create and add classes to the JAR
JavaArchive archive = JavaArchiveFactory.create(name).
addClasses(OutputBean.class, OutputLocalBusiness.class);
// Get a stream so we can serialize to disk as a JAR
InputStream in = ZipExporter.exportZip(archive);
// Or deploy directly to Embedded AS
server.deploy(archive);
This project in particular has had a lot of community support (I'd
estimate 50% of the code and tests currently in place, as well as many
design ideas). Aslak Knutsen and John Bailey are the contributors, and
can typically be found on IRC Freenode #jboss-dev.
S,
ALR
--
Andrew Lee Rubinger
Sr. Software Engineer
JBoss by Red Hat
http://exitcondition.alrubinger.com