1 23 24 package org.objectweb.fractal.adl; 25 26 import java.util.Map ; 27 28 import org.objectweb.fractal.api.control.BindingController; 29 30 33 34 public abstract class AbstractLoader implements BindingController, Loader { 35 36 40 41 public final static String LOADER_BINDING = "client-loader"; 42 43 46 47 public Loader clientLoader; 48 49 53 public String [] listFc () { 54 return new String [] { LOADER_BINDING }; 55 } 56 57 public Object lookupFc (String s) { 58 if (LOADER_BINDING.equals(s)) { 59 return clientLoader; 60 } 61 return null; 62 } 63 64 public void bindFc (String s, Object o) { 65 if (LOADER_BINDING.equals(s)) { 66 clientLoader = (Loader)o; 67 } 68 } 69 70 public void unbindFc (String s) { 71 if (LOADER_BINDING.equals(s)) { 72 clientLoader = null; 73 } 74 } 75 76 80 protected ClassLoader getClassLoader (final Map context) { 81 ClassLoader loader = null; 82 if (context != null) { 83 loader = (ClassLoader )context.get("classloader"); 84 } 85 if (loader == null) { 86 loader = getClass().getClassLoader(); 87 } 88 return loader; 89 } 90 } 91 92 | Popular Tags |