1 17 package org.apache.geronimo.naming.reference; 18 19 import javax.management.ObjectName ; 20 21 import org.apache.geronimo.kernel.Kernel; 22 import org.apache.geronimo.kernel.proxy.ProxyManager; 23 24 27 public class GBeanProxyReference extends SimpleAwareReference { 28 private final ObjectName target; 29 private final Class type; 30 31 public GBeanProxyReference(ObjectName target, Class type) { 32 this.target = target; 33 this.type = type; 34 } 35 36 public String getClassName() { 37 return type.getName(); 38 } 39 40 public Object getContent() throws IllegalStateException { 41 Kernel kernel = getKernel(); 42 ProxyManager proxyManager = kernel.getProxyManager(); 44 return proxyManager.createProxy(target, type); 45 } 46 } 47 | Popular Tags |