1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 27 28 import org.objectweb.openccm.descriptor.componentassembly.Componentsupportedinterface; 29 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentsupportedinterfaceBean; 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 ComponentsupportedinterfaceDeployerContext 44 extends ChildDeployerContext { 45 private ComponentsupportedinterfaceBean componentsupportedinterface; 51 private FindbyDeployer findbyDeployer; 52 private ComponentinstantiationDeployer componentinstantiationDeployer; 53 69 72 public Componentsupportedinterface 73 getComponentsupportedinterface() 74 { 75 return componentsupportedinterface; 76 } 77 78 81 public FindbyDeployer 82 getFindbyDeployer() 83 { 84 return findbyDeployer; 85 } 86 87 90 public void 91 connectComponentsupportedinterface 92 (ComponentsupportedinterfaceBean componentsupportedinterface) 93 { 94 this.componentsupportedinterface = componentsupportedinterface; 95 connectDeployerDescription(componentsupportedinterface); 96 } 97 98 101 public void 102 connectFindbyDeployer(FindbyDeployer deployer) 103 { 104 findbyDeployer = deployer; 105 } 106 107 110 public ComponentinstantiationDeployer 111 getComponentinstantiationDeployer() 112 { 113 return componentinstantiationDeployer; 114 } 115 116 119 public void 120 connectComponentinstantiationDeployer(ComponentinstantiationDeployer deployer) 121 { 122 componentinstantiationDeployer = deployer; 123 } 124 125 132 public void 133 initialize() 134 throws InitializationError 135 { 136 if (getComponentsupportedinterface() == null) 137 getErrorManager().submitException( 138 new InitializationError( 139 this, 140 "Connection on componentsupportedinterface is required" 141 + "check the handler code it must specify this connection")); 142 143 if (getComponentsupportedinterface().getComponentinstantiationref() 144 == null 145 && getFindbyDeployer() == null) 146 getErrorManager().submitException( 147 new InitializationError( 148 this, 149 "At least one of componentinstantiationref/findby child" 150 + "must be specified in componentsupportedinterface element," 151 + "check you componentfiles element description.\n" 152 + getStringifiedDeployerDescription())); 153 getLifeCycleManager().stepEndedSuccessFully(); 154 } 155 156 } 157 | Popular Tags |