1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 27 28 import org.objectweb.openccm.descriptor.componentassembly.Usesport; 29 import org.objectweb.openccm.descriptor.componentassembly.beans.UsesportBean; 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.ComponentinstantiationDeployer; 33 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FindbyDeployer; 34 35 43 public class UsesportDeployerContext 44 extends ChildDeployerContext 45 { 46 private UsesportBean usesport; 52 private FindbyDeployer findbyDeployer; 53 private ComponentinstantiationDeployer componentinstantiationDeployer; 54 70 73 public FindbyDeployer 74 getFindbyDeployer() 75 { 76 return findbyDeployer; 77 } 78 79 82 public Usesport 83 getUsesport() 84 { 85 return usesport; 86 } 87 88 91 public void 92 connectFindbyDeployer(FindbyDeployer deployer) 93 { 94 findbyDeployer = deployer; 95 } 96 97 100 public void 101 connectUsesport(UsesportBean usesport) 102 { 103 this.usesport = usesport; 104 connectDeployerDescription(usesport); 105 } 106 109 public ComponentinstantiationDeployer 110 getComponentinstantiationDeployer() 111 { 112 return componentinstantiationDeployer; 113 } 114 115 118 public void 119 connectComponentinstantiationDeployer(ComponentinstantiationDeployer deployer) 120 { 121 componentinstantiationDeployer = deployer; 122 } 123 130 public void initialize() throws InitializationError{ 131 if(getUsesport()==null) 132 getErrorManager() 133 .submitException( new InitializationError(this,"Connection on usesport bean is required"+ 134 "check the handler code it must specify this connection")); 135 136 if(getUsesport().getComponentinstantiationref()!=null&&( 137 getUsesport().getComponentinstantiationref().getIdref()==null || 138 getUsesport().getComponentinstantiationref().getIdref().length()==0)) 139 getErrorManager() 140 .submitException( new InitializationError(this,"The idref attribute of the componentinstantiationref element"+ 141 "must be fullfilled, check theUsesport element"+ 142 "description\n."+getStringifiedDeployerDescription())); 143 if(getUsesport().getComponentinstantiationref()==null&&getFindbyDeployer()==null) 144 getErrorManager() 145 .submitException( new InitializationError(this,"One of componentinstantiationref/findby children must be"+ 146 "specified check the Usesport element"+ 147 "description\n."+getStringifiedDeployerDescription())); 148 getLifeCycleManager().stepEndedSuccessFully(); 149 } 150 151 152 } 153 | Popular Tags |