Package javax.resource.spi

Examples of javax.resource.spi.UnavailableException


        // get an instance of MDB
        EasyBeansMDB easyBeansMDB = null;
        try {
            easyBeansMDB = getPool().get();
        } catch (PoolException e) {
            throw new UnavailableException("Cannot get instance in the pool", e);
        }

        // Build a wrapper around this mdb instance
        MDBListenerEndpointInvocationHandler handler = new MDBListenerEndpointInvocationHandler(this, easyBeansMDB,
                this.listenerInterface);
View Full Code Here


      throw e;
    } catch (InvocationTargetException e) {
      if (e.getCause() instanceof RuntimeException)
        throw (RuntimeException) e.getCause();
      if (e.getCause() != null)
        throw new UnavailableException(e.getCause());
      else
        throw new UnavailableException(e);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    public Object createInstance(boolean ignoreInstanceCount) throws UnavailableException {
        if (!ignoreInstanceCount) {
            synchronized (this) {
                // check the instance limit
                if (instanceLimit > 0 && instanceCount >= instanceLimit) {
                    throw new UnavailableException("Only " + instanceLimit + " instances can be created");
                }
                // increment the instance count
                instanceCount++;
            }
        }
View Full Code Here

            if (e instanceof java.lang.reflect.InvocationTargetException) {
                e = ((java.lang.reflect.InvocationTargetException) e).getTargetException();
            }
            String message = "The bean instance threw a system exception:" + e;
            MdbInstanceFactory.logger.error(message, e);
            throw new UnavailableException(message, e);
        } finally {
            ThreadContext.exit(oldContext);
        }
    }
View Full Code Here

        public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
            try {
                return new JmsEndpoint(connectionFactory);
            } catch (JMSException e) {
                e.printStackTrace();
                throw new UnavailableException(e);
            }
        }
View Full Code Here

    @Override
    protected Object doInvoke(Object proxy, Method method, Object[] args) throws Throwable {
        // Are we still usable?
        if (released.get())
            throw new UnavailableException("Message endpoint " + this + " has already been released");

        // TODO: check for concurrent invocation

        if (method.getDeclaringClass().equals(MessageEndpoint.class))
            return handle(method, args);
View Full Code Here

    public Object createInstance(boolean ignoreInstanceCount) throws UnavailableException {
        if (!ignoreInstanceCount) {
            synchronized (this) {
                // check the instance limit
                if (instanceLimit > 0 && instanceCount >= instanceLimit) {
                    throw new UnavailableException("Only " + instanceLimit + " instances can be created");
                }
                // increment the instance count
                instanceCount++;
            }
        }
View Full Code Here

            if (e instanceof java.lang.reflect.InvocationTargetException) {
                e = ((java.lang.reflect.InvocationTargetException) e).getTargetException();
            }
            String message = "The bean instance threw a system exception:" + e;
            MdbInstanceFactory.logger.error(message, e);
            throw new UnavailableException(message, e);
        } finally {
            ThreadContext.exit(oldContext);
        }
    }
View Full Code Here

        }

        if (messageEndpoint != null) {
            return messageEndpoint;
        } else {
            throw new UnavailableException("Unable to create end point within the specified timeout " + timeout);
        }
    }
View Full Code Here

        public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
            try {
                return new JmsEndpoint(connectionFactory);
            } catch (JMSException e) {
                e.printStackTrace();
                throw new UnavailableException(e);
            }
        }
View Full Code Here

TOP

Related Classes of javax.resource.spi.UnavailableException

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.