Package javax.resource.spi.endpoint

Examples of javax.resource.spi.endpoint.MessageEndpoint


        }       
    }

    protected void postDeliveryHook(MessageListener listener, ActiveMQMessage message) {
        if (listener instanceof MessageEndpoint) {
            MessageEndpoint endpoint = (MessageEndpoint) listener;
            try {
                endpoint.afterDelivery();
            } catch (ResourceException e) {
                log.warn(e.toString(), e);
            }
        }       
    }
View Full Code Here


                     return;
                  }
               }
            }

            MessageEndpoint endToUse = endpoint;
            try
            {
               // to avoid a NPE that would happen while the RA is in tearDown
               if (endToUse != null)
               {
                  endToUse.afterDelivery();
               }
            }
            catch (ResourceException e1)
            {
               HornetQRALogger.LOGGER.unableToCallAfterDelivery(e1);
View Full Code Here

        this.targetJndiName = targetJndiName;
    }
   
    @Override
    public Object getServiceObject(Exchange context) {
        MessageEndpoint ep = null;
        MessageEndpoint epFromMessage = null;
       
        if (context != null) {
            epFromMessage = context.getInMessage().getContent(MessageEndpoint.class);
        }
        
View Full Code Here

    /**
     * Performs the work
     */
    public void run() {
        MDBInvoker invoker = createInvoker();
        MessageEndpoint mep = invoker.getMessageEndpoint();
        if (mep == null) {
            return;           
        }
       
        ClassLoader savedClassLoader = null;

        try {
            savedClassLoader = Thread.currentThread().getContextClassLoader();
            ClassLoader classLoader = mep.getClass().getClassLoader();
            Thread.currentThread().setContextClassLoader(classLoader);
            activate(invoker, classLoader);
        } finally {
            invoker.releaseEndpoint(mep);
            if (savedClassLoader != null) {
View Full Code Here

                                                          jmsConfig));
            }
           
            BusFactory.setThreadDefaultBus(bus);

            MessageEndpoint ep = JCATransactionalMessageListenerContainer.ENDPOINT_LOCAL.get();
            if (ep != null) {
                inMessage.setContent(MessageEndpoint.class, ep);
                JCATransactionalMessageListenerContainer.ENDPOINT_LOCAL.remove();
            }
           
View Full Code Here

   
    @Override
    protected boolean receiveAndExecute(Session session, MessageConsumer consumer)
        throws JMSException {
        boolean messageReceived = false;
        MessageEndpoint ep = null;
        MessageConsumer mc = null;
        XASession xa = null;
        Session s = null;

        try {       
            xa = (XASession)createSession(getSharedConnection());
            XAResource xar = xa.getXAResource();
            s = xa.getSession();
            mc = s.createConsumer(getDestination());           
            ep = factory.createEndpoint(xar);
            ENDPOINT_LOCAL.set(ep);
            ep.beforeDelivery(method);  
            messageReceived = doReceiveAndExecute(s, mc, null);
            ep.afterDelivery();
        } catch (Exception ex) {
            throw new JMSException(ex.getMessage());
        } finally {
            ep.release();
            JmsUtils.closeMessageConsumer(mc);
            JmsUtils.closeSession(xa);
            JmsUtils.closeSession(s);
        }
View Full Code Here

    /**
     * Performs the work
     */
    public void run() {
        // get message driven bean proxy
        MessageEndpoint endpoint = getMesssageEndpoint();
        if (endpoint == null) {
            // error has been logged.
            return;
        }
   
        // get class loader
        ClassLoader classLoader = endpoint.getClass().getClassLoader();
        ClassLoader savedClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(classLoader);
            activate(endpoint, classLoader);
        } finally {
View Full Code Here

    /**
     * Invokes endpoint factory to create message endpoint (event driven bean).
     * It will retry if the event driven bean is not yet available.
     */
    private MessageEndpoint getMesssageEndpoint() {
        MessageEndpoint answer = null;
        for (int i = 0; i < MAX_ATTEMPTS; i++) {
           
            if (released) {
                LOG.warning("CXF service activation has been stopped.");
                return null;
View Full Code Here

        public void endpointDeactivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) {
            EmailAccountInfo accountInfo = (EmailAccountInfo) activationSpec;

            EmailConsumer emailConsumer = consumers.remove(accountInfo.getAddress());
            MessageEndpoint endpoint = (MessageEndpoint) emailConsumer;
            endpoint.release();
        }
View Full Code Here

            EmailConsumer emailConsumer = consumers.get(to);

            if (emailConsumer == null) throw new Exception("No such account");

            MessageEndpoint endpoint = (MessageEndpoint) emailConsumer;

            endpoint.beforeDelivery(EmailConsumer.class.getMethod("receiveEmail", Properties.class, String.class));
            emailConsumer.receiveEmail(headers, body);
            endpoint.afterDelivery();
        }
View Full Code Here

TOP

Related Classes of javax.resource.spi.endpoint.MessageEndpoint

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.