Class 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 Detail

      • ACTIVE_CONNECTION_MONITOR_DELAY

        public static final long ACTIVE_CONNECTION_MONITOR_DELAY
        Delay for ActiveConnectionMonitor
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpCoreNIOListener

        public HttpCoreNIOListener()
    • 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 interface org.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 path
        host - name of the host
        port - 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 path
        wsdlEPRPrefix - 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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.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 interface org.apache.axis2.transport.TransportListener
        Parameters:
        serviceName - name of the service
        ip - 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 interface org.apache.axis2.transport.TransportListener
        Parameters:
        messageContext - context to be used
        Returns:
        always null
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.apache.axis2.transport.TransportListener
      • getMessagesReceived

        public long getMessagesReceived()
        Specified by:
        getMessagesReceived in interface org.apache.axis2.transport.base.ManagementSupport
      • getFaultsReceiving

        public long getFaultsReceiving()
        Specified by:
        getFaultsReceiving in interface org.apache.axis2.transport.base.ManagementSupport
      • getBytesReceived

        public long getBytesReceived()
        Specified by:
        getBytesReceived in interface org.apache.axis2.transport.base.ManagementSupport
      • getMessagesSent

        public long getMessagesSent()
        Specified by:
        getMessagesSent in interface org.apache.axis2.transport.base.ManagementSupport
      • getFaultsSending

        public long getFaultsSending()
        Specified by:
        getFaultsSending in interface org.apache.axis2.transport.base.ManagementSupport
      • getBytesSent

        public long getBytesSent()
        Specified by:
        getBytesSent in interface org.apache.axis2.transport.base.ManagementSupport
      • getTimeoutsReceiving

        public long getTimeoutsReceiving()
        Specified by:
        getTimeoutsReceiving in interface org.apache.axis2.transport.base.ManagementSupport
      • getTimeoutsSending

        public long getTimeoutsSending()
        Specified by:
        getTimeoutsSending in interface org.apache.axis2.transport.base.ManagementSupport
      • getMinSizeReceived

        public long getMinSizeReceived()
        Specified by:
        getMinSizeReceived in interface org.apache.axis2.transport.base.ManagementSupport
      • getMaxSizeReceived

        public long getMaxSizeReceived()
        Specified by:
        getMaxSizeReceived in interface org.apache.axis2.transport.base.ManagementSupport
      • getAvgSizeReceived

        public double getAvgSizeReceived()
        Specified by:
        getAvgSizeReceived in interface org.apache.axis2.transport.base.ManagementSupport
      • getMinSizeSent

        public long getMinSizeSent()
        Specified by:
        getMinSizeSent in interface org.apache.axis2.transport.base.ManagementSupport
      • getMaxSizeSent

        public long getMaxSizeSent()
        Specified by:
        getMaxSizeSent in interface org.apache.axis2.transport.base.ManagementSupport
      • getAvgSizeSent

        public double getAvgSizeSent()
        Specified by:
        getAvgSizeSent in interface org.apache.axis2.transport.base.ManagementSupport
      • getResponseCodeTable

        public Map getResponseCodeTable()
        Specified by:
        getResponseCodeTable in interface org.apache.axis2.transport.base.ManagementSupport
      • resetStatistics

        public void resetStatistics()
        Specified by:
        resetStatistics in interface org.apache.axis2.transport.base.ManagementSupport
      • getLastResetTime

        public long getLastResetTime()
        Specified by:
        getLastResetTime in interface org.apache.axis2.transport.base.ManagementSupport
      • getMetricsWindow

        public long getMetricsWindow()
        Specified by:
        getMetricsWindow in interface org.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