FileDocCategorySizeDatePackage
PESamplesDomainXmlEventListener.javaAPI DocGlassfish v2 API3830Fri May 04 22:24:32 BST 2007com.sun.enterprise.admin.servermgmt.pe

PESamplesDomainXmlEventListener

public class PESamplesDomainXmlEventListener extends Object implements com.sun.enterprise.admin.servermgmt.DomainXmlEventListener
The event listener class for PE Samples domain

Fields Summary
private static final com.sun.enterprise.util.i18n.StringManager
strMgr
Constructors Summary
Methods Summary
public voidhandleCreateEvent(com.sun.enterprise.admin.servermgmt.DomainConfig cfg)
after the creation of domain.xml , unjar the bundled samples.jar.


                   
                                  
        PEFileLayout layout = new PEFileLayout(cfg);
        File appsDir = layout.getInstallApplicationsDir();
        File domainDir = layout.getRepositoryDir();
        File jarFile = new File(appsDir, "samples.jar" );
        
        try{
            ZipFile file = new ZipFile(FileUtils.safeGetCanonicalPath(jarFile), 
                                        FileUtils.safeGetCanonicalPath(domainDir));
            file.explode();
        }catch(ZipFileException e){
            throw new DomainException( strMgr.getString("samplesDomainNotCreated") ,e );
        }
    
public voidhandleDeleteEvent(com.sun.enterprise.admin.servermgmt.DomainConfig cfg)
currently do nothing