1 26 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.binder; 27 28 import org.objectweb.openccm.descriptor.componentassembly.beans.ComponentinstantiationrefBeanImpl; 29 import org.objectweb.openccm.descriptor.componentassembly.beans.ConsumesportBeanImpl; 30 import org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.base.HandlerBase; 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 ConsumesportDeployerHandler 44 extends HandlerBase 45 { 46 private ConsumesportDeployer _deploy; 52 53 69 77 public Object 78 getInstance(ConsumesportBeanImpl cons) 79 throws InitializationError 80 { 81 if(_deploy==null){ 82 _deploy=new ConsumesportDeployer(); 83 _deploy.connectConsumesport(cons); 84 applyCommonConfig(_deploy); 85 if(cons.getFindby()!=null){ 86 _deploy.connectFindbyDeployer((FindbyDeployer)getDeployer(cons.getFindby())); 87 88 } 89 if(cons.getComponentinstantiationref()!=null&& 90 cons.getComponentinstantiationref().getIdref()!=null) 91 { 92 try{ 93 if(((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()) 94 .pullIdref()==null) 95 throw new InitializationError(_deploy,"Bad componentinstantiationref idref was specified "+ 96 cons.getComponentinstantiationref().getIdref()+ 97 " check your CAD file "+_deploy.getStringifiedDeployerDescription()); 98 99 _deploy.connectComponentinstantiationDeployer( 100 (ComponentinstantiationDeployer) 101 getDeployer( 102 ((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()) 103 .pullIdref())); 104 } 105 catch(java.lang.ClassCastException e){ 106 String classFound=((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()) 107 .pullIdref().getClass().getName(); 108 throw new InitializationError(_deploy,"Similar identifiants was detected, it was expected that \""+ 109 cons.getComponentinstantiationref().getIdref()+"\" id of <consumesport> element"+ 110 " denote a <componentinstantiation> element:\n" 111 +getStringifiedDescription(cons) 112 +"\n but a <" 113 +classFound.substring(classFound.lastIndexOf('.')+1,classFound.lastIndexOf("BeanImpl")) 114 +"> element was found:\n " 115 +getStringifiedDescription(((ComponentinstantiationrefBeanImpl)cons.getComponentinstantiationref()).pullIdref()) 116 +"check your CAD file a identifiant is used for two different elements."+ 117 " To achieve successfully the deployment use different names for those two identifiants"); 118 } 119 120 } 121 _deploy.initialize(); 122 } 123 124 return (_deploy); 125 } 126 127 128 } 129 | Popular Tags |