Package javax.ejb

Examples of javax.ejb.NoSuchEJBException


    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if (isInvalidReference) {
            if (remote || java.rmi.Remote.class.isAssignableFrom(method.getDeclaringClass())){
                throw new NoSuchObjectException("reference is invalid");
            } else {
                throw new NoSuchEJBException("reference is invalid");
            }
        }

        Object returnObj = null;
        returnObj = _invoke(proxy, method, args);
View Full Code Here


             */
            if (e instanceof NoSuchObjectException) {
                if (java.rmi.Remote.class.isAssignableFrom(method.getDeclaringClass())){
                    return e;
                } else {
                    return new NoSuchEJBException(e.getMessage()).initCause(getCause(e));
                }
            }
            if (e instanceof AccessException) {
                return new AccessLocalException(e.getMessage()).initCause(getCause(e));
            }
View Full Code Here

            if(entry == null)
            {
               entry = pm.activateSession(key);
               if (entry == null)
               {
                  throw new NoSuchEJBException("Could not find stateful bean: " + key);
               }
               --passivatedCount;
              
               // We cache the entry even if we will throw an exception below
               // as we may still need it for its children and XPC references
               if (log.isTraceEnabled())
               {
                  log.trace("Caching activated context " + entry.getId() + " of type " + entry.getClass());
               }
              
               synchronized (cacheMap)
               {
                  cacheMap.put(key, entry);
               }
            }
         }
      }
     
      // Now we know entry isn't null
      if (markInUse)
      {
         if (entry.isRemoved())
         {
            throw new NoSuchEJBException("Could not find stateful bean: " + key +
                                         " (bean was marked as removed");
         }     
     
         entry.setInUse(true);
         entry.lastUsed = System.currentTimeMillis();
View Full Code Here

      // object from the key. Instead, use the get() method
      // which will even activate any sessions which have been
      // passivated (see https://jira.jboss.org/jira/browse/EJBTHREE-2030)
      StatefulBeanContext ctx = this.get(key);
      if(ctx == null)
         throw new NoSuchEJBException("Could not find Stateful bean: " + key);
      if (!ctx.isRemoved())
         container.destroy(ctx);
     
      ++removeCount;
     
View Full Code Here

   {
      synchronized (cache)
      {
         Entry entry = cache.get(key);
         if(entry == null)
            throw new NoSuchEJBException(String.valueOf(key));
         if(entry.state != State.READY)
            throw new IllegalStateException("entry " + entry + " is not ready");
         entry.state = State.IN_USE;
         entry.lastUsed = System.currentTimeMillis();
         return entry.obj;
View Full Code Here

   {
      synchronized (cache)
      {
         Entry entry = cache.get(key);
         if(entry == null)
            throw new NoSuchEJBException(String.valueOf(key));
         return entry.obj;
      }
   }
View Full Code Here

               cache.put(key, entry);
               return entry.obj;
            }
         }
         if(entry == null)
            throw new NoSuchEJBException(String.valueOf(key));
         if(entry.state != EntryState.READY)
            throw new IllegalStateException("entry " + entry + " is not ready");
         entry.state = EntryState.IN_USE;
         entry.lastUsed = System.currentTimeMillis();
         return entry.obj;
View Full Code Here

               cache.put(key, entry);
            }
         }
         entry.state = EntryState.READY;
         if(entry == null)
            throw new NoSuchEJBException(String.valueOf(key));
         return entry.obj;
      }
   }
View Full Code Here

      {
         StatefulBeanContext bean = this.invoker.invoke(this.cache, operation);
  
         if (bean == null)
         {
            throw new NoSuchEJBException("Could not find bean: " + id);
         }
        
         if (!bean.isRemoved())
         {
            this.container.destroy(bean);
View Full Code Here

      this.trace("get(%s, %s)", id, markInUse);
      StatefulBeanContext bean = this.getFromCache(id);
     
      if (bean == null)
      {
         throw new NoSuchEJBException(String.format("Could not find stateful bean: %s", id));
      }
      else if (markInUse && bean.isRemoved())
      {
         throw new NoSuchEJBException(String.format("Could not find stateful bean: %s (bean was marked as removed)", id));
      }
     
      bean.postReplicate();
     
      if (markInUse)
View Full Code Here

TOP

Related Classes of javax.ejb.NoSuchEJBException

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.