1 19 package org.netbeans.modules.j2ee.websphere6; 20 21 import java.io.*; 22 import java.util.*; 23 import java.util.jar.JarFile ; 24 25 import javax.enterprise.deploy.model.*; 26 import javax.enterprise.deploy.shared.*; 27 import javax.enterprise.deploy.spi.*; 28 import javax.enterprise.deploy.spi.exceptions.*; 29 import javax.enterprise.deploy.spi.factories.*; 30 import javax.enterprise.deploy.spi.status.*; 31 import javax.management.MalformedObjectNameException ; 32 import javax.management.ObjectName ; 33 import org.netbeans.modules.j2ee.websphere6.config.*; 34 35 import org.openide.*; 36 import org.openide.util.*; 37 import org.netbeans.modules.j2ee.deployment.plugins.api.*; 38 39 import org.netbeans.modules.j2ee.websphere6.util.WSDebug; 40 import java.lang.reflect.InvocationTargetException ; 41 import java.lang.reflect.Method ; 42 import java.util.zip.ZipEntry ; 43 44 52 public class WSDeploymentManager implements DeploymentManager { 53 54 57 private WSClassLoader loader; 58 59 62 private DeploymentFactory factory; 63 64 67 private DeploymentManager dm; 68 69 72 private InstanceProperties instanceProperties; 73 74 77 private String uri; 78 79 82 private String username; 83 84 87 private String password; 88 89 92 private boolean isConnected; 93 94 97 private static String webUrlInEntApp = ""; 98 105 public WSDeploymentManager(String uri, String username, String password) { 106 if (WSDebug.isEnabled()) WSDebug.notify("WSDeploymentManager(" + uri + ", " + username + ", " + password + ")"); 110 this.uri = uri; 112 this.username = username; 113 this.password = password; 114 } 115 116 121 public WSDeploymentManager(String uri) { 122 this(uri, null, null); 123 } 124 125 129 private void parseUri() { 130 String [] parts = uri.split(":"); 133 getInstanceProperties().setProperty( 135 WSDeploymentFactory.HOST_ATTR, parts[2]); 136 getInstanceProperties().setProperty( 137 WSDeploymentFactory.PORT_ATTR, parts[3]); 138 } 139 140 146 public String getURI() { 147 return this.uri; 148 } 149 150 153 public String getHost() { 154 return getInstanceProperties().getProperty( 155 WSDeploymentFactory.HOST_ATTR); 156 } 157 158 161 public String getPassword() { 162 return getInstanceProperties().getProperty(WSDeploymentFactory.PASSWORD_ATTR); 163 164 } 165 166 169 public String getUsername() { 170 return getInstanceProperties().getProperty(WSDeploymentFactory.USERNAME_ATTR); 171 172 } 173 174 175 178 public String getPort() { 179 return getInstanceProperties().getProperty( 180 WSDeploymentFactory.PORT_ATTR); 181 } 182 public String getAdminPort() { 183 return getInstanceProperties().getProperty( 184 WSDeploymentFactory.ADMIN_PORT_ATTR); 185 } 186 public String getDefaultHostPort() { 187 return getInstanceProperties().getProperty( 188 WSDeploymentFactory.DEFAULT_HOST_PORT_ATTR); 189 } 190 193 public String getServerRoot() { 194 return (getInstanceProperties()!=null)?getInstanceProperties().getProperty( 195 WSDeploymentFactory.SERVER_ROOT_ATTR):""; 196 } 197 198 201 public String getDomainRoot() { 202 return (getInstanceProperties()!=null)?getInstanceProperties().getProperty( 203 WSDeploymentFactory.DOMAIN_ROOT_ATTR):""; 204 } 205 206 public String getLogFilePath() { 207 return getDomainRoot() + File.separator + "logs" + File.separator + 209 getInstanceProperties().getProperty( 210 WSDeploymentFactory.SERVER_NAME_ATTR) + File.separator + 211 "trace.log"; } 213 214 217 public String getIsLocal() { 218 return (getInstanceProperties()!=null)?getInstanceProperties().getProperty( 219 WSDeploymentFactory.IS_LOCAL_ATTR):""; 220 } 221 222 225 public void setServerRoot(String serverRoot) { 226 if(getInstanceProperties()!=null) 227 getInstanceProperties().setProperty(WSDeploymentFactory.SERVER_ROOT_ATTR,serverRoot); 228 } 229 230 233 public void setDomainRoot(String domainRoot) { 234 if(getInstanceProperties()!=null) 235 getInstanceProperties().setProperty(WSDeploymentFactory.DOMAIN_ROOT_ATTR,domainRoot); 236 } 237 238 241 public void setHost(String host) { 242 if(getInstanceProperties()!=null) { 243 getInstanceProperties().setProperty(WSDeploymentFactory.HOST_ATTR,host); 244 } 245 } 246 247 250 public void setPort(String port) { 251 if(getInstanceProperties()!=null){ 252 getInstanceProperties().setProperty(WSDeploymentFactory.PORT_ATTR,port); 253 } 254 } 255 256 257 260 public void setAdminPort(String adminPort) { 261 if(getInstanceProperties()!=null){ 262 getInstanceProperties().setProperty(WSDeploymentFactory.ADMIN_PORT_ATTR,adminPort); 263 } 264 } 265 266 269 public void setDefaultHostPort(String defaultHostPort) { 270 if(getInstanceProperties()!=null){ 271 getInstanceProperties().setProperty(WSDeploymentFactory.DEFAULT_HOST_PORT_ATTR,defaultHostPort); 272 } 273 } 274 277 public void setPassword(String password) { 278 if(getInstanceProperties()!=null) 279 getInstanceProperties().setProperty(WSDeploymentFactory.PASSWORD_ATTR,password); 280 } 281 282 285 public void setUsername(String username) { 286 if(getInstanceProperties()!=null) 287 getInstanceProperties().setProperty(WSDeploymentFactory.USERNAME_ATTR,username); 288 } 289 290 293 public void setServerName(String name) { 294 if(getInstanceProperties()!=null) 295 getInstanceProperties().setProperty(WSDeploymentFactory.SERVER_NAME_ATTR,name); 296 } 297 298 301 public void setConfigXmlPath(String path) { 302 if(getInstanceProperties()!=null) 303 getInstanceProperties().setProperty(WSDeploymentFactory.CONFIG_XML_PATH,path); 304 } 305 306 309 public void setIsLocal(String isLocal) { 310 if(getInstanceProperties()!=null) 311 getInstanceProperties().setProperty(WSDeploymentFactory.IS_LOCAL_ATTR,isLocal); 312 } 313 314 321 private void loadDeploymentFactory() { 322 if (WSDebug.isEnabled()) WSDebug.notify("loadDeploymentFactory()"); 325 if (factory == null) { 327 329 String serverProp=getServerRoot(); 330 331 String domainProp=getDomainRoot(); 332 333 loader = WSClassLoader.getInstance(serverProp,domainProp); 334 335 loader.updateLoader(); 337 338 try { 340 factory = (DeploymentFactory) loader.loadClass( 341 "com.ibm.ws.management.application.j2ee." + "deploy.spi.factories.DeploymentFactoryImpl"). newInstance(); 344 } catch (ClassNotFoundException e) { 345 e=null; 347 } catch (InstantiationException e) { 350 ErrorManager.getDefault().notify(ErrorManager.ERROR, e); 351 } catch (IllegalAccessException e) { 352 ErrorManager.getDefault().notify(ErrorManager.ERROR, e); 353 } finally { 354 loader.restoreLoader(); 356 } 357 } 358 } 359 360 365 private void updateDeploymentManager() { 366 if (WSDebug.isEnabled()) WSDebug.notify("updateDeploymentManager()"); 369 loadDeploymentFactory(); 371 372 loader.updateLoader(); 374 375 try { 376 if (dm != null) { 379 dm.release(); 380 } 381 382 if(factory!=null) { 383 dm = factory.getDeploymentManager(uri, username, password); 385 386 isConnected = true; 388 } 389 } catch (DeploymentManagerCreationException e) { 390 try { 391 isConnected = false; 394 dm = factory.getDisconnectedDeploymentManager(uri); 395 } catch (DeploymentManagerCreationException ex) { 396 ErrorManager.getDefault().notify(ErrorManager.ERROR, ex); 397 } 398 } finally { 399 loader.restoreLoader(); 401 } 402 } 403 404 410 public InstanceProperties getInstanceProperties() { 411 if (WSDebug.isEnabled()) WSDebug.notify("getInstanceProperties()"); 414 if (instanceProperties == null) { 417 instanceProperties = InstanceProperties.getInstanceProperties(uri); 418 419 if (instanceProperties != null) { 422 parseUri(); 423 } 424 } 425 426 return instanceProperties; 428 } 429 430 public boolean getIsConnected() { 431 return isConnected; 432 } 433 public String getServerTitleMessage() { 434 String title = "[" + getInstanceProperties(). getProperty(WSDeploymentFactory.SERVER_NAME_ATTR) + ", "+ 436 getInstanceProperties(). 437 getProperty(WSDeploymentFactory.HOST_ATTR) + ":"+ 438 getInstanceProperties(). 439 getProperty(WSDeploymentFactory.PORT_ATTR)+ "]"; 440 return title; 441 } 442 443 444 452 public ProgressObject distribute(Target[] target, File file, File file2) 453 throws IllegalStateException { 454 if (WSDebug.isEnabled()) WSDebug.notify("distribute(" + target + ", " + file + ", " + file2 + ")"); 458 updateDeploymentManager(); 460 461 if (!isConnected) { 463 throw new IllegalStateException (NbBundle.getMessage( 464 WSDeploymentManager.class, "ERR_illegalState")); } 466 467 loader.updateLoader(); 469 webUrlInEntApp = null; 471 472 if(file.exists() && file.getPath().endsWith(".ear")) { 473 JarFile jarFile = null; 475 ZipEntry ze= null; 476 InputStream is = null; 477 ByteArrayOutputStream os = null; 478 try { 479 jarFile = new JarFile (file); 480 ze = jarFile.getEntry("META-INF/application.xml"); 481 is = jarFile.getInputStream(ze); 482 os = new ByteArrayOutputStream(); 483 int n=0; 484 byte[] buf = new byte[1024]; 485 while ((n = is.read(buf, 0, 1024)) > -1) { 486 os.write(buf, 0, n); 487 } 488 String content = os.toString(); 489 String token = "<context-root>"; 490 int startIndex = content.indexOf(token); 491 int endIndex = content.indexOf("</context-root>"); 492 if (startIndex != -1 && endIndex != -1) { 493 webUrlInEntApp = content.substring(startIndex + token.length(), 494 endIndex); 495 } 496 } catch (IOException ex) { 497 } finally { 499 try { 500 if(jarFile!=null) jarFile.close(); 501 } catch(IOException ex) { 502 } finally { 503 try { 504 if(is != null) is.close(); 505 } catch(IOException ex) { 506 } finally { 507 try { 508 if(os != null) is.close(); 509 } catch(IOException ex) { 510 } 511 } 512 } 513 } 514 515 } 516 517 519 try { 520 ProgressObject po = dm.distribute(target, file, file2); 522 523 return po; 524 525 } finally { 526 loader.restoreLoader(); 528 } 529 } 530 531 538 public DeploymentConfiguration createConfiguration( 539 DeployableObject deployableObject) throws InvalidModuleException { 540 if (WSDebug.isEnabled()) WSDebug.notify("createConfiguration(" + deployableObject + ")"); 544 updateDeploymentManager(); 546 547 548 549 loader.updateLoader(); 551 ModuleType type = deployableObject.getType(); 552 try { 553 if(dm!=null) { 554 InstanceProperties ip=getInstanceProperties(); 555 if (type == ModuleType.WAR) { 556 return new WarDeploymentConfiguration(dm, deployableObject,ip); 557 } else if (type == ModuleType.EAR) { 558 if(deployableObject instanceof J2eeApplicationObject) { 559 return new EarDeploymentConfiguration(dm, (J2eeApplicationObject)deployableObject,ip); 560 } 561 return new EarDeploymentConfiguration(dm, deployableObject,ip); 562 } else if (type == ModuleType.EJB) { 563 return new EjbDeploymentConfiguration(dm, deployableObject,ip); 564 } else { 565 throw new InvalidModuleException("Unsupported module type: " + type.toString()); } 567 } 568 } finally { 569 loader.restoreLoader(); 571 } 572 return null; 573 } 574 575 580 public ProgressObject redeploy(TargetModuleID[] targetModuleID, 581 InputStream inputStream, InputStream inputStream2) 582 throws UnsupportedOperationException , IllegalStateException { 583 if (WSDebug.isEnabled()) WSDebug.notify("redeploy(" + targetModuleID + ", " + inputStream + ", " + inputStream2 + ")"); 587 updateDeploymentManager(); 589 590 if (!isConnected) { 592 throw new IllegalStateException (NbBundle.getMessage( 593 WSDeploymentManager.class, "ERR_illegalState")); } 595 596 loader.updateLoader(); 598 599 try { 600 return dm.redeploy(targetModuleID, inputStream, inputStream2); 602 } finally { 603 loader.restoreLoader(); 605 } 606 } 607 608 613 public ProgressObject distribute(Target[] target, InputStream inputStream, 614 InputStream inputStream2) throws IllegalStateException { 615 if (WSDebug.isEnabled()) WSDebug.notify("distribute(" + target + ", " + inputStream + ", " + inputStream2 + ")"); 619 updateDeploymentManager(); 621 622 if (!isConnected) { 624 throw new IllegalStateException (NbBundle.getMessage( 625 WSDeploymentManager.class, "ERR_illegalState")); } 627 628 loader.updateLoader(); 630 631 try { 632 return dm.distribute(target, inputStream, inputStream2); 634 } finally { 635 loader.restoreLoader(); 637 } 638 } 639 640 645 public ProgressObject undeploy(TargetModuleID[] targetModuleID) 646 throws IllegalStateException { 647 if (WSDebug.isEnabled()) WSDebug.notify("undeploy(" + targetModuleID + ")"); 650 updateDeploymentManager(); 652 653 if (!isConnected) { 655 throw new IllegalStateException (NbBundle.getMessage( 656 WSDeploymentManager.class, "ERR_illegalState")); } 658 659 loader.updateLoader(); 661 662 try { 663 return dm.undeploy(targetModuleID); 665 } finally { 666 loader.restoreLoader(); 668 } 669 } 670 671 676 public ProgressObject stop(TargetModuleID[] targetModuleID) 677 throws IllegalStateException { 678 if (WSDebug.isEnabled()) WSDebug.notify("stop(" + targetModuleID + ")"); 681 updateDeploymentManager(); 683 684 if (!isConnected) { 686 throw new IllegalStateException (NbBundle.getMessage( 687 WSDeploymentManager.class, "ERR_illegalState")); } 689 690 loader.updateLoader(); 692 693 try { 694 return dm.stop(targetModuleID); 696 } finally { 697 loader.restoreLoader(); 699 } 700 } 701 702 707 public ProgressObject start(TargetModuleID[] targetModuleID) 708 throws IllegalStateException { 709 if (WSDebug.isEnabled()) WSDebug.notify("start(" + targetModuleID + ")"); 712 updateDeploymentManager(); 714 715 if (!isConnected) { 717 throw new IllegalStateException (NbBundle.getMessage( 718 WSDeploymentManager.class, "ERR_illegalState")); } 720 721 loader.updateLoader(); 723 724 String webUrl=null; 725 try { 726 Method method = targetModuleID[0].getClass(). 728 getMethod("getWebURL", new Class [0]); webUrl = (String ) method. 730 invoke(targetModuleID[0], new Object [0]); 731 732 if (webUrlInEntApp!=null && targetModuleID[0].getModuleID().contains("type=Application")) { 733 TargetModuleID [] tmids = targetModuleID; 734 if (tmids.length==1 && 735 tmids[0].getModuleID().contains("type=Application") && 736 tmids[0].getChildTargetModuleID()==null) { 737 try { 738 TargetModuleID child = (TargetModuleID) loader.loadClass( 739 "com.ibm.ws.management.application.j2ee.deploy.spi.TargetModuleIDImpl"). 740 newInstance(); 741 742 method = child.getClass(). 744 getMethod("setTarget", new Class [] {Target.class}); method.invoke(child, new Object [] {tmids[0].getTarget()}); 746 747 748 method = child.getClass(). 750 getMethod("setParentTargetModuleID", new Class [] {TargetModuleID.class}); method.invoke(child, new Object [] {tmids[0]}); 752 753 754 String id = "WebSphere:name=" + webUrlInEntApp.substring(1) + ",type=WebModule"; 756 String oname = id + ",*"; 757 ObjectName on = new ObjectName (oname); 758 method = child.getClass(). 759 getMethod("setObjectName", new Class [] {ObjectName .class} ); method.invoke(child, new Object [] {on}); 761 762 763 method = child.getClass(). 765 getMethod("setModuleID", new Class [] {String .class}); method.invoke(child, new Object [] {id}); 767 768 method = child.getClass(). 770 getMethod("setModuleType", new Class [] {String .class}); String type = ModuleType.WAR.toString(); 772 method.invoke(child, new Object [] {type}); 773 774 776 method = child.getClass(). 777 getMethod("setStartable", new Class [] {boolean.class}); method.invoke(child, new Object [] {true}); 779 780 String port=getDefaultHostPort(); 782 String host=getHost(); 783 if(uri.indexOf(WSURIManager.WSURI)!=-1) { 784 host=uri.split(":")[2]; 785 } 786 webUrl="http://" + host + ":" + port; if (webUrlInEntApp != null) { 788 webUrl = webUrl + webUrlInEntApp; 789 webUrlInEntApp = null; 790 } else { 791 System.out.println( 792 NbBundle.getMessage(WSDeploymentManager.class, 793 "ERR_wrongContextRoot")); 794 } 795 method = child.getClass(). 796 getMethod("setWebURL", new Class [] {String .class}); method.invoke(child, new Object [] {webUrl}); 798 799 method = tmids[0].getClass(). 800 getMethod("setChildTargetModuleID", new Class [] {TargetModuleID[].class}); method.invoke(tmids[0], new Object [] {new TargetModuleID[] {child}}); 802 803 } catch (ClassNotFoundException ex) { 804 ex=null; } catch (InstantiationException ex) { 806 ex=null; } catch (IllegalAccessException ex) { 808 ex=null; } catch (NoSuchMethodException ex) { 810 ex=null; } catch (InvocationTargetException ex) { 812 ex=null; } catch (NullPointerException ex) { 814 ex=null; } catch (MalformedObjectNameException ex) { 816 ex=null; } 818 } 819 } 820 821 822 if(targetModuleID[0].getModuleID().contains("type=WebModule") ) { 824 if(webUrl==null) { 825 String port=getDefaultHostPort(); 826 String host=getHost(); 827 if(uri.indexOf(WSURIManager.WSURI)!=-1) { 828 host=uri.split(":")[2]; 829 } 830 webUrl="http://" + host + ":" + port; if (webUrlInEntApp != null) { 832 webUrl = webUrl + webUrlInEntApp; 833 webUrlInEntApp = null; 834 } else { 835 System.out.println( 836 NbBundle.getMessage(WSDeploymentManager.class, 837 "ERR_wrongContextRoot")); 838 } 839 method = targetModuleID[0].getClass(). 840 getMethod("setWebURL", new Class [] {String .class}); method.invoke(targetModuleID[0], new Object [] {webUrl}); 842 843 method = targetModuleID[0].getClass(). 844 getMethod("getWebURL", new Class [0] ); String webUrlAfter = (String ) method. 846 invoke(targetModuleID[0], new Object [0]); 847 webUrlAfter = webUrlAfter + ""; 848 } 849 850 869 } 870 871 } catch (IllegalAccessException e) { 872 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); 873 } catch (NoSuchMethodException e) { 874 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); 875 } catch (InvocationTargetException e) { 876 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); 877 } catch (ArrayIndexOutOfBoundsException e) { 878 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); 879 } 880 881 try { 882 return dm.start(targetModuleID); 884 } finally { 885 loader.restoreLoader(); 887 } 888 } 889 890 895 public TargetModuleID[] getAvailableModules(ModuleType moduleType, 896 Target[] target) throws TargetException , IllegalStateException { 897 if (WSDebug.isEnabled()) WSDebug.notify("getAvailableModules(" + moduleType + ", " + target + ")"); 901 updateDeploymentManager(); 903 904 if (!isConnected) { 906 throw new IllegalStateException (NbBundle.getMessage( 907 WSDeploymentManager.class, "ERR_illegalState")); } 909 910 loader.updateLoader(); 912 913 try { 914 TargetModuleID[] am = dm.getAvailableModules(moduleType, target); 916 return am; 917 } finally { 918 loader.restoreLoader(); 920 } 921 } 922 923 928 public TargetModuleID[] getNonRunningModules(ModuleType moduleType, 929 Target[] target) throws TargetException , IllegalStateException { 930 if (WSDebug.isEnabled()) WSDebug.notify("getNonRunningModules(" + moduleType + ", " + target + ")"); 934 updateDeploymentManager(); 936 937 if (!isConnected) { 939 throw new IllegalStateException (NbBundle.getMessage( 940 WSDeploymentManager.class, "ERR_illegalState")); } 942 943 loader.updateLoader(); 945 946 try { 947 TargetModuleID [] nrm = dm.getNonRunningModules(moduleType, target); 949 return nrm; 950 } finally { 951 loader.restoreLoader(); 953 } 954 } 955 956 961 public TargetModuleID[] getRunningModules(ModuleType moduleType, 962 Target[] target) throws TargetException , IllegalStateException { 963 if (WSDebug.isEnabled()) WSDebug.notify("getRunningModules(" + moduleType + ", " + target + ")"); 967 updateDeploymentManager(); 969 970 if (!isConnected) { 972 throw new IllegalStateException (NbBundle.getMessage( 973 WSDeploymentManager.class, "ERR_illegalState")); } 975 976 loader.updateLoader(); 978 979 try { 980 TargetModuleID [] rm = dm.getRunningModules(moduleType, target); 982 return rm; 983 } finally { 984 loader.restoreLoader(); 986 } 987 } 988 989 994 public ProgressObject redeploy(TargetModuleID[] targetModuleID, File file, 995 File file2) throws UnsupportedOperationException , 996 IllegalStateException { 997 if (WSDebug.isEnabled()) WSDebug.notify("redeploy(" + targetModuleID + ", " + file + ", " + file2 + ")"); 1001 updateDeploymentManager(); 1003 1004 if (!isConnected) { 1006 throw new IllegalStateException (NbBundle.getMessage( 1007 WSDeploymentManager.class, "ERR_illegalState")); } 1009 1010 loader.updateLoader(); 1012 1013 try { 1014 return dm.redeploy(targetModuleID, file, file2); 1016 } finally { 1017 loader.restoreLoader(); 1019 } 1020 } 1021 1022 1027 public void setLocale(Locale locale) throws UnsupportedOperationException { 1028 if (WSDebug.isEnabled()) WSDebug.notify("setLocale(" + locale + ")"); 1031 updateDeploymentManager(); 1033 1034 dm.setLocale(locale); 1036 } 1037 1038 1043 public boolean isLocaleSupported(Locale locale) { 1044 if (WSDebug.isEnabled()) WSDebug.notify("isLocaleSupported(" + locale + ")"); 1047 updateDeploymentManager(); 1049 1050 return dm.isLocaleSupported(locale); 1052 } 1053 1054 1059 public void setDConfigBeanVersion( 1060 DConfigBeanVersionType dConfigBeanVersionType) 1061 throws DConfigBeanVersionUnsupportedException { 1062 if (WSDebug.isEnabled()) WSDebug.notify("setDConfigBeanVersion(" + dConfigBeanVersionType + ")"); 1066 updateDeploymentManager(); 1068 1069 dm.setDConfigBeanVersion(dConfigBeanVersionType); 1071 } 1072 1073 1078 public boolean isDConfigBeanVersionSupported( 1079 DConfigBeanVersionType dConfigBeanVersionType) { 1080 if (WSDebug.isEnabled()) WSDebug.notify("isDConfigBeanVersionSupported(" + dConfigBeanVersionType + ")"); 1084 updateDeploymentManager(); 1086 1087 return dm.isDConfigBeanVersionSupported(dConfigBeanVersionType); 1089 } 1090 1091 1096 public void release() { 1097 if (WSDebug.isEnabled()) WSDebug.notify("release()"); 1100 if (dm != null) { 1101 dm.release(); 1103 dm = null; 1104 } 1105 } 1106 1107 1112 public boolean isRedeploySupported() { 1113 if (WSDebug.isEnabled()) WSDebug.notify("isRedeploySupported()"); 1116 updateDeploymentManager(); 1118 1119 return dm.isRedeploySupported(); 1121 } 1122 1123 1128 public Locale getCurrentLocale() { 1129 if (WSDebug.isEnabled()) WSDebug.notify("getCurrentLocale()"); 1132 updateDeploymentManager(); 1134 1135 return dm.getCurrentLocale(); 1137 } 1138 1139 1144 public DConfigBeanVersionType getDConfigBeanVersion() { 1145 if (WSDebug.isEnabled()) WSDebug.notify("getDConfigBeanVersion()"); 1148 updateDeploymentManager(); 1150 1151 return dm.getDConfigBeanVersion(); 1153 } 1154 1155 1160 public Locale getDefaultLocale() { 1161 if (WSDebug.isEnabled()) WSDebug.notify("getDefaultLocale()"); 1164 updateDeploymentManager(); 1166 1167 return dm.getDefaultLocale(); 1169 } 1170 1171 1176 public Locale[] getSupportedLocales() { 1177 if (WSDebug.isEnabled()) WSDebug.notify("getSupportedLocales()"); 1180 updateDeploymentManager(); 1182 1183 return dm.getSupportedLocales(); 1185 } 1186 1187 1192 public Target[] getTargets() throws IllegalStateException { 1193 if (WSDebug.isEnabled()) WSDebug.notify("getTargets()"); 1196 updateDeploymentManager(); 1198 1199 loader.updateLoader(); 1201 1202 if (!isConnected) { 1204 throw new IllegalStateException (NbBundle.getMessage( 1205 WSDeploymentManager.class, "ERR_illegalState")); } 1207 1208 try { 1209 return dm.getTargets(); 1211 } finally { 1212 loader.restoreLoader(); 1214 } 1215 } 1216 1217} | Popular Tags |