Class TcpServerGate

java.lang.Object
org.jspace.gate.TcpServerGate
All Implemented Interfaces:
ServerGate
Direct Known Subclasses:
ConnServerGate, KeepServerGate

public abstract class TcpServerGate
extends java.lang.Object
implements ServerGate
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.net.InetSocketAddress address  
    protected int backlog  
    protected boolean isClosed  
    protected jSpaceMarshaller marshaller  
  • Constructor Summary

    Constructors
    Constructor Description
    TcpServerGate​(jSpaceMarshaller marshaller, java.net.InetSocketAddress address, int backlog)  
  • Method Summary

    Modifier and Type Method Description
    ClientHandler accept()  
    void close()  
    protected abstract ClientHandler getClientHandler​(java.net.Socket socket)  
    protected abstract java.lang.String getConnectionCode()  
    java.net.URI getURI()  
    boolean isClosed()  
    void open()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • marshaller

      protected final jSpaceMarshaller marshaller
    • address

      protected final java.net.InetSocketAddress address
    • backlog

      protected final int backlog
    • isClosed

      protected boolean isClosed
  • Constructor Details

    • TcpServerGate

      public TcpServerGate​(jSpaceMarshaller marshaller, java.net.InetSocketAddress address, int backlog)
  • Method Details

    • open

      public void open() throws java.io.IOException
      Specified by:
      open in interface ServerGate
      Throws:
      java.io.IOException
    • accept

      public ClientHandler accept() throws java.io.IOException
      Specified by:
      accept in interface ServerGate
      Throws:
      java.io.IOException
    • getClientHandler

      protected abstract ClientHandler getClientHandler​(java.net.Socket socket) throws java.io.IOException
      Throws:
      java.io.IOException
    • close

      public void close() throws java.io.IOException
      Specified by:
      close in interface ServerGate
      Throws:
      java.io.IOException
    • getURI

      public java.net.URI getURI()
      Specified by:
      getURI in interface ServerGate
    • getConnectionCode

      protected abstract java.lang.String getConnectionCode()
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface ServerGate