1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.root; 27 28 import java.net.ServerSocket ; 30 import org.ist.coach.DCI.AssemblyManager; 31 import org.ist.coach.DCI.DCIInformation; 32 import org.objectweb.openccm.descriptor.ZipEntryRetriever; 33 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentassemblyBeanImpl; 34 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.*; 35 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder.*; 36 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer.*; 37 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.managers.*; 38 import org.omg.Components.HomeFinder; 39 import org.omg.Components.HomeRegistration; 40 import org.omg.CosNaming.NamingContextExt ; 41 42 50 public class ComponentassemblyDeployerHandler 51 extends HandlerBase 52 { 53 private ComponentassemblyDeployer _deploy; 59 private NamingContextExt namingcontext; 60 private HomeFinder homefinder; 61 private HomeRegistration homeregistration; 62 private DCIInformation dciinfo; 63 private ZipEntryRetriever zipEntryRetriever; 64 private ServerSocket serverSocket; 65 private AssemblyManager assemblyManager; 66 private DeploymentLogger deploymentLogger; 67 private ErrorManager errorManager; 68 private DestinationDeployerFactory destinationDeployerFactory; 69 92 public Object 93 getInstance(ComponentassemblyBeanImpl cai) 94 throws InitializationError 95 { 96 if(_deploy==null){ 97 getDeploymentLogger().log("<<STEP1>> Begin the deployers instantiation/initialization"); 98 _deploy=new ComponentassemblyDeployer(); 99 _deploy.connectComponentassembly(cai); 100 DefaultLifeCycleManager dlcm=new DefaultLifeCycleManager(); 101 _deploy.connectLifeCycleManager(dlcm); 102 dlcm.connectLogger(getDeploymentLogger()); 103 dlcm.connectManagedDeployer(_deploy); 104 _deploy.connectDCIInformation(getDciinfo()); 105 _deploy.connectNamingContextExt(getNamingcontext()); 106 _deploy.connectHomeFinder(getHomefinder()); 107 _deploy.connectHomeregistration(getHomeregistration()); 108 _deploy.connectServerSocket(getServerSocket()); 109 _deploy.connectZipEntryRetriever(getZipEntryRetriever()); 110 _deploy.getZipEntryRetriever().connectStreamManager(_deploy); 111 _deploy.connectDeploymentLogger(getDeploymentLogger()); 112 _deploy.connectErrorManager(getErrorManager()); 113 _deploy.connectDestinationDeployerFactory(getDestinationDeployerFactory()); 114 116 this.connectRootDeployerContext(_deploy); 117 118 if(cai.getComponentfiles()!=null){ 119 ComponentfilesDeployer c= 120 (ComponentfilesDeployer)getDeployer(cai.getComponentfiles()); 121 122 _deploy.connectComponentfilesDeployer(c); 124 } 125 126 PartitioningDeployer p=(PartitioningDeployer) 128 getDeployer(cai.getPartitioning()); 129 130 _deploy.connectPartitioningDeployer(p); 131 132 if(cai.getConnections()!=null){ 133 _deploy.connectConnectionsDeployer 134 ((ConnectionsDeployer)getDeployer(cai.getConnections())); 135 } 136 137 _deploy.initialize(); 138 getDeploymentLogger().log("<</STEP1>>Deployers initialization ended"); 139 } 140 return (_deploy); 141 } 142 143 146 public void 147 connectAssemblyManager(AssemblyManager manager) 148 { 149 assemblyManager = manager; 150 } 151 152 155 public void 156 connectDciinfo(DCIInformation information) 157 { 158 dciinfo = information; 159 } 160 161 164 public void 165 connectHomefinder(HomeFinder finder) 166 { 167 homefinder = finder; 168 } 169 170 173 public void 174 connectHomeregistration(HomeRegistration registration) 175 { 176 homeregistration = registration; 177 } 178 179 182 public void 183 connectNamingcontext(NamingContextExt ext) 184 { 185 namingcontext = ext; 186 } 187 188 191 public void 192 connectServerSocket(ServerSocket socket) 193 { 194 serverSocket = socket; 195 } 196 197 200 public void 201 connectZipEntryRetriever(ZipEntryRetriever retriever) 202 { 203 zipEntryRetriever = retriever; 204 } 205 206 209 private AssemblyManager 210 getAssemblyManager() 211 { 212 return assemblyManager; 213 } 214 215 218 private DCIInformation 219 getDciinfo() 220 { 221 return dciinfo; 222 } 223 224 227 private HomeFinder 228 getHomefinder() 229 { 230 return homefinder; 231 } 232 233 236 private HomeRegistration 237 getHomeregistration() 238 { 239 return homeregistration; 240 } 241 242 245 private NamingContextExt 246 getNamingcontext() 247 { 248 return namingcontext; 249 } 250 251 254 private ServerSocket 255 getServerSocket() 256 { 257 return serverSocket; 258 } 259 260 263 private ZipEntryRetriever 264 getZipEntryRetriever() 265 { 266 return zipEntryRetriever; 267 } 268 269 272 public DeploymentLogger 273 getDeploymentLogger() 274 { 275 return deploymentLogger; 276 } 277 278 281 public void 282 connectDeploymentLogger(DeploymentLogger logger) 283 { 284 deploymentLogger = logger; 285 } 286 287 290 public DestinationDeployerFactory 291 getDestinationDeployerFactory() 292 { 293 return destinationDeployerFactory; 294 } 295 296 299 public ErrorManager 300 getErrorManager() 301 { 302 return errorManager; 303 } 304 305 308 public void 309 connectDestinationDeployerFactory(DestinationDeployerFactory factory) 310 { 311 destinationDeployerFactory = factory; 312 } 313 314 317 public void connectErrorManager(ErrorManager manager) { 318 errorManager = manager; 319 } 320 321 } 322 | Popular Tags |