1 17 18 package org.apache.geronimo.deployment.plugin; 19 20 import java.io.File ; 21 import java.io.InputStream ; 22 import java.util.Locale ; 23 24 import javax.enterprise.deploy.model.DeployableObject ; 25 import javax.enterprise.deploy.shared.DConfigBeanVersionType ; 26 import javax.enterprise.deploy.shared.ModuleType ; 27 import javax.enterprise.deploy.spi.DeploymentConfiguration ; 28 import javax.enterprise.deploy.spi.DeploymentManager ; 29 import javax.enterprise.deploy.spi.Target ; 30 import javax.enterprise.deploy.spi.TargetModuleID ; 31 import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException ; 32 import javax.enterprise.deploy.spi.exceptions.InvalidModuleException ; 33 import javax.enterprise.deploy.spi.exceptions.TargetException ; 34 import javax.enterprise.deploy.spi.status.ProgressObject ; 35 36 import org.apache.commons.logging.Log; 37 import org.apache.commons.logging.LogFactory; 38 39 45 public class DisconnectedDeploymentManager implements DeploymentManager { 46 private static final Log log = LogFactory.getLog(DisconnectedDeploymentManager.class); 47 48 public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException { 49 if(dObj.getType().equals(ModuleType.CAR)) { 50 } else if(dObj.getType().equals(ModuleType.EAR)) { 52 } else if(dObj.getType().equals(ModuleType.EJB)) { 54 try { 55 Class cls = Class.forName("org.apache.openejb.deployment.EJBConfigurer"); 56 return (DeploymentConfiguration )cls.getMethod("createConfiguration", new Class []{DeployableObject .class}).invoke(cls.newInstance(), new Object []{dObj}); 57 } catch (Exception e) { 58 log.error("Unable to invoke EJB deployer", e); 59 } 60 } else if(dObj.getType().equals(ModuleType.RAR)) { 61 } else if(dObj.getType().equals(ModuleType.WAR)) { 63 } 66 throw new InvalidModuleException ("Not supported"); 67 } 68 69 public Locale [] getSupportedLocales() { 70 return new Locale []{getDefaultLocale()}; 71 } 72 73 public Locale getCurrentLocale() { 74 return getDefaultLocale(); 75 } 76 77 public Locale getDefaultLocale() { 78 return Locale.getDefault(); 79 } 80 81 public boolean isLocaleSupported(Locale locale) { 82 return getDefaultLocale().equals(locale); 83 } 84 85 public void setLocale(Locale locale) { 86 if (isLocaleSupported(locale)) { 87 throw new UnsupportedOperationException ("Unsupported Locale"); 88 } 89 } 90 91 public DConfigBeanVersionType getDConfigBeanVersion() { 92 return DConfigBeanVersionType.V1_4; 93 } 94 95 public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version) { 96 return DConfigBeanVersionType.V1_4.equals(version); 97 } 98 99 public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException { 100 if (!isDConfigBeanVersionSupported(version)) { 101 throw new DConfigBeanVersionUnsupportedException ("Version not supported " + version); 102 } 103 } 104 105 public Target [] getTargets() throws IllegalStateException { 106 throw new IllegalStateException ("Disconnected"); 107 } 108 109 public TargetModuleID [] getRunningModules(ModuleType moduleType, Target [] targets) throws TargetException , IllegalStateException { 110 throw new IllegalStateException ("Disconnected"); 111 } 112 113 public TargetModuleID [] getNonRunningModules(ModuleType moduleType, Target [] targets) throws TargetException , IllegalStateException { 114 throw new IllegalStateException ("Disconnected"); 115 } 116 117 public TargetModuleID [] getAvailableModules(ModuleType moduleType, Target [] targets) throws TargetException , IllegalStateException { 118 throw new IllegalStateException ("Disconnected"); 119 } 120 121 public ProgressObject distribute(Target [] targets, File file, File file1) throws IllegalStateException { 122 throw new IllegalStateException ("Disconnected"); 123 } 124 125 public ProgressObject distribute(Target [] targets, InputStream inputStream, InputStream inputStream1) throws IllegalStateException { 126 throw new IllegalStateException ("Disconnected"); 127 } 128 129 public ProgressObject start(TargetModuleID [] targetModuleIDs) throws IllegalStateException { 130 throw new IllegalStateException ("Disconnected"); 131 } 132 133 public ProgressObject stop(TargetModuleID [] targetModuleIDs) throws IllegalStateException { 134 throw new IllegalStateException ("Disconnected"); 135 } 136 137 public ProgressObject undeploy(TargetModuleID [] targetModuleIDs) throws IllegalStateException { 138 throw new IllegalStateException ("Disconnected"); 139 } 140 141 public boolean isRedeploySupported() { 142 return false; 143 } 144 145 public ProgressObject redeploy(TargetModuleID [] targetModuleIDs, File file, File file1) throws UnsupportedOperationException , IllegalStateException { 146 throw new IllegalStateException ("Disconnected"); 147 } 148 149 public ProgressObject redeploy(TargetModuleID [] targetModuleIDs, InputStream inputStream, InputStream inputStream1) throws UnsupportedOperationException , IllegalStateException { 150 throw new IllegalStateException ("Disconnected"); 151 } 152 153 public void release() { 154 throw new IllegalStateException ("Disconnected"); 155 } 156 } 157 | Popular Tags |