jaroslav@1646: /* jaroslav@1646: * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. jaroslav@1646: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jaroslav@1646: * jaroslav@1646: * This code is free software; you can redistribute it and/or modify it jaroslav@1646: * under the terms of the GNU General Public License version 2 only, as jaroslav@1646: * published by the Free Software Foundation. Oracle designates this jaroslav@1646: * particular file as subject to the "Classpath" exception as provided jaroslav@1646: * by Oracle in the LICENSE file that accompanied this code. jaroslav@1646: * jaroslav@1646: * This code is distributed in the hope that it will be useful, but WITHOUT jaroslav@1646: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jaroslav@1646: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jaroslav@1646: * version 2 for more details (a copy is included in the LICENSE file that jaroslav@1646: * accompanied this code). jaroslav@1646: * jaroslav@1646: * You should have received a copy of the GNU General Public License version jaroslav@1646: * 2 along with this work; if not, write to the Free Software Foundation, jaroslav@1646: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jaroslav@1646: * jaroslav@1646: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jaroslav@1646: * or visit www.oracle.com if you need additional information or have any jaroslav@1646: * questions. jaroslav@1646: */ jaroslav@1646: jaroslav@1646: package sun.invoke; jaroslav@1646: jaroslav@1646: import java.lang.invoke.MethodHandle; jaroslav@1646: jaroslav@1646: /** jaroslav@1646: * Private API used inside of java.lang.invoke.MethodHandles. jaroslav@1646: * Interface implemented by every object which is produced by jaroslav@1646: * {@link java.lang.invoke.MethodHandleProxies#asInterfaceInstance MethodHandleProxies.asInterfaceInstance}. jaroslav@1646: * The methods of this interface allow a caller to recover the parameters jaroslav@1646: * to {@code asInstance}. jaroslav@1646: * This allows applications to repeatedly convert between method handles jaroslav@1646: * and SAM objects, without the risk of creating unbounded delegation chains. jaroslav@1646: */ jaroslav@1646: public interface WrapperInstance { jaroslav@1646: /** Produce or recover a target method handle which is behaviorally jaroslav@1646: * equivalent to the SAM method of this object. jaroslav@1646: */ jaroslav@1646: public MethodHandle getWrapperInstanceTarget(); jaroslav@1646: /** Recover the SAM type for which this object was created. jaroslav@1646: */ jaroslav@1646: public Class getWrapperInstanceType(); jaroslav@1646: } jaroslav@1646: