class ConfigPathConfigurer 
implements 
    BeanPostProcessor, 
    ApplicationListener<ApplicationEvent>,
    ApplicationContextAware, 
    Ordered {
    private static final Logger logger =
        Logger.getLogger(ConfigPathConfigurer.class.getName());

    protected Map<String,Object> allBeans = new HashMap<String,Object>();
    
    
    //// BEAN PROPERTIES
    
    /** 'home' directory for all other paths to be resolved 
     * relative to; defaults to directory of primary XML config file */
    protected ConfigPath path; 
    public ConfigPath getPath() {
        return path;
    }
    
    //// BEANPOSTPROCESSOR IMPLEMENTATION
    /**
     * Remember all beans for later fixup.
     * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
     */
    public Object postProcessAfterInitialization(Object bean, String beanName)
    throws BeansException {
        allBeans.put(beanName,bean);
        return bean;
    }
    
    // APPLICATIONLISTENER IMPLEMENTATION
    /**
     * Fix all beans with ConfigPath properties that lack a base path
     * or a name, to use a job-implied base path and name. 
     */
    public void onApplicationEvent(ApplicationEvent event) {
        if(event instanceof ContextRefreshedEvent) {
            for(String beanName: allBeans.keySet()) {
                fixupPaths(allBeans.get(beanName), beanName);
            }
            allBeans.clear(); // forget 
        }
        // ignore all others
    }

    /**
     * Find any ConfigPath properties in the passed bean; ensure that
     * if they have a null 'base', that is replaced with the job home
     * directory. Also, remember all ConfigPaths so fixed-up for later
     * reference. 
     * 
     * @param bean
     * @param beanName
     * @return Same bean as passed in, fixed as necessary
     */
    protected Object fixupPaths(Object bean, String beanName) {<FILL_FUNCTION_BODY>}

    protected void fixupConfigPath(ConfigPath cp, String patchName) {
        if(cp.getBase()==null && cp != path) {
            cp.setBase(path);
        }
        
        if(StringUtils.isEmpty(cp.getName())) {
            cp.setName(patchName);
        }
        cp.setConfigurer(this);
        remember(patchName, cp);
    }

    //// APPLICATIONCONTEXTAWARE IMPLEMENTATION

    protected PathSharingContext appCtx;
    /**
     * Remember ApplicationContext, and if possible primary 
     * configuration file's home directory. 
     * 
     * Requires appCtx be a PathSharingContext 
     * 
     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
     */
    public void setApplicationContext(ApplicationContext appCtx) throws BeansException {
        this.appCtx = (PathSharingContext)appCtx;
        String basePath;
        if(appCtx instanceof PathSharingContext) {
            basePath = this.appCtx.getConfigurationFile().getParent();
        } else {
            basePath = ".";
        }
        path = new ConfigPath("job base",basePath); 
        path.setConfigurer(this);
    }

    // REMEMBERED CONFIGPATHS
    protected Map<String,ConfigPath> allConfigPaths = new HashMap<String,ConfigPath>();
    protected void remember(String key, ConfigPath cp) {
        allConfigPaths.put(key, cp);
    }
    public Map<String,ConfigPath> getAllConfigPaths() {
        return allConfigPaths; 
    }
    
    // noop
    public Object postProcessBeforeInitialization(Object bean, String beanName) 
    throws BeansException {
        return bean;
    }

    /** 
     * Act as late as possible.
     * 
     * @see org.springframework.core.Ordered#getOrder()
     */
    public int getOrder() {
        return Ordered.LOWEST_PRECEDENCE;
    }

    public void snapshotToLaunchDir(File readFile) throws IOException {
        if(appCtx.getCurrentLaunchDir()==null|| !appCtx.getCurrentLaunchDir().exists()) {
            logger.log(Level.WARNING, "launch directory unavailable to snapshot "+readFile); 
            return; 
        }
        FileUtils.copyFileToDirectory(readFile, appCtx.getCurrentLaunchDir());
    }

    protected String interpolate(String rawPath) {
        if (appCtx.getCurrentLaunchId() != null) {
            return rawPath.replace("${launchId}", appCtx.getCurrentLaunchId());
        } else {
            return rawPath;
        }
    }
}

        BeanWrapperImpl wrapper = new BeanWrapperImpl(bean);
        for(PropertyDescriptor d : wrapper.getPropertyDescriptors()) {
            if (d.getPropertyType().isAssignableFrom(ConfigPath.class)
                    || d.getPropertyType().isAssignableFrom(ConfigFile.class)) {
                Object value = wrapper.getPropertyValue(d.getName());
                if (value != null && value instanceof ConfigPath) {
                    String patchName = beanName+"."+d.getName();
                    fixupConfigPath((ConfigPath) value,patchName);
                }
            } else if (Iterable.class.isAssignableFrom(d.getPropertyType())) {
                Iterable<?> iterable = (Iterable<?>) wrapper.getPropertyValue(d.getName());
                if (iterable != null) {
                    int i = 0;
                    for (Object candidate : iterable) {
                        if(candidate!=null && candidate instanceof ConfigPath) {
                            String patchName = beanName+"."+d.getName()+"["+i+"]";
                            fixupConfigPath((ConfigPath) candidate,patchName); 
                        }
                        i++; 
                    }
                }
            }
        }
        return bean;
    
<no_super_class>