📄 localclienttracker.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Core License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: $package org.ozoneDB.core;import java.util.WeakHashMap;import java.util.Iterator;import org.ozoneDB.core.DbRemote.DbLocalClient;/** Tracks local database clients. This is necessary for tracking references from these clients into the database.*/public class LocalClientTracker { /** The WeakHashMaps where local clients are keys. If the local clients are not referenced by any other object, they will vanish here as well soon or later. */ protected WeakHashMap localClients; /** The value for all entries of {@link #localClients} */ protected final static Object value = new Object(); public LocalClientTracker() { localClients = new WeakHashMap(); } /** Adds a client to this local client tracker. */ public void addClient(DbLocalClient client) { synchronized (localClients) { localClients.put(client,value); } } /** Starts filtering references to database objects ({@link org.ozoneDB.OzoneProxy}s) which are exported to clients at all client connections. Every reference which is exported will be notified to the given GarbageCollector. Additionally, references which are known to be used by clients are notified to the given GarbageCollector within this call. */ public void startFilterDatabaseObjectReferencesExports(GarbageCollector garbageCollector) { synchronized (localClients) { Iterator i = localClients.keySet().iterator(); /* What do we if just during iteration a client disappears? Will a ConcurrentModificationException be thrown? If so how do we handle such an Exception? Should we restart the iteration? */ while (i.hasNext()) { ((DbLocalClient) i.next()).getProxyObjectGate().startFilterDatabaseObjectReferencesExports(garbageCollector); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -