001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  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    /**
022     * Manages kernel proxies.  Note that all proxies will include an
023     * implementation of GeronimoManagedBean.
024     *
025     * @see org.apache.geronimo.kernel.proxy.GeronimoManagedBean
026     *
027     * @version $Rev: 476457 $ $Date: 2006-11-18 01:49:20 -0500 (Sat, 18 Nov 2006) $
028     */
029    public interface ProxyManager {
030    
031    
032        /**
033         * Creates a proxy factory for GBeans which will implement the specified types.  The proxy class will be created
034         * within the specified class loader.  All of the specified types must be visible from the class loader.
035         *
036         * @param types the type of the proxies this factory should create
037         * @param classLoader the class loader in which the proxy class will be registered
038         * @return the proxy factory
039         */
040        ProxyFactory createProxyFactory(Class[] types, ClassLoader classLoader);
041    
042        public Object createProxy(AbstractName target, ClassLoader loader);
043    
044        public Object createProxy(AbstractName target, Class type);
045    
046        /**
047         * Cleans up and resources associated with the proxy
048         * @param proxy the proxy to destroy
049         */
050        public void destroyProxy(Object proxy);
051    
052        /**
053         * Is the specified object a proxy
054         * @param object the object to determin if it is a proxy
055         * @return true if the object is a proxy
056         */
057        public boolean isProxy(Object object);
058    
059        /**
060         * Get the object name of the specified proxy
061         * TODO convert to abstractName
062         * @param proxy the proxy to get the target object name from
063         * @return the object name of the target
064         */
065        public AbstractName getProxyTarget(Object proxy);
066    }