Package javax.ejb

Examples of javax.ejb.NoSuchEJBException


    protected Object invoke(final Object proxy, final Method method, final Object[] args, final String methodName,
            final Long hashMethod) throws Exception {

        // Bean removed, no methods are allowed
        if (isRemoved()) {
            handleThrowable(convertThrowable(new NoSuchEJBException("The bean has been removed")), false, method, null);
        }

        // Methods on the Object.class are not send on the remote side
        if (method.getDeclaringClass().getName().equals("java.lang.Object")) {
            // for stateful bean, let the first call to toString go to the remote side in order to initialize the bean ID
View Full Code Here


     *         the proxy instance.
     */
    public Object invoke(final Object proxy, final Method method, final Object[] args, final Long hashMethod) throws Exception {
        // bean removed ?
        if (isRemoved()) {
            handleThrowable(convertThrowable(new NoSuchEJBException("The bean has been removed")), false, method, null);
        }

        // Methods on the Object.class are not send on the remote side
        if (method.getDeclaringClass().getName().equals("java.lang.Object")) {
            // for stateful bean, let the first call to toString go to the remote side in order to initialize the bean ID
View Full Code Here

   */
  @Override
  public AbstractContext getContext(Object key, boolean forceLoad)
      throws FinderException
  {
    throw new NoSuchEJBException("no matching object:" + key);
    /*
     * if (key == null) return null;
     *
     * StatefulContext cxt = _sessions.get(key);
     *
 
View Full Code Here

   */
  @Override
  public AbstractContext<X> getContext(Object key, boolean forceLoad)
    throws FinderException
  {
    throw new NoSuchEJBException("no matching object:" + key);
    /*
    if (key == null)
      return null;

    StatefulContext cxt = _sessions.get(key);
View Full Code Here

    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

             * will return NoSuchObjectException instead of NoSuchEJBException             *
             * when it can't obtain an instance.   Actually, the async client
             * is expecting a NoSuchEJBException.  Wrap it here as a workaround.
             */
            if (e instanceof NoSuchObjectException) {
                e = new NoSuchEJBException(e.getMessage(), (Exception) e);
            }

            boolean isExceptionUnchecked = (e instanceof Error) || (e instanceof RuntimeException);

            // throw checked excpetion and EJBException directly.
View Full Code Here

            if (interfaceType.isComponent() && interfaceType.isLocal()){
                throw new NoSuchObjectLocalException("reference is invalid");
            } else if (interfaceType.isComponent() || java.rmi.Remote.class.isAssignableFrom(method.getDeclaringClass())) {
                throw new NoSuchObjectException("reference is invalid");
            } else {
                throw new NoSuchEJBException("reference is invalid");
            }
        }
        if (!(Object.class.equals(method.getDeclaringClass())
                && method.getName().equals("finalize")
                && method.getExceptionTypes().length == 1
View Full Code Here

                return e;
            }
        }
        if (e instanceof NoSuchObjectException) {
            if (!rmiRemote && interfaceType.isBusiness()) {
                return new NoSuchEJBException(e.getMessage()).initCause(getCause(e));
            } else if (interfaceType.isLocal()) {
                return new NoSuchObjectLocalException(e.getMessage()).initCause(getCause(e));
            } else {
                return e;
            }
View Full Code Here

            // At this point we can safely return the singleton
            return singletonFuture.get();

        } catch (InterruptedException e) {
            Thread.interrupted();
            throw new ApplicationException(new NoSuchEJBException("Singleton initialization interrupted").initCause(e));
        } catch (ExecutionException e) {
            Throwable throwable = e.getCause();
            if (throwable instanceof ApplicationException) {
                throw (ApplicationException) throwable;
            }

            throw new ApplicationException(new NoSuchEJBException("Singleton initialization failed").initCause(e.getCause()));
        }
    }
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.