1 28 package org.objectweb.carol.jtests.conform.basic.server; 29 30 import java.util.Hashtable ; 31 32 import javax.naming.Context ; 33 import javax.naming.Name ; 34 import javax.naming.RefAddr ; 35 import javax.naming.Reference ; 36 import javax.naming.spi.ObjectFactory ; 37 38 43 public class BasicObjectRefFactory implements ObjectFactory { 44 45 48 public BasicObjectRefFactory() { 49 } 50 51 67 public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws Exception { 68 if (obj instanceof Reference ) { 69 Reference ref = (Reference ) obj; 70 if (ref.getClassName().equals(BasicObjectRef.class.getName())) { 71 RefAddr addr = ref.get("content"); 72 if (addr != null) { 73 return new BasicObjectRef((String ) addr.getContent()); 74 } 75 } 76 } 77 return null; 78 } 79 80 } | Popular Tags |