Package javax.resource.spi.endpoint

Examples of javax.resource.spi.endpoint.MessageEndpoint


    /**
     * 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


        return instanceFactory;
    }

    public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
        EndpointHandler endpointHandler = new EndpointHandler(container, deploymentInfo, instanceFactory, xaResource);
        MessageEndpoint messageEndpoint = (MessageEndpoint) Proxy.newProxyInstance(classLoader, interfaces, endpointHandler);
        return messageEndpoint;
    }
View Full Code Here

        public void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) throws ResourceException {
            assertNotNull("messageEndpointFactory is null", messageEndpointFactory);
            assertNotNull("activationSpec is null", activationSpec);
            assertTrue("activationSpec should be an instance of FakeActivationSpec", activationSpec instanceof FakeActivationSpec);

            MessageEndpoint endpoint = messageEndpointFactory.createEndpoint(null);
            assertNotNull("endpoint is null", endpoint);
            assertTrue("endpoint should be an instance of FakeMessageListener", endpoint instanceof FakeMessageListener);
        }
View Full Code Here

    public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
        if (xaResource != null && xaResourceWrapper != null) {
            xaResource = xaResourceWrapper.wrap(xaResource, container.getContainerID().toString());
        }
        EndpointHandler endpointHandler = new EndpointHandler(container, beanContext, instanceFactory, xaResource);
        MessageEndpoint messageEndpoint = null;
        try {
            messageEndpoint = (MessageEndpoint) Proxy.newProxyInstance(classLoader, interfaces, endpointHandler);
        } catch (IllegalArgumentException e) {
            //try to create the proxy with tccl once again.
            ClassLoader tccl = Thread.currentThread().getContextClassLoader();
View Full Code Here

        if (timeout <= 0) {
            return createEndpoint(xaResource);
        }

        long end = System.currentTimeMillis() + timeout;
        MessageEndpoint messageEndpoint = null;

        while (System.currentTimeMillis() <= end) {
            try {
                messageEndpoint = createEndpoint(xaResource);
                break;
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

        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

    _session = null;
   
    MessageConsumer consumer = _consumer;
    _consumer = null;
   
    MessageEndpoint endpoint = _endpoint;
    _endpoint = null;
   
    try {
      if (consumer != null)
        consumer.close();
      if (session != null)
        session.close();
      if (connection != null)
        connection.close();
    } catch (Throwable e) {
    }

    _listener = null;

    if (endpoint != null)
      endpoint.release();
  }
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.