/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.aopalliance.intercept.MethodInterceptor
 *  org.aopalliance.intercept.MethodInvocation
 */
package com.l7tech.server.identity.ldap;

import com.l7tech.server.identity.ldap.LdapSslCustomizerSupport;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class LdapClassLoaderMethodInterceptor
implements MethodInterceptor {
    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(LdapSslCustomizerSupport.getSSLSocketFactoryClassLoader());
            Object object = methodInvocation.proceed();
            return object;
        }
        finally {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
    }
}

