Package org.jencks

Examples of org.jencks.SingletonEndpointFactory


        private Executor executor;

        public Connector(ActiveMQDestination destination, MessageListener listener, boolean transacted) {
            ra = new ActiveMQResourceAdapter();
            ra.setConnectionFactory(connectionFactory);
            SingletonEndpointFactory ef = new SingletonEndpointFactory(listener, transacted ? getTransactionManager() : null);
            ef.setName(INBOUND_PREFIX + broker.getContainer().getName());
            endpointFactory = ef;
            spec = new ActiveMQActivationSpec();
            spec.setActiveMQDestination(destination);
        }
View Full Code Here


        super(endpoint);
    }

    public void start() throws Exception {
        transactionManager = (TransactionManager) context.getTransactionManager();
        endpointFactory = new SingletonEndpointFactory(this, transactionManager);
        bootstrapContext = endpoint.getBootstrapContext();
        if (bootstrapContext == null) {
            throw new IllegalArgumentException("bootstrapContext not set");
        }
        connectionFactory = endpoint.getConnectionFactory();
View Full Code Here

        }
        resourceAdapter.start(bootstrapContext);
        activationSpec.setResourceAdapter(resourceAdapter);
        if (endpointFactory == null) {
            TransactionManager tm = (TransactionManager) getContext().getTransactionManager();
            endpointFactory = new SingletonEndpointFactory(new MessageListener() {
                public void onMessage(Message message) {
                    try {
                        JmsJcaConsumerEndpoint.this.onMessage(message, null);
                    } catch (JMSException e) {
                        throw new ListenerExecutionFailedException("Unable to handle message", e);
View Full Code Here

        private Executor executor;

        public Connector(ActiveMQDestination destination, MessageListener listener, boolean transacted) {
            ra = new ActiveMQResourceAdapter();
            ra.setConnectionFactory(connectionFactory);
            SingletonEndpointFactory ef = new SingletonEndpointFactory(listener, transacted ? getTransactionManager() : null);
            ef.setName(INBOUND_PREFIX + broker.getContainer().getName());
            endpointFactory = ef;
            spec = new ActiveMQActivationSpec();
            spec.setActiveMQDestination(destination);
        }
View Full Code Here

          transactionManager = (TransactionManager) getContext().getTransactionManager();
        }
        if (transactionManager != null) {
            jcaConnector.setTransactionManager(transactionManager);
        }
        jcaConnector.setEndpointFactory(new SingletonEndpointFactory(this, transactionManager));
        try {
          jcaConnector.afterPropertiesSet();
        } catch (Exception e) {
          throw new JBIException("Unable to start jca connector", e);
        }
View Full Code Here

          ac.setDestination(INBOUND_PREFIX + broker.getContainerName());
          containerConnector = new JCAConnector();
          containerConnector.setBootstrapContext(getBootstrapContext());
          containerConnector.setActivationSpec(ac);
          containerConnector.setResourceAdapter(resourceAdapter);
          containerConnector.setEndpointFactory(new SingletonEndpointFactory(this, getTransactionManager()));
          containerConnector.afterPropertiesSet();
         
          // Outbound connector
          ActiveMQManagedConnectionFactory mcf = new ActiveMQManagedConnectionFactory();
          mcf.setResourceAdapter(resourceAdapter);
          ConnectionFactory cf = (ConnectionFactory) mcf.createConnectionFactory(getConnectionManager());
          jmsTemplate = new JmsTemplate(cf);
          jmsTemplate.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
          jmsPersistentTemplate = new JmsTemplate(cf);
          jmsPersistentTemplate.setDeliveryMode(DeliveryMode.PERSISTENT);
         
          // Inbound broadcast
          ac = new ActiveMQActivationSpec();
          ac.setDestinationType("javax.jms.Topic");
          ac.setDestination(broadcastDestinationName);
          broadcastConnector = new JCAConnector();
          broadcastConnector.setBootstrapContext(getBootstrapContext());
          broadcastConnector.setActivationSpec(ac);
          broadcastConnector.setResourceAdapter(resourceAdapter);
          broadcastConnector.setEndpointFactory(new SingletonEndpointFactory(this));
          broadcastConnector.afterPropertiesSet();
         
          // Outbound broadcast
          connection = ((ActiveMQResourceAdapter) resourceAdapter).makeConnection();
          connection.start();
View Full Code Here

              ac.setDestination(INBOUND_PREFIX + componentName);
              JCAConnector connector = new JCAConnector();
              connector.setBootstrapContext(getBootstrapContext());
              connector.setActivationSpec(ac);
              connector.setResourceAdapter(resourceAdapter);
              connector.setEndpointFactory(new SingletonEndpointFactory(this, getTransactionManager()));
              connector.afterPropertiesSet();
                connectorMap.put(componentName, connector);
            } else if (event.getStatus() == ComponentPacketEvent.DEACTIVATED){
              JCAConnector connector = (JCAConnector) connectorMap.remove(componentName);
                if (connector != null){
View Full Code Here

          transactionManager = (TransactionManager) getContext().getTransactionManager();
        }
        if (transactionManager != null) {
            jcaConnector.setTransactionManager(transactionManager);
        }
        jcaConnector.setEndpointFactory(new SingletonEndpointFactory(this, transactionManager));
        try {
          jcaConnector.afterPropertiesSet();
        } catch (Exception e) {
          throw new JBIException("Unable to initialize jca connector", e);
        }
View Full Code Here

          ac.setDestination(INBOUND_PREFIX + broker.getContainer().getName());
          containerConnector = new JCAConnector();
          containerConnector.setBootstrapContext(getBootstrapContext());
          containerConnector.setActivationSpec(ac);
          containerConnector.setResourceAdapter(resourceAdapter);
          containerConnector.setEndpointFactory(new SingletonEndpointFactory(this, getTransactionManager()));
          containerConnector.start();
         
          // Outbound connector
          ActiveMQManagedConnectionFactory mcf = new ActiveMQManagedConnectionFactory();
          mcf.setResourceAdapter(resourceAdapter);
View Full Code Here

                ac.setDestination(broadcastDestinationName);
                broadcastConnector = new JCAConnector();
                broadcastConnector.setBootstrapContext(getBootstrapContext());
                broadcastConnector.setActivationSpec(ac);
                broadcastConnector.setResourceAdapter(resourceAdapter);
                broadcastConnector.setEndpointFactory(new SingletonEndpointFactory(new MessageListener() {
                    public void onMessage(Message message) {
                        try {
                            Object obj = ((ObjectMessage) message).getObject();
                            if (obj instanceof EndpointEvent) {
                                EndpointEvent event = (EndpointEvent) obj;
View Full Code Here

TOP

Related Classes of org.jencks.SingletonEndpointFactory

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.