ozone core API

org.ozoneDB.core.DbRemote
Class ProxyObjectGate

java.lang.Object
  extended byorg.ozoneDB.core.DbRemote.ProxyObjectGate

public class ProxyObjectGate
extends java.lang.Object

A gate for Proxy objects. Every Proxy which leaves the Database should wander through a ProxyObjectGate to be registered (so that the objects referenced by such a Proxy are known to be referenced and thus reachable). Every Proxy which left the Database, was registered and is now known to be unreachable should sign itself off exactly one time.

Author:
Medium.net

Field Summary
protected  GarbageCollector garbageCollectorToBeNotifiedOfExportedReferences
           
protected  java.util.HashMap objectsReferencesByClient
          This is a Mapping from ObjectID to Integer.
protected static java.lang.Integer one
          This is an Integer which represents the number "1".
 
Constructor Summary
protected ProxyObjectGate()
          Creates a new ProxyObjectGate.
 
Method Summary
 void addObjectReferencedByClient(org.ozoneDB.OzoneProxy proxy)
           
protected  void removeObjectReferencedByClient(ObjectID id)
           
protected  void removeObjectReferencedByClient(org.ozoneDB.OzoneProxy proxy)
           
 void startFilterDatabaseObjectReferencesExports(GarbageCollector garbageCollector)
          Starts filtering references to database objects (OzoneProxys) which are exported to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectsReferencesByClient

protected java.util.HashMap objectsReferencesByClient
This is a Mapping from ObjectID to Integer. It represents the count of references this client holds to the database object represented by the objectID. Entries have to be added when returning OzoneProxys directly or indirectly. Entries have to be removed if a {#link OzoneProxy} is finalize()d on the client side. This way, the ozoneDB always know which objects are referenced and thus have to be considered reachable, even if they were not reachable internally.


garbageCollectorToBeNotifiedOfExportedReferences

protected GarbageCollector garbageCollectorToBeNotifiedOfExportedReferences

one

protected static final java.lang.Integer one
This is an Integer which represents the number "1".

Constructor Detail

ProxyObjectGate

protected ProxyObjectGate()
Creates a new ProxyObjectGate.

Method Detail

addObjectReferencedByClient

public void addObjectReferencedByClient(org.ozoneDB.OzoneProxy proxy)

removeObjectReferencedByClient

protected void removeObjectReferencedByClient(org.ozoneDB.OzoneProxy proxy)

removeObjectReferencedByClient

protected void removeObjectReferencedByClient(ObjectID id)

startFilterDatabaseObjectReferencesExports

public void startFilterDatabaseObjectReferencesExports(GarbageCollector garbageCollector)
Starts filtering references to database objects (OzoneProxys) which are exported to the client. Every reference which is exported will be notified to the given GarbageCollector. Additionally, references which are known to be used by the client are notified to the given GarbageCollector within this call.


ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.