001 /**
002 *
003 * Copyright 2004 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.geronimo.kernel.proxy;
018
019 import org.apache.geronimo.gbean.AbstractName;
020
021 import javax.management.ObjectName;
022 import javax.management.MalformedObjectNameException;
023
024 /**
025 * Manages kernel proxies. Note that all proxies will include an
026 * implementation of GeronimoManagedBean.
027 *
028 * @see org.apache.geronimo.kernel.proxy.GeronimoManagedBean
029 *
030 * @version $Rev: 396405 $ $Date: 2006-04-23 20:53:26 -0700 (Sun, 23 Apr 2006) $
031 */
032 public interface ProxyManager {
033
034
035 /**
036 * Creates a proxy factory for GBeans which will implement the specified types. The proxy class will be created
037 * within the specified class loader. All of the specified types must be visible from the class loader.
038 *
039 * @param types the type of the proxies this factory should create
040 * @param classLoader the class loader in which the proxy class will be registered
041 * @return the proxy factory
042 */
043 ProxyFactory createProxyFactory(Class[] types, ClassLoader classLoader);
044
045 public Object createProxy(AbstractName target, ClassLoader loader);
046
047 public Object createProxy(AbstractName target, Class type);
048
049 /**
050 * Cleans up and resources associated with the proxy
051 * @param proxy the proxy to destroy
052 */
053 public void destroyProxy(Object proxy);
054
055 /**
056 * Is the specified object a proxy
057 * @param object the object to determin if it is a proxy
058 * @return true if the object is a proxy
059 */
060 public boolean isProxy(Object object);
061
062 /**
063 * Get the object name of the specified proxy
064 * TODO convert to abstractName
065 * @param proxy the proxy to get the target object name from
066 * @return the object name of the target
067 */
068 public AbstractName getProxyTarget(Object proxy);
069 }