1 26 27 package org.objectweb.openccm.OpenCCM_DCI.cif; 28 29 import org.objectweb.openccm.OpenCCM_DCI.*; 30 31 40 41 public class AssemblyManagerModelImpl 42 extends org.objectweb.openccm.OpenCCM_DCI. 43 AssemblyManagerModelSessionComposition.AssemblyManagerModelImpl 44 { 45 46 private String xml_descriptor; 53 private String assemblyUUID; 55 56 private byte[] componentArchive; 57 58 private boolean removed=false; 60 61 private org.omg.Components.Cookie cookie; 62 63 private org.objectweb.openccm.OpenCCM_DCI 64 .AssemblyManagerModelRegistration AMMR; 65 66 public AssemblyManagerModelImpl(String xml_descriptor){ 77 this.xml_descriptor=xml_descriptor; 78 assemblyUUID=System.currentTimeMillis()+""; 80 assemblyUUID.substring(assemblyUUID.length()-5,assemblyUUID.length()); 81 assemblyUUID="AAM:"+assemblyUUID; 82 } 83 84 public AssemblyManagerModelImpl(byte[] componentArchive){ 85 this.componentArchive=componentArchive; 86 assemblyUUID=System.currentTimeMillis()+""; 88 assemblyUUID.substring(assemblyUUID.length()-5,assemblyUUID.length()); 89 assemblyUUID="AAM:"+assemblyUUID; 90 } 91 public String xml_descriptor(){ 97 if(xml_descriptor==null) 98 return "Not Component assembly description available"; 99 return xml_descriptor; 100 101 } 102 103 public String assemblyUUID(){ 104 return assemblyUUID; 105 } 106 public void 112 configuration_complete() 113 { 114 try{ 115 if(xml_descriptor!=null) 116 ((AssemblyInstanceManagementSegImpl) 117 obtain_executor("assembly_instance_management")) 118 .setupXML(xml_descriptor); 119 else { 120 ((AssemblyInstanceManagementSegImpl) 121 obtain_executor("assembly_instance_management")) 122 .setupComponentArchive(componentArchive); 123 assemblyUUID=((AssemblyInstanceManagementSegImpl) 124 obtain_executor("assembly_instance_management")).getModelName() 125 +":"+assemblyUUID; 126 } 127 128 org.omg.Components.SessionContext sc= 129 (org.omg.Components.SessionContext)get_context(); 130 131 AMMR=get_context() 132 .get_connection_assembly_manager_model_registration(); 133 134 cookie= AMMR.register_assembly_manager_model 135 (org.objectweb.openccm. 136 OpenCCM_DCI.AssemblyManagerModelHelper 137 .narrow(sc.get_CCM_object())); 138 ((AssemblyInstanceManagementSegImpl) 139 obtain_executor("assembly_instance_management")) 140 .setupCookie(cookie); 141 142 } 143 catch(Exception e){ 144 e.printStackTrace(); 145 } 146 } 147 148 152 public void 153 ccm_remove() 154 throws org.omg.Components.CCMException 155 { 156 System.err.println("Assembly manager removed invoke:boolean value:"+removed); 157 158 if(removed) return; 159 160 try{ 161 164 165 removed=true; 166 167 ((AssemblyInstanceManagementSegImpl) 168 obtain_executor("assembly_instance_management")) 169 .uninstall(); 170 171 172 173 } 174 catch(Exception e){ 175 e.printStackTrace(); 176 } 177 178 179 } 180 181 public void 182 push(AssemblyManagerRemoved amr) 183 { 184 185 try 186 { 187 ((AssemblyInstanceManagementSegImpl) 189 obtain_executor("assembly_instance_management")) 190 .disconnectRemovedAssembly(amr.assembly_manager_ref); 191 } 192 catch(Exception e){ 193 e.printStackTrace(); 194 } 195 } 196 } 197 | Popular Tags |