1 26 27 package org.objectweb.openccm.descriptor.componentassembly.ccm.deployer.util; 28 29 import org.objectweb.openccm.descriptor.componentassembly.*; 31 import org.omg.Components.HomeNotFound; 32 33 40 public class FindbyDeployer 41 extends FindbyDeployerContext 42 { 43 49 55 61 62 71 private org.omg.Components.CCMHome 72 proceedWithHomeFinder(Homefinder hf) 73 throws CannotResolveReferenceException 74 { 75 try{ 76 77 return getHomeFinder().find_home_by_name(hf.getName()); 78 } 79 catch(HomeNotFound hnf) 80 { 81 throw new CannotResolveReferenceException(this,hnf,"Resolution failed using home finder "); 82 } 83 } 84 85 86 95 private org.omg.CORBA.Object 96 proceedWithNameService(Namingservice service) 97 throws CannotResolveReferenceException 98 { 99 100 try{ 101 102 return getNamingContextExt() 103 .resolve(getNamingContextExt().to_name(service.getName())); 104 } 105 catch(Exception e){ 106 throw new CannotResolveReferenceException(this,e,"Resolution failed using name service.\n"); 107 } 108 109 } 110 111 112 122 public org.omg.CORBA.Object 123 resolveReference() 124 throws CannotResolveReferenceException 125 { 126 Findby fb=getFindby(); 127 if(fb!=null ) { 129 if(fb.getNamingservice()!=null) 130 return proceedWithNameService(fb.getNamingservice()); 131 else if(fb.getStringifiedobjectref()!=null) 132 return org.objectweb.openccm.corba.TheORBSingleton.getORB(). 133 string_to_object(fb.getStringifiedobjectref().getValue()); 134 else if(fb.getHomefinder()!=null) 135 return proceedWithHomeFinder(fb.getHomefinder()); 136 } 137 throw new CannotResolveReferenceException(this,null,"No resolution way precised"); 138 } 139 140 141 } 142 | Popular Tags |