1 26 package org.objectweb.openccm.descriptor.softpkg.ccm; 27 28 import java.util.LinkedList ; 29 30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.ChildDeployerContext; 31 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError; 32 import org.objectweb.openccm.descriptor.softpkg.beans.ImplementationBean; 33 34 42 public class ImplementationDeployerContext 43 extends ChildDeployerContext 44 { 45 private ImplementationBean implementation; 51 private LinkedList codeDeployers; 52 private LinkedList dependencyDeployers; 53 private LinkedList descriptorDeployers; 54 public ImplementationDeployerContext(){ 60 codeDeployers=new LinkedList (); 61 dependencyDeployers=new LinkedList (); 62 descriptorDeployers=new LinkedList (); 63 } 64 public void 75 connectDependencyDeployer(DependencyDeployer dep) 76 { 77 dependencyDeployers.addLast(dep); 78 } 79 80 public DependencyDeployer [] 81 getDependencyDeployers() 82 { 83 return (DependencyDeployer[])dependencyDeployers.toArray(new DependencyDeployer[dependencyDeployers.size()]); 84 } 85 86 public void 87 connectCodeDeployer(CodeDeployer codeDeployer) 88 { 89 codeDeployers.addLast(codeDeployer); 90 } 91 92 public CodeDeployer [] 93 getCodeDeployers() 94 { 95 return (CodeDeployer[])codeDeployers.toArray(new CodeDeployer[codeDeployers.size()]); 96 } 97 98 101 public ImplementationBean 102 getImplementation() 103 { 104 return implementation; 105 } 106 107 110 public void 111 connectImplementation(ImplementationBean bean) 112 { 113 implementation = bean; 114 connectDeployerDescription(bean); 115 } 116 117 public void 118 connectDescriptorDeployer(DescriptorDeployerInterface descriptorDeployer) 119 { 120 descriptorDeployers.addLast(descriptorDeployer); 121 } 122 123 public DescriptorDeployerInterface [] 124 getDescriptorDeployers() 125 { 126 return 127 (DescriptorDeployerInterface[]) 128 descriptorDeployers 129 .toArray(new DescriptorDeployerInterface[descriptorDeployers.size()]); 130 131 } 132 133 140 public void initialize() throws InitializationError { 141 if(getImplementation()==null) 143 getErrorManager() 144 .submitException(new InitializationError(this,"Connection on implementation bean is required"+ 145 "check the handler code it must specify this connection")); 146 getLifeCycleManager().stepEndedSuccessFully(); 147 } 148 149 150 151 } 152 | Popular Tags |