Package com.sun.sgs.app

Examples of com.sun.sgs.app.ResourceUnavailableException


  for (int i = 0; true; i++) {
      Cache.Reservation reserve = cache.getReservation(1);
      try {
    synchronized (lock) {
        if (i >= MAX_CACHE_RETRIES) {
      throw new ResourceUnavailableException(
          "Too many retries");
        }
        ObjectCacheEntry entry = cache.getObjectEntry(oid);
        if (entry == null) {
      /* Fetch for write */
 
View Full Code Here


  long stop = context.getStopTime();
  BindingKey nameKey = BindingKey.get(name);
  BindingValue result;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find cache entry for name or next higher name */
      BindingCacheEntry entry = cache.getCeilingBindingEntry(nameKey);
      Object lock =
    cache.getBindingLock((entry != null) ? entry.key : LAST);
View Full Code Here

  long stop = context.getStopTime();
  BindingKey nameKey = BindingKey.get(name);
  BindingValue result;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find cache entry for name or next higher name */
      BindingCacheEntry entry = cache.getCeilingBindingEntry(nameKey);
      final BindingKey entryKey = (entry != null) ? entry.key : LAST;
      final Object lock = cache.getBindingLock(entryKey);
View Full Code Here

  long stop = context.getStopTime();
  BindingKey nameKey = BindingKey.get(name);
  BindingValue result;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find cache entry for name or next higher name */
      BindingCacheEntry entry = cache.getCeilingBindingEntry(nameKey);
      Object lock =
    cache.getBindingLock((entry != null) ? entry.key : LAST);
View Full Code Here

  long stop = context.getStopTime();
  BindingKey nameKey = BindingKey.getAllowFirst(name);
  String result;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find next entry */
      BindingCacheEntry entry = cache.getHigherBindingEntry(nameKey);
      Object lock =
    cache.getBindingLock((entry != null) ? entry.key : LAST);
View Full Code Here

  TxnContext context = contextMap.join(txn);
  long nextNew = context.nextNewObjectId(oid);
  long last = oid;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      NextObjectResults results;
      try {
    results = server.nextObjectId(nodeId, last);
      } catch (IOException e) {
View Full Code Here

      new DataConflict(getNameForAccess(name), conflictNodeId, false));
  assert added;
  BindingKey nameKey = BindingKey.getAllowLast(name);
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find cache entry for name or next higher name */
      BindingCacheEntry entry = cache.getCeilingBindingEntry(nameKey);
      if (entry == null) {
    /* No entry -- already evicted */
 
View Full Code Here

      new DataConflict(getNameForAccess(name), conflictNodeId, true));
  assert added;
  BindingKey nameKey = BindingKey.getAllowLast(name);
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      /* Find cache entry for name or next higher name */
      BindingCacheEntry entry = cache.getCeilingBindingEntry(nameKey);
      if (entry == null) {
    /* No entry -- already evicted */
 
View Full Code Here

       * next key, lock it, and confirm that it is indeed the next key
       * after locking it, repeating as necessary.
       */
      for (int i = 0; true; i++) {
    if (i > MAX_RANGE_LOCK_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    DbTransaction txn = env.beginTransaction(txnTimeout);
    boolean txnDone = false;
    String nextName;
    boolean found;
View Full Code Here

      checkNull("name", name);
      GetBindingForUpdateResults results = null;
      BindingKey key = null;
      for (int i = 0; true; i++) {
    if (i > MAX_RANGE_LOCK_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    DbTransaction txn = env.beginTransaction(txnTimeout);
    boolean txnDone = false;
    String nextName;
    boolean found;
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.ResourceUnavailableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.