Package org.codehaus.activemq

Examples of org.codehaus.activemq.ActiveMQSession


    private void createSession() throws ResourceException {
        try {
            physicalSession = physicalConnection
                    .createSession(true, Session.SESSION_TRANSACTED);
            if (physicalSession instanceof ActiveMQSession) {
                ActiveMQSession session = (ActiveMQSession) physicalSession;
                LocalTransactionEventListener l = createLocalTransactionEventListener();
                session.setLocalTransactionEventListener(l);
            }
            else {
                log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
            }
           
View Full Code Here


     * @throws javax.jms.JMSException
     */
    protected ActiveMQSession createSession() throws JMSException {
        int acknowledge = (transacted) ? Session.SESSION_TRANSACTED :
                            endpointActivationKey.getActivationSpec().getAcknowledgeModeForSession();
        ActiveMQSession session = (ActiveMQSession) getPhysicalConnection().createSession(transacted, acknowledge);
        return session;
    }
View Full Code Here

        ActiveMQActivationSpec activationSpec = endpointActivationKey.getActivationSpec();
        boolean ok = false;
        try {
            workers = new CircularQueue(MAX_WORKERS, stopping);
            for (int i = 0; i < workers.size(); i++) {
                ActiveMQSession session = createSession();
                XAResource xaresource = null;
                if (session instanceof XASession) {
                    if (!transacted) {
                        throw new ResourceException("You cannot use an XA Connection with a non transacted endpoint.");
                    }
View Full Code Here

    }

    private Session createSession() throws JMSException {
        Session s = physicalConnection.createSession(true, Session.SESSION_TRANSACTED);
        if (s instanceof ActiveMQSession) {
            ActiveMQSession session = (ActiveMQSession) s;
            LocalTransactionEventListener l = createLocalTransactionEventListener();
            session.setLocalTransactionEventListener(l);
        }
        else {
            log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
        }
                   
View Full Code Here

        ActiveMQActivationSpec activationSpec = endpointActivationKey.getActivationSpec();       
        boolean ok = false;
        try {  
          workers = new CircularQueue(MAX_WORKERS, stopping);
          for( int i=0; i < workers.size(); i++) {
            ActiveMQSession session = (ActiveMQSession) adapter.getPhysicalConnection().createSession(transacted,Session.AUTO_ACKNOWLEDGE);
            XAResource xaresource=null;
            if( session instanceof XASession  ) {
              if( !transacted )
                throw new ResourceException("You cannot use an XA Connection with a non transacted endpoint.");
              xaresource = ((XASession)session).getXAResource();
View Full Code Here

    private void createSession() throws ResourceException {
        try {
            physicalSession = physicalConnection
                    .createSession(true, Session.SESSION_TRANSACTED);
            if (physicalSession instanceof ActiveMQSession) {
                ActiveMQSession session = (ActiveMQSession) physicalSession;
                LocalTransactionEventListener l = createLocalTransactionEventListener();
                session.setLocalTransactionEventListener(l);
            }
            else {
                log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
            }
           
View Full Code Here

        // lets make a snapshot before we process them
        Object[] sessionArray = sessions.toArray();
        int size = sessionArray.length;
        JMSSessionStats[] answer = new JMSSessionStats[size];
        for (int i = 0; i < size; i++) {
            ActiveMQSession session = (ActiveMQSession) sessionArray[i];
            answer[i] = session.getSessionStats();
        }
        return answer;
    }
View Full Code Here

    }

    private Session createSession() throws JMSException {
        Session s = physicalConnection.createSession(true, Session.SESSION_TRANSACTED);
        if (s instanceof ActiveMQSession) {
            ActiveMQSession session = (ActiveMQSession) s;
            LocalTransactionEventListener l = createLocalTransactionEventListener();
            session.setLocalTransactionEventListener(l);
        }
        else {
            log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
        }
                   
View Full Code Here

    private void createSession() throws ResourceException {
        try {
            physicalSession = physicalConnection
                    .createSession(true, Session.SESSION_TRANSACTED);
            if (physicalSession instanceof ActiveMQSession) {
                ActiveMQSession session = (ActiveMQSession) physicalSession;
                LocalTransactionEventListener l = createLocalTransactionEventListener();
                session.setLocalTransactionEventListener(l);
            }
            else {
                log.trace("Cannot register LocalTransactionEventLister on non-ActiveMQ session");
            }
           
View Full Code Here

        // lets make a snapshot before we process them
        Object[] sessionArray = sessions.toArray();
        int size = sessionArray.length;
        JMSSessionStats[] answer = new JMSSessionStats[size];
        for (int i = 0; i < size; i++) {
            ActiveMQSession session = (ActiveMQSession) sessionArray[i];
            answer[i] = session.getSessionStats();
        }
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.ActiveMQSession

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.