IT. Expert System.

Android Reference

Proxy


java.lang.reflect

Class Proxy

  • All Implemented Interfaces:
    Serializable


    public class Proxy
    extends Object
    implements Serializable
    Proxy defines methods for creating dynamic proxy classes and instances. A proxy class implements a declared set of interfaces and delegates method invocations to an InvocationHandler.
    Since:
    1.3
    See Also:
    InvocationHandler, Serialized Form
    • Field Detail

      • h

        protected InvocationHandler h
        The invocation handler on which the method calls are dispatched.
    • Constructor Detail

      • Proxy

        protected Proxy(InvocationHandler h)
        Constructs a new Proxy instance with the specified invocation handler.
        Parameters:
        h - the invocation handler for the newly created proxy
    • Method Detail

      • getProxyClass

        public static Class<?> getProxyClass(ClassLoader loader,
                             Class<?>... interfaces)
                                      throws IllegalArgumentException
        Returns the dynamically built Class for the specified interfaces. Creates a new Class when necessary. The order of the interfaces is relevant. Invocations of this method with the same interfaces but different order result in different generated classes. The interfaces must be visible from the supplied class loader; no duplicates are permitted. All non-public interfaces must be defined in the same package.
        Parameters:
        loader - the class loader that will define the proxy class
        interfaces - an array of Class objects, each one identifying an interface that will be implemented by the returned proxy class
        Returns:
        a proxy class that implements all of the interfaces referred to in the contents of interfaces
        Throws:
        IllegalArgumentException - if any of the interface restrictions are violated
        NullPointerException - if either interfaces or any of its elements are null
      • newProxyInstance

        public static Object newProxyInstance(ClassLoader loader,
                              Class<?>[] interfaces,
                              InvocationHandler h)
                                       throws IllegalArgumentException
        Returns an instance of the dynamically built class for the specified interfaces. Method invocations on the returned instance are forwarded to the specified invocation handler. The interfaces must be visible from the supplied class loader; no duplicates are permitted. All non-public interfaces must be defined in the same package.
        Parameters:
        loader - the class loader that will define the proxy class
        interfaces - an array of Class objects, each one identifying an interface that will be implemented by the returned proxy object
        h - the invocation handler that handles the dispatched method invocations
        Returns:
        a new proxy object that delegates to the handler h
        Throws:
        IllegalArgumentException - if any of the interface restrictions are violated
        NullPointerException - if the interfaces or any of its elements are null
      • isProxyClass

        public static boolean isProxyClass(Class<?> cl)
        Indicates whether or not the specified class is a dynamically generated proxy class.
        Parameters:
        cl - the class
        Returns:
        true if the class is a proxy class, false otherwise
        Throws:
        NullPointerException - if the class is null
      • getInvocationHandler

        public static InvocationHandler getInvocationHandler(Object proxy)
                                                      throws IllegalArgumentException
        Returns the invocation handler of the specified proxy instance.
        Parameters:
        proxy - the proxy instance
        Returns:
        the invocation handler of the specified proxy instance
        Throws:
        IllegalArgumentException - if the supplied proxy is not a proxy object


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1983 / . Delta: 0.02479 с