Class PassThroughListeningIOReactorManager
- java.lang.Object
-
- org.apache.synapse.transport.passthru.core.PassThroughListeningIOReactorManager
-
public class PassThroughListeningIOReactorManager extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
closeAllPTTListenerEndpoints(int port)
Close all endpoints started by PTT Listeners.boolean
closeDynamicPTTEndpoint(int port)
Close external endpoints listen in shared IO Reactorboolean
closeSpecificPTTListenerEndpoints(int port, Set<InetSocketAddress> bindAddresses)
Close specific endpoints started by PTT Listeners using give set of bind addresses.static PassThroughListeningIOReactorManager
getInstance()
Provide manager object for internal servicesServerIODispatch
getServerIODispatch(int port)
Return ServerIODispatch registered under given portSourceConfiguration
getSharedPassThroughSourceConfiguration()
SourceConfiguration
getSharedSSLPassThroughSourceConfiguration()
org.apache.http.nio.reactor.ListeningIOReactor
initIOReactor(int port, org.apache.http.nio.NHttpServerEventHandler nHttpServerEventHandler, PassThroughSharedListenerConfiguration passThroughSharedListenerConfiguration)
Create IOReactor with given configurationboolean
isDynamicEndpointRunning(int port)
Check whether dynamic endpoint is running for a particular portvoid
pauseIOReactor(int port)
Pause IO Reactor which is registered by HTTPListener running on given portvoid
resumeIOReactor(int port)
Resume IO Reactor which is registered by HTTPListener running on given portvoid
shutdownIOReactor(int port)
ShutdownIOReactor which is registered by HTTPListener running on given portvoid
shutdownIOReactor(int port, long miliSeconds)
ShutdownIOReactor which is registered by HTTPListener running on given portvoid
shutdownIOReactor(int port, SourceConfiguration sourceConfiguration, long timeout)
ShutdownIOReactor which is registered by HTTPListener running on given portboolean
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 startupboolean
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 startupvoid
startIOReactor(org.apache.http.nio.reactor.ListeningIOReactor listeningIOReactor, ServerIODispatch serverIODispatch, String prefix)
StartIOReactor with given ServerIODispatchboolean
startPTTEndpoint(InetSocketAddress inetSocketAddress, org.apache.http.impl.nio.reactor.DefaultListeningIOReactor defaultListeningIOReactor, String namePrefix)
Start PTT Endpoint which is given by axis2.xml
-
-
-
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 endpointdefaultListeningIOReactor
- IO Reactor which starts EndpointnamePrefix
- 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 endpointnHttpServerEventHandler
- ServerHandler responsible for handle events of portendpointName
- 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
- InetSocketAddressnHttpServerEventHandler
- ServerHandler responsible for handle events of portendpointName
- Endpoint NamesslConfiguration
- 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 ListenernHttpServerEventHandler
- Server Handler responsible for handle events of portpassThroughSharedListenerConfiguration
- 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 listenerbindAddresses
- 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 ListenersourceConfiguration
- Source Configuration from Source handlertimeout
- Maximum timeout value for shutdown- Throws:
IOException
- Exception throwing when ShutdownInterruptedException
-
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 ListenermiliSeconds
- 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 startserverIODispatch
- underlying Event Dispatcher for Reactorprefix
- 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
-
-