':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.'

def __init__(self, target_id, gateway_client):

    self._target_id = target_id
    self._gateway_client = gateway_client
    self._auto_field = gateway_client.gateway_property.auto_field
    self._methods = {}
    self._field_names = set()
    self._fully_populated = False
    self._gateway_doc = None
    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)
