1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer; 27 28 29 import java.util.LinkedList ; 30 import org.objectweb.openccm.descriptor.componentassembly.Componentplacement; 31 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentplacementBean; 32 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.*; 33 34 42 public class ComponentplacementDeployerContext 43 extends ChildDeployerContext 44 { 45 private ExistinghomeDeployer existinghome; 51 private ComponentplacementBean componentPlacement; 52 private LinkedList componentInstantiations; 53 public ComponentplacementDeployerContext(){ 59 this.componentInstantiations=new LinkedList (); 60 } 61 72 73 74 public void 75 connectComponentplacement(ComponentplacementBean componentPlacement) 76 { 77 this.componentPlacement=componentPlacement; 78 connectDeployerDescription(componentPlacement); 79 } 80 81 public Componentplacement 82 getComponentplacement() 83 { 84 return componentPlacement; 85 } 86 87 public void 88 connectExistinghomeDeployer(ExistinghomeDeployer existinghome) 89 { 90 this.existinghome=existinghome; 91 } 92 93 public ExistinghomeDeployer 94 getExistinghomeDeployer() 95 { 96 return existinghome; 97 } 98 99 public void 100 connectComponentinstantiationDeployer 101 (ComponentinstantiationDeployer componentInstantiation) 102 { 103 this.componentInstantiations.addLast(componentInstantiation); 104 } 105 106 public ComponentinstantiationDeployer[] 107 getComponentinstantiationDeployer() 108 { 109 return (ComponentinstantiationDeployer []) 110 componentInstantiations.toArray 111 (new ComponentinstantiationDeployer[componentInstantiations.size()]); 112 } 113 120 public void 121 initialize() 122 throws InitializationError 123 { 124 if(getComponentplacement()==null) 125 getErrorManager() 126 .submitException( new InitializationError(this,"Connection on componentplacement bean is required"+ 127 "check the handler code it must specify this connection")); 128 129 if(getComponentinstantiationDeployer().length==0){ 130 getErrorManager() 131 .submitException(new InitializationError(this,"At least one componentinstantiation must be specified in"+ 132 "componentplacement element check you componentplacement element"+ 133 "description.\n"+getStringifiedDeployerDescription())); 134 } 135 136 if(getExistinghomeDeployer()==null) 137 getErrorManager() 138 .submitException(new InitializationError(this,"The existinghome element must be specified in"+ 139 "componentplacement element check you componentplacement element"+ 140 "description."+getStringifiedDeployerDescription())); 141 getLifeCycleManager().stepEndedSuccessFully(); 142 } 143 144 } 145 146 | Popular Tags |