Documentation of 'edu.jas.util.TaggedSocketChannel' Java class
TaggedSocketChannel
edu.jas.util

Class TaggedSocketChannel

  • All Implemented Interfaces:
    java.lang.Runnable


    public class TaggedSocketChannel
    extends java.lang.Thread
    TaggedSocketChannel provides a communication channel with message tags for Java objects using TCP/IP sockets.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor and Description
      TaggedSocketChannel(SocketChannel s)
      Constructs a tagged socket channel on the given socket channel s.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Closes the channel.
      SocketChannel getSocket()
      Get the SocketChannel
      void init()
      thread initialization and start.
      int messages()
      Number of messages.
      java.lang.Object receive(java.lang.Integer tag)
      Receive an object.
      void run()
      Run receive() in an infinite loop.
      void send(java.lang.Integer tag, java.lang.Object v)
      Sends an object.
      int tagSize()
      Number of tags.
      void terminate()
      Terminate the TaggedSocketChannel.
      java.lang.String toString()
      To string.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TaggedSocketChannel

        public TaggedSocketChannel(SocketChannel s)
        Constructs a tagged socket channel on the given socket channel s.
        Parameters:
        s - A socket channel object.
    • Method Detail

      • init

        public void init()
        thread initialization and start.
      • getSocket

        public SocketChannel getSocket()
        Get the SocketChannel
      • send

        public void send(java.lang.Integer tag,
                         java.lang.Object v)
                  throws java.io.IOException
        Sends an object.
        Parameters:
        tag - message tag
        v - object to send
        Throws:
        java.io.IOException
      • receive

        public java.lang.Object receive(java.lang.Integer tag)
                                 throws java.lang.InterruptedException,
                                        java.io.IOException,
                                        java.lang.ClassNotFoundException
        Receive an object.
        Parameters:
        tag - message tag
        Returns:
        object received
        Throws:
        java.lang.InterruptedException
        java.io.IOException
        java.lang.ClassNotFoundException
      • close

        public void close()
        Closes the channel.
      • toString

        public java.lang.String toString()
        To string.
        Overrides:
        toString in class java.lang.Thread
        See Also:
        Thread.toString()
      • tagSize

        public int tagSize()
        Number of tags.
        Returns:
        size of key set.
      • messages

        public int messages()
        Number of messages.
        Returns:
        sum of all messages in queues.
      • run

        public void run()
        Run receive() in an infinite loop.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
        See Also:
        Thread.run()
      • terminate

        public void terminate()
        Terminate the TaggedSocketChannel.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.