Class EndpointAdapter

java.lang.Object
org.serviceconnector.net.res.EndpointAdapter
All Implemented Interfaces:
Runnable, IEndpoint
Direct Known Subclasses:
NettyHttpEndpoint, NettyTcpEndpoint, NettyTcpProxyEndpoint, NettyWebEndpoint

public abstract class EndpointAdapter extends Object implements IEndpoint, Runnable
The Class EndpointAdapter. Provides basic functionality for endpoints.
Author:
JTraber
  • Field Details

    • baseConf

      protected final BasicConfiguration baseConf
      The base conf.
    • host

      protected String host
      The host.
    • port

      protected int port
      The port.
    • bootstrap

      protected io.netty.bootstrap.ServerBootstrap bootstrap
      The bootstrap.
    • channel

      protected io.netty.channel.Channel channel
      The channel.
    • resp

      protected IResponder resp
      The responder.
    • bossGroup

      protected io.netty.channel.EventLoopGroup bossGroup
    • workerGroup

      protected io.netty.channel.EventLoopGroup workerGroup
  • Constructor Details

    • EndpointAdapter

      public EndpointAdapter()
      Instantiates a new EndpointAdapter.
  • Method Details

    • create

      public void create()
      Creates an endpoint.
      Specified by:
      create in interface IEndpoint
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • startListenSync

      public void startListenSync() throws Exception
      Start listen synchronous. Starts listener in current thread. Does not give back control.
      Specified by:
      startListenSync in interface IEndpoint
      Throws:
      Exception - the exception
    • startsListenAsync

      public void startsListenAsync() throws Exception
      Starts listen asynchronous. Starts listener in a separate thread.
      Specified by:
      startsListenAsync in interface IEndpoint
      Throws:
      Exception - the exception
    • stopListening

      public void stopListening()
      Stop listening.
      Specified by:
      stopListening in interface IEndpoint
    • destroy

      public void destroy()
      Destroys endpoint.
      Specified by:
      destroy in interface IEndpoint
    • getResponder

      public IResponder getResponder()
      Gets the responder.
      Specified by:
      getResponder in interface IEndpoint
      Returns:
      the responder
    • setResponder

      public void setResponder(IResponder resp)
      Sets the responder.
      Specified by:
      setResponder in interface IEndpoint
      Parameters:
      resp - the new responder
    • getHost

      public String getHost()
      Gets the host.
      Returns:
      the host
    • setHost

      public void setHost(String host)
      Sets the host.
      Specified by:
      setHost in interface IEndpoint
      Parameters:
      host - the host
    • getPort

      public int getPort()
      Gets the port.
      Returns:
      the port
    • setPort

      public void setPort(int port)
      Sets the port.
      Specified by:
      setPort in interface IEndpoint
      Parameters:
      port - the port
    • dump

      public void dump(XMLDumpWriter writer) throws Exception
      Dump the endpoint into the xml writer.
      Specified by:
      dump in interface IEndpoint
      Parameters:
      writer - the writer
      Throws:
      Exception - the exception