1 package org.sapia.ubik.rmi.naming.remote.proxy; 2 3 import javax.naming.Binding ; 4 import javax.naming.Name ; 5 import javax.naming.NamingEnumeration ; 6 import javax.naming.NamingException ; 7 8 import org.sapia.archie.jndi.proxy.EnumProxy; 9 import org.sapia.ubik.rmi.naming.remote.RemoteContext; 10 11 12 20 public class LocalNamingEnum extends EnumProxy { 21 private String _url; 22 23 public LocalNamingEnum(String url, Name ctxName, NamingEnumeration en) { 24 super(ctxName, en); 25 _url = url; 26 } 27 28 public Object onNextElement(Name contextName, Object next) 29 throws NamingException { 30 if (next instanceof Binding && 31 ((Binding ) next).getObject() instanceof RemoteContext) { 32 Binding b = (Binding ) next; 33 b.setObject(new LocalContext(_url, (RemoteContext) b.getObject())); 34 35 return b; 36 } else if (next instanceof RemoteContext) { 37 return new LocalContext(_url, (RemoteContext) next); 38 } else { 39 return next; 40 } 41 } 42 } 43 | Popular Tags |