1 /** 2 * 3 * Copyright 2004 The Apache Software Foundation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.geronimo.kernel.proxy; 18 19 import org.apache.geronimo.gbean.AbstractName; 20 21 import javax.management.ObjectName; 22 import javax.management.MalformedObjectNameException; 23 24 /** 25 * Manages kernel proxies. Note that all proxies will include an 26 * implementation of GeronimoManagedBean. 27 * 28 * @see org.apache.geronimo.kernel.proxy.GeronimoManagedBean 29 * 30 * @version $Rev: 396405 $ $Date: 2006-04-23 20:53:26 -0700 (Sun, 23 Apr 2006) $ 31 */ 32 public interface ProxyManager { 33 34 35 /** 36 * Creates a proxy factory for GBeans which will implement the specified types. The proxy class will be created 37 * within the specified class loader. All of the specified types must be visible from the class loader. 38 * 39 * @param types the type of the proxies this factory should create 40 * @param classLoader the class loader in which the proxy class will be registered 41 * @return the proxy factory 42 */ 43 ProxyFactory createProxyFactory(Class[] types, ClassLoader classLoader); 44 45 public Object createProxy(AbstractName target, ClassLoader loader); 46 47 public Object createProxy(AbstractName target, Class type); 48 49 /** 50 * Cleans up and resources associated with the proxy 51 * @param proxy the proxy to destroy 52 */ 53 public void destroyProxy(Object proxy); 54 55 /** 56 * Is the specified object a proxy 57 * @param object the object to determin if it is a proxy 58 * @return true if the object is a proxy 59 */ 60 public boolean isProxy(Object object); 61 62 /** 63 * Get the object name of the specified proxy 64 * TODO convert to abstractName 65 * @param proxy the proxy to get the target object name from 66 * @return the object name of the target 67 */ 68 public AbstractName getProxyTarget(Object proxy); 69 }