クラス OverlayImpl<D extends Destination,K extends Key>
- すべての実装されたインタフェース:
Closeable,AutoCloseable,Overlay<D,K>,RequestTransport<D>,Transport<D>
public abstract class OverlayImpl<D extends Destination,K extends Key> extends RequestTransportImpl<D> implements Overlay<D,K>
-
ネストされたクラスの概要
クラスから継承されたネストされたクラス/インタフェース org.piax.gtrans.impl.RequestTransportImpl
RequestTransportImpl.IsEasySend -
フィールドの概要
フィールド 修飾子とタイプ フィールド 説明 protected booleanisJoinedprotected Map<K,Integer>keyRegisterクラスから継承されたフィールド org.piax.gtrans.impl.TransportImpl
defaultAppId, isActive, isBaseTransport, listenersByUpper, lowerTrans, peer, peerId, transId, transIdPath, uppers -
コンストラクタの概要
コンストラクタ コンストラクタ 説明 OverlayImpl(Peer peer, TransportId transId, Transport<?> lowerTrans) -
メソッドの概要
修飾子とタイプ メソッド 説明 booleanaddKey(K key)booleanaddKey(ObjectId upper, K key)指定されたkeyをオーバレイに登録する。CompletableFuture<Boolean>addKeyAsync(K key)CompletableFuture<Boolean>addKeyAsync(ObjectId upper, K key)指定されたkeyをオーバレイに非同期に登録する。Class<?>getAvailableKeyType()Set<K>getKeys()Set<K>getKeys(ObjectId upper)OverlayListener<D,K>getListener(ObjectId upper)Return the registered TransportListener.booleanisJoined()overlayの状態(join/leave)を返す。booleanjoin()booleanjoin(String spec)abstract booleanjoin(Collection<? extends Endpoint> seeds)引数で指定されたseedのリストをseedピアとして、Overlayをjoinする。booleanjoin(Endpoint seed)abstract booleanleave()Overlayを不活性化(leave)する。protected voidlowerAddKey(K key)protected CompletableFuture<Boolean>lowerAddKeyAsync(K key)protected voidlowerRemoveKey(K key)protected CompletableFuture<Boolean>lowerRemoveKeyAsync(K key)protected intnumOfRegisteredKey(K key)protected voidregisterKey(K key)protected voidregisterKey(ObjectId upper, K key)booleanremoveKey(K key)booleanremoveKey(ObjectId upper, K key)指定されたkeyをオーバレイから登録削除する。CompletableFuture<Boolean>removeKeyAsync(K key)CompletableFuture<Boolean>removeKeyAsync(ObjectId upper, K key)指定されたkeyをオーバレイから非同期に登録削除する。FutureQueue<?>request(String dstExp, Object msg)FutureQueue<?>request(String dstExp, Object msg, int timeout)FutureQueue<?>request(String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(ObjectId appId, String dstExp, Object msg)FutureQueue<?>request(ObjectId appId, String dstExp, Object msg, int timeout)FutureQueue<?>request(ObjectId appId, String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, int timeout)FutureQueue<?>request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, TransOptions opts)FutureQueue<?>request(TransportId transId, String dstExp, Object msg, int timeout)voidrequestAsync(ObjectId sender, ObjectId receiver, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts)protected ObjectselectOnReceive(OverlayListener<D,K> listener, Overlay<D,K> trans, OverlayReceivedMessage<K> rmsg)voidsend(String dstExp, Object msg)voidsend(ObjectId appId, String dstExp, Object msg)voidsend(ObjectId sender, ObjectId receiver, String dstExp, Object msg)voidsend(TransportId transId, String dstExp, Object msg)voidsetListener(ObjectId upper, OverlayListener<D,K> listener)<E> FutureQueue<E>singletonFutureQueue(E value)<E> FutureQueue<E>singletonFutureQueue(E value, Throwable t)StringtoString0()protected booleanunregisterKey(K key)protected booleanunregisterKey(ObjectId upper, K key)クラスから継承されたメソッド org.piax.gtrans.impl.RequestTransportImpl
checkAndClearIsEasySend, getListener0, request, request, request, request, request, request, request, request, request, request, requestAsync, selectOnReceive, send, sendクラスから継承されたメソッド org.piax.gtrans.impl.TransportImpl
checkActive, fin, getBaseTransport, getDefaultAppId, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, getUppers, hasStableLocator, isUp, send, send, send, send, send, send, setBaseTransport, setDefaultAppId, setListener, setListener, toStringクラスから継承されたメソッド java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitインタフェースから継承されたメソッド org.piax.gtrans.ov.Overlay
requestAsync, requestAsync, requestAsync, requestAsync, requestAsyncインタフェースから継承されたメソッド org.piax.gtrans.RequestTransport
request, request, request, request, request, request, request, request, request, request, request, requestAsync, requestAsync, requestAsync, requestAsync, requestAsync, requestAsync, requestAsyncインタフェースから継承されたメソッド org.piax.gtrans.Transport
close, fin, getBaseTransport, getEndpoint, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, hasStableLocator, isUp, send, send, send, send, send, send, send, send, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, sendAsync, setListener, setListener
-
フィールド詳細
-
keyRegister
-
isJoined
protected volatile boolean isJoined
-
-
コンストラクタの詳細
-
OverlayImpl
public OverlayImpl(Peer peer, TransportId transId, Transport<?> lowerTrans) throws IdConflictException- パラメータ:
peer- the peer object.transId- the id of the transport.lowerTrans- the lower transport.- 例外:
IdConflictException- thrown when the id is conflicted.
-
-
メソッドの詳細
-
getAvailableKeyType
- 定義:
getAvailableKeyTypeインタフェース内Overlay<D extends Destination,K extends Key>
-
setListener
- 定義:
setListenerインタフェース内Overlay<D extends Destination,K extends Key>
-
getListener
インタフェースからコピーされた説明:TransportReturn the registered TransportListener.upperis an ObjectId specified by the setListener. If TransportListener is not registered,nullis returned.- 定義:
getListenerインタフェース内Overlay<D extends Destination,K extends Key>- 定義:
getListenerインタフェース内Transport<D extends Destination>- オーバーライド:
getListenerクラス内TransportImpl<D extends Destination>- パラメータ:
upper- The ObjectId of the receiver (upper layer) entity.- 戻り値:
- The TransportListener registered.
-
send
public void send(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
send
public void send(TransportId transId, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
singletonFutureQueue
- 定義:
singletonFutureQueueインタフェース内RequestTransport<D extends Destination>
-
singletonFutureQueue
- 定義:
singletonFutureQueueインタフェース内RequestTransport<D extends Destination>
-
send
public void send(ObjectId appId, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
send
public void send(String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
sendインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(TransportId transId, String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId appId, String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId appId, String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(ObjectId appId, String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(String dstExp, Object msg) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(String dstExp, Object msg, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
request
public FutureQueue<?> request(String dstExp, Object msg, int timeout) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
requestAsync
public void requestAsync(ObjectId sender, ObjectId receiver, String dstExp, Object msg, BiConsumer<Object,Exception> responseReceiver, TransOptions opts) throws org.piax.gtrans.dcl.parser.ParseException, ProtocolUnsupportedException, IOException- 定義:
requestAsyncインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
org.piax.gtrans.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOException
-
selectOnReceive
protected Object selectOnReceive(OverlayListener<D,K> listener, Overlay<D,K> trans, OverlayReceivedMessage<K> rmsg) -
numOfRegisteredKey
-
registerKey
-
registerKey
-
unregisterKey
-
unregisterKey
-
lowerAddKey
- 例外:
IOException
-
addKey
インタフェースからコピーされた説明:Overlay指定されたkeyをオーバレイに登録する。同一key が複数回登録できるかどうかはオーバーレイによる。 オーバーレイが同一keyの複数回登録を許していない場合、登録は失敗しfalseが返る。
null を key として登録することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
- 定義:
addKeyインタフェース内Overlay<D extends Destination,K extends Key>- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイに登録するkey- 戻り値:
- 登録に成功した場合 true
- 例外:
IOException- 実装クラス特有の例外が発生した場合
-
addKey
- 定義:
addKeyインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
IOException
-
lowerAddKeyAsync
-
addKeyAsync
インタフェースからコピーされた説明:Overlay指定されたkeyをオーバレイに非同期に登録する。CompletableFugure内に返値としてBooleanを返す。 その値は登録成功でtrue、失敗でfalseである。 同一keyが複数回登録できるかどうかはオーバーレイによる。 オーバーレイが同一keyの複数回登録を許していない場合、登録は失敗しfalseが返る。
null を key として登録することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、CompletableFuture にIOExceptionのサブクラスとなる例外が帰る。
- 定義:
addKeyAsyncインタフェース内Overlay<D extends Destination,K extends Key>- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイに登録するkey- 戻り値:
- 登録用のCompletionStageを表すCompletableFuture
-
addKeyAsync
- 定義:
addKeyAsyncインタフェース内Overlay<D extends Destination,K extends Key>
-
lowerRemoveKey
- 例外:
IOException
-
removeKey
インタフェースからコピーされた説明:Overlay指定されたkeyをオーバレイから登録削除する。key がオーバレイに登録されていない場合は、falseが返る。 同一key が複数回登録される場合は、 addKey された回数と同じ回数だけremoveKeyが呼ばれないとkeyは削除されない。
null を key として指定することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
- 定義:
removeKeyインタフェース内Overlay<D extends Destination,K extends Key>- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイから登録削除するkey- 戻り値:
- 登録削除に成功した場合 true
- 例外:
IOException- 実装クラス特有の例外が発生した場合
-
removeKey
- 定義:
removeKeyインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
IOException
-
lowerRemoveKeyAsync
-
removeKeyAsync
インタフェースからコピーされた説明:Overlay指定されたkeyをオーバレイから非同期に登録削除する。CompletableFugure内に返値としてBooleanを返す。 その値は、keyの削除に成功した場合にtrue、失敗した場合はfalseである。 同一key が複数回登録される場合は、 addKey された回数と同じ回数だけremoveKeyAsyncが呼ばれないとkeyは削除されない。
null を key として指定することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、CompletableFuture にIOExceptionのサブクラスとなる例外が帰る。
- 定義:
removeKeyAsyncインタフェース内Overlay<D extends Destination,K extends Key>- パラメータ:
upper- このオーバーレイを利用するエンティティのObjectIdkey- オーバレイから登録削除するkey- 戻り値:
- 登録削除用のCompletionStageを表すCompletableFuture
-
removeKeyAsync
- 定義:
removeKeyAsyncインタフェース内Overlay<D extends Destination,K extends Key>
-
getKeys
-
getKeys
-
join
- 定義:
joinインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
ProtocolUnsupportedExceptionIOException
-
join
- 定義:
joinインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
ProtocolUnsupportedExceptionIOException
-
join
- 定義:
joinインタフェース内Overlay<D extends Destination,K extends Key>- 例外:
IOException
-
join
インタフェースからコピーされた説明:Overlay引数で指定されたseedのリストをseedピアとして、Overlayをjoinする。Overlayがすでにjoinな状態の場合は、joinは実行されずに、falseが返る。
- 定義:
joinインタフェース内Overlay<D extends Destination,K extends Key>- パラメータ:
seeds- seedピアのリスト- 戻り値:
- すでにjoinされていた場合false
- 例外:
IOException- join時に例外が発生した時
-
leave
インタフェースからコピーされた説明:OverlayOverlayを不活性化(leave)する。 不活性化により、自ピアはオーバレイネットワークから離脱する。- 定義:
leaveインタフェース内Overlay<D extends Destination,K extends Key>- 戻り値:
- すでにleaveされていた場合false
- 例外:
IOException- I/Oエラーが発生した場合
-
isJoined
public boolean isJoined()インタフェースからコピーされた説明:Overlayoverlayの状態(join/leave)を返す。 -
toString0
- オーバーライド:
toString0クラス内TransportImpl<D extends Destination>
-