public abstract class OverlayImpl<D extends Destination,K extends Key> extends RequestTransportImpl<D> implements Overlay<D,K>
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected boolean |
isJoined |
protected Map<K,Integer> |
keyRegister |
NONdefaultAppId, isActive, isBaseTransport, listenersByUpper, lowerTrans, peer, peerId, transId, transIdPath, uppersDEFAULT_APP_ID| コンストラクタと説明 |
|---|
OverlayImpl(Peer peer,
TransportId transId,
Transport<?> lowerTrans) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
boolean |
addKey(K key) |
boolean |
addKey(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.
|
boolean |
isJoined()
overlayの状態(join/leave)を返す。
|
abstract boolean |
join(Collection<? extends Endpoint> seeds)
引数で指定されたseedのリストをseedピアとして、Overlayをjoinする。
|
boolean |
join(Endpoint seed) |
abstract boolean |
leave()
Overlayを不活性化(leave)する。
|
protected void |
lowerAddKey(K key) |
protected void |
lowerRemoveKey(K key) |
protected void |
registerKey(K key) |
boolean |
removeKey(K key) |
boolean |
removeKey(ObjectId upper,
K key)
指定されたkeyをオーバレイから登録削除する。
|
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(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(String dstExp,
Object msg) |
FutureQueue<?> |
request(String dstExp,
Object msg,
int timeout) |
FutureQueue<?> |
request(String dstExp,
Object msg,
TransOptions opts) |
FutureQueue<?> |
request(TransportId transId,
String dstExp,
Object msg,
int timeout) |
protected FutureQueue<?> |
selectOnReceive(OverlayListener<D,K> listener,
Overlay<D,K> trans,
OverlayReceivedMessage<K> rmsg) |
void |
send(ObjectId sender,
ObjectId receiver,
String dstExp,
Object msg) |
void |
send(ObjectId appId,
String dstExp,
Object msg) |
void |
send(String dstExp,
Object msg) |
void |
send(TransportId transId,
String dstExp,
Object msg) |
void |
setListener(ObjectId upper,
OverlayListener<D,K> listener) |
<E> FutureQueue<E> |
singletonFutureQueue(E value) |
<E> FutureQueue<E> |
singletonFutureQueue(E value,
Throwable t) |
String |
toString0() |
protected boolean |
unregisterKey(K key) |
checkAndClearIsEasySend, getListener0, request, request, request, request, request, request, request, request, request, request, selectOnReceive, send, sendcheckActive, fin, getBaseTransport, getDefaultAppId, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, getUppers, hasStableLocator, isUp, send, send, send, send, send, send, setBaseTransport, setDefaultAppId, setListener, setListener, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitrequest, request, request, request, request, request, request, request, request, request, requestfin, getBaseTransport, getEndpoint, getListener, getLowerTransport, getLowerTransports, getMTU, getPeer, getPeerId, getTransportId, getTransportIdPath, hasStableLocator, isUp, send, send, send, send, send, send, send, send, setListener, setListenerpublic 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.public Class<?> getAvailableKeyType()
getAvailableKeyType インタフェース内 Overlay<D extends Destination,K extends Key>public void setListener(ObjectId upper, OverlayListener<D,K> listener)
setListener インタフェース内 Overlay<D extends Destination,K extends Key>public OverlayListener<D,K> getListener(ObjectId upper)
Transportupper is an ObjectId specified by the setListener.
If TransportListener is not registered, null is 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.public void send(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
send インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic void send(TransportId transId, String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
send インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic <E> FutureQueue<E> singletonFutureQueue(E value)
singletonFutureQueue インタフェース内 Overlay<D extends Destination,K extends Key>public <E> FutureQueue<E> singletonFutureQueue(E value, Throwable t)
singletonFutureQueue インタフェース内 Overlay<D extends Destination,K extends Key>public void send(ObjectId appId, String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
send インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic void send(String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
send インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, TransOptions opts) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId sender, ObjectId receiver, String dstExp, Object msg, int timeout) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(TransportId transId, String dstExp, Object msg, int timeout) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId appId, String dstExp, Object msg, TransOptions opts) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId appId, String dstExp, Object msg, int timeout) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(ObjectId appId, String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(String dstExp, Object msg) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(String dstExp, Object msg, TransOptions opts) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionpublic FutureQueue<?> request(String dstExp, Object msg, int timeout) throws org.piax.common.dcl.parser.ParseException, ProtocolUnsupportedException, IOException
request インタフェース内 Overlay<D extends Destination,K extends Key>org.piax.common.dcl.parser.ParseExceptionProtocolUnsupportedExceptionIOExceptionprotected FutureQueue<?> selectOnReceive(OverlayListener<D,K> listener, Overlay<D,K> trans, OverlayReceivedMessage<K> rmsg)
protected void registerKey(K key)
protected boolean unregisterKey(K key)
protected void lowerAddKey(K key) throws IOException
IOExceptionpublic boolean addKey(ObjectId upper, K key) throws IOException
Overlay同一key が複数回登録される場合は、 key がすでにオーバレイに登録されていても、false は返らない。
null を key として登録することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
addKey インタフェース内 Overlay<D extends Destination,K extends Key>upper - このオーバーレイを利用するエンティティのObjectIdkey - オーバレイに登録するkeyIOException - 実装クラス特有の例外が発生した場合public boolean addKey(K key) throws IOException
addKey インタフェース内 Overlay<D extends Destination,K extends Key>IOExceptionprotected void lowerRemoveKey(K key) throws IOException
IOExceptionpublic boolean removeKey(ObjectId upper, K key) throws IOException
Overlaykey がオーバレイに登録されていない場合は、falseが返る。 同一key が複数回登録される場合は、 addKey された回数と同じ回数だけremoveKeyが呼ばれないとkeyは削除されない。
null を key として指定することはできない。 引数に nullを指定した場合は、IllegalArgumentException が発生する。 引数が、実装クラスにとって適切な型でない場合は、 ClassCastException が発生する。 また、実装クラスがこのメソッドをサポートしない場合は、 UnsupportedOperationException が発生する。 実装クラス特有の例外が発生した場合は、IOExceptionのサブクラスとなる例外が発生する。
removeKey インタフェース内 Overlay<D extends Destination,K extends Key>upper - このオーバーレイを利用するエンティティのObjectIdkey - オーバレイから登録削除するkeyIOException - 実装クラス特有の例外が発生した場合public boolean removeKey(K key) throws IOException
removeKey インタフェース内 Overlay<D extends Destination,K extends Key>IOExceptionpublic boolean join(Endpoint seed) throws IOException
join インタフェース内 Overlay<D extends Destination,K extends Key>IOExceptionpublic abstract boolean join(Collection<? extends Endpoint> seeds) throws IOException
OverlayOverlayがすでにjoinな状態の場合は、joinは実行されずに、falseが返る。
join インタフェース内 Overlay<D extends Destination,K extends Key>seeds - seedピアのリストIOException - join時に例外が発生した時public abstract boolean leave()
throws IOException
Overlayleave インタフェース内 Overlay<D extends Destination,K extends Key>IOException - I/Oエラーが発生した場合public boolean isJoined()
Overlaypublic String toString0()
toString0 クラス内 TransportImpl<D extends Destination>Copyright © 2017. All rights reserved.