Example usage for javax.jms XASession getClass

List of usage examples for javax.jms XASession getClass

Introduction

In this page you can find the example usage for javax.jms XASession getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.atomikos.jms.AtomikosJmsXaSessionProxy.java

public static Object newInstance(XASession s, XATransactionalResource jmsTransactionalResource,
        SessionHandleStateChangeListener pooledConnection, SessionHandleStateChangeListener connectionProxy)
        throws JMSException {
    AtomikosJmsXaSessionProxy proxy = new AtomikosJmsXaSessionProxy(s, jmsTransactionalResource,
            pooledConnection, connectionProxy);
    Set<Class> interfaces = PropertyUtils.getAllImplementedInterfaces(s.getClass());
    //see case 24532
    interfaces.add(DynamicProxy.class);
    Class[] interfaceClasses = (Class[]) interfaces.toArray(new Class[0]);

    Set<Class> minimumSetOfInterfaces = new HashSet<Class>();
    minimumSetOfInterfaces.add(Reapable.class);
    minimumSetOfInterfaces.add(DynamicProxy.class);
    minimumSetOfInterfaces.add(javax.jms.Session.class);
    Class[] minimumSetOfInterfaceClasses = (Class[]) minimumSetOfInterfaces.toArray(new Class[0]);

    List<ClassLoader> classLoaders = new ArrayList<ClassLoader>();
    classLoaders.add(Thread.currentThread().getContextClassLoader());
    classLoaders.add(s.getClass().getClassLoader());
    classLoaders.add(AtomikosJmsXaSessionProxy.class.getClassLoader());

    return (Session) ClassLoadingHelper.newProxyInstance(classLoaders, minimumSetOfInterfaceClasses,
            interfaceClasses, proxy);//from   w  w  w  .ja  v a2s  .c om
}