package org.cgc.wfx;

import org.cgc.wfx.exception.WfxHdfsException;

public class FSClientLauncher {

	private static final String PAIR_CLASS = "org.cgc.wfx.impl.FileSystemProxy";

	public static WfxPair getPairInstance(String dependencyFolder) {
		try {
			DepsLoader loader = new DepsLoader(dependencyFolder);
			ClassLoader cl = loader.loadFolder();
			if (cl != null) {
				Thread.currentThread().setContextClassLoader(cl);
				Class<?> pairClasss = cl.loadClass(PAIR_CLASS);
				Object obj = pairClasss.newInstance();
				if (obj instanceof WfxPair) {
					return (WfxPair) obj;
				}
			} else {
				System.err
						.println("Unable to initialize the new class loader with hdfs dependencies");

			}
		} catch (ClassNotFoundException cnfEx) {
			cnfEx.printStackTrace();
			System.err.println("Unable to find WfxPair class "
					+ cnfEx.getMessage());
			throw new WfxHdfsException(cnfEx);
		} catch (IllegalAccessException illAcEx) {
			illAcEx.printStackTrace();
			System.err
					.println("Fail on accessing WfxPair implementation with message"
							+ illAcEx.getMessage());
			throw new WfxHdfsException(illAcEx);
		} catch (InstantiationException instEx) {
			instEx.printStackTrace();
			System.err
					.println("Fail on instantiate WfxPair object with message"
							+ instEx.getMessage());
			throw new WfxHdfsException(instEx);
		} catch (Throwable thr) {
			thr.printStackTrace();
			System.err
					.println("Fail on initialization HDFS client with message"
							+ thr.getMessage());
			throw new WfxHdfsException(thr);
		}
		System.err.println("Fail on creating new instance of Wfx Pair");
		return null;
	}

}

@@ -249,16 +249,71 @@
 %09%09try %7B%0A
+%09%09%09System.out.println(%22Try getting WfxPair instance%22);%0A
 %09%09%09DepsL
@@ -602,24 +602,78 @@
  WfxPair) %7B%0A
+%09%09%09%09%09System.out.println(%22WfxPair instance obtained%22);%0A
 %09%09%09%09%09return 

add some logs again