예제 #1
0
 def __init__(self, id, acc):
     self.id = id
     self.acc = acc
     self.methods = []
     ThreadSafeFinalizer.add_finalizer(
         id,
         ref(self, lambda wr, i=self.id, a=self.acc: deleted(a, i)))
 def __init__(self, id, acc):
     self.id = id
     self.acc = acc
     self.methods = []
     ThreadSafeFinalizer.add_finalizer(
         id,
         ref(self, lambda wr, i=self.id, a=self.acc: deleted(a, i)))
예제 #3
0
파일: java_gateway.py 프로젝트: gdw2/py4j
    def __init__(self, target_id, gateway_client):
        """
        :param target_id: the identifier of the object on the JVM side. Given
         by the JVM.

        :param gateway_client: the gateway client used to communicate with
         the JVM.
        """
#        print(target_id + ' created.')
        self._target_id = target_id
        self._gateway_client = gateway_client
        self._auto_field = gateway_client.gateway_property.auto_field
        self._methods = {}

        key = smart_decode(self._gateway_client.address) +\
              smart_decode(self._gateway_client.port) +\
              self._target_id

        value = weakref.ref(self, lambda wr, cc=self._gateway_client,
                id=self._target_id: _garbage_collect_object(cc, id))

        ThreadSafeFinalizer.add_finalizer(key, value)
예제 #4
0
    def __init__(self, target_id, gateway_client):
        """
        :param target_id: the identifier of the object on the JVM side. Given
         by the JVM.

        :param gateway_client: the gateway client used to communicate with
         the JVM.
        """
#        print(target_id + ' created.')
        self._target_id = target_id
        self._gateway_client = gateway_client
        self._auto_field = gateway_client.gateway_property.auto_field
        self._methods = {}

        key = smart_decode(self._gateway_client.address) +\
              smart_decode(self._gateway_client.port) +\
              self._target_id

        value = weakref.ref(self, lambda wr, cc=self._gateway_client,
                id=self._target_id: _garbage_collect_object(cc, id))

        ThreadSafeFinalizer.add_finalizer(key, value)