Class PassThroughListeningIOReactorManager

java.lang.Object
org.apache.synapse.transport.passthru.core.PassThroughListeningIOReactorManager

public class PassThroughListeningIOReactorManager extends Object
  • Method Details

    • getInstance

      public static PassThroughListeningIOReactorManager getInstance()
      Provide manager object for internal services
      Returns:
      PassThroughIOReactorManager
    • startPTTEndpoint

      public boolean startPTTEndpoint(InetSocketAddress inetSocketAddress, org.apache.http.impl.nio.reactor.DefaultListeningIOReactor defaultListeningIOReactor, String namePrefix)
      Start PTT Endpoint which is given by axis2.xml
      Parameters:
      inetSocketAddress - Socket Address of starting endpoint
      defaultListeningIOReactor - IO Reactor which starts Endpoint
      namePrefix - name specified for endpoint
      Returns:
      Is started
    • startDynamicPTTEndpoint

      public boolean startDynamicPTTEndpoint(InetSocketAddress inetSocketAddress, org.apache.http.nio.NHttpServerEventHandler nHttpServerEventHandler, String endpointName)
      Start Endpoint in IOReactor which is external to PTT Axis2 Listeners started at server startup
      Parameters:
      inetSocketAddress - Socket Address of starting endpoint
      nHttpServerEventHandler - ServerHandler responsible for handle events of port
      endpointName - Endpoint Name
      Returns:
      Is Endpoint started
    • startDynamicPTTSSLEndpoint

      public boolean startDynamicPTTSSLEndpoint(InetSocketAddress inetSocketAddress, org.apache.http.nio.NHttpServerEventHandler nHttpServerEventHandler, String endpointName, SSLConfiguration sslConfiguration)
      Start SSL endpoint in IO reactor which is external to PTT Axis Listeners started at server startup
      Parameters:
      inetSocketAddress - InetSocketAddress
      nHttpServerEventHandler - ServerHandler responsible for handle events of port
      endpointName - Endpoint Name
      sslConfiguration - SSL information for create secure connection
      Returns:
    • initIOReactor

      public org.apache.http.nio.reactor.ListeningIOReactor initIOReactor(int port, org.apache.http.nio.NHttpServerEventHandler nHttpServerEventHandler, PassThroughSharedListenerConfiguration passThroughSharedListenerConfiguration) throws org.apache.http.nio.reactor.IOReactorException
      Create IOReactor with given configuration
      Parameters:
      port - Port of the Endpoint for axis2 Listener
      nHttpServerEventHandler - Server Handler responsible for handle events of port
      passThroughSharedListenerConfiguration - configuration related to create and start IOReactor
      Returns:
      IOReactor
      Throws:
      org.apache.http.nio.reactor.IOReactorException
    • closeDynamicPTTEndpoint

      public boolean closeDynamicPTTEndpoint(int port)
      Close external endpoints listen in shared IO Reactor
      Parameters:
      port - Port of the endpoint need to close
      Returns:
      Is endpoint closed
    • closeAllPTTListenerEndpoints

      public boolean closeAllPTTListenerEndpoints(int port)
      Close all endpoints started by PTT Listeners.
      Parameters:
      port - Port of the Endpoint for PTT axis2 Listener
      Returns:
      is all Endpoints closed
    • closeSpecificPTTListenerEndpoints

      public boolean closeSpecificPTTListenerEndpoints(int port, Set<InetSocketAddress> bindAddresses)
      Close specific endpoints started by PTT Listeners using give set of bind addresses.
      Parameters:
      port - Port of the listener
      bindAddresses - bind address list of endpoints to be closed
      Returns:
      true if successfully closed, false if any error
    • getServerIODispatch

      public ServerIODispatch getServerIODispatch(int port)
      Return ServerIODispatch registered under given port
      Parameters:
      port - Port of axis2 PTT Listener
      Returns:
      ServerIODispatch
    • getSharedPassThroughSourceConfiguration

      public SourceConfiguration getSharedPassThroughSourceConfiguration()
      Returns:
      source configuration used by shared IO Reactor
    • getSharedSSLPassThroughSourceConfiguration

      public SourceConfiguration getSharedSSLPassThroughSourceConfiguration()
      Returns:
      source configuration used by shared SSL IO Reactor
    • shutdownIOReactor

      public void shutdownIOReactor(int port, SourceConfiguration sourceConfiguration, long timeout) throws IOException, InterruptedException
      ShutdownIOReactor which is registered by HTTPListener running on given port
      Parameters:
      port - Port of axis2 PTT Listener
      sourceConfiguration - Source Configuration from Source handler
      timeout - Maximum timeout value for shutdown
      Throws:
      IOException - Exception throwing when Shutdown
      InterruptedException
    • shutdownIOReactor

      public void shutdownIOReactor(int port) throws IOException
      ShutdownIOReactor which is registered by HTTPListener running on given port
      Parameters:
      port - Port of axis2 PTT Listener
      Throws:
      IOException - Exception throwing when Shutdown
    • shutdownIOReactor

      public void shutdownIOReactor(int port, long miliSeconds) throws IOException
      ShutdownIOReactor which is registered by HTTPListener running on given port
      Parameters:
      port - Port of axis2 PTT Listener
      miliSeconds - Waiting Time before close IO Reactor
      Throws:
      IOException - Exception throwing when Shutdown
    • pauseIOReactor

      public void pauseIOReactor(int port) throws IOException
      Pause IO Reactor which is registered by HTTPListener running on given port
      Parameters:
      port - Port of axis2 PTT Listener
      Throws:
      IOException - Exception throwing when pausing
    • resumeIOReactor

      public void resumeIOReactor(int port) throws IOException
      Resume IO Reactor which is registered by HTTPListener running on given port
      Parameters:
      port - Port of axis2 PTT Listener
      Throws:
      IOException - Exception throwing when pausing
    • startIOReactor

      public void startIOReactor(org.apache.http.nio.reactor.ListeningIOReactor listeningIOReactor, ServerIODispatch serverIODispatch, String prefix)
      StartIOReactor with given ServerIODispatch
      Parameters:
      listeningIOReactor - Listening IO Reactor to be start
      serverIODispatch - underlying Event Dispatcher for Reactor
      prefix - HTTP/HTTPS
    • isDynamicEndpointRunning

      public boolean isDynamicEndpointRunning(int port)
      Check whether dynamic endpoint is running for a particular port
      Parameters:
      port - port
      Returns:
      whether dynamic endpoint is running for a particular port