public <T> T getInstance(Class<T> itfCls) {
		// obtain the local object map.
		Map<Class<?>, Object> map = localMap.get();

		if (map == null) {
			// register one if needed.
			map = new HashMap<Class<?>, Object>();
			localMap.set(map);
		}

		Object object = map.get(itfCls);
		if (object == null || itfCls.isInstance(object)) {
			try {
				final Object target = contextMap.get(itfCls).newInstance();
				final TargetChainImpl targetChainImpl = new TargetChainImpl(
						intercepters.iterator());
				object = Proxy.newProxyInstance(this.getClass()
						.getClassLoader(), new Class[] { itfCls },
						new InvocationHandler() {
							public Object invoke(final Object proxy,
									final Method method, final Object[] args)
									throws Throwable {
								return targetChainImpl.chain(target, method,
										args);
							}
						});
			} catch (InstantiationException e) {
				throw new RuntimeException(e);
			} catch (IllegalAccessException e) {
				throw new RuntimeException(e);
			}
			map.put(itfCls, object);
		}

		return itfCls.cast(object);
	}