for (Iterator i = deploymentFactories.iterator(); i.hasNext();) { DeploymentFactory factory = (DeploymentFactory) i.next(); if (factory != null) { if (factory.handlesURI(uri)) { try { return factory.getDisconnectedDeploymentManager(uri); } catch (DeploymentManagerCreationException e) {  throw new DeploymentManagerCreationException("Could not get DeploymentManager"); }
if(uri == null) { throw new IllegalArgumentException("URI for DeploymentManager should not be null"); } DeploymentManager manager = null; for(Iterator i = deploymentFactories.iterator(); i.hasNext();) { DeploymentFactory factory = (DeploymentFactory)i.next(); if(factory.handlesURI(uri)) { manager = factory.getDisconnectedDeploymentManager(uri); if(manager != null) { return manager;
    public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException {        // RI doesn't care about uri being null, neither do we        for (Iterator i = deploymentFactories.iterator(); i.hasNext();) {            DeploymentFactory factory = (DeploymentFactory) i.next();            if (factory != null) {                if (factory.handlesURI(uri)) {                    try {                        return factory.getDisconnectedDeploymentManager(uri);                    } catch (DeploymentManagerCreationException e) {                        // Just like the RI we throw a new exception with a generic message                        throw new DeploymentManagerCreationException("Could not get DeploymentManager");                    }                }            }        }        throw new DeploymentManagerCreationException("Could not get DeploymentManager");    }