1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer; 27 28 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentfileBeanImpl; 30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.*; 31 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FileinarchiveDeployer; 32 import org.objectweb.openccm.descriptor.softpkg.beans.ImplementationBean; 33 import org.objectweb.openccm.descriptor.softpkg.beans.SoftpkgBeanImpl; 34 import org.objectweb.openccm.descriptor.softpkg.ccm.ImplementationDeployer; 35 import org.objectweb.openccm.descriptor.softpkg.ccm.SoftpkgDeployer; 36 import org.objectweb.openccm.descriptor.softpkg.ccm.SoftpkgDeployerHandler; 37 import org.objectweb.openccm.descriptor.softpkg.ccm.SoftpkgRootDeployerContext; 38 39 47 public class ComponentfileDeployerHandler 48 extends HandlerBase 49 { 50 private ComponentfileDeployer _deploy; 56 78 public Object 79 getInstance(ComponentfileBeanImpl comp) 80 throws InitializationError 81 { 82 if (_deploy == null) { 83 _deploy = new ComponentfileDeployer(); 84 _deploy.connectComponentfile(comp); 85 applyCommonConfig(_deploy); 86 87 if (comp.getFileinarchive() != null) 88 _deploy.connectFileinarchiveDeployer( 89 (FileinarchiveDeployer) getDeployer(comp 90 .getFileinarchive())); 91 92 _deploy.initialize(); 93 94 SoftpkgDeployer softDeployer = 95 (SoftpkgDeployer) getDeployer2(_deploy.getSoftpkg()); 96 _deploy.connectSoftpkgDeployer(softDeployer); 97 98 ImplementationBean[] ib = _deploy.getImplementations(); 99 100 for (int i = 0; i < ib.length; i++) { 101 ImplementationDeployer id = 102 (ImplementationDeployer) getDeployer(ib[i]); 103 _deploy.connectImplementationDeployer(id); 104 } 105 } 106 return (_deploy); 107 } 108 109 public Object getDeployer2(Object obj) 110 throws InitializationError 111 { 112 try{ 113 SoftpkgBeanImpl sbi=(SoftpkgBeanImpl)obj; 114 SoftpkgDeployerHandler tmp = 115 (SoftpkgDeployerHandler) 116 sbi.getExtensionManager() 117 .getExtensionByName(resolveExtention(sbi)); 118 119 SoftpkgRootDeployerContext srdc=new SoftpkgRootDeployerContext(); 120 srdc.connectZipEntryRetriever 121 (_deploy.getFileinarchiveDeployer().getInnerArchive()); 122 123 srdc.connectGlobalDeployerContext(getRootDeployerContext()); 124 tmp.connectRootDeployerContext(srdc); 125 tmp.connectHandlerContext(getHandlerContext()); 126 127 return tmp.getInstance(sbi); 128 } 129 catch(Exception e){ 130 e.printStackTrace(); 131 throw new InitializationError(_deploy,e," Failed during softpkg retrieval"); 132 } 133 } 134 } 135 | Popular Tags |