HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/root/lib/fm-agent/dependencies/linux/python3.9/jpype/__pycache__/_jproxy.cpython-39.pyc
a

��i��@stddlZddgZdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�dd�Zdd�ZGdd�de	�Z
Gdd�dej�ZdS)�N�JProxy�JImplementscCsZ|D]P}|j��D]@}|��d@dkr(qt|���|vrtd|j��|��f��qqdS)Nirz6Interface '%s' requires method '%s' to be implemented.)�class_Z
getMethodsZgetModifiers�str�getName�NotImplementedError)�
interfaces�	overridesZ	interface�method�r�?/usr/lib/fm-agent/dependencies/linux/python3.9/jpype/_jproxy.py�_checkInterfaceOverridess�r
c	CsLi}|j��D]8\}}zt�|d�}||f||<WqtyDYq0q|S)NZ
__joverride__)�__dict__�items�object�__getattribute__�AttributeError)�clsr	�k�v�attrrrr�_classOverrides%srcCst|�}t|�}t||�|S�N)�_convertInterfacesrr
)r�intf�
actualIntfr	rrr�_prepareInterfaces1s
rcs.��fdd�}d|i}td�j�tjf|�S)z� (internal) Create a proxy from a Python class with
    @JOverride notation on methods evaluated at first
    instantiation.
    cs4t|dd�}|dur$t���}||_tj�|d|�S)N�__jpype_interfaces__)�getattrrr�_jpype�_JProxy�__new__)�tp�args�kwargsr�rrrr�new>s

z"_createJProxyDeferred.<locals>.newr!�proxy.%s)�type�__name__rr �rrr&�membersrr%r�_createJProxyDeferred9s	r,cs6t||���fdd�}d|i}td|j|tjf|�S)zu (internal) Create a proxy from a Python class with
    @JOverride notation on methods evaluated at declaration.
    cs,tj�|d��}|j|g|�Ri|��|Sr)rr r!�__init__)r"r#r$�self�rrrr&Rsz_createJProxy.<locals>.newr!r')rr(r)rr r*rr/r�
_createJProxyLs
r0F)�deferredcs&|r��fdd�}n��fdd�}|S)a Annotation for creating a new proxy that implements one or more
    Java interfaces.

    This annotation is placed on an ordinary Python class.  The annotation
    requires a list of interfaces.  It must implement all of the java
    methods for each of the interfaces.  Each implemented method
    should have a @JOverride annotation.  The JVM must be running in
    order to validate the class.

    Args:
      interfaces (str*,JClass*): Strings or JClasses for each Java interface
        this proxy is to implement.

    Kwargs:
      deferred (bool):
        Whether to defer validation of the interfaces and overrides until
        the first instance instantiation (True) or validate at declaration
        (False). Deferred validation allows a proxy class to be declared prior
        to starting the JVM.  Validation only occurs once per proxy class,
        thus there is no performance penalty.  Default False.

    Example:

      .. code-block:: python

          @JImplement("java.lang.Runnable")
          class MyImpl(object):
             @JOverride
             def run(self, arg):
               pass

          @JImplement("org.my.Interface1", "org.my.Interface2")
          class MyImpl(object):
             @JOverride
             def method(self, arg):
               pass

    cst|g��Ri���Sr)r,�r�rr$rr�
JProxyCreator�sz"JImplements.<locals>.JProxyCreatorcst|g��Ri���Sr)r0r2r3rrr4�sr)r1rr$r4rr3rr\s'cCs�g}|D].}t|t�s t|d�s,|�|�q|�|�qt�}|D]*}t|t�rb|�t�|��qB|�|�qB|szt	d��|D]<}t|tj�s�t	dt
|�j��t|tj
�s~t	d|j��q~t|�S)zf (internal) Convert a list of interface names into
    a list of interfaces suitable for a proxy.
    �__iter__z-At least one Java interface must be specifiedz'%s' is not a Java interface)�
isinstancer�hasattr�append�extend�set�addrZJClass�	TypeErrorr(r)�
issubclassZ
JInterface�tuple)rZintflist�itemrrrrrr�s(
�rc@seZdZdd�Zdd�ZdS)�
_JFromDictcCs
||_dSr)�dict)r.rArrrr-�sz_JFromDict.__init__cCs2zt�|d�|WSty$Yn0td��dS)NrAzattribute not found)rr�KeyErrorr)r.�namerrrr�s
z_JFromDict.__getattribute__N)r)�
__module__�__qualname__r-rrrrrr@�sr@c@s&eZdZdZddd�Zedd��ZdS)	raD Define a proxy for a Java interface.

    This is an older style JPype proxy interface that uses either a
    dictionary or an object instance to implement methods defined
    in java.  The python object can be held by java and its lifespan
    will continue as long as java holds a reference to the object
    instance.  New code should use ``@JImplements`` annotation as
    it will support improved type safety and error handling.

    Name lookups can either made using a dictionary or an object
    instance.  One of these two options must be specified.

    Args:
        intf: either a single interface or a list of java interfaces.
            The interfaces can either be defined by strings or
            JClass instance.  Only interfaces may be used in a
            proxy,
        dict (dict[string, callable], optional): specifies a dictionary
            containing the methods to be called when executing the
            java interface methods.
        inst (object, optional): specifies an object with methods
            whose names matches the java interfaces methods.
    NFcCsbt|g�}|dur"|dur"td��|dur<t�t|�||�S|durVtj�||||�Std��dS)Nz!Specify only one of dict and instz a dict or inst must be specified)rr<rr r@r!)rrrA�inst�convertrrrrr!�s
zJProxy.__new__cCst|tj�s|S|jSr)r6rr �__javainst__)�objrrr�unwrap�sz
JProxy.unwrap)NNF)r)rDrE�__doc__r!�staticmethodrJrrrrr�s
)
r�__all__r
rrr,r0rrrr@r rrrrr�<module>s0$