1 19 20 package org.jacorb.notification.container; 21 22 import org.omg.CORBA.ORB ; 23 import org.omg.CORBA.ORBPackage.InvalidName ; 24 import org.omg.DynamicAny.DynAnyFactory ; 25 import org.omg.DynamicAny.DynAnyFactoryHelper ; 26 import org.picocontainer.PicoContainer; 27 import org.picocontainer.PicoInitializationException; 28 import org.picocontainer.defaults.AbstractComponentAdapter; 29 30 public class DynAnyFactoryComponentAdapter extends AbstractComponentAdapter 31 { 32 private static final long serialVersionUID = 1L; 33 34 public DynAnyFactoryComponentAdapter() 35 { 36 super(DynAnyFactory .class, DynAnyFactory .class); 37 } 38 39 public Object getComponentInstance(PicoContainer container) 40 { 41 try 42 { 43 ORB orb = (ORB ) container.getComponentInstance(ORB .class); 44 45 return DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory")); 46 } catch (InvalidName e) 47 { 48 throw new PicoInitializationException("Could not resolve DynAnyFactory", e); 49 } 50 } 51 52 public void verify(PicoContainer container) 53 { 54 } 56 } | Popular Tags |