チェンジセット 283
- コミット日時:
- 2008/04/17 17:44:53 (14 年前)
- ファイル:
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
trunk/im-jssp/pom.xml
r265 r283 69 69 <artifactId>axis2-jaxws</artifactId> 70 70 <version>1.3</version> 71 <scope> runtime</scope>71 <scope>compile</scope> 72 72 </dependency> 73 73 <dependency> … … 75 75 <artifactId>axis2-adb-codegen</artifactId> 76 76 <version>1.3</version> 77 <scope> provided</scope>77 <scope>compile</scope> 78 78 </dependency> 79 79 <dependency> … … 81 81 <artifactId>axis2-codegen</artifactId> 82 82 <version>1.3</version> 83 <scope> provided</scope>83 <scope>compile</scope> 84 84 </dependency> 85 85 <dependency> … … 87 87 <artifactId>axis2-kernel</artifactId> 88 88 <version>1.3</version> 89 <scope> provided</scope>89 <scope>compile</scope> 90 90 </dependency> 91 91 <dependency> 92 92 <groupId>javassist</groupId> 93 93 <artifactId>javassist</artifactId> 94 <version>3. 0</version>95 <scope> provided</scope>94 <version>3.6.0.GA</version> 95 <scope>compile</scope> 96 96 </dependency> 97 97 <dependency> … … 99 99 <artifactId>js</artifactId> 100 100 <version>1.6R7</version> 101 <scope> provided</scope>101 <scope>compile</scope> 102 102 </dependency> 103 103 <dependency> trunk/im-jssp/src/main/java/org/intra_mart/jssp/script/api/SOAPClientObject.java
r278 r283 11 11 import java.io.PrintStream; 12 12 import java.io.Writer; 13 import java.lang.reflect.Constructor; 13 14 import java.lang.reflect.Field; 15 import java.lang.reflect.InvocationTargetException; 14 16 import java.lang.reflect.Method; 15 17 import java.lang.reflect.Modifier; … … 22 24 import java.util.WeakHashMap; 23 25 26 import javassist.ClassClassPath; 24 27 import javassist.ClassPool; 25 28 import javassist.CtClass; … … 225 228 226 229 /** 230 * @param classLoader 231 * @param stubClassName 232 * @param endpoint 233 * @return 234 * @throws ClassNotFoundException 235 * @throws SecurityException 236 * @throws NoSuchMethodException 237 * @throws IllegalArgumentException 238 * @throws InstantiationException 239 * @throws IllegalAccessException 240 * @throws InvocationTargetException 241 */ 242 public static Object newStubInstance(final ClassLoader classLoader, 243 final String stubClassName, 244 final String endpoint) 245 throws ClassNotFoundException, SecurityException, 246 NoSuchMethodException, IllegalArgumentException, 247 InstantiationException, IllegalAccessException, 248 InvocationTargetException{ 249 250 ClassLoader cl = (classLoader != null) ? classLoader : getCurrentThreadClassLoader4SOAPClient(); 251 252 Class stubClass = cl.loadClass(stubClassName); 253 if(endpoint == null){ 254 return stubClass.newInstance(); 255 } 256 else{ 257 Constructor stubConstructor = stubClass.getConstructor(String.class); 258 return stubConstructor.newInstance(endpoint); 259 } 260 } 261 262 /** 227 263 * @param arg 228 264 */ … … 523 559 args[1] = "-c"; 524 560 args[2] = unix.toString(); 525 _logger.debug("Compile 561 _logger.debug("Compile Command(UNIX) -> {} {} {}", args); 526 562 } 527 563 else{ 528 564 args = argsList.toArray(new String[argsList.size()]); 529 _logger.debug("Compile 565 _logger.debug("Compile Command(Windows) -> {}", argsList); 530 566 } 531 567 532 568 533 569 // コンパイル実行 534 _logger.info("Compile 535 _logger.debug("Compile 570 _logger.info("Compile Stub(Java): {}{}{}", new Object[]{srcDir, File.separator, source}); 571 _logger.debug("Compile classpath -> '{}'", classpath); 536 572 Runtime runtime = Runtime.getRuntime(); 537 573 … … 627 663 source.append(" * This file was generated automatically on " + new Date()) .append(LINE_SEP); 628 664 source.append(" */") .append(LINE_SEP); 665 source.append("var wsdlUri = \"" + wsdlUri + "\";") .append(LINE_SEP); 666 source.append("var classLoader = " + code4ClassLoader) .append(LINE_SEP); 629 667 source.append(LINE_SEP); 630 source.append("var wsdlUri = \"" + wsdlUri + "\";") .append(LINE_SEP);631 668 source.append("load('" + _jsPath4SOAPClientHelper + "');") .append(LINE_SEP); 632 669 } … … 638 675 source.append(LINE_SEP); 639 676 source.append("function init( targetEndpoint ) {") .append(LINE_SEP); 640 source.append(" if( !isBlank(targetEndpoint) ) {") .append(LINE_SEP); 641 source.append(" this.stub = new Packages." + stubClassName + "( targetEndpoint );") .append(LINE_SEP); 642 source.append(" }") .append(LINE_SEP); 643 source.append(" else{") .append(LINE_SEP); 644 source.append(" this.stub = new Packages." + stubClassName + "();") .append(LINE_SEP); 645 source.append(" }") .append(LINE_SEP); 677 source.append(" var endpoint = (targetEndpoint == undefined) ? null : targetEndpoint;") .append(LINE_SEP); 678 source.append(" this.stub = " + name4SOAPClientObject); 679 source.append( ".newStubInstance(classLoader, "); 680 source.append( "\"" + stubClassName + "\", "); 681 source.append( "endpoint);") .append(LINE_SEP); 646 682 source.append("}") .append(LINE_SEP); 647 683 } … … 729 765 String paramTypeName = operationParamType.getName(); 730 766 731 source.append(" var operationParam = new Packages." + paramTypeName + "();").append(LINE_SEP);732 source.append(" var classLoader = " + code4ClassLoader) .append(LINE_SEP);733 767 source.append(" var clazz = classLoader.loadClass(\"" + paramTypeName + "\");") .append(LINE_SEP); 768 source.append(" var operationParam = clazz.newInstance();") .append(LINE_SEP); 769 734 770 // WSDLより、Webサービスのパラメータクラスのプロパティ順を取得。 735 771 // (∵SOAPClient#オペレーション()に指定した引数の順序(=arguments オブジェクト)とあわせるため) … … 921 957 source.append(LINE_SEP); 922 958 source.append(" var str = \"\";") .append(LINE_SEP); 923 source.append( " var classLoader = " + code4ClassLoader) .append(LINE_SEP);959 source.append(LINE_SEP); 924 960 source.append( usage); // Usageを追加 925 961 source.append(LINE_SEP); … … 1029 1065 1030 1066 ClassPool cp = ClassPool.getDefault(); 1067 cp.insertClassPath(new ClassClassPath(SOAPClientObject.class)); 1031 1068 CtClass class4codeGenerationEngine = cp.get("org.apache.axis2.wsdl.codegen.CodeGenerationEngine"); 1032 1069