1 26 27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 28 29 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentinstantiationrefBeanImpl; 30 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentsupportedinterfaceBeanImpl; 31 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.HandlerBase; 32 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.InitializationError; 33 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.installer.ComponentinstantiationDeployer; 34 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util.FindbyDeployer; 35 36 44 public class ComponentsupportedinterfaceDeployerHandler 45 extends HandlerBase 46 { 47 53 private ComponentsupportedinterfaceDeployer _deploy; 55 78 public Object 79 getInstance(ComponentsupportedinterfaceBeanImpl cons) 80 throws InitializationError 81 { 82 if (_deploy == null) { 83 _deploy = new ComponentsupportedinterfaceDeployer(); 84 _deploy.connectComponentsupportedinterface(cons); 85 applyCommonConfig(_deploy); 86 if (cons.getFindby() != null) { 87 _deploy.connectFindbyDeployer( 88 (FindbyDeployer) getDeployer(cons.getFindby())); 89 } 90 if (cons.getComponentinstantiationref() != null 91 && cons.getComponentinstantiationref().getIdref() != null) { 92 try { 93 94 _deploy.connectComponentinstantiationDeployer( 95 (ComponentinstantiationDeployer) getDeployer( 96 ((ComponentinstantiationrefBeanImpl) cons 97 .getComponentinstantiationref()) 98 .pullIdref())); 99 } catch (java.lang.ClassCastException e) { 100 String classFound=((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()) 101 .pullIdref().getClass().getName(); 102 throw new InitializationError(_deploy,"Similar identifiants was detected, it was expected that \""+ 103 cons.getComponentinstantiationref().getIdref()+"\" id of <componentsupportedinterface> element"+ 104 " denote a <componentinstantiation> element:\n" 105 +getStringifiedDescription(cons) 106 +"\n but a <" 107 +classFound.substring(classFound.lastIndexOf('.')+1,classFound.lastIndexOf("BeanImpl")) 108 +"> element was found:\n " 109 +getStringifiedDescription(((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()).pullIdref()) 110 +"check your CAD file a identifiant is used for two different elements."+ 111 " To achieve successfully the deployment use different names for those two identifiants"); 112 113 } 114 } 115 _deploy.initialize(); 116 } 117 118 return (_deploy); 119 } 120 121 } 122 | Popular Tags |