1 26 27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 28 29 import org.objectweb.openccm.descriptor.componentassembly.beans.ConnecteventBean; 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.componentassembly.ccm.deployer.util.FindbyDeployer; 33 34 42 43 public class ConnecteventDeployerContext 44 extends ChildDeployerContext 45 { 46 private ConnecteventBean connectevent; 52 private FindbyDeployer findbyDeployer; 53 private ConsumesportDeployer consumesportDeployer; 54 private EmitsportDeployer emitsportDeployer; 55 private PublishesportDeployer publishesportDeployer; 56 private ExistinginterfaceDeployer existinginterfaceDeployer; 57 58 74 77 public ConnecteventBean 78 getConnectevent() 79 { 80 return connectevent; 81 } 82 83 86 public ConsumesportDeployer 87 getConsumesportDeployer() 88 { 89 return consumesportDeployer; 90 } 91 92 95 public EmitsportDeployer 96 getEmitsportDeployer() 97 { 98 return emitsportDeployer; 99 } 100 101 104 public ExistinginterfaceDeployer 105 getExistinginterfaceDeployer() 106 { 107 return existinginterfaceDeployer; 108 } 109 110 113 public FindbyDeployer 114 getFindbyDeployer() 115 { 116 return findbyDeployer; 117 } 118 119 122 public PublishesportDeployer 123 getPublishesportDeployer() 124 { 125 return publishesportDeployer; 126 } 127 128 131 public void 132 connectConnectevent(ConnecteventBean connectevent) 133 { 134 this.connectevent = connectevent; 135 connectDeployerDescription(connectevent); 136 } 137 138 141 public void 142 connectConsumesportDeployer(ConsumesportDeployer deployer) 143 { 144 consumesportDeployer = deployer; 145 } 146 147 150 public void 151 connectEmitsportDeployer(EmitsportDeployer deployer) 152 { 153 emitsportDeployer = deployer; 154 } 155 156 159 public void 160 connectExistinginterfaceDeployer(ExistinginterfaceDeployer deployer) 161 { 162 existinginterfaceDeployer = deployer; 163 } 164 165 168 public void 169 connectFindbyDeployer(FindbyDeployer deployer) 170 { 171 findbyDeployer = deployer; 172 } 173 174 177 public void 178 connectPublishesportDeployer(PublishesportDeployer deployer) 179 { 180 publishesportDeployer = deployer; 181 } 182 183 190 public void 191 initialize() 192 throws InitializationError 193 { 194 if(getConnectevent()==null) 195 getErrorManager() 196 .submitException(new InitializationError(this,"Connection on connectevent bean is required "+ 197 "check the handler code it must specify this connection")); 198 199 200 if(getPublishesportDeployer()==null&&getEmitsportDeployer()==null){ 201 getErrorManager() 202 .submitException(new InitializationError(this,"One of publishesport/emitsport child must be specified in "+ 203 "connectevent element check you connectevent element "+ 204 "description.\n"+getStringifiedDeployerDescription())); 205 } 206 207 if(getConsumesportDeployer()==null&&getExistinginterfaceDeployer()==null){ 208 getErrorManager() 209 .submitException(new InitializationError(this,"One of consumesport/existinginterface child must be specified in "+ 210 "connectevent element check you connectevent element "+ 211 "description.\n"+getStringifiedDeployerDescription())); 212 } 213 214 getLifeCycleManager().stepEndedSuccessFully(); 215 } 216 } 217 | Popular Tags |