createInstance support both type name and type.


Signed-off-by: Yin MingJun <yinmingjuncn@gmail.com>