FileDocCategorySizeDatePackage
AutoDeployer.javaAPI DocGlassfish v2 API49497Sun May 13 15:19:38 BST 2007com.sun.enterprise.deployment.autodeploy

AutoDeployer

public class AutoDeployer extends Object
Handles the logic of deploying the module/app to the required destination.
The destination can be modified by calling setTarget(), default is first non-admin instance entry from domain.xml
The specific directory scanner can be set using setDirectoryScanner, default is AutoDeployDirectoryScanner
Present logic is using MBean ManagedServerInstance as actual deployment service.
author
vikas

Fields Summary
private ObjectName
mbeanName
private MBeanServer
mbs
private Boolean
verify
private Boolean
forceDeploy
private Boolean
enabled
private Boolean
jspPreCompilation
private boolean
renameOnSuccess
private String
targetInstance
private static final Logger
sLogger
private static com.sun.enterprise.util.i18n.StringManager
localStrings
private DirectoryScanner
directoryScanner
private boolean
cancelDeployment
protected static final int
DEPLOY_SUCCESS
protected static final int
DEPLOY_FAILURE
protected static final int
DEPLOY_PENDING
private final com.sun.enterprise.deployment.deploy.shared.AbstractArchiveFactory
archiveFactory
archive factory used to create an archive for each file to be deployed - the archive is needed by Depl. Facility
private AutodeployRetryManager
retryManager
Constructors Summary
public AutoDeployer()
Creates a new instance of AutoDeployer

           
      
        
        ///initialize other attributes
        verify= new Boolean(false);
        jspPreCompilation=new Boolean(false);
        forceDeploy=new Boolean(true);
        enabled=new Boolean(true);
    
public AutoDeployer(boolean verify, boolean jspPreCompilation)
Creates a new instance of AutoDeployer

        
        ///initialize other attributes
        this.verify= new Boolean(verify);
        this.jspPreCompilation=new Boolean(jspPreCompilation);
        forceDeploy=new Boolean(true);
        enabled=new Boolean(true);
    
Methods Summary
private voidcleanupAppAndRequest(java.io.File f)

        boolean logFine = sLogger.isLoggable(Level.FINE);

        /*
         * Clean up the application file or directory.
         */
        if (f.isDirectory()) {
            if (logFine) {
                sLogger.fine("Deleting autodeployed directory " + f.getAbsolutePath() + " by request");
            }
            FileUtils.liquidate(f);
        } else {
            if (logFine) {
                sLogger.fine("Deleting autodeployed file " + f.getAbsolutePath() + " by request");
            }
            FileUtils.deleteFile(f);
        }
        
        /*
         * Remove the undeploy request file.
         */
        File requestFile = AutoDeployedFilesManager.appToUndeployRequestFile(f);
        if (logFine) {
            sLogger.fine("Deleting autodeploy request file " + requestFile.getAbsolutePath());
        }
        FileUtils.deleteFile(requestFile);
    
protected voiddeleteAllMarks(java.io.File f)

        try {
            getDeployedFile(f).delete();
            getDeployFailedFile(f).delete();
            getUndeployedFile(f).delete();
            getUndeployFailedFile(f).delete();
        } catch (Exception e) { 
            //ignore 
        }
    
protected intdeploy(java.io.File deployablefile, java.io.File autodeployDir, java.lang.String name)
Deploy any type of module.

param
file Absolute path of the file to be deployed
param
name the module ID of the applications
return
status of the deployment attempt: DEPLOY_SUCCESS, DEPLOY_FAILURE, or DEPLOY_PENDING
throws
AutoDeploymentException if any invoked method throws an exception

        
        int status=DEPLOY_FAILURE;
        if(cancelDeployment) {
            return status;
        }
        String file=deployablefile.getAbsolutePath();
        status = retryManager.testFileAsArchive(file);
        if (status != DEPLOY_SUCCESS) {
            return status;
        }

        JBIAutoDeployer jad = JBIAutoDeployer.getInstance();

        String msg = localStrings.getString(
        "enterprise.deployment.autodeploy.selecting_file",
        deployablefile.getAbsolutePath());
        sLogger.log(Level.INFO, msg);
        if (jad.isJbiArchive(deployablefile)) {
            return deployJbiArchive(deployablefile);
        } else {
            return deployJavaEEArchive(deployablefile, autodeployDir, name);
        }

    
public voiddeployAll(java.io.File autoDeployDir)
do deployment for all the deployable components in autoDeployDir dir.

return

        deployAll(autoDeployDir, false);
    
public voiddeployAll(java.io.File autoDeployDir, boolean includeSubDir)
do deployment for all the deployable components in autoDeployDir dir.

return

        
        
        //create with default scanner
        if(directoryScanner==null) {
            directoryScanner=new AutoDeployDirectoryScanner();
        }
        
        //set target to default
        if(this.targetInstance == null) {
            setTarget(getDefaultTarget());
        }
        
        File [] files= null;
        
        //get me all deployable entities
        files= directoryScanner.getAllDeployableModules(autoDeployDir, includeSubDir);
        
        /*
         *The following pattern appears in each of the sections below, even though
         *it is described in detail only once here.  This can be improved
         *once autodeploy is converted to use the DeploymentFacility.
         *
         *To support slowly-copied files, the deployApplication (and deployWarmodule, and
         *deployRarModule and deployEjbModule) methods return 
         *    DEPLOY_SUCCESS  if the file was successfully autodeployed
         *    DEPLOY_FAILURE  if the file failed to be autodeployed
         *    DEPLOY_PENDING  if the file needs to be tried again later
         *
         *The marker files should be updated only if the result is success or
         *failure.  So for each file of each type, make a separate decision
         *about whether to record the result or not based on the result of
         *the deploy* method.  Note that the boolean is initialized to true
         *so that if an exception is thrown, the file's marker files will be
         *updated.
         */
        if(files != null) {
            for (int i=0; ((i < files.length) && !cancelDeployment);i++) {
                boolean okToRecordResult = true;
                try {
                    okToRecordResult = (deploy(files[i], autoDeployDir,
                    getNameFromFilePath(autoDeployDir,  
                    files[i])) != DEPLOY_PENDING);
                } catch (AutoDeploymentException ae) {
                    //ignore and move to next file
                } finally {
                    if(renameOnSuccess && okToRecordResult)
                        directoryScanner.deployedEntity(autoDeployDir, files[i]);
                }
            }
        } 
    
public voiddeployAll(java.io.File autoDeployDir, boolean verify, boolean jspPreCompilation)
do deployment for all the deployable components in autoDeployDir dir.

return

        this.verify= new Boolean(verify);
        this.jspPreCompilation=new Boolean(jspPreCompilation);
        deployAll(autoDeployDir);
    
intdeployJavaEEArchive(java.io.File deployablefile, java.io.File autodeployDir, java.lang.String name)
Deploy a Java EE archive.

        int status=DEPLOY_FAILURE;
        // if it's redeploy, first undeploy, then deploy
        if (isModuleDeployed(name)) {
            boolean result = 
            undeployApplication(deployablefile, autodeployDir, name);
            if (!result) {
                return DEPLOY_FAILURE;
            }
        }

        Properties props = getDeployActionProperties(deployablefile,name);
        String[] signature  = new String[]{"java.util.Properties"};
        
        Object[] params     = new Object[]{props};
        
        //invoke
        if (invokeDeploymentService(deployablefile, AutoDeployConstants.DEPLOY_METHOD,params,signature)) {
            status = DEPLOY_SUCCESS;
        } else {
            status = DEPLOY_FAILURE;
        }
        return status;
    
intdeployJbiArchive(java.io.File file)
Deploy a JBI archive.

        int returnStatus=DeploymentStatus.FAILURE;
        try {
            JBIAutoDeployer jad = JBIAutoDeployer.getInstance();
            JBIDeployer jd = jad.getDeployer();
            String saName = jad.getServiceAssemblyName(file);
            jd.deploy(getMBeanServer(), file, saName);
            returnStatus = DeploymentStatus.SUCCESS;
            return DEPLOY_SUCCESS;
        } catch (Exception e) {
            while (e instanceof MBeanException) {
                e = ((MBeanException)e).getTargetException();
            }
            String msg = localStrings.getString
            ("enterprise.deployment.autodeploy.invocation_exception",file);
            AutoDeploymentException ae;
            ae=new AutoDeploymentException(msg, e);
            sLogger.log(Level.INFO, ae.getMessage());
            throw ae;
        } finally {
            markFileAfterDeployment(file, returnStatus);   
        }
    
public voiddisableRenameOnSuccess()
If an archive is successfully autodeployed, file will not be renamed to archive_deployed

        renameOnSuccess = false;
    
public voidenableRenameOnSuccess()
If an archive is successfully autodeployed will be renamed to archive_deployed

        // FIXME - Mahesh
        renameOnSuccess = true;
    
private com.sun.enterprise.config.ConfigContextgetConfigContext()

        /*InstanceEnvironment instanceEnvironment =
        new InstanceEnvironment(instanceName);
        String fileUrl  = instanceEnvironment.getConfigFilePath();
         
        ConfigContext configContext   =
        ConfigFactory.createConfigContext(fileUrl);*/
        ServerContext serverContext = AdminService.getAdminService().getContext();
        ConfigContext context = serverContext.getConfigContext();
        return context;
    
private java.lang.StringgetDefaultTarget()

        try{
            ConfigContext confContext = getConfigContext();
            Domain domain = (Domain)confContext.getRootConfigBean();
            Servers svrs = domain.getServers();
            Server[] svrArr = svrs.getServer();
            int size = svrArr.length;
            String targetName = null;
            /*I am putting this logic specific for TP, as its decided to deploy directly
             *to instsnce, and not DAS. It need to be changed to next release
             */
            for(int i = 0 ; i< size; i++) {
                if(!svrArr[i].getName().equals("")) {
                    targetName = svrArr[i].getName();
                    break;
                }
            }
            if(targetName == null) {
                sLogger.log(Level.SEVERE, "enterprise.deployment.backend.autoDeploymentFailure",
                        new Object[] {"Target server not found"});
                        throw new AutoDeploymentException("Target Server not found");
            }
            
            return targetName;
        }catch(Exception ex) {
            return null;
        }
    
private java.lang.StringgetDefaultVirtualServer(java.lang.String instanceName)

        String virtualServer=null;
        try {
            ConfigContext context = getConfigContext();
            //Domain domain = (Domain)context.getRootConfigBean();
            //HttpService service = getHttpService(domain,instanceName);
            HttpService service = ServerBeansFactory.getHttpServiceBean(context);
            if(service !=null){
                HttpListener[] hlArray = service.getHttpListener();
                //check not needed since there should always be atleast 1 httplistener
                //if you don't find one, use first one.
                HttpListener ls = null;
                if(hlArray != null && hlArray.length > 0){
                    ls=hlArray[0];
                    //default is the first one that is enabled.
                    for(int i = 0;i<hlArray.length;i++) {
                        if(hlArray[i].isEnabled()) {
                            ls = hlArray[i];
                            break;
                        }
                    }
                }
                if(ls!=null)
                    virtualServer = ls.getDefaultVirtualServer();
            }
        } catch(ConfigException e){
            String msg = localStrings.getString("enterprise.deployment.autodeploy.unable_to_get_virtualserver");
            sLogger.log(Level.WARNING, msg+e.getMessage());
        } catch(Exception e){String msg = localStrings.getString("enterprise.deployment.autodeploy.unable_to_get_virtualserver");
        sLogger.log(Level.WARNING, msg+e.getMessage());
        }
        
        return virtualServer;
        
    
protected java.util.PropertiesgetDeployActionProperties(java.io.File deployablefile, java.lang.String ID)

        
        DeploymentProperties dProps = new DeploymentProperties();
        dProps.setArchiveName(deployablefile.getAbsolutePath());
        dProps.setName(ID);
        dProps.setEnable(enabled.booleanValue());
        dProps.setVirtualServers(getDefaultVirtualServer(targetInstance));
        dProps.setForce(forceDeploy.booleanValue());
        dProps.setVerify(verify.booleanValue());
        dProps.setPrecompileJSP(jspPreCompilation.booleanValue());
        dProps.setResourceAction(DeploymentProperties.RES_DEPLOYMENT);
        dProps.setResourceTargetList("server");

        return (Properties)dProps;
    
protected java.io.FilegetDeployFailedFile(java.io.File f)

        String absPath = f.getAbsolutePath();
        File ret = new File(absPath + AutoDeployConstants.DEPLOY_FAILED);
        return ret;
    
protected java.io.FilegetDeployedFile(java.io.File f)

        String absPath = f.getAbsolutePath();
        File ret = new File(absPath + AutoDeployConstants.DEPLOYED);
        return ret;
    
private javax.management.ObjectNamegetMBean(java.lang.String instanceName)

        ObjectName mbean=null;
        try {
            mbean = new ObjectName("com.sun.appserv:type=applications,category=config");
        } catch(Exception e) {
            sLogger.log(Level.SEVERE, "enterprise.deployment.backend.autoDeploymentFailure",
                    new Object[] {e.getMessage()});
        }
        return mbean;
        
    
final javax.management.ObjectNamegetMBeanName()
get the MBean Name. bnevins 9/16/03

        if(mbeanName == null)
            throw new AutoDeploymentException("Internal Error: mbeanName is null");
        
        return mbeanName;
    
final javax.management.MBeanServergetMBeanServer()
get the MBeanServer. Initialize it if neccessary. Note that the 'final' allows the compiler to inline the method. So this will be just as fast as accessing the variable directly. bnevins 9/16/03

        if(mbs == null)
            mbs = MBeanServerFactory.getMBeanServer();
        
        return mbs;
    
static java.lang.StringgetNameFromFilePath(java.io.File autodeployDir, java.io.File filePath)

   //creating module name as file name
        
        File parent = filePath.getParentFile();
        String moduleName = null;
        while (!parent.getAbsolutePath().equals(autodeployDir.getAbsolutePath())) {
            if (moduleName==null) {
                moduleName = parent.getName();
            } else {
                moduleName = parent.getName()+"_"+moduleName;
            }
            parent = parent.getParentFile();
        }
        if (moduleName==null) {
            moduleName = filePath.getName();
        } else {
            moduleName = moduleName + "_" + filePath.getName();
        }
        int toIndex = moduleName.lastIndexOf('.");
        if (toIndex > 0) {
            moduleName = moduleName.substring(0, toIndex);
        }
        return moduleName;
    
protected java.util.PropertiesgetUndeployActionProperties(java.lang.String name)

        DeploymentProperties dProps = new DeploymentProperties();
        dProps.setName(name);
        dProps.setResourceAction(DeploymentProperties.RES_UNDEPLOYMENT);
        dProps.setResourceTargetList("server");

        return (Properties)dProps;
    
protected java.io.FilegetUndeployFailedFile(java.io.File f)

        String absPath = f.getAbsolutePath();
        File ret = new File(absPath + AutoDeployConstants.UNDEPLOY_FAILED);
        return ret;
    
protected java.io.FilegetUndeployedFile(java.io.File f)

        String absPath = f.getAbsolutePath();
        File ret = new File(absPath + AutoDeployConstants.UNDEPLOYED);
        return ret;
    
voidinit()
setup the required internal variables

        // this sets 'mbs'
        getMBeanServer();
        
        if(targetInstance == null) {
            // side effect -- this also sets mbeanName...
            setTarget(getDefaultTarget());
        }
    
booleaninvokeDeploymentService(java.io.File deployablefile, java.lang.String action, java.lang.Object[] params, java.lang.String[] signature)

        
        String file=deployablefile.getAbsolutePath();
        boolean status=false;
        int returnStatus = DeploymentStatus.FAILURE;
        
        
        //invoke
        try {
            Object result=getMBeanServer().invoke(getMBeanName(),action, params,signature);
            returnStatus = parseResult(result);
        } catch (Exception e) {
            while (e instanceof MBeanException) {
                e = ((MBeanException)e).getTargetException();
            }
            returnStatus = DeploymentStatus.FAILURE;
            String msg = localStrings.getString
            ("enterprise.deployment.autodeploy.invocation_exception",file);
            AutoDeploymentException ae;
            ae=new AutoDeploymentException(msg, e);
            sLogger.log(Level.INFO, ae.getMessage());
            throw ae;
        } finally {
            status = markFileAfterDeployment(deployablefile, returnStatus);   
        }
        return status;
        
    
private booleaninvokeUndeploymentService(java.lang.String appFile, java.lang.String action, java.lang.Object[] params, java.lang.String[] signature)

        
        boolean status=false;
        int returnStatus = DeploymentStatus.FAILURE;
        //invoke
        try {
            Object result=getMBeanServer().invoke(getMBeanName(),action, params,signature);
            returnStatus = parseResult(result);
        } catch (Exception e) {
            while (e instanceof MBeanException) {
                e = ((MBeanException)e).getTargetException();
            }
            returnStatus = DeploymentStatus.FAILURE;
            String msg = localStrings.getString("enterprise.deployment.autodeploy.invocation_exception",appFile);
            AutoDeploymentException ae;
            ae=new AutoDeploymentException(msg, e);
            sLogger.log(Level.INFO, ae.getMessage());
            throw ae;
        } finally {
            if(returnStatus == DeploymentStatus.SUCCESS) {
                status = true;
                String msg = localStrings.getString("enterprise.deployment.autodeploy.successfully_autoundeployed",appFile);
                sLogger.log(Level.INFO, msg);
            }  else if (returnStatus == DeploymentStatus.WARNING) {
                status = true;
                String msg = localStrings.getString("enterprise.deployment.autodeploy.warning_autoundeployed",appFile);
                sLogger.log(Level.INFO, msg);
            } else if (returnStatus == DeploymentStatus.FAILURE) {
                status = false;
                String msg = localStrings.getString("enterprise.deployment.autodeploy.autoundeploy_failed",appFile);
                sLogger.log(Level.INFO, msg);
            }
        }
        return status;
        
    
public booleanisCancelled()
get cancel flag value

return

        return cancelDeployment;
    
private booleanisModuleDeployed(java.lang.String moduleID)

        if (moduleID == null) {
            return false;
        }

        try {
            String[] signature = new String[] {"java.lang.String"};
            Object[] params = new Object[] {moduleID};
            Object result = getMBeanServer().invoke(getMBeanName(), 
                "getModuleType", params, signature);

            if (result != null) {
                return true;
            }
            return false;
        } catch (Exception e) {
            return false;
        }
    
protected voidmarkDeployFailed(java.io.File f)

        try {
            deleteAllMarks(f);
            getDeployFailedFile(f).createNewFile();
        } catch (Exception e) { 
            //ignore 
        }
    
protected voidmarkDeployed(java.io.File f)

        try {
            deleteAllMarks(f);
            getDeployedFile(f).createNewFile();
        } catch (Exception e) { 
            //ignore 
        }
    
private booleanmarkFileAfterDeployment(java.io.File file, int returnStatus)

        String msg = null;
        boolean status = false;
        if(returnStatus == DeploymentStatus.SUCCESS) {
            if(renameOnSuccess) {
                markDeployed(file);
            }
            status = true;
            msg = localStrings.getString("enterprise.deployment.autodeploy.successfully_autodeployed",file);
            sLogger.log(Level.INFO, msg);
        } else if (returnStatus == DeploymentStatus.WARNING) {
            if(renameOnSuccess) {
                markDeployed(file);
            }
            status = true;
            msg = localStrings.getString("enterprise.deployment.autodeploy.warning_autodeployed",file);
            sLogger.log(Level.INFO, msg);
        } else if (returnStatus == DeploymentStatus.FAILURE) {
            markDeployFailed(file);
            status = false;
            msg = localStrings.getString("enterprise.deployment.autodeploy.autodeploy_failed",file);
            sLogger.log(Level.INFO, msg);
        }
        return status;
    
protected voidmarkUndeployFailed(java.io.File f)

        try {
            deleteAllMarks(f);
            getUndeployFailedFile(f).createNewFile();
        } catch (Exception e) { 
            //ignore 
        }
    
protected voidmarkUndeployed(java.io.File f)

        try {
            deleteAllMarks(f);
            getUndeployedFile(f).createNewFile();
        } catch (Exception e) { 
            //ignore 
        }
    
protected intparseResult(java.lang.Object result)

        if(result!=null && result instanceof DeploymentStatus) {
            DeploymentStatus status = (DeploymentStatus) result;
            if (status.getStatus()>DeploymentStatus.WARNING) {
                return DeploymentStatus.SUCCESS;
            } else {
                // ok we got either a warning or an error.
                // parse the deployment status and retrieve failure/warning msg
                ByteArrayOutputStream bos =
                        new ByteArrayOutputStream();
                PrintWriter pw = new PrintWriter(bos);
                DeploymentStatus.parseDeploymentStatus(status, pw);
                byte[] statusBytes = bos.toByteArray();
                String statusString = new String(statusBytes);
                
                if (status.getStatus()==DeploymentStatus.WARNING) {
                    // warning, let's log and continue
                    String msg = localStrings.getString(
                            "enterprise.deployment.warning_occured", statusString);
                    sLogger.log(Level.WARNING, msg);
                    return DeploymentStatus.WARNING;
                } else if (status.getStatus()==DeploymentStatus.FAILURE) {
                    sLogger.log(Level.SEVERE, "enterprise.deployment.backend.autoDeploymentFailure",
                            new Object[] {statusString});
                            return DeploymentStatus.FAILURE;
                }
            }
        }
        return DeploymentStatus.FAILURE;
    
public voidsetCancel(boolean value)
set cancel flag, which will ensure that only if there is any current deployment is in process,
it will be completed but the deployer will not do any more deployment.

return

        cancelDeployment=value;
    
public voidsetDirectoryScanner(DirectoryScanner ds)
set DirectoryScanner which will be used for filtering out deployeble component

return

        directoryScanner=ds;
    
public voidsetJspPreCompilation(boolean jspPreCompilation)
Set whether this AutoDeployer should precompile JSPs or not.

param
boolean precompilation setting

        this.jspPreCompilation = new Boolean(jspPreCompilation);
    
public voidsetTarget(java.lang.String target)
set target server where the autual deployment will be done

return

        this.targetInstance = target;
        mbeanName = getMBean(targetInstance);
    
public voidsetVerify(boolean verify)
Set whether this AutoDeployer should verify or not.

param
boolean verify setting

        this.verify = new Boolean(verify);
    
public voidundeployAll(java.io.File autoDeployDir)
do undeployment for all deleted applications in autoDeployDir dir.

return

        
        
        //create with default scanner
        if(directoryScanner==null) {
            directoryScanner=new AutoDeployDirectoryScanner();
        }
        
        if(mbs == null) {
            mbs = getMBeanServer();
        }
        //set target to default
        if(this.targetInstance == null) {
            setTarget(getDefaultTarget());
        }
        
        File[] apps= null;
        
        //get me all apps
        apps= directoryScanner.getAllFilesForUndeployment(autoDeployDir);
        
        //deploying all applications
        if(apps !=null) {
            for (int i=0; i< apps.length && !cancelDeployment;i++) {
                try {
                    
                    boolean stat = this.undeployApplication(apps[i], autoDeployDir, 
                    getNameFromFilePath(autoDeployDir, apps[i]));
                    /*
                     * Before managing the marker file for the app, see if 
                     * the autodeployer is responsible for deleting this app
                     * file and, if so, delete it.
                     */
                    if (undeployedByRequestFile(apps[i])) {
                        cleanupAppAndRequest(apps[i]);
                    }
                    
                    if (stat)
                        markUndeployed(apps[i]);
                    else
                        markUndeployFailed(apps[i]);
                    
                    
                } catch (AutoDeploymentException ae) {
                    //ignore and move to next file
                    markUndeployFailed(apps[i]);
                } finally {
                    // Mark the application as undeployed both in the case of success & failure.
                    directoryScanner.undeployedEntity(autoDeployDir, apps[i]);
                }
            }
        }
        /////////end for apps
    
private booleanundeployApplication(java.io.File applicationFile, java.io.File autodeployDir, java.lang.String name)

        JBIAutoDeployer jad = JBIAutoDeployer.getInstance();
        String saName = jad.getServiceAssemblyName(applicationFile, autodeployDir);
        if (saName == null) {
            return undeployJavaEEArchive(applicationFile, name);
        } else {
            return undeployJbiArchive(saName);
        }
    
private booleanundeployJavaEEArchive(java.io.File applicationFile, java.lang.String name)
Undeploy a Java EE archive.

        boolean status = false;
        
        Properties props = getUndeployActionProperties(name);
        
        String[] signature  = new String[]{"java.util.Properties"};
        
        Object[] params     = new Object[]{props};
        sLogger.log(Level.INFO, "Autoundeploying application :" + name);
        status = invokeUndeploymentService(applicationFile.getAbsolutePath(), AutoDeployConstants.UNDEPLOY_METHOD,params,signature);;
        return status;
        
    
private booleanundeployJbiArchive(java.lang.String saName)
Undeploy a JBI archive.

        try {
            sLogger.log(Level.INFO, "Autoundeploying application :" + saName);
            JBIAutoDeployer jad = JBIAutoDeployer.getInstance();
            JBIDeployer jd = jad.getDeployer();
            jd.undeploy(getMBeanServer(), saName);
            String msg = localStrings.getString
            ("enterprise.deployment.autodeploy.successfully_autoundeployed",
            saName);
            sLogger.log(Level.INFO, msg);
            return true;
        } catch (Exception e) {
            while (e instanceof MBeanException) {
                e = ((MBeanException)e).getTargetException();
            }
            String msg = localStrings.getString(
            "enterprise.deployment.autodeploy.autoundeploy_failed",saName);
            sLogger.log(Level.INFO, msg);
            msg = localStrings.getString(
            "enterprise.deployment.autodeploy.invocation_exception",saName);
            AutoDeploymentException ae;
            ae=new AutoDeploymentException(msg, e);
            sLogger.log(Level.INFO, ae.getMessage());
            throw ae;
        }
    
private booleanundeployedByRequestFile(java.io.File f)

        return f instanceof AutoDeployedFilesManager.UndeployRequestedFile;