Class EndpointView

  • All Implemented Interfaces:
    org.apache.axis2.transport.base.MessageLevelMetricsCollector, EndpointViewMBean

    public class EndpointView
    extends Object
    implements EndpointViewMBean, org.apache.axis2.transport.base.MessageLevelMetricsCollector
    This class is the metrics collector and JMX control point for Endpoints
    • Constructor Detail

      • EndpointView

        public EndpointView​(String endpointName,
                            Endpoint endpoint)
        Create a new MBean to manage the given endpoint
        Parameters:
        endpointName - the name of the endpoint
        endpoint - the actual endpoint
    • Method Detail

      • destroy

        public void destroy()
      • isActive

        public boolean isActive()
                         throws Exception
        Is a leaf level endpoint active? For a group endpoint this means at least one is active
        Specified by:
        isActive in interface EndpointViewMBean
        Returns:
        true if at least one is active in a group endpoint; for a leaf - if it is currently active
        Throws:
        Exception
      • isTimedout

        public boolean isTimedout()
                           throws Exception
        Is this leaf level endpoint in timeout state? For a group, has all endpoints timed out?
        Specified by:
        isTimedout in interface EndpointViewMBean
        Returns:
        true if a leaf level endpoint has timed out, For a group, has all endpoints timed out?
        Throws:
        Exception
      • isSuspended

        public boolean isSuspended()
                            throws Exception
        Is this leaf level endpoint in suspend state?
        Specified by:
        isSuspended in interface EndpointViewMBean
        Returns:
        true if a leaf level endpoint is suspended, false for group endpoints and non-suspend
        Throws:
        Exception
      • isSwitchedOff

        public boolean isSwitchedOff()
                              throws Exception
        Is this leaf level endpoint switched off?
        Specified by:
        isSwitchedOff in interface EndpointViewMBean
        Returns:
        true if a leaf level endpoint is off, false for group endpoints and non-off
        Throws:
        Exception
      • getActiveChildren

        public int getActiveChildren()
                              throws Exception
        Return the number of active children for this endpoint
        Specified by:
        getActiveChildren in interface EndpointViewMBean
        Returns:
        the number of active children for this endpoint
        Throws:
        Exception
      • getReadyChildren

        public int getReadyChildren()
                             throws Exception
        Return the number of ready children for this endpoint
        Specified by:
        getReadyChildren in interface EndpointViewMBean
        Returns:
        the number of ready children for this endpoint
        Throws:
        Exception
      • getLastResetTime

        public long getLastResetTime()
        Time when statistics was last reset for this leaf endpoint
        Specified by:
        getLastResetTime in interface EndpointViewMBean
        Returns:
        the time when statistics was last reset for this leaf endpoint, or -1 for group endpoints
      • getMetricsWindow

        public long getMetricsWindow()
        Time since statistics was last reset for this leaf endpoint
        Specified by:
        getMetricsWindow in interface EndpointViewMBean
        Returns:
        the time since statistics was last reset for this leaf endpoint, or -1 for group endpoints
      • setSuspendedAt

        public void setSuspendedAt​(Date suspendedAt)
      • setTimedoutAt

        public void setTimedoutAt​(Date timedoutAt)
      • incrementSuspensions

        public void incrementSuspensions()
      • resetConsecutiveSuspensions

        public void resetConsecutiveSuspensions()
      • incrementTimeouts

        public void incrementTimeouts()
      • resetConsecutiveTimeouts

        public void resetConsecutiveTimeouts()
      • getMessagesReceived

        public long getMessagesReceived()
        Number of messages (ie replies) received
        Specified by:
        getMessagesReceived in interface EndpointViewMBean
        Returns:
        # of messages (replies) received
      • getFaultsReceiving

        public long getFaultsReceiving()
        Number of faults, receiving replies
        Specified by:
        getFaultsReceiving in interface EndpointViewMBean
        Returns:
        # of faults, receiving replies
      • getTimeoutsReceiving

        public long getTimeoutsReceiving()
        Number of timeouts, receiving replies
        Specified by:
        getTimeoutsReceiving in interface EndpointViewMBean
        Returns:
        # of timeouts, receiving replies
      • getBytesReceived

        public long getBytesReceived()
        Number of bytes received, receiving replies
        Specified by:
        getBytesReceived in interface EndpointViewMBean
        Returns:
        # of bytes received, receiving replies
      • getMessagesSent

        public long getMessagesSent()
        Number of messages sent
        Specified by:
        getMessagesSent in interface EndpointViewMBean
        Returns:
        # of messages sent
      • getFaultsSending

        public long getFaultsSending()
        Number of faults sending
        Specified by:
        getFaultsSending in interface EndpointViewMBean
        Returns:
        # of faults sending
      • getTimeoutsSending

        public long getTimeoutsSending()
        Number of timeouts, sending
        Specified by:
        getTimeoutsSending in interface EndpointViewMBean
        Returns:
        # of timeouts, sending
      • getBytesSent

        public long getBytesSent()
        Number of bytes sent
        Specified by:
        getBytesSent in interface EndpointViewMBean
        Returns:
        # of bytes sent
      • incrementMessagesReceived

        public void incrementMessagesReceived()
        Specified by:
        incrementMessagesReceived in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementFaultsReceiving

        public void incrementFaultsReceiving​(int errorCode)
        Specified by:
        incrementFaultsReceiving in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementTimeoutsReceiving

        public void incrementTimeoutsReceiving()
        Specified by:
        incrementTimeoutsReceiving in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementBytesReceived

        public void incrementBytesReceived​(long size)
        Specified by:
        incrementBytesReceived in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementMessagesSent

        public void incrementMessagesSent()
        Specified by:
        incrementMessagesSent in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementFaultsSending

        public void incrementFaultsSending​(int errorCode)
        Specified by:
        incrementFaultsSending in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementTimeoutsSending

        public void incrementTimeoutsSending()
        Specified by:
        incrementTimeoutsSending in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • incrementBytesSent

        public void incrementBytesSent​(long size)
        Specified by:
        incrementBytesSent in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • notifyReceivedMessageSize

        public void notifyReceivedMessageSize​(long size)
        Specified by:
        notifyReceivedMessageSize in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • notifySentMessageSize

        public void notifySentMessageSize​(long size)
        Specified by:
        notifySentMessageSize in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
      • reportSendingFault

        public void reportSendingFault​(int errorCode)
        Report a/an [typically non-fatal] error to the sending fault table, without incrementing the sendingFault count e.g. to report a successful fail-over etc
        Specified by:
        reportSendingFault in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
        Parameters:
        errorCode - the code to report
      • reportReceivingFault

        public void reportReceivingFault​(int errorCode)
        Report a/an [typically non-fatal] error to the receiving fault table, without incrementing the receivingFault count
        Specified by:
        reportReceivingFault in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
        Parameters:
        errorCode - the code to report
      • reportResponseCode

        public void reportResponseCode​(int respCode)
        Collect response code statistics
        Specified by:
        reportResponseCode in interface org.apache.axis2.transport.base.MessageLevelMetricsCollector
        Parameters:
        respCode - response code
      • isEndpointInState

        public boolean isEndpointInState​(int state)
        Is the endpoint considered to be in the given state?
        Parameters:
        state - the state to consider
        Returns:
        true if all endpoints in a group are of the given state, or if a leaf endpoint is in the given state