Package org.jboss.seam.jms.annotations

Examples of org.jboss.seam.jms.annotations.JmsSession


public class SessionProducer {
    @Produces
    @Dependent
    public Session getSession(Connection c, InjectionPoint ip) throws JMSException {
        JmsSession s = null;
        if (ip != null) {
            // Check for JmsSession annotation
            if (ip.getAnnotated().isAnnotationPresent(JmsSession.class)) {
                s = ip.getAnnotated().getAnnotation(JmsSession.class);
            } else {
                // Check meta-annotations
                for (Annotation a : ip.getAnnotated().getAnnotations()) {
                    if (a.annotationType().isAnnotationPresent(JmsSession.class)) {
                        s = a.annotationType().getAnnotation(JmsSession.class);
                    }
                }
            }
            if (s != null) {
                return c.createSession(s.transacted(), s.acknowledgementMode());
            }
        }

        // Default case where we cannot find an annotation
        return c.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

TOP

Related Classes of org.jboss.seam.jms.annotations.JmsSession

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.