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 longACTIVE_CONNECTION_MONITOR_DELAYDelay for ActiveConnectionMonitor
-
Constructor Summary
Constructors Constructor Description HttpCoreNIOListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()intgetActiveConnectionsSize()intgetActiveThreadCount()Returns the number of active threads processing messagesdoublegetAvgSizeReceived()doublegetAvgSizeSent()longgetBytesReceived()longgetBytesSent()org.apache.axis2.addressing.EndpointReferencegetEPRForService(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 transportlonggetFaultsReceiving()longgetFaultsSending()longgetLastResetTime()longgetMaxSizeReceived()longgetMaxSizeSent()longgetMessagesReceived()longgetMessagesSent()longgetMetricsWindow()longgetMinSizeReceived()longgetMinSizeSent()intgetQueueSize()Returns the number of requestes queued in the thread poolMapgetResponseCodeTable()protected StringgetServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String wsdlEPRPrefix)Return the EPR prefix for services made available over this transportprotected StringgetServiceEPRPrefix(org.apache.axis2.context.ConfigurationContext cfgCtx, String host, int port)Return the EPR prefix for services made available over this transportorg.apache.axis2.context.SessionContextgetSessionContext(org.apache.axis2.context.MessageContext messageContext)TODO: Return session context from transport, this is an improvement in axis2 1.2 and is not currently supportedlonggetTimeoutsReceiving()longgetTimeoutsSending()voidinit(org.apache.axis2.context.ConfigurationContext ctx, org.apache.axis2.description.TransportInDescription transportIn)Initialize the transport listener, and execute reactor in new separate threadprotected ServerConnFactoryBuilderinitConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host)protected ServerConnFactoryBuilderinitConnFactoryBuilder(org.apache.axis2.description.TransportInDescription transportIn, org.apache.http.HttpHost host, org.apache.axis2.context.ConfigurationContext configurationContext)protected SchemeinitScheme()voidmaintenenceShutdown(long millis)Stop accepting new connections, and wait the maximum specified time for in-flight requests to complete before a controlled shutdown for maintenencevoidpause()Pause the listener - Stops accepting new connections, but continues processing existing connections until they complete.voidreload(org.apache.axis2.description.TransportInDescription transportIn)voidreloadDynamicSSLConfig(org.apache.axis2.description.TransportInDescription transportInDescription)Reload SSL profiles and reset connectionsvoidreloadSpecificEndpoints(org.apache.axis2.description.TransportInDescription transportIn)Restart specific endpoints which was updated by new configurationsvoidresetStatistics()voidresume()Resume the lister - Brings the lister into active mode back from a paused statevoidstart()Start the transport listener.voidstop()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.AxisFaultInitialize the transport listener, and execute reactor in new separate thread- Specified by:
initin 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.AxisFaultStart the transport listener. This method returns when the listener is ready to accept connections.- Specified by:
startin interfaceorg.apache.axis2.transport.TransportListener- Throws:
org.apache.axis2.AxisFault
-
stop
public void stop() throws org.apache.axis2.AxisFaultStop the listener- Specified by:
stopin interfaceorg.apache.axis2.transport.TransportListener- Throws:
org.apache.axis2.AxisFault- on error
-
pause
public void pause() throws org.apache.axis2.AxisFaultPause 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:
pausein interfaceorg.apache.axis2.transport.base.ManagementSupport- Throws:
org.apache.axis2.AxisFault
-
resume
public void resume() throws org.apache.axis2.AxisFaultResume the lister - Brings the lister into active mode back from a paused state- Specified by:
resumein 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.AxisFaultRestart 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:
getActiveThreadCountin 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:
getQueueSizein interfaceorg.apache.axis2.transport.base.ManagementSupport- Returns:
- queue size
-
maintenenceShutdown
public void maintenenceShutdown(long millis) throws org.apache.axis2.AxisFaultStop accepting new connections, and wait the maximum specified time for in-flight requests to complete before a controlled shutdown for maintenence- Specified by:
maintenenceShutdownin 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:
getEPRForServicein 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:
getEPRsForServicein 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:
getSessionContextin interfaceorg.apache.axis2.transport.TransportListener- Parameters:
messageContext- context to be used- Returns:
- always null
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.apache.axis2.transport.TransportListener
-
getMessagesReceived
public long getMessagesReceived()
- Specified by:
getMessagesReceivedin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getFaultsReceiving
public long getFaultsReceiving()
- Specified by:
getFaultsReceivingin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getBytesReceived
public long getBytesReceived()
- Specified by:
getBytesReceivedin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMessagesSent
public long getMessagesSent()
- Specified by:
getMessagesSentin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getFaultsSending
public long getFaultsSending()
- Specified by:
getFaultsSendingin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getBytesSent
public long getBytesSent()
- Specified by:
getBytesSentin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getTimeoutsReceiving
public long getTimeoutsReceiving()
- Specified by:
getTimeoutsReceivingin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getTimeoutsSending
public long getTimeoutsSending()
- Specified by:
getTimeoutsSendingin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMinSizeReceived
public long getMinSizeReceived()
- Specified by:
getMinSizeReceivedin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMaxSizeReceived
public long getMaxSizeReceived()
- Specified by:
getMaxSizeReceivedin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getAvgSizeReceived
public double getAvgSizeReceived()
- Specified by:
getAvgSizeReceivedin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMinSizeSent
public long getMinSizeSent()
- Specified by:
getMinSizeSentin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMaxSizeSent
public long getMaxSizeSent()
- Specified by:
getMaxSizeSentin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getAvgSizeSent
public double getAvgSizeSent()
- Specified by:
getAvgSizeSentin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getResponseCodeTable
public Map getResponseCodeTable()
- Specified by:
getResponseCodeTablein interfaceorg.apache.axis2.transport.base.ManagementSupport
-
resetStatistics
public void resetStatistics()
- Specified by:
resetStatisticsin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getLastResetTime
public long getLastResetTime()
- Specified by:
getLastResetTimein interfaceorg.apache.axis2.transport.base.ManagementSupport
-
getMetricsWindow
public long getMetricsWindow()
- Specified by:
getMetricsWindowin interfaceorg.apache.axis2.transport.base.ManagementSupport
-
reloadDynamicSSLConfig
public void reloadDynamicSSLConfig(org.apache.axis2.description.TransportInDescription transportInDescription) throws org.apache.axis2.AxisFaultReload SSL profiles and reset connections- Parameters:
transportInDescription- TransportInDescription of the configuration- Throws:
org.apache.axis2.AxisFault
-
-