1 25 26 package org.objectweb.carol.jndi.enc.java; 27 28 import java.util.Hashtable ; 29 30 import javax.naming.Context ; 31 import javax.naming.Name ; 32 import javax.naming.spi.ObjectFactory ; 33 34 import org.objectweb.carol.util.configuration.TraceCarol; 35 36 41 public class javaURLContextFactory implements ObjectFactory { 42 43 55 public Object getObjectInstance(Object url, Name name, Context ctx, Hashtable env) throws Exception { 56 if (TraceCarol.isDebugjndiEncCarol()) { 57 TraceCarol.debugjndiEncCarol("url = '" + url + "'."); 58 } 59 60 if (url == null) { 61 return new JavaURLContext(env); 65 } 66 if (url instanceof String ) { 67 if (TraceCarol.isDebugjndiEncCarol()) { 69 TraceCarol.debugjndiEncCarol("javaURLContextFactory.getObjectInstance(" + url + ")"); 70 } 71 return null; 72 } else if (url instanceof String []) { 73 if (TraceCarol.isDebugjndiEncCarol()) { 75 TraceCarol.debugjndiEncCarol("javaURLContextFactory.getObjectInstance(String[])"); 76 } 77 return null; 78 } else { 79 throw (new IllegalArgumentException ("javaURLContextFactory")); 81 } 82 } 83 } | Popular Tags |