private DeploymentManager getDeploymentManager() throws Exception {
   if (deploymentManager == null) {
     DeploymentFactoryImpl.register();
     DeploymentFactoryManager dfManager = DeploymentFactoryManager.getInstance();
     DeploymentFactory[] factories = dfManager.getDeploymentFactories();
     assertTrue("DeploymentFactory available", factories.length > 0);
     String mgrURI = DeploymentManagerImpl.DEPLOYER_URI + "?targetType=as7";
     deploymentManager = factories[0].getDeploymentManager(mgrURI, null, null);
   }
   return deploymentManager;
 }
 public static DeploymentManager getAnyTypeManager(String uri) {
   DeploymentManager dm = null;
   try {
     dm = DeploymentFactoryManager.getInstance().getDisconnectedDeploymentManager(uri);
   } catch (DeploymentManagerCreationException ex) {
     LOG.log(Level.INFO, ex.getMessage());
   }
   return dm;
 }
  public static BaseDeploymentManager getManager(String uri) {
    if (!isEmbeddedServer(uri)) {
      return null;
    }

    BaseDeploymentManager dm = null;
    try {
      dm =
          (BaseDeploymentManager)
              DeploymentFactoryManager.getInstance().getDisconnectedDeploymentManager(uri);
    } catch (DeploymentManagerCreationException ex) {
      LOG.log(Level.INFO, ex.getMessage());
    }
    return dm;
  }