Package javax.ejb

Examples of javax.ejb.NoSuchEJBException


            if (e instanceof InvocationTargetException) {
                e = ((InvocationTargetException) e).getTargetException();
            }
            final String t = "The bean instance " + beanContext.getDeploymentID() + " threw a system exception:" + e;
            logger.error(t, e);
            throw new ApplicationException(new NoSuchEJBException("Singleton failed to initialize").initCause(e));
        }
    }
View Full Code Here


    @Override
    @SuppressWarnings({"unchecked"})
    public synchronized <S> S getBusinessObject(Class<S> businessInterfaceType) {
        if (isRemoved()) {
            throw new NoSuchEJBException("Bean has been removed");
        }
        if (viewServices.containsKey(businessInterfaceType.getName())) {
            final ServiceController<?> serviceController = CurrentServiceContainer.getServiceContainer().getRequiredService(viewServices.get(businessInterfaceType.getName()));
            final ComponentView view = (ComponentView) serviceController.getValue();
            return (S) view.createInstance(Collections.<Object, Object>singletonMap(SessionID.SESSION_ID_KEY, id)).getInstance();
View Full Code Here

         entry = (StatefulBeanContext) cacheMap.get(key);
      }
     
      if (entry == null)
      {
         throw new NoSuchEJBException("Could not find Stateful bean: " + key);
      }     
     
      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

         localActivity.set(active);
      }

      if (entry == null)
      {
         throw new NoSuchEJBException("Could not find stateful bean: " + key);
      }
      else if (markInUse && entry.isRemoved())
      {
         throw new NoSuchEJBException("Could not find stateful bean: " + key +
                                      " (bean was marked as removed)");
      }

      entry.postReplicate();
View Full Code Here

      if (entry == null)
      {
         entry = (StatefulBeanContext) 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

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

            // since it's just activated it couldn't have been in use as well.
            if(entry != null)
               entry.state = EntryState.READY;
         }
         if(entry == null)
            throw new NoSuchEJBException(String.valueOf(key));
         return entry.obj;
      }
   }
View Full Code Here

         entry = cache.remove(key);
         if(entry == null)
         {
            entry = activate(key);
            if(entry == null)
               throw new NoSuchEJBException(String.valueOf(key));
            // The entry was not in use, so it must be ready
            entry.state = EntryState.READY;
         }
         if(entry.state != EntryState.READY)
            throw new IllegalStateException("entry " + entry + " is not ready");
View Full Code Here

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

      {
         obj = cache.remove(key);
      }
      // EJBTHREE-1218: throw NoSuchEJBException if the bean can not be found
      if(obj == null)
         throw new NoSuchEJBException(String.valueOf(key));
     
      factory.destroy(obj);
   }
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.