|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectp2pMapReduce.impl.networkModule.jxta.JxtaBidiPipeConnection
public class JxtaBidiPipeConnection
During the creation of a JxtaBidiPipe an exchange of the node info is made between the two connection endpoint. If no node info is received after a timeout the constructor throws an IOException. After that the node info exchanging was completed successfully a thread is started to check that the remote endpoint is alive. This thread periodically exchanges a message with the remote endpoint. If no remote response is received in time the connection is marked as broken.
Field Summary | |
---|---|
static int |
CHECK_TIMEOUT
Time period of the connection check |
static int |
CONNECTION_OPENING_TIMEOUT
Time to wait for receiving remote node info. |
static java.lang.String |
MESSAGE_ELEMENT_NAME
|
static java.lang.String |
MESSAGE_NAMESPACE_NAME
|
static int |
RECEIVE_TIMEOUT
Deprecated. |
Constructor Summary | |
---|---|
JxtaBidiPipeConnection(net.jxta.util.JxtaBiDiPipe bipipe,
net.jxta.peergroup.PeerGroup peerGroup,
NodeInfo local,
JxtaNetworkModule netModule,
EventNotifier eventNotifier)
Used when a remote connection is received |
|
JxtaBidiPipeConnection(net.jxta.peergroup.PeerGroup peerGroup,
NodeInfo local,
NodeInfo remote,
net.jxta.protocol.PipeAdvertisement pipeADV,
JxtaNetworkModule netModule,
EventNotifier eventNotifier)
Use to open a new connection towards the specified pipe adv |
Method Summary | |
---|---|
void |
close()
Close the connection |
protected void |
finalize()
|
NodeInfo |
getRemoteNodeInfo()
|
boolean |
isBroken()
Indicate if the connection is no longer capable to send message and receive messages |
boolean |
isDisconnected()
|
boolean |
messengerStateChanged(int newState)
|
void |
pipeEvent(int event)
|
void |
pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
|
java.io.Serializable |
receive()
|
void |
send(java.io.Serializable o)
Used to send a serializable object through this connection |
void |
setEventNotifier(EventNotifier eventNotifier)
|
java.lang.String |
toString()
Remote PeerID toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CONNECTION_OPENING_TIMEOUT
IOException
is thrown
//TODO tuning this parameter and provide setter method
public static final int RECEIVE_TIMEOUT
public static final int CHECK_TIMEOUT
public static final java.lang.String MESSAGE_ELEMENT_NAME
public static final java.lang.String MESSAGE_NAMESPACE_NAME
Constructor Detail |
---|
public JxtaBidiPipeConnection(net.jxta.peergroup.PeerGroup peerGroup, NodeInfo local, NodeInfo remote, net.jxta.protocol.PipeAdvertisement pipeADV, JxtaNetworkModule netModule, EventNotifier eventNotifier) throws java.io.IOException
peerGroup
- pipeADV
-
java.io.IOException
public JxtaBidiPipeConnection(net.jxta.util.JxtaBiDiPipe bipipe, net.jxta.peergroup.PeerGroup peerGroup, NodeInfo local, JxtaNetworkModule netModule, EventNotifier eventNotifier) throws java.io.IOException
bipipe
-
java.io.IOException
Method Detail |
---|
public void send(java.io.Serializable o) throws java.io.IOException
ConnectionIF
send
in interface ConnectionIF
java.io.IOException
public void pipeMsgEvent(net.jxta.pipe.PipeMsgEvent event)
pipeMsgEvent
in interface net.jxta.pipe.PipeMsgListener
public java.io.Serializable receive() throws java.io.IOException
receive
in interface ConnectionIF
java.io.IOException
public void close() throws java.io.IOException
ConnectionIF
close
in interface ConnectionIF
java.io.IOException
public boolean isDisconnected()
public boolean isBroken()
ConnectionIF
isBroken
in interface ConnectionIF
public NodeInfo getRemoteNodeInfo()
getRemoteNodeInfo
in interface ConnectionIF
public void setEventNotifier(EventNotifier eventNotifier)
public void pipeEvent(int event)
pipeEvent
in interface net.jxta.util.PipeEventListener
public boolean messengerStateChanged(int newState)
messengerStateChanged
in interface net.jxta.endpoint.MessengerStateListener
public java.lang.String toString()
toString
in class java.lang.Object
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |