Package javax.resource.spi.endpoint

Examples of javax.resource.spi.endpoint.MessageEndpoint


                     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


    }

    private static void process() throws UnavailableException {
        if (endpointFactories.size() == 0)
            return;
        MessageEndpoint endpoint = endpointFactories.get(0).createEndpoint(null);
        try {
            while (!queue.isEmpty()) {
                try {
                    String message = queue.poll(30, SECONDS);
                    try {
                        ((PostmanPat) endpoint).deliver(message);
                    } catch (Throwable t) {
                        t.printStackTrace();
                        // ignore
                    }
                } catch (InterruptedException e) {
                    return;
                }
            }
        } finally {
            endpoint.release();
        }
    }
View Full Code Here

      log.debug("endpointActivation, spec="+spec);
      QuartzActivationSpec quartzSpec = (QuartzActivationSpec) spec;

      // allocate instance of endpoint to figure out its endpoint interface
      Class clazz = QuartzJob.class;
      MessageEndpoint tmpMe = endpointFactory.createEndpoint(null);
      if (tmpMe instanceof StatefulJob) clazz = StatefulQuartzJob.class;
      tmpMe.release();

      try
      {
         JobDetail jobDetail = new JobDetail(quartzSpec.getJobName(), quartzSpec.getJobGroup(), clazz, true, false, false);
         jobDetail.getJobDataMap().setAllowsTransientData(true);
View Full Code Here

   {
   }

   public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException
   {
      MessageEndpoint endpoint = null;
      try
      {
         MessageEndpointFactory endpointFactory = (MessageEndpointFactory)jobExecutionContext.getJobDetail().getJobDataMap().get("endpointFactory");
         endpoint = endpointFactory.createEndpoint(null);
         if (endpoint != null)
         {
            Job job = (Job) endpoint;
            job.execute(jobExecutionContext);
         }
         else
         {
            log.error("ENDPOINT IS NULL!!!!");
         }
      }
      catch (UnavailableException e)
      {
         throw new JobExecutionException(e);
      }
      finally
      {
         if (endpoint != null)
         {
            endpoint.release();
         }
      }

   }
View Full Code Here

   }
   // --- End Work interface

   private void deliverMsg(Message msg)
   {
      MessageEndpoint endpoint = null;
      try
      {
         endpoint = endpointFactory.createEndpoint(null);
         if (endpoint != null)
         {
            if( trace )
               log.trace("deliverMsg, msg subject="+msg.getSubject());
            MailListener listener = (MailListener) endpoint;
            listener.onMessage(msg);
         }
      }
      catch (Throwable e)
      {
         log.debug("onMessage delivery failure", e);
      }
      finally
      {
         if (endpoint != null)
         {
            endpoint.release();
         }
      }
   }
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

    public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
        if (txRecovery && xaResource != null) {
            xaResource = new WrapperNamedXAResource(xaResource, container.getContainerID().toString());
        }
        EndpointHandler endpointHandler = new EndpointHandler(container, deploymentInfo, instanceFactory, xaResource);
        MessageEndpoint messageEndpoint = (MessageEndpoint) Proxy.newProxyInstance(classLoader, interfaces, endpointHandler);
        return messageEndpoint;
    }
View Full Code Here

            Session session = createSession();
            XAResource xaResource=null;
            if (session instanceof XASession) {
        xaResource = ((XASession) session).getXAResource();
            }
            MessageEndpoint endpoint;
      try {
        endpoint = endpointFactory.createEndpoint( xaResource );
      } catch (UnavailableException e) {
        // The container could be limiting us on the number of endpoints that are being created.
        session.close();
View Full Code Here

                        throw new ResourceException("You cannot use an XA Connection with a non transacted endpoint.");
                    }
                    xaresource = ((XASession) session).getXAResource();
                }

                MessageEndpoint endpoint = endpointFactory.createEndpoint(xaresource);
                workers.returnObject(new InboundEndpointWork(session, endpoint, workers));
            }

            Destination dest = null;
            if ("javax.jms.Queue".equals(activationSpec.getDestinationType())) {
View Full Code Here

    private ServerSessionImpl createServerSessionImpl() throws JMSException {
        MessageActivationSpec 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

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.