Examples of MessageEndpoint


Examples of javax.resource.spi.endpoint.MessageEndpoint

                                                          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

Examples of javax.resource.spi.endpoint.MessageEndpoint

    }
   
    protected boolean receiveAndExecute(Object invoker, 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(invoker, 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

Examples of javax.resource.spi.endpoint.MessageEndpoint

        try {

            JobSpec spec = (JobSpec) activationSpec;

            MessageEndpoint endpoint = messageEndpointFactory.createEndpoint(null);
            spec.setEndpoint(endpoint);

            Job job = (Job) endpoint;

            JobDataMap jobDataMap = spec.getDetail().getJobDataMap();
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

        private static Method method = null;

        public void execute(JobExecutionContext execution) throws JobExecutionException {

            MessageEndpoint endpoint = null;

            try {

                JobDataMap jobDataMap = execution.getJobDetail().getJobDataMap();

                Data data = Data.class.cast(jobDataMap.get(Data.class.getName()));

                Job job = data.job;

                endpoint = (MessageEndpoint) job;

                if (null == method) {
                    method = Job.class.getMethod("execute", JobExecutionContext.class);
                }

                endpoint.beforeDelivery(method);

                job.execute(execution);

            } catch (NoSuchMethodException e) {
                throw new IllegalStateException(e);
            } catch (ResourceException e) {
                throw new JobExecutionException(e);
            } catch (Throwable t) {
                throw new JobExecutionException(new Exception(t));
            } finally {

                if (null != endpoint) {
                    try {
                        endpoint.afterDelivery();
                    } catch (ResourceException e) {
                        throw new JobExecutionException(e);
                    }
                }
            }
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

    private ServerSessionImpl createServerSessionImpl() throws JMSException {
        ActiveMQActivationSpec activationSpec = activeMQAsfEndpointWorker.endpointActivationKey.getActivationSpec();
        int acknowledge = (activeMQAsfEndpointWorker.transacted) ? Session.SESSION_TRANSACTED : activationSpec.getAcknowledgeModeForSession();
        final ActiveMQSession session = (ActiveMQSession)activeMQAsfEndpointWorker.getConnection().createSession(activeMQAsfEndpointWorker.transacted, acknowledge);
        MessageEndpoint endpoint;
        try {
            int batchSize = 0;
            if (activationSpec.getEnableBatchBooleanValue()) {
                batchSize = activationSpec.getMaxMessagesPerBatchIntValue();
            }
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

            return null;
        }
    }

    private MessageEndpoint createEndpoint(LocalAndXATransaction txResourceProxy) throws UnavailableException {
        MessageEndpoint endpoint;
        endpoint = activeMQAsfEndpointWorker.endpointFactory.createEndpoint(txResourceProxy);
        MessageEndpointProxy endpointProxy = new MessageEndpointProxy(endpoint);
        return endpointProxy;
    }
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

                                                          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

Examples of javax.resource.spi.endpoint.MessageEndpoint

      return test.run();
   }
  
   public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
   {
      MessageEndpoint endpoint = endpointFactory.createEndpoint(null);
      endpoints.put(spec, endpoint);
   }
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

      endpoints.put(spec, endpoint);
   }

   public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
   {
      MessageEndpoint endpoint = (MessageEndpoint) endpoints.remove(spec);
      if (endpoint != null)
         endpoint.release();
   }
View Full Code Here

Examples of javax.resource.spi.endpoint.MessageEndpoint

         server.unregisterMBean(mbean);
        
         for (Iterator i = endpoints.entrySet().iterator(); i.hasNext();)
         {
            Map.Entry entry = (Map.Entry) i.next();
            MessageEndpoint endpoint = (MessageEndpoint) entry.getValue();
            if (endpoint != null)
            {
               endpoint.release();
               i.remove();
            }
         }
      }
      catch (Exception ignored)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.