1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer; 27 28 import java.util.LinkedList ; 29 30 import org.objectweb.openccm.descriptor.componentassembly.Partitioning; 31 import org.objectweb.openccm.descriptor.componentassembly.beans.PartitioningBean; 32 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.ChildDeployerContext; 33 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError; 34 35 44 public class PartitioningDeployerContext extends ChildDeployerContext { 45 private LinkedList homeplacement; 51 private LinkedList componentplacement; 52 private LinkedList hostcollocation; 53 private LinkedList processcollocation; 54 private PartitioningBean partitioning; 55 public PartitioningDeployerContext() { 61 homeplacement = new LinkedList (); 62 componentplacement = new LinkedList (); 63 hostcollocation = new LinkedList (); 64 processcollocation = new LinkedList (); 65 } 66 public void 77 connectHomeplacementDeployer(HomeplacementDeployer homeplacement) 78 { 79 this.homeplacement.addLast(homeplacement); 80 } 81 public HomeplacementDeployer[] 82 getHomeplacementDeployers() 83 { 84 return (HomeplacementDeployer[]) this.homeplacement.toArray( 85 new HomeplacementDeployer[homeplacement.size()]); 86 } 87 88 public void 89 connectComponentplacementDeployer(ComponentplacementDeployer componentplacement) 90 { 91 this.componentplacement.addLast(componentplacement); 92 } 93 94 public ComponentplacementDeployer[] 95 getComponentplacementDeployers() 96 { 97 return (ComponentplacementDeployer[]) this.componentplacement.toArray( 98 new ComponentplacementDeployer[componentplacement.size()]); 99 } 100 101 public void 102 connectHostcollocationDeployer(HostcollocationDeployer hostcollocation) 103 { 104 this.hostcollocation.addLast(hostcollocation); 105 } 106 107 public HostcollocationDeployer[] 108 getHostcollocationDeployers() 109 { 110 return (HostcollocationDeployer[]) this.hostcollocation.toArray( 111 new HostcollocationDeployer[hostcollocation.size()]); 112 } 113 114 public void 115 connectProcesscollocationDeployer(ProcesscollocationDeployer processcollocation) 116 { 117 this.processcollocation.addLast(processcollocation); 118 } 119 120 public ProcesscollocationDeployer[] 121 getProcesscollocationDeployers() 122 { 123 return (ProcesscollocationDeployer[]) this.processcollocation.toArray( 124 new ProcesscollocationDeployer[processcollocation.size()]); 125 } 126 129 public Partitioning 130 getPartitioning() 131 { 132 return partitioning; 133 } 134 135 138 public void 139 connectPartitioning(PartitioningBean partitioning) 140 { 141 this.partitioning = partitioning; 142 connectDeployerDescription(partitioning); 143 } 144 151 public void 152 initialize() 153 throws InitializationError 154 { 155 if (getPartitioning() == null) 156 getErrorManager().submitException( 157 new InitializationError( 158 this, 159 "Connection on partitioning bean is required" 160 + "check the handler code it must specify this connection")); 161 if (getHomeplacementDeployers().length == 0 162 && getComponentplacementDeployers().length == 0 163 && getHostcollocationDeployers().length == 0 164 && getProcesscollocationDeployers().length == 0) 165 getErrorManager().submitException( 166 new InitializationError( 167 this, 168 "At least one of homeplacement/hostcollocation/processcollocation/" 169 + "componentplacement/hostcollation children must be specified " 170 + "check the partitioning element" 171 + "description\n." 172 + getStringifiedDeployerDescription())); 173 getLifeCycleManager().stepEndedSuccessFully(); 174 } 175 176 177 } 178 | Popular Tags |