1 25 26 package org.objectweb.jonas.webapp.jonasadmin.deploy; 27 28 import java.util.ArrayList ; 29 import java.util.Properties ; 30 31 import javax.management.ObjectName ; 32 import javax.servlet.http.HttpServletRequest ; 33 34 import org.objectweb.jonas.jmx.J2eeObjectName; 35 import org.objectweb.jonas.jmx.JonasManagementRepr; 36 import org.objectweb.jonas.jmx.JonasObjectName; 37 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx; 38 import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction; 39 import org.objectweb.jonas.webapp.jonasadmin.JonasTreeBuilder; 40 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou; 41 import org.objectweb.jonas.webapp.taglib.TreeControl; 42 import org.objectweb.jonas.webapp.taglib.TreeControlNode; 43 44 47 48 abstract public class BaseDeployAction extends JonasBaseAction { 49 50 52 protected int getCurrentJonasDeployment() 53 throws Exception { 54 int iRet = 0; 55 iRet = m_WhereAreYou.getCurrentJonasDeploymentType(); 56 return iRet; 57 } 58 59 protected void setCurrentJonasDeployment(HttpServletRequest p_Request) 60 throws Exception { 61 int iDeployment = 0; 62 String sDeployment = p_Request.getParameter("type"); 63 if (sDeployment != null) { 64 if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_EAR) == true) { 66 iDeployment = WhereAreYou.DEPLOYMENT_EAR; 67 } 68 else if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_JAR) == true) { 69 iDeployment = WhereAreYou.DEPLOYMENT_JAR; 70 } 71 else if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_WAR) == true) { 72 iDeployment = WhereAreYou.DEPLOYMENT_WAR; 73 } 74 else if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_RAR) == true) { 75 iDeployment = WhereAreYou.DEPLOYMENT_RAR; 76 } 77 else if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_DATASOURCE) == true) { 78 iDeployment = WhereAreYou.DEPLOYMENT_DATASOURCE; 79 } 80 else if (sDeployment.equals(WhereAreYou.DEPLOYMENT_STRING_MAILFACTORY) == true) { 81 iDeployment = WhereAreYou.DEPLOYMENT_MAIL; 82 } 83 else if (sDeployment.equals(WhereAreYou.DOMAIN_DEPLOYMENT_STRING_EAR) == true) { 84 iDeployment = WhereAreYou.DOMAIN_DEPLOYMENT_EAR; 85 } 86 else if (sDeployment.equals(WhereAreYou.DOMAIN_DEPLOYMENT_STRING_JAR) == true) { 87 iDeployment = WhereAreYou.DOMAIN_DEPLOYMENT_JAR; 88 } 89 else if (sDeployment.equals(WhereAreYou.DOMAIN_DEPLOYMENT_STRING_WAR) == true) { 90 iDeployment = WhereAreYou.DOMAIN_DEPLOYMENT_WAR; 91 } 92 else if (sDeployment.equals(WhereAreYou.DOMAIN_DEPLOYMENT_STRING_RAR) == true) { 93 iDeployment = WhereAreYou.DOMAIN_DEPLOYMENT_RAR; 94 } 95 else { 96 throw new Exception ("Unknown type deployment"); 97 } 98 m_WhereAreYou.setCurrentJonasDeploymentType(iDeployment); 100 } 101 } 102 103 108 protected String getForwardEdit() { 109 String sForward = null; 110 try { 111 switch (getCurrentJonasDeployment()) { 112 case WhereAreYou.DEPLOYMENT_EAR: 113 case WhereAreYou.DEPLOYMENT_JAR: 114 case WhereAreYou.DEPLOYMENT_WAR: 115 case WhereAreYou.DEPLOYMENT_RAR: 116 sForward = "Deploy"; 117 break; 118 case WhereAreYou.DOMAIN_DEPLOYMENT_EAR: 119 case WhereAreYou.DOMAIN_DEPLOYMENT_JAR: 120 case WhereAreYou.DOMAIN_DEPLOYMENT_WAR: 121 case WhereAreYou.DOMAIN_DEPLOYMENT_RAR: 122 sForward = "Domain Deploy"; 123 break; 124 case WhereAreYou.DEPLOYMENT_DATASOURCE: 125 sForward = "Deploy Datasource"; 126 break; 127 case WhereAreYou.DEPLOYMENT_MAIL: 128 sForward = "Deploy Mail Factory"; 129 break; 130 } 131 } 132 catch (Exception e) { 133 } 135 return sForward; 136 } 137 138 protected boolean isDomain() { 139 boolean result = false; 140 try { 141 switch (getCurrentJonasDeployment()) { 142 case WhereAreYou.DOMAIN_DEPLOYMENT_EAR: 143 case WhereAreYou.DOMAIN_DEPLOYMENT_JAR: 144 case WhereAreYou.DOMAIN_DEPLOYMENT_WAR: 145 case WhereAreYou.DOMAIN_DEPLOYMENT_RAR: 146 result = true; 147 break; 148 } 149 } catch (Exception e) { 150 } 152 return result; 153 } 154 155 protected String getDomainDeploymentMethodName() { 156 String result = ""; 157 try { 158 switch (getCurrentJonasDeployment()) { 159 case WhereAreYou.DOMAIN_DEPLOYMENT_EAR: 160 result = "deployEar"; 161 break; 162 case WhereAreYou.DOMAIN_DEPLOYMENT_JAR: 163 result = "deployJar"; 164 break; 165 case WhereAreYou.DOMAIN_DEPLOYMENT_WAR: 166 result = "deployWar"; 167 break; 168 case WhereAreYou.DOMAIN_DEPLOYMENT_RAR: 169 result = "deployRar"; 170 break; 171 } 172 } catch (Exception e) { 173 } 175 return result; 176 } 177 178 protected String getDomainUploadDeployMethodName() { 179 String result = ""; 180 try { 181 switch (getCurrentJonasDeployment()) { 182 case WhereAreYou.DOMAIN_DEPLOYMENT_EAR: 183 result = "uploadDeployEar"; 184 break; 185 case WhereAreYou.DOMAIN_DEPLOYMENT_JAR: 186 result = "uploadDeployJar"; 187 break; 188 case WhereAreYou.DOMAIN_DEPLOYMENT_WAR: 189 result = "uploadDeployWar"; 190 break; 191 case WhereAreYou.DOMAIN_DEPLOYMENT_RAR: 192 result = "uploadDeployRar"; 193 break; 194 } 195 } catch (Exception e) { 196 } 198 return result; 199 } 200 201 208 protected ArrayList getListDeployableFiles() 209 throws Exception { 210 ArrayList al = null; 211 switch (getCurrentJonasDeployment()) { 212 case WhereAreYou.DEPLOYMENT_EAR: 213 al = JonasAdminJmx.getEarFilesDeployable(); 214 break; 215 case WhereAreYou.DEPLOYMENT_JAR: 216 al = JonasAdminJmx.getJarFilesDeployable(); 217 break; 218 case WhereAreYou.DEPLOYMENT_WAR: 219 al = JonasAdminJmx.getWarFilesDeployable(); 220 break; 221 case WhereAreYou.DEPLOYMENT_RAR: 222 al = JonasAdminJmx.getRarFilesDeployable(); 223 break; 224 case WhereAreYou.DOMAIN_DEPLOYMENT_EAR: 225 al = JonasAdminJmx.getEarFilesDeployable(); 226 al.addAll(JonasAdminJmx.getEarFilesDeployed()); 227 break; 228 case WhereAreYou.DOMAIN_DEPLOYMENT_JAR: 229 al = JonasAdminJmx.getJarFilesDeployable(); 230 al.addAll(JonasAdminJmx.getJarFilesDeployed()); 231 break; 232 case WhereAreYou.DOMAIN_DEPLOYMENT_WAR: 233 al = JonasAdminJmx.getWarFilesDeployable(); 234 al.addAll(JonasAdminJmx.getWarFilesDeployed()); 235 break; 236 case WhereAreYou.DOMAIN_DEPLOYMENT_RAR: 237 al = JonasAdminJmx.getRarFilesDeployable(); 238 al.addAll(JonasAdminJmx.getRarFilesDeployed()); 239 break; 240 case WhereAreYou.DEPLOYMENT_DATASOURCE: 241 al = JonasAdminJmx.getDatasourceFilesDeployable(); 242 break; 243 case WhereAreYou.DEPLOYMENT_MAIL: 244 al = JonasAdminJmx.getMailFilesDeployable(); 245 break; 246 } 247 return al; 248 } 249 250 257 protected ArrayList getListDeployedFiles() 258 throws Exception { 259 ArrayList al = null; 260 switch (getCurrentJonasDeployment()) { 261 case WhereAreYou.DEPLOYMENT_EAR: 262 al = JonasAdminJmx.getEarFilesDeployed(); 263 break; 264 case WhereAreYou.DEPLOYMENT_JAR: 265 al = JonasAdminJmx.getJarFilesDeployed(); 266 break; 267 case WhereAreYou.DEPLOYMENT_RAR: 268 al = JonasAdminJmx.getRarFilesDeployed(); 269 break; 270 case WhereAreYou.DEPLOYMENT_WAR: 271 al = JonasAdminJmx.getWarFilesDeployed(); 272 break; 273 case WhereAreYou.DEPLOYMENT_DATASOURCE: 274 String domainName = m_WhereAreYou.getCurrentDomainName(); 275 String serverName = m_WhereAreYou.getCurrentJonasServerName(); 276 al = JonasAdminJmx.getDatasourceFilesDeployed(domainName, serverName); 277 break; 278 case WhereAreYou.DEPLOYMENT_MAIL: 279 al = JonasAdminJmx.getMailFilesDeployed(m_WhereAreYou); 280 break; 281 } 282 return al; 283 } 284 285 292 protected void undeploy(String p_Filename) 293 throws Exception { 294 String [] asParam = new String [1]; 295 asParam[0] = p_Filename; 296 String [] asSignature = new String [1]; 297 asSignature[0] = "java.lang.String"; 298 299 switch (getCurrentJonasDeployment()) { 300 case WhereAreYou.DEPLOYMENT_EAR: 301 JonasManagementRepr.invoke(JonasObjectName.earService(), "unDeployEarMBean" 302 , asParam, asSignature); 303 break; 304 case WhereAreYou.DEPLOYMENT_JAR: 305 JonasManagementRepr.invoke(JonasObjectName.ejbService(), "removeContainerMBean", asParam 306 , asSignature); 307 break; 308 case WhereAreYou.DEPLOYMENT_RAR: 309 JonasManagementRepr.invoke(JonasObjectName.resourceService(), "unDeployRarMBean" 310 , asParam, asSignature); 311 break; 312 case WhereAreYou.DEPLOYMENT_WAR: 313 JonasManagementRepr.invoke(JonasObjectName.webContainerService() 314 , "unRegisterWarMBean", asParam, asSignature); 315 break; 316 case WhereAreYou.DEPLOYMENT_DATASOURCE: 317 undeployDataSource(p_Filename); 318 break; 319 case WhereAreYou.DEPLOYMENT_MAIL: 320 undeployMailFactory(p_Filename); 321 break; 322 } 323 } 324 325 331 protected void undeployDataSource(String p_Filename) 332 throws Exception { 333 ArrayList al = JonasAdminJmx.getDatasourceDependences(p_Filename 334 , m_WhereAreYou.getCurrentDomainName() 335 , m_WhereAreYou.getCurrentJonasServerName()); 336 if (al.size() == 0) { 337 String [] asParam = new String [1]; 338 asParam[0] = p_Filename; 339 String [] asSignature = new String [1]; 340 asSignature[0] = "java.lang.String"; 341 JonasManagementRepr.invoke(JonasObjectName.databaseService(), "unloadDataSource" 342 , asParam, asSignature); 343 } 344 else { 345 throw new Exception (m_Resources.getMessage("error.undeploy.datasource.dependences" 346 , al.toString())); 347 } 348 } 349 350 356 protected void undeployMailFactory(String p_Filename) 357 throws Exception { 358 ArrayList al = JonasAdminJmx.getMailFactoryDependences(p_Filename, m_WhereAreYou); 359 if (al.size() == 0) { 360 String [] asParam = new String [1]; 361 asParam[0] = p_Filename; 362 String [] asSignature = new String [1]; 363 asSignature[0] = "java.lang.String"; 364 JonasManagementRepr.invoke(JonasObjectName.mailService(), "unbindMailFactoryMBean" 365 , asParam, asSignature); 366 } 367 else { 368 throw new Exception (m_Resources.getMessage("error.undeploy.mailfactory.dependences" 369 , al.toString())); 370 } 371 } 372 373 380 protected void deploy(String p_Filename) 381 throws Exception { 382 String [] asParam = new String [1]; 383 asParam[0] = p_Filename; 384 String [] asSignature = new String [1]; 385 asSignature[0] = "java.lang.String"; 386 387 switch (getCurrentJonasDeployment()) { 388 case WhereAreYou.DEPLOYMENT_EAR: 389 JonasManagementRepr.invoke(JonasObjectName.earService(), "deployEarMBean", asParam 390 , asSignature); 391 break; 392 case WhereAreYou.DEPLOYMENT_JAR: 393 JonasManagementRepr.invoke(JonasObjectName.ejbService(), "createContainerMBean", asParam 394 , asSignature); 395 break; 396 case WhereAreYou.DEPLOYMENT_RAR: 397 JonasManagementRepr.invoke(JonasObjectName.resourceService(), "deployRarMBean" 398 , asParam, asSignature); 399 break; 400 case WhereAreYou.DEPLOYMENT_WAR: 401 JonasManagementRepr.invoke(JonasObjectName.webContainerService() 402 , "registerWarMBean", asParam, asSignature); 403 break; 404 case WhereAreYou.DEPLOYMENT_DATASOURCE: 405 deployDataSource(p_Filename); 406 break; 407 case WhereAreYou.DEPLOYMENT_MAIL: 408 deployMailFactory(p_Filename); 409 break; 410 } 411 } 412 413 419 protected void deployDataSource(String p_Filename) 420 throws Exception { 421 422 String [] asParam = new String [1]; 423 String [] asSignature = new String [1]; 424 asParam[0] = p_Filename; 425 asSignature[0] = "java.lang.String"; 426 427 ObjectName onDb = JonasObjectName.databaseService(); 428 Boolean oLoaded = (Boolean ) JonasManagementRepr.invoke(onDb, "isLoadedDataSource", asParam 430 , asSignature); 431 if (oLoaded.booleanValue() == false) { 432 Properties oProps = (Properties ) JonasManagementRepr.invoke(onDb 434 , "getDataSourcePropertiesFile", asParam, asSignature); 435 Object [] aoParam = { 437 p_Filename, oProps, new Boolean (true)}; 438 String [] asSign_3 = { 439 "java.lang.String", "java.util.Properties", "java.lang.Boolean"}; 440 JonasManagementRepr.invoke(onDb, "loadDataSource", aoParam, asSign_3); 441 } 442 else { 443 throw new Exception (m_Resources.getMessage("error.deploy.datasource.isloaded")); 444 } 445 } 446 447 453 protected void deployMailFactory(String p_Filename) 454 throws Exception { 455 456 String [] asParam = new String [1]; 457 String [] asSignature = new String [1]; 458 asParam[0] = p_Filename; 459 asSignature[0] = "java.lang.String"; 460 461 ObjectName onMail = JonasObjectName.mailService(); 462 Properties oProps = (Properties ) JonasManagementRepr.invoke(onMail 464 , "getMailFactoryPropertiesFile", asParam, asSignature); 465 Object [] aoParam = { 467 p_Filename, oProps, new Boolean (true)}; 468 String [] asSign_3 = { 469 "java.lang.String", "java.util.Properties", "java.lang.Boolean"}; 470 JonasManagementRepr.invoke(onMail, "createMailFactoryMBean", aoParam, asSign_3); 471 } 472 473 478 protected void runGC() 479 throws Exception { 480 ObjectName oObjectName = J2eeObjectName.J2EEServer(m_WhereAreYou.getCurrentDomainName() 481 , m_WhereAreYou.getCurrentJonasServerName()); 482 JonasManagementRepr.invoke(oObjectName, "runGC", null, null); 483 } 484 485 491 protected void refreshTree(HttpServletRequest p_Request) throws Exception { 492 switch (getCurrentJonasDeployment()) { 494 case WhereAreYou.DEPLOYMENT_EAR: 495 refreshServiceTree(WhereAreYou.DEPLOYMENT_EAR, p_Request); 496 if (JonasAdminJmx.hasMBeanName(JonasObjectName.ejbService()) == true) { 497 refreshServiceTree(WhereAreYou.DEPLOYMENT_JAR, p_Request); 498 } 499 if (JonasAdminJmx.hasMBeanName(JonasObjectName.webContainerService()) == true) { 500 refreshServiceTree(WhereAreYou.DEPLOYMENT_WAR, p_Request); 501 } 502 if (JonasAdminJmx.hasMBeanName(JonasObjectName.resourceService()) == true) { 503 refreshServiceTree(WhereAreYou.DEPLOYMENT_RAR, p_Request); 504 } 505 break; 506 case WhereAreYou.DEPLOYMENT_JAR: 507 refreshServiceTree(WhereAreYou.DEPLOYMENT_JAR, p_Request); 508 break; 509 case WhereAreYou.DEPLOYMENT_WAR: 510 refreshServiceTree(WhereAreYou.DEPLOYMENT_WAR, p_Request); 511 break; 512 case WhereAreYou.DEPLOYMENT_RAR: 513 refreshServiceTree(WhereAreYou.DEPLOYMENT_RAR, p_Request); 514 refreshJoramTree(p_Request); 515 break; 516 case WhereAreYou.DEPLOYMENT_DATASOURCE: 517 refreshServiceTree(WhereAreYou.DEPLOYMENT_DATASOURCE, p_Request); 518 break; 519 case WhereAreYou.DEPLOYMENT_MAIL: 520 refreshServiceTree(WhereAreYou.DEPLOYMENT_MAIL, p_Request); 521 break; 522 } 523 refreshMBeansTree(); 525 m_WhereAreYou.setTreeToRefresh(true); 527 } 528 529 536 protected void refreshServiceTree(int p_Deployment, HttpServletRequest p_Request) 537 throws Exception { 538 String sDomainLabel = "domain"; 540 String sServerName = m_WhereAreYou.getCurrentJonasServerName(); 541 String sCurrentNodeNameServiceItem = null; 543 switch (p_Deployment) { 544 case WhereAreYou.DEPLOYMENT_EAR: 545 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 546 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 547 + WhereAreYou.NODE_SEPARATOR + "ear"; 548 break; 549 case WhereAreYou.DEPLOYMENT_JAR: 550 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 551 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 552 + WhereAreYou.NODE_SEPARATOR + "ejbContainers"; 553 break; 554 case WhereAreYou.DEPLOYMENT_RAR: 555 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 556 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 557 + WhereAreYou.NODE_SEPARATOR + "resourceAdapter"; 558 break; 559 case WhereAreYou.DEPLOYMENT_WAR: 560 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 561 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 562 + WhereAreYou.NODE_SEPARATOR + "web"; 563 break; 564 case WhereAreYou.DEPLOYMENT_DATASOURCE: 565 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 566 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 567 + WhereAreYou.NODE_SEPARATOR + "database"; 568 break; 569 case WhereAreYou.DEPLOYMENT_MAIL: 570 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 571 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 572 + WhereAreYou.NODE_SEPARATOR + "mail"; 573 break; 574 case WhereAreYou.DEPLOYMENT_JMS: 575 sCurrentNodeNameServiceItem = sDomainLabel + WhereAreYou.NODE_SEPARATOR 576 + sServerName + WhereAreYou.NODE_SEPARATOR + "services" 577 + WhereAreYou.NODE_SEPARATOR + "jms"; 578 break; 579 } 580 TreeControl oControl = m_WhereAreYou.getTreeControl(); 582 TreeControlNode oServiceNode = oControl.findNode(sCurrentNodeNameServiceItem); 584 oControl.enableAutoRefresh(); 586 TreeControlNode[] aoNodes = oServiceNode.findChildren(); 588 for (int i = 0; i < aoNodes.length; i++) { 589 aoNodes[i].remove(); 590 } 591 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 593 String sDomainName = m_WhereAreYou.getCurrentDomainName(); 594 595 switch (p_Deployment) { 596 case WhereAreYou.DEPLOYMENT_EAR: 597 oBuilder.getAppContainers(oServiceNode, m_Resources, sDomainName, sServerName); 598 refreshWebServiceTree(p_Request); 599 break; 600 case WhereAreYou.DEPLOYMENT_JAR: 601 oBuilder.getContainers(oServiceNode, m_Resources, sDomainName, sServerName); 602 break; 603 case WhereAreYou.DEPLOYMENT_RAR: 604 oBuilder.getResourceAdapters(oServiceNode, m_Resources, sDomainName, sServerName); 605 break; 606 case WhereAreYou.DEPLOYMENT_WAR: 607 oBuilder.getWebContainers(oServiceNode, m_Resources, p_Request); 608 refreshWebServiceTree(p_Request); 609 break; 610 case WhereAreYou.DEPLOYMENT_DATASOURCE: 611 oBuilder.getDatasources(oServiceNode, m_Resources, sDomainName, sServerName); 612 break; 613 case WhereAreYou.DEPLOYMENT_JMS: 614 oBuilder.getJmsResources(oServiceNode, m_Resources); 615 break; 616 case WhereAreYou.DEPLOYMENT_MAIL: 617 oBuilder.getAllSessionMailFactories(oServiceNode, m_Resources, p_Request); 618 oBuilder.getAllMimePartDSMailFactories(oServiceNode, m_Resources, p_Request); 619 break; 620 } 621 oControl.disableAutoRefresh(); 623 } 624 625 protected void refreshWebServiceTree(HttpServletRequest p_Request) throws Exception { 626 String sServerName = m_WhereAreYou.getCurrentJonasServerName(); 627 String sDomainName = m_WhereAreYou.getCurrentDomainName(); 628 TreeControl oControl = m_WhereAreYou.getTreeControl(); 630 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 632 633 String sServicesNodeName = "domain" + WhereAreYou.NODE_SEPARATOR + sServerName + WhereAreYou.NODE_SEPARATOR + "services"; 636 TreeControlNode services = oControl.findNode(sServicesNodeName); 638 if(JonasAdminJmx.hasMBeanName(JonasObjectName.wsService()) && services != null){ 640 oBuilder.getServiceWebService(services, m_Resources, p_Request, sDomainName, sServerName); 642 }else{ 643 TreeControlNode ws = oControl.findNode(sServicesNodeName + WhereAreYou.NODE_SEPARATOR + "WebService"); 644 if(ws!=null){ 646 ws.remove(); 647 } 648 } 649 } 650 651 656 protected void refreshMBeansTree() throws Exception { 657 TreeControl oControl = m_WhereAreYou.getTreeControl(); 659 TreeControlNode oMBeansNode = oControl.findNode("domain*mbeans"); 661 TreeControlNode oDomainNode= oMBeansNode.getParent(); 662 if (oMBeansNode != null) { 663 oControl.enableAutoRefresh(); 665 oMBeansNode.remove(); 667 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 669 oBuilder.getMBeans(oDomainNode, m_Resources); 670 oControl.disableAutoRefresh(); 672 } 673 } 674 675 680 protected void refreshJoramTree(HttpServletRequest p_Request) throws Exception { 681 TreeControl oControl = m_WhereAreYou.getTreeControl(); 683 String sNodeName = "domain" + WhereAreYou.NODE_SEPARATOR + "joramplatform"; 685 TreeControlNode oJoramNode = oControl.findNode(sNodeName); 686 if (oJoramNode != null) { 687 TreeControlNode parentNode = oJoramNode.getParent(); 688 oControl.enableAutoRefresh(); 690 694 TreeControlNode[] aoNodes = oJoramNode.findChildren(); 696 for (int i = 0; i < aoNodes.length; i++) { 697 aoNodes[i].remove(); 698 } 699 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 700 703 oBuilder.getJoramResources(oJoramNode, null, m_Resources, p_Request); 704 oControl.disableAutoRefresh(); 706 } else { 707 String sDomainName = m_WhereAreYou.getCurrentDomainName(); 709 TreeControlNode oDomainNode = oControl.findNode(sDomainName); 710 oControl.enableAutoRefresh(); 712 JonasTreeBuilder oBuilder = new JonasTreeBuilder(); 714 oBuilder.getJoramPlatform(oDomainNode, m_Resources, p_Request); 715 oControl.disableAutoRefresh(); 717 } 718 } 719 720 726 protected boolean removeFile(String fileName) throws Exception { 727 728 ObjectName j2eeServer = J2eeObjectName.J2EEServer(m_WhereAreYou.getCurrentDomainName(), m_WhereAreYou.getCurrentJonasServerName()); 730 731 Object [] param = new Object [] {fileName}; 733 String [] signature = {"java.lang.String"}; 734 return ((Boolean ) JonasManagementRepr.invoke(j2eeServer, "removeModuleFile", param, signature)).booleanValue(); 735 } 736 737 } 738 | Popular Tags |