/** * Returns the value of the head key. The head key points to the next entry to * be removed from the queue. * * @return the value of the head key * @throws CacheException */ private long getHeadKey() throws CacheException { long hKey; // Test whether _headKey = -1. If so, the queue has just been created. // Go into the region to get the value of HEAD_KEY. If it is null, then // this is the first attempt to access this queue. Set the _headKey and // headKey appropriately (to 0). If there is a value in the region, then // this queue has been accessed before and this instance is taking up where // a previous one left off. Set the _headKey to the value in the region. // From now on, this queue will use the value of _headKey in the VM to // determine the headKey. If the _headKey != -1, set the headKey // to the value of the _headKey. initializeKeys(); hKey = this.headKey; if (logger.isTraceEnabled()) { logger.trace("{}: Determined head key: {}", this, hKey); } return hKey; }
/** * Returns the value of the tail key. The tail key points to an empty where * the next queue entry will be stored. * * @return the value of the tail key * @throws CacheException */ private long getTailKey() throws CacheException { long tlKey; // Test whether tailKey = -1. If so, the queue has just been created. // Go into the region to get the value of TAIL_KEY. If it is null, then // this is the first attempt to access this queue. Set the tailKey and // tailKey appropriately (to 0). If there is a value in the region, then // this queue has been accessed before and this instance is taking up where // a previous one left off. Set the tailKey to the value in the region. // From now on, this queue will use the value of tailKey in the VM to // determine the tailKey. If the tailKey != -1, set the tailKey // to the value of the tailKey. initializeKeys(); tlKey = this.tailKey.get(); if (logger.isTraceEnabled()) { logger.trace("{}: Determined tail key: {}", this, tlKey); } return tlKey; }
/** * Returns the value of the tail key. The tail key points to an empty where * the next queue entry will be stored. * * @return the value of the tail key * @throws CacheException */ private long getTailKey() throws CacheException { long tlKey; // Test whether tailKey = -1. If so, the queue has just been created. // Go into the region to get the value of TAIL_KEY. If it is null, then // this is the first attempt to access this queue. Set the tailKey and // tailKey appropriately (to 0). If there is a value in the region, then // this queue has been accessed before and this instance is taking up where // a previous one left off. Set the tailKey to the value in the region. // From now on, this queue will use the value of tailKey in the VM to // determine the tailKey. If the tailKey != -1, set the tailKey // to the value of the tailKey. initializeKeys(); tlKey = this.tailKey.get(); if (this.logger.finerEnabled()) { this.logger.finer(this + ": Determined tail key: " + tlKey); } return tlKey; }
/** * Returns the value of the head key. The head key points to the next entry to * be removed from the queue. * * @return the value of the head key * @throws CacheException */ private long getHeadKey() throws CacheException { long hKey; // Test whether _headKey = -1. If so, the queue has just been created. // Go into the region to get the value of HEAD_KEY. If it is null, then // this is the first attempt to access this queue. Set the _headKey and // headKey appropriately (to 0). If there is a value in the region, then // this queue has been accessed before and this instance is taking up where // a previous one left off. Set the _headKey to the value in the region. // From now on, this queue will use the value of _headKey in the VM to // determine the headKey. If the _headKey != -1, set the headKey // to the value of the _headKey. initializeKeys(); hKey = this.headKey; if (this.logger.finerEnabled()) { this.logger.finer(this + ": Determined head key: " + hKey); } return hKey; }