...
Code Block |
---|
language | java |
---|
theme | Confluence |
---|
title | ChannelCommunicationListener.java |
---|
collapse | true |
---|
|
/**
*
*/
public interface Channel extends Closeable {
/**
* @return Connection id to remote node.
*/
public ChannelId id();
/**
* @return The channel's configuration.
*/
public ChannelConfig config();
/**
* @return A map of all channel attributes.
*/
public Map<String, Serializable> attrs();
/**
* @param name The name to get attribute.
* @param <T> The attribute type.
* @return The corresponding channel attribute instance.
*/
public <T extends Serializable> T attr(String name);
/**
* @param name The name to get attribute.
* @param obj The chanel attribute instance.
* @param <T> The attribute type.
*/
public <T extends Serializable> void attr(String name, T obj);
/**
* @return <tt>true</tt> if the channel is configured and ready to use.
*/
public boolean active();
/**
* Make the channel ready for use.
*/
public void activate();
} |
Code Block |
---|
language | java |
---|
theme | Confluence |
---|
title | ChannelConfig.java |
---|
collapse | true |
---|
|
/**
*
*/
public interface ChannelConfig {
/**
* Gets the channel's mode.
*/
public boolean blocking();
/**
* @param blocking The channel's mode to set.
* @return The config instance.
*/
public ChannelConfig blocking(boolean blocking);
/**
* Gets the timeout option option.
*/
public int timeout();
/**
* @param millis The timeout in milliseconds.
* @return The config instance.
*/
public ChannelConfig timeout(int millis);
} |
Code Block |
---|
language | java |
---|
theme | Confluence |
---|
title | CommunicationSpi.java |
---|
collapse | true |
---|
|
public interface CommunicationSpi<T extends Serializable> extends IgniteSpi {
/**
* @param remote Destination cluster node to communicate with.
* @param attrs Configuration channel attributes.
* @throws IgniteSpiException If fails.
*/
public default Channel channel(ClusterNode remote, Map<String, Serializable> attrs) throws IgniteSpiException {
throw new UnsupportedOperationException();
}
} |
Code Block |
---|
language | java |
---|
theme | Confluence |
---|
title | CommunicationListener.java |
---|
collapse | true |
---|
|
public interface CommunicationListener<T extends Serializable> extends EventListener {
/**
* @param ch A channel instance to process configure request.
* @return Additional attributes to send to remote node.
*/
public default Map<String, Serializable> onChannelConfigure(Channel ch) {
return null;
}
CommunicationListenerEx<T extends Serializable> extends EventListener {
/**
* @param nodeId Remote node id.
* @param initMsg Init channel message.
* @param chchannel Locally created channel endpoint.
*/
public default void onChannelCreatedonChannelOpened(UUID nodeId, Message initMsg, Channel ch) {
// No-op.
}channel);
} |
FileTransmitProcessor
The file transmission manager must support to:
...
Code Block |
---|
language | java |
---|
theme | Confluence |
---|
title | TransmitSession.java |
---|
collapse | true |
---|
|
/**
*
*/
public interface TransmitSessionTransmitSessionHandler {
/**
* @param nodeId The remote node id connected from.
* @param sessionId The unique session id.
*/
public void begin(UUID nodeId, String sessionId);
/**
* @return The instance of read handler to process incoming data by chunks.
*/
public ChunkHandler chunkHandler();
/**
* @return The intance of read handler to process incoming data like the {@link FileChannel} manner.
*/
public FileHandler fileHandler();
/**
* The end of session transmission process.
*/
public void end();
/**
* @param cause The cause of fail handling process.
*/
public void onException(Throwable cause);
} |
...