1 26 27 package org.objectweb.openccm.OpenCCM_DCI.cif; 28 29 import org.objectweb.openccm.OpenCCM_DCI.*; 30 31 39 40 public class AssemblyManagerXMLImpl 41 extends org.objectweb.openccm.OpenCCM_DCI. 42 AssemblyManagerSessionComposition.AssemblyManagerImpl 43 { 44 50 private String assemblyLoc; 51 private String xmlFilePath; 52 private org.objectweb.openccm.OpenCCM_DCI.AssemblyManagerRegistration AMR; 53 private org.omg.Components.Cookie cookie; 54 private boolean removed; 55 private String xml; 56 public String instanceUUID; 58 private org.objectweb.openccm.OpenCCM_DCI.AssemblyManager AM; 60 61 67 68 public AssemblyManagerXMLImpl(String xml){ 74 this.xml=xml; 75 instanceUUID=System.currentTimeMillis()+""; 76 instanceUUID.substring(instanceUUID.length()-5,instanceUUID.length()); 77 instanceUUID="AssemblyManagerInstance"+instanceUUID; 78 80 } 81 87 public void 88 configuration_complete() 89 { 90 91 try{ 92 AMR=get_context().get_connection_assembly_manager_registration(); 95 96 try{ 97 org.omg.Components.SessionContext sc= 98 (org.omg.Components.SessionContext)get_context(); 99 100 AM=org.objectweb.openccm. 101 OpenCCM_DCI.AssemblyManagerHelper 102 .narrow(sc.get_CCM_object()); 103 104 cookie=AMR.register_assembly_manager(AM); 105 106 ((AssemblySegImpl)obtain_executor("assembly")) 107 .setupAssemblyManager(org.objectweb.openccm. 108 OpenCCM_DCI.AssemblyManagerHelper 109 .narrow(sc.get_CCM_object())); 110 111 } 112 catch(Exception e) 113 { 114 e.printStackTrace(); 115 } 116 117 } 118 catch(Exception e){ 119 e.printStackTrace(); 120 } 121 122 123 } 124 125 126 public void 127 ccm_remove() 128 throws org.omg.Components.CCMException 129 { 130 131 if(!removed){ 132 removed=true; 133 try{ 134 AMR.unregister_assembly_manager(cookie); 135 get_context().push_assembly_manager_removed 136 (new AssemblyManagerRemovedImpl(AM)); 137 if(org.omg.Components.Deployment.AssemblyState.INSERVICE== 139 ((AssemblySegImpl)obtain_executor("assembly")).get_state()) 140 ((AssemblySegImpl)obtain_executor("assembly")).tear_down(); 141 } 142 catch(Exception e ) 143 { 144 System.out.println("Cannot tear_down assembly"); 145 e.printStackTrace(); 146 } 147 148 } 149 } 150 151 public void 152 push(org.objectweb.openccm.OpenCCM_DCI.ComponentServerManagerRemoved csmr) 153 { 154 return ; 155 } 156 157 163 164 public org.ist.coach.DCI.DeploymentDescriptor[] descriptors(){ 165 return new org.ist.coach.DCI.DeploymentDescriptor[0]; 166 } 167 168 public String ass_id(){ 169 return instanceUUID; 170 } 171 172 public void 173 assembly_loc(java.lang.String assemblyLoc) 174 { 175 this.assemblyLoc=assemblyLoc; 176 } 177 178 public String 179 assembly_loc() 180 { 181 return this.assemblyLoc; 182 } 183 184 185 } 186 | Popular Tags |