1 23 24 29 30 package com.sun.enterprise.management.util; 31 32 import com.sun.enterprise.management.model.J2EEDeployedObjectMdl; 33 import com.sun.enterprise.management.util.J2EEModuleCallBack; 34 35 import javax.management.MBeanException ; 36 37 42 public class J2EEModuleCallBackImpl implements J2EEModuleCallBack { 43 44 private String name; 45 private String parentName; 46 private String deploymentDescriptor; 47 private String serverName; 48 private J2EEManagementObjectManager mgmtObjectManager; 49 private StartStopCallback sscb; 50 51 public J2EEModuleCallBackImpl(String nm, String pName, String dd, 52 J2EEManagementObjectManager mgmtObjectManager) { 53 this.name = nm; 54 this.parentName = pName; 55 this.deploymentDescriptor = dd; 56 this.mgmtObjectManager = mgmtObjectManager; 57 } 58 59 public J2EEModuleCallBackImpl(String nm, String pName, String serverName, String dd, 60 J2EEManagementObjectManager mgmtObjectManager) { 61 this.name = nm; 62 this.parentName = pName; 63 this.deploymentDescriptor = dd; 64 this.serverName = serverName; 65 this.mgmtObjectManager = mgmtObjectManager; 66 } 67 68 public J2EEModuleCallBackImpl(String nm, String pName, String serverName, String dd, 69 StartStopCallback sscb) { 70 this.name = nm; 71 this.parentName = pName; 72 this.deploymentDescriptor = dd; 73 this.serverName = serverName; 74 this.sscb = sscb; 75 } 76 77 public String getDeploymentDescriptor() { 78 return this.deploymentDescriptor; 79 } 80 81 82 public void start(Object module) { 83 try { 84 sscb.startModule((J2EEDeployedObjectMdl)module); 85 } catch (Exception ex) { 86 throw new RuntimeException (ex); 87 } 88 } 89 90 91 public void stop(Object module) { 92 try { 93 sscb.stopModule((J2EEDeployedObjectMdl)module); 94 } catch (Exception ex) { 95 throw new RuntimeException (ex); 96 } 97 } 98 99 100 public String getName() { 101 return this.name; 102 } 103 104 public String getParentName() { 105 return this.parentName; 106 } 107 108 public String getServerName() { 109 return this.serverName; 110 } 111 112 } 113 | Popular Tags |