All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blazebit.persistence.impl.hibernate.Hibernate4TransactionCoordinatorInvocationHandler Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package com.blazebit.persistence.impl.hibernate;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;


public class Hibernate4TransactionCoordinatorInvocationHandler implements InvocationHandler {
    
    private final Object delegate;
    private final Object jdbcCoordinatorProxy;

    public Hibernate4TransactionCoordinatorInvocationHandler(Object delegate, Object jdbcCoordinatorProxy) {
        this.delegate = delegate;
        this.jdbcCoordinatorProxy = jdbcCoordinatorProxy;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if ("getJdbcCoordinator".equals(method.getName())) {
            return jdbcCoordinatorProxy;
        }
        
        return method.invoke(delegate, args);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy