cc.otavia.core.channel

Members list

Type members

Classlikes

abstract class AbstractChannel(val system: ActorSystem) extends Channel, ChannelState, QueueMapEntity

Abstract class of file channel and network channel.

Abstract class of file channel and network channel.

Attributes

Companion
object
Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class AbstractFileChannel(system: ActorSystem) extends AbstractChannel

Abstract channel for file, support aio.

Abstract channel for file, support aio.

Attributes

Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class AbstractNetworkChannel(system: ActorSystem) extends AbstractChannel

Attributes

Companion
object
Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class AbstractServerChannel(system: ActorSystem) extends AbstractNetworkChannel

Attributes

Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class AbstractSocketChannel(system: ActorSystem) extends AbstractNetworkChannel

Attributes

Supertypes
trait ChannelState
trait Channel
class Object
trait Matchable
class Any
Show all
Known subtypes
abstract class AbstractUnsafeChannel(val channel: AbstractChannel) extends UnsafeChannel, ChannelState

The AbstractChannel in Reactor

The AbstractChannel in Reactor

Attributes

Supertypes
trait ChannelState
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Channel extends ChannelAddress

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Channel

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Channel.type

An interface for Channel used in Actor

An interface for Channel used in Actor

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
class ChannelException(message: String | Null, cause: Throwable | Null) extends RuntimeException

A RuntimeException which is thrown when an I/O operation fails.

A RuntimeException which is thrown when an I/O operation fails.

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
class ChannelFactory(val transportFactory: TransportFactory)

Attributes

Supertypes
class Object
trait Matchable
class Any

Handles an I/O event or intercepts an I/O operation, and forwards it to its next handler in its ChannelPipeline. ===The context object=== A ChannelHandler is provided with a ChannelHandlerContext object. A ChannelHandler is supposed to interact with the ChannelPipeline it belongs to via a context object. Using the context object, the ChannelHandler can pass events upstream or downstream, modify the pipeline dynamically, or store the information (using AttributeKeys) which is specific to the handler. ===State management=== A ChannelHandler often needs to store some stateful information. The simplest and recommended approach is to use member variables:

Handles an I/O event or intercepts an I/O operation, and forwards it to its next handler in its ChannelPipeline. ===The context object=== A ChannelHandler is provided with a ChannelHandlerContext object. A ChannelHandler is supposed to interact with the ChannelPipeline it belongs to via a context object. Using the context object, the ChannelHandler can pass events upstream or downstream, modify the pipeline dynamically, or store the information (using AttributeKeys) which is specific to the handler. ===State management=== A ChannelHandler often needs to store some stateful information. The simplest and recommended approach is to use member variables:

  trait Msg {
     // your methods here
  }

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
abstract class ChannelHandlerAdapter extends ChannelHandler

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class ChannelHandlerContextImpl(val pipeline: ChannelPipelineImpl, val name: String, val handler: ChannelHandler) extends ChannelHandlerContext

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
abstract class ChannelInitializer[C <: Channel] extends ChannelHandler

A special ChannelHandler which offers an easy way to initialize a Channel once it was registered to its ChannelsActor. Implementations are most often used in the context of ChannelsActor.handler, to setup the ChannelPipeline of a Channel.

A special ChannelHandler which offers an easy way to initialize a Channel once it was registered to its ChannelsActor. Implementations are most often used in the context of ChannelsActor.handler, to setup the ChannelPipeline of a Channel.

    class MyChannelInitializer extends ChannelInitializer[Channel] {
        override protected def initChannel(ch: Channel): Unit = {
            ch.pipeline.addLast("myHandler", new MyHandler())
        }
    }

Be aware that this class is marked as isSharable and so the implementation must be safe to be re-used

Type parameters

C

A sub-type of Channel

Attributes

Supertypes
class Object
trait Matchable
class Any
class ChannelOption[T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class NioChannelOption[T]
object ChannelOption

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ChannelOutputShutdownException(message: String | Null, cause: Throwable | Null) extends IOException

Used to fail pending writes when a channel's output has been shutdown.

Used to fail pending writes when a channel's output has been shutdown.

Attributes

Supertypes
class IOException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ChannelPipelineException(message: String | Null, cause: Throwable | Null) extends ChannelException

A ChannelException which is thrown when a ChannelPipeline failed to execute an operation.

A ChannelException which is thrown when a ChannelPipeline failed to execute an operation.

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final class ChannelPipelineImpl(val channel: AbstractChannel) extends ChannelPipeline

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

The direction of a shutdown. Depending on the direction this has different meaning. If the Inbound direction is shutdown, no more data is read from the transport and dispatched. If the Outbound direction is shutdown, no more writes will be possible to the transport and so all writes will fail.

The direction of a shutdown. Depending on the direction this has different meaning. If the Inbound direction is shutdown, no more data is read from the transport and dispatched. If the Outbound direction is shutdown, no more writes will be possible to the transport and so all writes will fail.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

A trait for manage lifecycle for Channel

A trait for manage lifecycle for Channel

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ChannelState

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Combines the inbound handling of one ChannelHandler with the outbound handling of another ChannelHandler.

Combines the inbound handling of one ChannelHandler with the outbound handling of another ChannelHandler.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class ConnectTimeoutException(msg: String | Null) extends ConnectException

Attributes

Supertypes
class ConnectException
class SocketException
class IOException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class DefaultFileRegion(val position: Long, val count: Long) extends AbstractReferenceCounted, FileRegion

Default FileRegion implementation which transfer data from a FileChannel or File. Be aware that the FileChannel will be automatically closed once FileRegion.refCnt returns 0.

Default FileRegion implementation which transfer data from a FileChannel or File. Be aware that the FileChannel will be automatically closed once FileRegion.refCnt returns 0.

Value parameters

count

the number of bytes to transfer

position

the position from which the transfer should start

Attributes

Supertypes
trait FileRegion
class AbstractReferenceCounted
trait ReferenceCounted
class Object
trait Matchable
class Any
Show all
trait FileRegion extends ReferenceCounted

A region of a file that is sent via a Channel which supports zero-copy file transfer.

A region of a file that is sent via a Channel which supports zero-copy file transfer.

=== Upgrade your JDK / JRE ===

java.nio.channels.FileChannel.transferTo has at least four known bugs in the old versions of Sun JDK and perhaps its derived ones. Please upgrade your JDK to 1.6.0_18 or later version if you are going to use zero-copy file transfer.

  • 5103988
    • FileChannel.transferTo() should return -1 for EAGAIN instead throws IOException
  • 6253145
    • FileChannel.transferTo() on Linux fails when going beyond 2GB boundary
  • 6427312
    • FileChannel.transferTo() throws IOException "system call interrupted"
  • 6470086
    • FileChannel.transferTo(2147483647, 1, channel) causes "Value too large" exception

=== Check your operating system and JDK / JRE ===

If your operating system (or JDK / JRE) does not support zero-copy file transfer, sending a file with FileRegion might fail or yield worse performance. For example, sending a large file doesn't work well in Windows.

=== Not all transports support it ===

Attributes

Supertypes
trait ReferenceCounted
class Object
trait Matchable
class Any
Known subtypes
trait ServerChannel extends Channel

A Channel that accepts an incoming connection attempts and creates its child Channels by accepting them. A ServerChannel does not allow the following operations and so will throws Exception of these operations:

A Channel that accepts an incoming connection attempts and creates its child Channels by accepting them. A ServerChannel does not allow the following operations and so will throws Exception of these operations:

  1. connect(SocketAddress)
  2. disconnect()
  3. write(Object)
  4. flush()
  5. shutdown(ChannelShutdownDirection)

Attributes

Supertypes
trait Channel
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes