1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 27 28 import org.objectweb.openccm.descriptor.componentassembly.Homeinterface; 29 import org.objectweb.openccm.descriptor.componentassembly.beans.HomeinterfaceBean; 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.installer.HomeplacementDeployer; 33 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FindbyDeployer; 34 35 43 public class HomeinterfaceDeployerContext 44 extends ChildDeployerContext 45 { 46 private HomeinterfaceBean homeinterface; 52 private FindbyDeployer findbyDeployer; 53 private HomeplacementDeployer homeplacementDeployer; 54 72 public FindbyDeployer 73 getFindbyDeployer() 74 { 75 return findbyDeployer; 76 } 77 78 81 public Homeinterface 82 getHomeinterface() 83 { 84 return homeinterface; 85 } 86 87 90 public void 91 connectFindbyDeployer(FindbyDeployer deployer) 92 { 93 findbyDeployer = deployer; 94 } 95 96 99 public void 100 connectHomeinterface(HomeinterfaceBean homeinterface) 101 { 102 this.homeinterface = homeinterface; 103 connectDeployerDescription(homeinterface); 104 } 105 106 109 public HomeplacementDeployer 110 getHomeplacementDeployer() 111 { 112 return homeplacementDeployer; 113 } 114 115 118 public void 119 connectHomeplacementDeployer(HomeplacementDeployer deployer) 120 { 121 homeplacementDeployer = deployer; 122 } 123 124 131 public void 132 initialize() 133 throws InitializationError 134 { 135 if(getHomeinterface()==null) 136 getErrorManager() 137 .submitException(new InitializationError(this,"Connection on homeinterface bean is required"+ 138 "check the handler code it must specify this connection")); 139 140 if(getHomeinterface().getHomeplacementref()!=null&&( 141 getHomeinterface().getHomeplacementref().getIdref()==null || 142 getHomeinterface().getHomeplacementref().getIdref().length()==0)) 143 getErrorManager() 144 .submitException(new InitializationError(this,"The idref attribute of the homeplacementref element"+ 145 "must be fullfilled, check the homeinterface element"+ 146 "description\n."+getStringifiedDeployerDescription())); 147 if(getHomeinterface().getHomeplacementref()==null&&getFindbyDeployer()==null) 148 getErrorManager() 149 .submitException(new InitializationError(this,"One of homeplacementref/findby children must be"+ 150 "specified check the homeinterface element"+ 151 "description\n."+getStringifiedDeployerDescription())); 152 getLifeCycleManager().stepEndedSuccessFully(); 153 } 154 155 156 157 158 } 159 | Popular Tags |