1 package org.jboss.enterprise.deploy.spi; 2 3 import java.io.File ; 4 import java.io.InputStream ; 5 import java.util.Locale ; 6 import javax.enterprise.deploy.model.DeployableObject ; 7 import javax.enterprise.deploy.shared.DConfigBeanVersionType ; 8 import javax.enterprise.deploy.spi.*; 9 import javax.enterprise.deploy.spi.exceptions.*; 10 import javax.enterprise.deploy.spi.status.*; 11 12 19 public class JBoss30DeploymentManager implements DeploymentManager 20 { 21 22 protected boolean connected; 23 24 protected Locale currentLocale; 25 26 protected Locale [] supportedLocale = new Locale []{ 27 new Locale ("en", "UK"), 28 new Locale ("fr", "FR") 29 }; 30 31 protected DConfigBeanVersionType versionType = DConfigBeanVersionType.V1_3_1; 32 33 34 39 public JBoss30DeploymentManager(String uri) 40 { 41 connected = false; 43 } 44 45 46 53 public JBoss30DeploymentManager(String uri, String username, String password) 54 { 55 connected = true; 57 } 58 59 60 67 public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException 68 { 69 return null; 70 } 71 72 73 83 public ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan) throws IllegalStateException 84 { 85 if (!connected) 86 { 87 throw new IllegalStateException ("Illegal access to distribute"); 88 } 89 90 return null; 91 } 92 93 94 104 105 public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException 106 { 107 if (!connected) 108 { 109 throw new IllegalStateException ("Illegal access to distribute"); 110 } 111 112 return null; 113 } 114 115 116 126 public TargetModuleID[] getAvailableModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException 127 { 128 if (!connected) 129 { 130 throw new IllegalStateException ("Illegal access to getAvailableModules"); 131 } 132 133 136 return null; 137 } 138 139 140 145 public Locale getCurrentLocale() 146 { 147 return currentLocale; 148 } 149 150 151 157 public DConfigBeanVersionType getDConfigBeanVersion() 158 { 159 return versionType; 160 } 161 162 163 168 public Locale getDefaultLocale() 169 { 170 return supportedLocale[0]; 171 } 172 173 174 184 public TargetModuleID[] getNonRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException 185 { 186 if (!connected) 187 { 188 throw new IllegalStateException ("Illegal access to getNonRunningModules"); 189 } 190 191 194 return null; 195 } 196 197 198 207 public TargetModuleID[] getRunningModules(int moduleType, Target[] targetList) throws TargetException, IllegalStateException 208 { 209 if (!connected) 210 { 211 throw new IllegalStateException ("Illegal access to getRunningModules"); 212 } 213 214 217 return null; 218 } 219 220 221 226 public Locale [] getSupportedLocales() 227 { 228 return supportedLocale; 229 } 230 231 232 238 public Target[] getTargets() throws IllegalStateException 239 { 240 if (!connected) 241 { 242 throw new IllegalStateException ("Illegal access to getTargets"); 243 } 244 245 248 return null; 249 } 250 251 252 258 public boolean isDConfigBeanVersionSupported(DConfigBeanVersionType version) 259 { 260 return true; 261 } 262 263 264 270 public boolean isLocaleSupported(Locale locale) 271 { 272 for (int i = 0; i < supportedLocale.length; i++) 273 { 274 if (supportedLocale[i].equals(locale)) 275 { 276 return true; 277 } 278 } 279 return true; 280 } 281 282 283 289 public boolean isRedeploySupported() 290 { 291 return true; 292 } 293 294 295 310 311 public ProgressObject redeploy(TargetModuleID[] moduleIDList, File moduleArchive, File deploymentPlan) throws UnsupportedOperationException , IllegalStateException 312 { 313 if (!connected) 314 { 315 throw new IllegalStateException ("Illegal access to redeploy"); 316 } 317 if (!isRedeploySupported()) 318 { 319 throw new UnsupportedOperationException ("Redeploy is not supported"); 320 } 321 322 return null; 323 } 324 325 326 341 public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) throws UnsupportedOperationException , IllegalStateException 342 { 343 if (!connected) 344 { 345 throw new IllegalStateException ("Illegal access to redeploy"); 346 } 347 if (!isRedeploySupported()) 348 { 349 throw new UnsupportedOperationException ("Redeploy is not supported"); 350 } 351 352 return null; 353 } 354 355 356 357 364 public void release() 365 { 366 if (connected) 367 { 368 connected = false; 371 } 372 } 373 374 375 381 public void setDConfigBeanVersion(DConfigBeanVersionType version) throws DConfigBeanVersionUnsupportedException 382 { 383 if (false) 384 { 385 throw new DConfigBeanVersionUnsupportedException(""); 386 } 387 versionType = version; 388 } 389 390 391 397 public void setLocale(Locale locale) throws UnsupportedOperationException 398 { 399 if (isLocaleSupported(locale)) 400 { 401 currentLocale = locale; 402 } 403 } 404 405 406 416 417 public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException 418 { 419 if (!connected) 420 { 421 throw new IllegalStateException ("Illegal access to start"); 422 } 423 424 return null; 425 } 426 427 428 438 public ProgressObject stop(TargetModuleID[] moduleIDList) throws IllegalStateException 439 { 440 if (!connected) 441 { 442 throw new IllegalStateException ("Illegal access to stop"); 443 } 444 445 return null; 446 } 447 448 449 460 public ProgressObject undeploy(TargetModuleID[] moduleIDList) throws IllegalStateException 461 { 462 if (!connected) 463 { 464 throw new IllegalStateException ("Illegal access to undeploy"); 465 } 466 467 return null; 468 } 469 } 470 471 | Popular Tags |