kandata.client
インタフェース KandataConnector
- 既知の実装クラスの一覧:
- DebugConnector, HttpConnector
- public interface KandataConnector
サーバとの通信に使われるコネクタ.
クライアントアプリはこのインターフェースを介して、サーバとやり取りを
行います。
メソッドの概要 |
void |
disconnect()
サーバ側に切断したことを通知します.
|
byte[] |
getResource(java.lang.String path)
サーバ側に格納されているクライアントのリソースを取得します.
|
java.lang.Object |
invoke(java.lang.String command,
java.lang.Object[] args)
サーバ側のアプリケーションメソッドを呼び出します. |
disconnect
public void disconnect()
throws KandataClientException,
KandataServerException
- サーバ側に切断したことを通知します.
クライアントアプリケーションが終了するときは、必ずこれを呼んでください。
getResource
public byte[] getResource(java.lang.String path)
throws KandataClientException,
KandataServerException
- サーバ側に格納されているクライアントのリソースを取得します.
ファイルの中身をそのままバイト配列で返します。
例えば、画像として取得するには以下のようにします。
byte[] imagedata = connector.getResource("/symbol.png");
ImageIcon icon = new ImageIcon(imagedata);
- パラメータ:
path
- クライアントリソースパスからの相対パス名(先頭にFile.separatorが必要です)- 戻り値:
- ファイルの中身
invoke
public java.lang.Object invoke(java.lang.String command,
java.lang.Object[] args)
throws KandataClientException,
KandataServerException
- サーバ側のアプリケーションメソッドを呼び出します.
- パラメータ:
command
- 任意の文字列を指定します。ただし、先頭に'@'を付けることはできません。args
- コマンドの引数です。引数が不要な場合は null
で構いません。