log = LogFactory.getLog(this);  String home = FileSystem.lookupAbsolutePath(this, ATTR_HOME, null, null, false, null); File homedir=null; if(home!=null) { homedir = new File(home); }  String name = sfResolve(ATTR_CONFIGURATION_CLASS, "", true); codebase = sfResolve(SmartFrogCoreKeys.SF_CODE_BASE, (String) null, false); configuration = createLocalConfiguration(name,homedir);  containerClassname = sfResolve(ATTR_CONTAINER_CLASS, "", true); container =(LocalContainer) construct(containerClassname, LocalConfiguration.class, configuration);   EmbeddedLocalContainer embedded = null; InstalledLocalContainer installed = null;   if (container instanceof EmbeddedLocalContainer) { embedded = (EmbeddedLocalContainer) container; } else if (container instanceof InstalledLocalContainer) {  installed = (InstalledLocalContainer) container; }   container.setLogger(new MonitorToSFLog(log));      Vector classes = null; classes = sfResolve(ATTR_EXTRA_CLASSPATH, classes, false); if (classes != null) { final int size = classes.size(); String[] classArray = new String[size]; URL[] urlArray = new URL[size]; Iterator classesIterator = classes.listIterator(); for (int i = 0; i < size; i++) { Object o = classesIterator.next(); String pathElement = o.toString(); File pathElementFile = new File(pathElement); if (!pathElementFile.exists()) { throw new SmartFrogDeploymentException( "Path element not found:" + pathElementFile.getAbsolutePath()); } classArray[i] = pathElementFile.getAbsolutePath(); try { urlArray[i]= pathElementFile.toURL(); } catch (MalformedURLException e) { throw SmartFrogDeploymentException.forward(e); } } if (installed != null) {  installed.setExtraClasspath(classArray); } else { if(embedded!=null) {  URLClassLoader loader=new URLClassLoader(urlArray); embedded.setClassLoader(loader); } else { log.warn("Classpath setup is not supported with this container "+container.getClass()); } } }   Vector properties=null; properties=sfResolve(ATTR_PROPERTIES,properties,false); if(properties!=null) { Iterator it=properties.iterator(); int count=0; while (it.hasNext()) { Vector tuple = (Vector) it.next(); if(tuple.size()!=2) { throw new SmartFrogDeploymentException("Element " +count +" in "+ATTR_PROPERTIES+"is not a two element list"); } String propertyName =tuple.get(0).toString(); String value=tuple.get(1).toString(); setConfigurationProperty(propertyName, value); count++; } }       int port=sfResolve(ATTR_PORT,DEFAULT_CARGO_PORT,false); if(port!=DEFAULT_CARGO_PORT) { setConfigurationProperty(ServletPropertySet.PORT,Integer.toString(port)); }    container.setConfiguration(configuration);
    public synchronized void sfDeploy()            throws SmartFrogException, RemoteException {        super.sfDeploy();        log = LogFactory.getLog(this);        //ConfigurationFactory factory = new DefaultConfigurationFactory();        String home = FileSystem.lookupAbsolutePath(this, ATTR_HOME,                null, null, false, null);        File homedir=null;        if(home!=null) {            homedir = new File(home);        }        String name = sfResolve(ATTR_CONFIGURATION_CLASS, "", true);        codebase = sfResolve(SmartFrogCoreKeys.SF_CODE_BASE,                (String) null,                false);        configuration = createLocalConfiguration(name,homedir);        containerClassname = sfResolve(ATTR_CONTAINER_CLASS, "", true);        container =(LocalContainer) construct(containerClassname,                LocalConfiguration.class,                configuration);        //at this point the container is instantiated        EmbeddedLocalContainer embedded = null;        InstalledLocalContainer installed = null;        //maybe it is an embedded container        if (container instanceof EmbeddedLocalContainer) {            embedded = (EmbeddedLocalContainer) container;        } else if (container instanceof InstalledLocalContainer) {            //set the home stuff            installed = (InstalledLocalContainer) container;        }        //monitoring relays to smartfrog        container.setLogger(new MonitorToSFLog(log));/*        if (installed != null) {            //set the home            installed.setHome(new File(home));        }*/        //classpath setup        Vector classes = null;        classes = sfResolve(ATTR_EXTRA_CLASSPATH, classes, false);        if (classes != null) {            final int size = classes.size();            String[] classArray = new String[size];            URL[] urlArray = new URL[size];            Iterator classesIterator = classes.listIterator();            for (int i = 0; i < size; i++) {                Object o = classesIterator.next();                String pathElement = o.toString();                File pathElementFile = new File(pathElement);                if (!pathElementFile.exists()) {                    throw new SmartFrogDeploymentException(                            "Path element not found:"                                    + pathElementFile.getAbsolutePath());                }                classArray[i] = pathElementFile.getAbsolutePath();                try {                    urlArray[i]= pathElementFile.toURL();                } catch (MalformedURLException e) {                    throw SmartFrogDeploymentException.forward(e);                }            }            if (installed != null) {                //installed deployments get a classpath set                installed.setExtraClasspath(classArray);            } else {                if(embedded!=null) {                    //embedded deployments have a new classpath                    URLClassLoader loader=new URLClassLoader(urlArray);                    embedded.setClassLoader(loader);                } else {                    log.warn("Classpath setup is not supported with this container "+container.getClass());                }            }        }        //properties        Vector properties=null;        properties=sfResolve(ATTR_PROPERTIES,properties,false);        if(properties!=null) {            Iterator it=properties.iterator();            int count=0;            while (it.hasNext()) {                Vector tuple = (Vector) it.next();                if(tuple.size()!=2) {                    throw new SmartFrogDeploymentException("Element "                            +count                            +" in "+ATTR_PROPERTIES+"is not a two element list");                }                String propertyName =tuple.get(0).toString();                String value=tuple.get(1).toString();                setConfigurationProperty(propertyName, value);                count++;            }        }        //add any direct bindings from JavaWebApplicationServer to cargo options        //the port is only set if it !=8080. This is to avoid bothering        //with raising warning messages for runtimes that don't support it.        int port=sfResolve(ATTR_PORT,DEFAULT_CARGO_PORT,false);        if(port!=DEFAULT_CARGO_PORT) {            setConfigurationProperty(ServletPropertySet.PORT,Integer.toString(port));        }        //bind the container to the config        container.setConfiguration(configuration);    }