1 23 24 29 30 package com.sun.enterprise.config.backup; 31 import java.util.*; 32 import java.net.*; 33 import com.sun.enterprise.cli.framework.CLIMain; 34 import com.sun.enterprise.cli.framework.InputsAndOutputs; 35 36 40 public class MyCLI 41 { 42 43 44 public MyCLI() 45 { 46 } 47 48 51 public static void main(String [] args) 52 { 53 try 54 { 55 String drive = "C:"; 56 String tempDirDomains = drive + "/tmp/domains"; 57 String iasroot = drive + "/ee"; 58 System.setProperty("com.sun.aas.instanceRoot", iasroot); 59 System.setProperty("com.sun.aas.domainsRoot", iasroot + "/domains"); 60 System.setProperty("com.sun.aas.instanceName", "server"); 61 System.setProperty("java.library.path", iasroot + "/bin"); 62 System.setProperty("com.sun.aas.configRoot", iasroot + "/config" ); 63 System.setProperty("java.endorsed.dirs", iasroot + "/lib/endorsed"); 64 66 MyCLI cli = new MyCLI(); 67 Enumeration urls = MyCLI.class.getClassLoader().getResources("CLIDescriptor.xml"); 68 69 if ((urls == null) || (!urls.hasMoreElements())) 70 { 71 System.out.println("No URLS"); 72 } 73 else 74 System.out.println(urls); 75 76 while (urls.hasMoreElements()) 77 { 78 URL url = (URL) urls.nextElement(); 79 System.out.println(url); 80 } 81 82 88 String cmdline = "backup-domain domain1 --verbose --description foobarski"; 90 92 93 System.out.println(cmdline); 94 CLIMain.invokeCLI(cmdline, InputsAndOutputs.getInstance()); 95 } 96 catch(Exception e) 97 { 98 e.printStackTrace(); 99 } 100 } 101 102 } 103 | Popular Tags |