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