1 26 27 28 29 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer; 30 31 import java.io.InputStreamReader ; 33 import org.objectweb.openccm.descriptor.ZipEntryRetriever; 34 import org.objectweb.openccm.descriptor.componentassembly.beans.*; 35 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError; 36 import org.objectweb.openccm.descriptor.softpkg.*; 37 import org.objectweb.openccm.descriptor.softpkg.beans.*; 38 39 47 public class ComponentfileDeployer 48 extends ComponentfileDeployerContext 49 { 50 51 57 58 private String prefix="ComponentFileDeployer >> "; 59 60 66 67 73 74 80 84 public void 85 initializeSoftpkgTree() 86 throws InitializationError 87 { 88 try { 89 ZipEntryRetriever zer = 90 getFileinarchiveDeployer().getInnerArchive(); 91 92 93 String csdname ; 94 if(getFileinarchiveDeployer().getFileinarchive().getName()!=null 95 &&getFileinarchiveDeployer().getFileinarchive().getName().endsWith(".csd")) 96 97 csdname=getFileinarchiveDeployer().getFileinarchive().getName(); 98 else csdname= zer.getZipEntriesEndingBy(".csd")[0]; 99 100 101 104 InputStreamReader reader = 105 new InputStreamReader ( 106 zer.getZipEntryISIgnoringDelimiterType(csdname)); 107 getRootDeployerContext().connectOpenReader(reader); 108 SoftpkgBean soft = SoftpkgBeanImpl.unmarshalBean(reader, true); 109 connectSoftpkg(soft); 110 for (java.util.Iterator i = soft.getImplementationList().iterator(); 112 i.hasNext(); 113 ) { 114 ImplementationBeanImpl ii = (ImplementationBeanImpl) i.next(); 115 if (((Programminglanguage) ii 116 .getProgramminglanguageList() 117 .get(0)) 118 .getName() 119 .equalsIgnoreCase("java")) { 120 connectImplementation(ii); 121 } 122 } 123 124 } catch (Exception e) { 125 throw new InitializationError( 126 this, 127 e, 128 "Fatal error:\n" 129 + prefix 130 + "Cannot open CSD file [" 131 + getFileinarchiveDeployer().getFileinarchive().getName() 132 + "] in the current ComponentAssembly archive.\n" 133 + getStringifiedDeployerDescription()); 134 } 135 136 getLifeCycleManager().stepEndedSuccessFully(); 137 } 138 } 139 | Popular Tags |