org.codehaus.jam
Class JamServiceFactory

java.lang.Object
  extended by org.codehaus.jam.JamServiceFactory
Direct Known Subclasses:
JamServiceFactoryImpl

public abstract class JamServiceFactory
extends java.lang.Object

Start here! This is the normal entry point into the JAM subsystem. JamServiceFactory is a singleton factory which can create a new JamServiceParams and JServices. Here is a code sample that demonstrates how to use JamServiceFactory.

 // Get the factory singleton
 JamServiceFactory factory = JamServiceFactory.getInstance();

 // Use the factory to create an object that we can use to specify what
 // java types we want to view
 JamServiceParams params = factory.createServiceParams();

 // Include the classes under mypackage
 params.includeSources(new File("c:/myproject/src","mypackage/*.java"));

 // Create a JamService, which will contain JClasses for the classes found in mypackage
 JamService service = factory.createServiceRoot(params);
 

Author:
Patrick Calahan <email: pcal-at-bea-dot-com>

Constructor Summary
protected JamServiceFactory()
           
 
Method Summary
abstract  JamClassLoader createJamClassLoader(java.lang.ClassLoader cl)
          Returns a new JamClassLoader which simply wraps the given classloader.
abstract  JamService createService(JamServiceParams params)
          Create a new JamService from the given parameters.
abstract  JamServiceParams createServiceParams()
          Create a new JamServiceParams instance.
abstract  JamClassLoader createSystemJamClassLoader()
          Returns a new JamClassLoader which simply wraps the system classloader.
static JamServiceFactory getInstance()
          Return the default factory singleton for this VM.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JamServiceFactory

protected JamServiceFactory()
Method Detail

getInstance

public static JamServiceFactory getInstance()
Return the default factory singleton for this VM.


createServiceParams

public abstract JamServiceParams createServiceParams()
Create a new JamServiceParams instance. The params can be populated and then given to the createServiceRoot method to create a new JamService.


createService

public abstract JamService createService(JamServiceParams params)
                                  throws java.io.IOException
Create a new JamService from the given parameters.

Throws:
java.io.IOException - if an IO error occurred while creating the service
java.lang.IllegalArgumentException - if the params is null or not an instance returned by createServiceParams().

createSystemJamClassLoader

public abstract JamClassLoader createSystemJamClassLoader()

Returns a new JamClassLoader which simply wraps the system classloader.


createJamClassLoader

public abstract JamClassLoader createJamClassLoader(java.lang.ClassLoader cl)

Returns a new JamClassLoader which simply wraps the given classloader.


main

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