1 21 22 package org.jacorb.notification.container; 23 24 import org.omg.CORBA.ORB ; 25 import org.omg.CORBA.Repository ; 26 import org.omg.CORBA.RepositoryHelper; 27 import org.omg.CORBA.ORBPackage.InvalidName ; 28 import org.picocontainer.PicoContainer; 29 import org.picocontainer.PicoInitializationException; 30 import org.picocontainer.PicoIntrospectionException; 31 import org.picocontainer.defaults.AbstractComponentAdapter; 32 33 37 public class RepositoryComponentAdapter extends AbstractComponentAdapter 38 { 39 private static final long serialVersionUID = 1L; 40 41 public RepositoryComponentAdapter() 42 { 43 super(Repository .class, Repository .class); 44 } 45 46 public Object getComponentInstance(PicoContainer container) throws PicoInitializationException, PicoIntrospectionException 47 { 48 try 49 { 50 ORB orb = (ORB ) container.getComponentInstance(ORB .class); 51 52 Repository repository = RepositoryHelper.narrow(orb.resolve_initial_references("InterfaceRepository")); 53 54 return repository; 55 } catch (InvalidName e) 56 { 57 throw new PicoInitializationException("could not resolve RootPOA", e); 58 } 59 } 60 61 62 public void verify(PicoContainer container) throws PicoIntrospectionException 63 { 64 } 66 } 67 | Popular Tags |