次のセクションでは、新しいプロトコル・ハンドラーを設計したり、既存のプロトコル・ハンドラーを修正するときに使用するプロトコル・ハンドラー・フレームワークのメソッドについて説明します。
getContent() メソッドは、ビジネス・オブジェクト処理用に使用されます。このメソッドの実行内容は次のとおりです。
public String getContent (object input, String mimeType, Sting BOPrefix) throws IOException
ビジネス・オブジェクト・インターフェースを戻します。
次のコードに、WebSphere Business Integration Server Express Adapter 提供のプロトコル・ハンドラーを呼び出す方法を示します。
try { // set the system property, so that Java knows where to look for // the protocol handlers. You only need to do it once. Properties prop = System.getProperties(); prop.put("java.protocol.handler.pkgs," "com.crossworlds.connectors.utils.ProtocolHandlers"); URL url = new URL("http://www.crossworlds.com"); CWURLConnection uc = (CWURLConnection) url.openConnection(); BusinessObjectInterface respBO = (BusinessObjectInterface) uc.getContent (input, mime, prefix); } catch (Exception XX) { //flag error }