FileDocCategorySizeDatePackage
Loader.javaAPI DocApache James 2.3.14546Fri Jan 12 12:56:26 GMT 2007org.apache.james.transport

Loader

public abstract class Loader extends org.apache.avalon.framework.logger.AbstractLogEnabled implements org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable
$Id: Loader.java 494012 2007-01-08 10:23:58Z norman $

Fields Summary
protected String
baseDirectory
protected final String
MAILET_PACKAGE
protected final String
MATCHER_PACKAGE
protected Vector
packages
The list of packages that may contain Mailets or matchers
private org.apache.avalon.framework.service.ServiceManager
serviceManager
System service manager
protected org.apache.mailet.MailetContext
mailetContext
Mailet context
Constructors Summary
Methods Summary
public abstract voidconfigure(org.apache.avalon.framework.configuration.Configuration arg0)

see
org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)

public voidcontextualize(org.apache.avalon.framework.context.Context context)

see
org.apache.avalon.framework.context.Contextualizable#contextualize(Context)


           
           
    
        try 
        {
            baseDirectory = ((File)context.get( "app.home") ).getCanonicalPath();
        } 
        catch (Throwable e) 
        {
            getLogger().error( "can't get base directory for mailet loader" );
            throw new ContextException("can't contextualise mailet loader " + e.getMessage(), e);
        }
    
protected voidgetPackages(org.apache.avalon.framework.configuration.Configuration conf, java.lang.String packageType)

        packages = new Vector();
        packages.addElement("");
        final Configuration[] pkgConfs = conf.getChildren(packageType);
        for (int i = 0; i < pkgConfs.length; i++) {
            Configuration c = pkgConfs[i];
            String packageName = c.getValue();
            if (!packageName.endsWith(".")) {
                packageName += ".";
            }
            packages.addElement(packageName);
        }
    
public voidinitialize()

see
org.apache.avalon.framework.activity.Initializable#initialize()

        mailetContext = (MailetContext) serviceManager.lookup("org.apache.mailet.MailetContext");
    
public voidservice(org.apache.avalon.framework.service.ServiceManager sm)

see
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)

        serviceManager = new DefaultServiceManager(sm);