Package com.sun.sgs.app

Examples of com.sun.sgs.app.ResourceUnavailableException


      // check in the EventQueue.offer method.  Is this OK?
      event.serviceEvent(this);
  } else if (eventQueue.offer(event)) {
      notifyServiceEventQueue(eventQueue);
  } else {
      throw new ResourceUnavailableException(
       "not enough resources to add channel event");
  }
    }
View Full Code Here


   */
  if (isLocalSession && eventQueue.isEmpty()) {
      event.serviceEvent(eventQueue);

  } else if (!eventQueue.offer(event)) {
      throw new ResourceUnavailableException(
       "not enough resources to add client session event");

  } else if (isLocalSession) {
      eventQueue.serviceEvent();

View Full Code Here

     eventQueue,
    sessionService,
    sessionService.getHandler(eventQueue.getSessionRefId()));

  } else if (!eventQueue.offer(event)) {
      throw new ResourceUnavailableException(
       "not enough resources to add client session event");

  } else if (!isRelocating()) {
      if (isLocalSession) {
    eventQueue.serviceEvent();
View Full Code Here

    private void addEvent(ChannelEvent event) {

  EventQueue eventQueue = eventQueueRef.get();

  if (!eventQueue.offer(event, this)) {
      throw new ResourceUnavailableException(
       "not enough resources to add channel event");
  }
    }
View Full Code Here

      sessionRef = dm.createReference(session);
  }

  public void validateSession(ClientSession session) {
      if (this.sessionRef == null) {
    throw new ResourceUnavailableException("sessionRef is null");
      } else {
    System.err.println(
        "ValidatingChannelListener.validateSession: session = " +
        session);
    ClientSession thisSession = sessionRef.get();
View Full Code Here

     eventQueue,
    sessionService,
    sessionService.getHandler(eventQueue.getSessionRefId()));

  } else if (!eventQueue.offer(event)) {
      throw new ResourceUnavailableException(
       "not enough resources to add client session event");

  } else if (!isRelocating()) {
      if (isLocalSession) {
    eventQueue.serviceEvent();
View Full Code Here

    AwaitWritableResult awaitWritable(Object lock, long stop) {
  assert Thread.holdsLock(lock);
  for (int i = 0; true; i++) {
      if (i >= CachingDataStore.MAX_CACHE_RETRIES) {
    /* TBD: Add profile counter.  -tjb@sun.com (01/25/2010) */
    throw new ResourceUnavailableException("Too many retries");
      }
      if (checkStatus(Status.WRITABLE)) {
    /* Already cached for write */
    return AwaitWritableResult.WRITABLE;
      } else if (checkStatus(Status.UPGRADING)) {
View Full Code Here

  try {
      long timeout = stop - System.currentTimeMillis();
      if (timeout < 0) {
    throw new TransactionTimeoutException("Transaction timed out");
      } else if (!commitAvailable.tryAcquire(timeout, MILLISECONDS)) {
    throw new ResourceUnavailableException("Update queue full");
      }
  } catch (InterruptedException e) {
      throw new TransactionInterruptedException("Task interrupted", e);
  }
    }
View Full Code Here

     * causes the entry to be evicted, but in the very unlikely
     * case that it happens too many times, throw a resource
     * exception.
     */
    if (i >= MAX_CACHE_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    ObjectCacheEntry entry = cache.getObjectEntry(oid);
    assert entry != null :
        "markForUpdate called for object not in cache: " + oid;
    switch (entry.awaitWritable(lock, stop)) {
View Full Code Here

  long stop = context.getStopTime();
  Object lock = cache.getObjectLock(oid);
  byte[] value;
  for (int i = 0; true; i++) {
      if (i >= MAX_CACHE_RETRIES) {
    throw new ResourceUnavailableException("Too many retries");
      }
      Cache.Reservation reserve = cache.getReservation(1);
      try {
    synchronized (lock) {
        ObjectCacheEntry entry = cache.getObjectEntry(oid);
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.