|  |  |  | 
|---|
|  |  |  | throw new IllegalArgumentException(">>>>>>>>>>> xxl-glue, loadNewInstance error, instance is null"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据字符串获取几个java实例 | 
|---|
|  |  |  | * @param codeSource | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | * @throws Exception | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Object loadInstance(String codeSource) throws Exception{ | 
|---|
|  |  |  | if (codeSource!=null && codeSource.trim().length()>0) { | 
|---|
|  |  |  | Class<?> clazz = groovyClassLoader.parseClass(codeSource); | 
|---|
|  |  |  | if (clazz != null) { | 
|---|
|  |  |  | Object instance = clazz.newInstance(); | 
|---|
|  |  |  | if (instance!=null) { | 
|---|
|  |  |  | this.injectService(instance); | 
|---|
|  |  |  | return  instance; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | throw new IllegalArgumentException(">>>>>>>>>>> xxl-glue, loadNewInstance error, instance is null"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|