edu.yale.emailet
Class EmailetDocComposer

java.lang.Object
  |
  +--edu.yale.emailet.EmailetDocComposer

public class EmailetDocComposer
extends java.lang.Object

This class is responsible for assembling Emailet object into EmailetDoc object by gathering all required classes and pack them together. It will find the required classes from a local repository (on disk) and a temporary repository of a class loader.

Author:
Hong Jiang

Constructor Summary
EmailetDocComposer()
           
 
Method Summary
protected  InlineClass[] collectRequiredClasses(java.lang.String name)
          Collect all classes referenced by a given class.
 EmailetDoc createEmailetDoc(Emailet emailet)
           
 EmailetClassLoader getClassLoader()
           
 ClassRepository getClassRepository()
          Get the class repository
static void main(java.lang.String[] args)
           
 void setClassLoader(EmailetClassLoader loader)
           
 void setClassRepository(ClassRepository repository)
          Set the class repository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailetDocComposer

public EmailetDocComposer()
Method Detail

createEmailetDoc

public EmailetDoc createEmailetDoc(Emailet emailet)
                            throws java.lang.ClassNotFoundException,
                                   java.io.IOException
java.lang.ClassNotFoundException
java.io.IOException

collectRequiredClasses

protected InlineClass[] collectRequiredClasses(java.lang.String name)
                                        throws java.io.IOException,
                                               java.lang.ClassNotFoundException
Collect all classes referenced by a given class.

Parameters:
name - Name of the class to be analyzed.
Returns:
an array of classes referenced by (including) the parameter class
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getClassLoader

public EmailetClassLoader getClassLoader()
Returns:
The instance of EmailetClassLoader used to load incoming emailets.

getClassRepository

public ClassRepository getClassRepository()
Get the class repository

Returns:
The class replository which contains the local classes used by various emailets. Some of them need to be packaged with the referencing Emailet object to form an EmailetDoc object.

setClassLoader

public void setClassLoader(EmailetClassLoader loader)
Parameters:
loader - The instance of EmailetClassLoader used to load incoming emailets.

setClassRepository

public void setClassRepository(ClassRepository repository)
Set the class repository

Parameters:
repository - The class replository which contains the local classes used by various emailets. Some of them need to be packaged with the referencing Emailet object to form an EmailetDoc object.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception