org.apache.synapse.transport.passthru.core
Class PassThroughListeningIOReactorManager

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

public class PassThroughListeningIOReactorManager
extends Object


Method Summary
 boolean closeAllPTTListenerEndpoints(int port)
          Close all endpoints started by PTT Listeners.
 boolean closeDynamicPTTEndpoint(int port)
          Close external endpoints listen in shared IO Reactor
static PassThroughListeningIOReactorManager getInstance()
          Provide manager object for internal services
 ServerIODispatch getServerIODispatch(int port)
          Return ServerIODispatch registered under given port
 SourceConfiguration getSharedPassThroughSourceConfiguration()
           
 org.apache.http.nio.reactor.ListeningIOReactor initIOReactor(int port, org.apache.http.nio.NHttpServerEventHandler nHttpServerEventHandler, PassThroughSharedListenerConfiguration passThroughSharedListenerConfiguration)
          Create IOReactor with given configuration
 boolean isDynamicEndpointRunning(int port)
          Check whether dynamic endpoint is running for a particular port
 void pauseIOReactor(int port)
          Pause IO Reactor which is registered by HTTPListener running on given port
 void resumeIOReactor(int port)
          Resume IO Reactor which is registered by HTTPListener running on given port
 void shutdownIOReactor(int port)
          ShutdownIOReactor which is registered by HTTPListener running on given port
 void shutdownIOReactor(int port, long miliSeconds)
          ShutdownIOReactor which is registered by HTTPListener running on given port
 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
 void startIOReactor(org.apache.http.nio.reactor.ListeningIOReactor listeningIOReactor, ServerIODispatch serverIODispatch, String prefix)
          StartIOReactor with given ServerIODispatch
 boolean startPTTEndpoint(InetSocketAddress inetSocketAddress, org.apache.http.impl.nio.reactor.DefaultListeningIOReactor defaultListeningIOReactor, String namePrefix)
          Start PTT Endpoint which is given by axis2.xml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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

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

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

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


Copyright © 2005–2015 Apache Software Foundation. All rights reserved.