パッケージ jcifs.util.transport
クラス Transport
- java.lang.Object
-
- jcifs.util.transport.Transport
-
- すべての実装されたインタフェース:
AutoCloseable,Runnable
public abstract class Transport extends Object implements Runnable, AutoCloseable
This class simplifies communication for protocols that support multiplexing requests. It encapsulates a stream and some protocol knowledge (provided by a concrete subclass) so that connecting, disconnecting, sending, and receiving can be syncronized properly. Apparatus is provided to send and receive requests concurrently.
-
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 Transport()
-
メソッドの概要
すべてのメソッド staticメソッド インスタンス・メソッド abstractメソッド concreteメソッド 修飾子とタイプ メソッド 説明 Transportacquire()voidclose()booleanconnect(long timeout)Connect the transportbooleandisconnect(boolean hard)Disconnect the transportbooleandisconnect(boolean hard, boolean inUse)Disconnect the transportprotected abstract voiddoConnect()protected abstract booleandoDisconnect(boolean hard, boolean inUse)protected abstract voiddoRecv(Response response)protected abstract voiddoSend(Request request)protected <T extends Response>
longdoSend(Request request, T response, Set<RequestParam> params, long timeout)protected abstract voiddoSkip(Long key)protected voidfinalize()protected abstract intgetResponseTimeout(Request request)protected longgetUsageCount()protected <T extends Response>
booleanhandleIntermediate(Request request, T response)booleanisDisconnected()booleanisFailed()protected abstract longmakeKey(Request request)protected abstract LongpeekKey()static intreadn(InputStream in, byte[] b, int off, int len)Read bytes from the input stream into a buffervoidrelease()voidrun()<T extends Response>
Tsendrecv(Request request, T response, Set<RequestParam> params)Send a request message and recieve responseStringtoString()
-
-
-
メソッドの詳細
-
readn
public static int readn(InputStream in, byte[] b, int off, int len) throws IOException
Read bytes from the input stream into a buffer- パラメータ:
in-b-off-len-- 戻り値:
- number of bytes read
- 例外:
IOException
-
acquire
public Transport acquire()
- 戻り値:
- session increased usage count
-
close
public void close()
- 定義:
closeインタフェース内AutoCloseable- 関連項目:
AutoCloseable.close()
-
release
public void release()
-
finalize
protected void finalize() throws Throwable- オーバーライド:
finalizeクラス内Object- 例外:
Throwable- 関連項目:
Object.finalize()
-
getUsageCount
protected long getUsageCount()
- 戻り値:
- the number of known usages
-
makeKey
protected abstract long makeKey(Request request) throws IOException
- 例外:
IOException
-
peekKey
protected abstract Long peekKey() throws IOException
- 例外:
IOException
-
doSend
protected abstract void doSend(Request request) throws IOException
- 例外:
IOException
-
doRecv
protected abstract void doRecv(Response response) throws IOException
- 例外:
IOException
-
doSkip
protected abstract void doSkip(Long key) throws IOException
- 例外:
IOException
-
isDisconnected
public boolean isDisconnected()
- 戻り値:
- whether the transport is disconnected
-
isFailed
public boolean isFailed()
- 戻り値:
- whether the transport is marked failed
-
sendrecv
public <T extends Response> T sendrecv(Request request, T response, Set<RequestParam> params) throws IOException
Send a request message and recieve response- パラメータ:
request-response-params-- 戻り値:
- the response
- 例外:
IOException
-
doSend
protected <T extends Response> long doSend(Request request, T response, Set<RequestParam> params, long timeout) throws IOException
- パラメータ:
request-response-params-timeout-- 戻り値:
- 例外:
IOException
-
handleIntermediate
protected <T extends Response> boolean handleIntermediate(Request request, T response)
- パラメータ:
request-response-- 戻り値:
-
getResponseTimeout
protected abstract int getResponseTimeout(Request request)
- パラメータ:
request-- 戻り値:
-
doDisconnect
protected abstract boolean doDisconnect(boolean hard, boolean inUse) throws IOException- 例外:
IOException
-
connect
public boolean connect(long timeout) throws TransportExceptionConnect the transport- パラメータ:
timeout-- 戻り値:
- whether the transport was connected
- 例外:
TransportException
-
disconnect
public boolean disconnect(boolean hard) throws IOExceptionDisconnect the transport- パラメータ:
hard-- 戻り値:
- whether conenction was in use
- 例外:
IOException
-
disconnect
public boolean disconnect(boolean hard, boolean inUse) throws IOExceptionDisconnect the transport- パラメータ:
hard-inUse- whether the caller is holding a usage reference on the transport- 戻り値:
- whether conenction was in use
- 例外:
IOException
-
-