1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.registrar; 27 28 import org.objectweb.openccm.descriptor.componentassembly.Registerwithhomefinder; 29 import org.objectweb.openccm.descriptor.componentassembly.beans.RegisterwithhomefinderBean; 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.ccm.DescriptorDeployerInterface; 33 import org.omg.Components.HomeRegistration; 34 35 42 public class RegisterwithhomefinderDeployerContext 43 extends ChildDeployerContext 44 { 45 private RegisterwithhomefinderBean registerwithhomefinder; 51 private DescriptorDeployerInterface descriptorDeployer; 52 70 public Registerwithhomefinder 71 getRegisterwithhomefinder() 72 { 73 return registerwithhomefinder; 74 } 75 76 79 public void 80 connectRegisterwithhomefinder(RegisterwithhomefinderBean registerwithhomefinder) 81 { 82 this.registerwithhomefinder = registerwithhomefinder; 83 connectDeployerDescription(registerwithhomefinder); 84 } 85 86 89 public DescriptorDeployerInterface getDescriptorDeployer() { 90 return descriptorDeployer; 91 } 92 93 96 public void connectDescriptorDeployer(DescriptorDeployerInterface interface1) { 97 descriptorDeployer = interface1; 98 } 99 100 public HomeRegistration 101 getHomeregistration() 102 { 103 return getRootDeployerContext().getHomeRegistration(); 104 } 105 106 113 public void initialize() throws InitializationError{ 114 if(getRegisterwithhomefinder()==null) 115 getErrorManager() 116 .submitException(new InitializationError(this,"Connection on registerwithhomefinder bean is required"+ 117 "check the handler code it must specify this connection")); 118 119 if(getRegisterwithhomefinder().getName()==null|| 120 getRegisterwithhomefinder().getName().length()==0) 121 getErrorManager() 122 .submitException( new InitializationError(this,"The name attribute of the registerwithhomefinder element"+ 123 "must be fullfilled, check its "+ 124 "description\n."+getStringifiedDeployerDescription())); 125 if(getHomeregistration()==null) 126 getErrorManager() 127 .submitException(new InitializationError(this,"Connection on the current HomeFinder is required to make"+ 128 "make homefinder registration change your findby description if"+ 129 "if you cannot start it.\n"+getStringifiedDeployerDescription())); 130 getLifeCycleManager().stepEndedSuccessFully(); 131 } 132 133 134 } 135 | Popular Tags |