1 package org.sapia.soto.config; 2 3 import org.sapia.soto.NotFoundException; 4 import org.sapia.soto.SotoContainer; 5 6 import org.sapia.util.xml.confix.ConfigurationException; 7 import org.sapia.util.xml.confix.ObjectCreationCallback; 8 9 10 20 public class ServiceRef implements ObjectCreationCallback { 21 private String _id; 22 private SotoContainer _cont; 23 24 27 public ServiceRef(SotoContainer container) { 28 _cont = container; 29 } 30 31 34 public void setId(String id) { 35 _id = id; 36 } 37 38 41 public Object onCreate() throws ConfigurationException { 42 try { 43 return _cont.lookup(_id); 44 } catch (NotFoundException e) { 45 throw new ConfigurationException("Could not retrieve service", e); 46 } 47 } 48 } 49 | Popular Tags |