Class HttpCoreNIOListener
- java.lang.Object
-
- org.apache.synapse.transport.nhttp.HttpCoreNIOListener
-
- All Implemented Interfaces:
org.apache.axis2.transport.base.ManagementSupport
,org.apache.axis2.transport.TransportListener
- Direct Known Subclasses:
HttpCoreNIOMultiSSLListener
,HttpCoreNIOSSLListener
public class HttpCoreNIOListener extends Object implements org.apache.axis2.transport.TransportListener, org.apache.axis2.transport.base.ManagementSupport
NIO transport listener for Axis2 based on HttpCore and NIO extensions
-
-
Field Summary
Fields Modifier and Type Field Description static long
ACTIVE_CONNECTION_MONITOR_DELAY
Delay for ActiveConnectionMonitor
-
Constructor Summary
Constructors Constructor Description HttpCoreNIOListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
int
getActiveConnectionsSize()
int
getActiveThreadCount()
Returns the number of active threads processing messagesdouble
getAvgSizeReceived()
double
getAvgSizeSent()
long
getBytesReceived()
long
getBytesSent()
org.apache.axis2.addressing.EndpointReference
getEPRForService(String serviceName, String ip)
Return the EPR for the given service (implements deprecated method temporarily)org.apache.axis2.addressing.EndpointReference[]
getEPRsForService(String serviceName, String ip)
Return the EPRs for the given service over this transportlong
getFaultsReceiving()
long
getFaultsSending()
long
getLastResetTime()
long
getMaxSizeReceived()
long
getMaxSizeSent()
long
getMessagesReceived()
long
getMessagesSent()
long
getMetricsWindow()
long
getMinSizeReceived()
long
getMinSizeSent()
int
getQueueSize()
Returns the number of requestes queued in the thread poolMap
getResponseCodeTable()
protected String
getServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String wsdlEPRPrefix)
Return the EPR prefix for services made available over this transportprotected String
getServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String host, int port)
Return the EPR prefix for services made available over this transportorg.apache.axis2.context.SessionContext
getSessionContext(org.apache.axis2.context.MessageContext messageContext)
TODO: Return session context from transport, this is an improvement in axis2 1.2 and is not currently supportedlong
getTimeoutsReceiving()
long
getTimeoutsSending()
void
init(org.apache.axis2.context.ConfigurationContext ctx, org.apache.axis2.description.TransportInDescription transportIn)
Initialize the transport listener, and execute reactor in new separate threadprotected ServerConnFactoryBuilder
initConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host)
protected ServerConnFactoryBuilder
initConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host, org.apache.axis2.context.ConfigurationContext configurationContext)
protected Scheme
initScheme()
void
maintenenceShutdown(long millis)
Stop accepting new connections, and wait the maximum specified time for in-flight requests to complete before a controlled shutdown for maintenencevoid
pause()
Pause the listener - Stops accepting new connections, but continues processing existing connections until they complete.void
reload(org.apache.axis2.description.TransportInDescription transportIn)
void
reloadDynamicSSLConfig(org.apache.axis2.description.TransportInDescription transportInDescription)
Reload SSL profiles and reset connectionsvoid
reloadSpecificEndpoints(org.apache.axis2.description.TransportInDescription transportIn)
Restart specific endpoints which was updated by new configurationsvoid
resetStatistics()
void
resume()
Resume the lister - Brings the lister into active mode back from a paused statevoid
start()
Start the transport listener.void
stop()
Stop the listener
-
-
-
Field Detail
-
ACTIVE_CONNECTION_MONITOR_DELAY
public static final long ACTIVE_CONNECTION_MONITOR_DELAY
Delay for ActiveConnectionMonitor- See Also:
- Constant Field Values
-
-
Method Detail
-
initScheme
protected Scheme initScheme()
-
initConnFactoryBuilder
protected ServerConnFactoryBuilder initConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host, org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault
- Throws:
org.apache.axis2.AxisFault
-
initConnFactoryBuilder
protected ServerConnFactoryBuilder initConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host) throws org.apache.axis2.AxisFault
- Throws:
org.apache.axis2.AxisFault
-
init
public void init(org.apache.axis2.context.ConfigurationContext ctx, org.apache.axis2.description.TransportInDescription transportIn) throws org.apache.axis2.AxisFault
Initialize the transport listener, and execute reactor in new separate thread- Specified by:
init
in interfaceorg.apache.axis2.transport.TransportListener
- Parameters:
transportIn
- the description of the http/s transport from Axis2 configuration- Throws:
org.apache.axis2.AxisFault
- on error
-
getActiveConnectionsSize
public int getActiveConnectionsSize()
-
getServiceEPRPrefix
protected String getServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String host, int port)
Return the EPR prefix for services made available over this transport- Parameters:
cfgCtx
- configuration context to retrieve the service context pathhost
- name of the hostport
- listening port- Returns:
- wsdlEPRPrefix for the listener
-
getServiceEPRPrefix
protected String getServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String wsdlEPRPrefix)
Return the EPR prefix for services made available over this transport- Parameters:
cfgCtx
- configuration context to retrieve the service context pathwsdlEPRPrefix
- specified wsdlPrefix- Returns:
- wsdlEPRPrefix for the listener
-
start
public void start() throws org.apache.axis2.AxisFault
Start the transport listener. This method returns when the listener is ready to accept connections.- Specified by:
start
in interfaceorg.apache.axis2.transport.TransportListener
- Throws:
org.apache.axis2.AxisFault
-
stop
public void stop() throws org.apache.axis2.AxisFault
Stop the listener- Specified by:
stop
in interfaceorg.apache.axis2.transport.TransportListener
- Throws:
org.apache.axis2.AxisFault
- on error
-
pause
public void pause() throws org.apache.axis2.AxisFault
Pause the listener - Stops accepting new connections, but continues processing existing connections until they complete. This helps bring an instance into a maintenence mode- Specified by:
pause
in interfaceorg.apache.axis2.transport.base.ManagementSupport
- Throws:
org.apache.axis2.AxisFault
-
resume
public void resume() throws org.apache.axis2.AxisFault
Resume the lister - Brings the lister into active mode back from a paused state- Specified by:
resume
in interfaceorg.apache.axis2.transport.base.ManagementSupport
- Throws:
org.apache.axis2.AxisFault
-
reload
public void reload(org.apache.axis2.description.TransportInDescription transportIn) throws org.apache.axis2.AxisFault
- Throws:
org.apache.axis2.AxisFault
-
reloadSpecificEndpoints
public void reloadSpecificEndpoints(org.apache.axis2.description.TransportInDescription transportIn) throws org.apache.axis2.AxisFault
Restart specific endpoints which was updated by new configurations- Parameters:
transportIn
- TransportInDescription of new configuration- Throws:
org.apache.axis2.AxisFault
-
getActiveThreadCount
public int getActiveThreadCount()
Returns the number of active threads processing messages- Specified by:
getActiveThreadCount
in interfaceorg.apache.axis2.transport.base.ManagementSupport
- Returns:
- number of active threads processing messages
-
getQueueSize
public int getQueueSize()
Returns the number of requestes queued in the thread pool- Specified by:
getQueueSize
in interfaceorg.apache.axis2.transport.base.ManagementSupport
- Returns:
- queue size
-
maintenenceShutdown
public void maintenenceShutdown(long millis) throws org.apache.axis2.AxisFault
Stop accepting new connections, and wait the maximum specified time for in-flight requests to complete before a controlled shutdown for maintenence- Specified by:
maintenenceShutdown
in interfaceorg.apache.axis2.transport.base.ManagementSupport
- Parameters:
millis
- a number of milliseconds to wait until pending requests are allowed to complete- Throws:
org.apache.axis2.AxisFault
-
getEPRForService
public org.apache.axis2.addressing.EndpointReference getEPRForService(String serviceName, String ip) throws org.apache.axis2.AxisFault
Return the EPR for the given service (implements deprecated method temporarily)- Specified by:
getEPRForService
in interfaceorg.apache.axis2.transport.TransportListener
- Throws:
org.apache.axis2.AxisFault
-
getEPRsForService
public org.apache.axis2.addressing.EndpointReference[] getEPRsForService(String serviceName, String ip) throws org.apache.axis2.AxisFault
Return the EPRs for the given service over this transport- Specified by:
getEPRsForService
in interfaceorg.apache.axis2.transport.TransportListener
- Parameters:
serviceName
- name of the serviceip
- IP address- Returns:
- the EndpointReferences for this service over the transport
- Throws:
org.apache.axis2.AxisFault
- on error
-
getSessionContext
public org.apache.axis2.context.SessionContext getSessionContext(org.apache.axis2.context.MessageContext messageContext)
TODO: Return session context from transport, this is an improvement in axis2 1.2 and is not currently supported- Specified by:
getSessionContext
in interfaceorg.apache.axis2.transport.TransportListener
- Parameters:
messageContext
- context to be used- Returns:
- always null
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.apache.axis2.transport.TransportListener
-
getMessagesReceived
public long getMessagesReceived()
- Specified by:
getMessagesReceived
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getFaultsReceiving
public long getFaultsReceiving()
- Specified by:
getFaultsReceiving
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getBytesReceived
public long getBytesReceived()
- Specified by:
getBytesReceived
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMessagesSent
public long getMessagesSent()
- Specified by:
getMessagesSent
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getFaultsSending
public long getFaultsSending()
- Specified by:
getFaultsSending
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getBytesSent
public long getBytesSent()
- Specified by:
getBytesSent
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getTimeoutsReceiving
public long getTimeoutsReceiving()
- Specified by:
getTimeoutsReceiving
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getTimeoutsSending
public long getTimeoutsSending()
- Specified by:
getTimeoutsSending
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMinSizeReceived
public long getMinSizeReceived()
- Specified by:
getMinSizeReceived
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMaxSizeReceived
public long getMaxSizeReceived()
- Specified by:
getMaxSizeReceived
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getAvgSizeReceived
public double getAvgSizeReceived()
- Specified by:
getAvgSizeReceived
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMinSizeSent
public long getMinSizeSent()
- Specified by:
getMinSizeSent
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMaxSizeSent
public long getMaxSizeSent()
- Specified by:
getMaxSizeSent
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getAvgSizeSent
public double getAvgSizeSent()
- Specified by:
getAvgSizeSent
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getResponseCodeTable
public Map getResponseCodeTable()
- Specified by:
getResponseCodeTable
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
resetStatistics
public void resetStatistics()
- Specified by:
resetStatistics
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getLastResetTime
public long getLastResetTime()
- Specified by:
getLastResetTime
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMetricsWindow
public long getMetricsWindow()
- Specified by:
getMetricsWindow
in interfaceorg.apache.axis2.transport.base.ManagementSupport
-
reloadDynamicSSLConfig
public void reloadDynamicSSLConfig(org.apache.axis2.description.TransportInDescription transportInDescription) throws org.apache.axis2.AxisFault
Reload SSL profiles and reset connections- Parameters:
transportInDescription
- TransportInDescription of the configuration- Throws:
org.apache.axis2.AxisFault
-
-