Class JMXMediationFlowObserver
- java.lang.Object
-
- org.wso2.carbon.das.messageflow.data.publisher.observer.jmx.JMXMediationFlowObserver
-
- All Implemented Interfaces:
StatisticCollectionViewMXBean
,MessageFlowObserver
,TenantInformation
public class JMXMediationFlowObserver extends Object implements StatisticCollectionViewMXBean, MessageFlowObserver, TenantInformation
Publish statistics data for JMX monitoring.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MBEAN_CATEGORY
static String
MBEAN_ID
-
Constructor Summary
Constructors Constructor Description JMXMediationFlowObserver(int tenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Clean up this observer and prepare for shutdownStatisticsCompositeObject
getApiJmxStatistics(String apiName)
Returns statistics related to a API.StatisticsCompositeObject
getEndpointJmxStatistics(String endpointName)
Returns statistics related to a Endpoint.StatisticsCompositeObject
getInboundEndpointJmxStatistics(String inboundEndpointName)
Returns statistics related to a Inbound Endpoint.StatisticsCompositeObject
getProxyServiceJmxStatistics(String proxyName)
Returns statistics related to a Proxy Service.StatisticsCompositeObject
getSequenceJmxStatistics(String sequenceName)
Returns statistics related to a Sequence.int
getTenantId()
Get the tenant id for the observervoid
resetAllStatistics()
Reset all JMX statistics.void
resetAPIStatistics()
Reset JMX API statistic collection.void
resetEndpointStatistics()
Reset JMX Endpoint statistic collection.void
resetInboundEndpointStatistics()
Reset JMX Inbound Endpoint statistic collection.void
resetProxyStatistics()
Reset JMX Proxy statistic collection.void
resetSequenceStatistics()
Reset JMX Sequence statistic collection.void
setTenantId(int i)
Set the tenantId for the observervoid
updateStatistics(org.apache.synapse.aspects.flow.statistics.publishing.PublishingFlow snapshot)
Receive a statistics update from the statistics store/provider.
-
-
-
Field Detail
-
MBEAN_CATEGORY
public static final String MBEAN_CATEGORY
- See Also:
- Constant Field Values
-
MBEAN_ID
public static final String MBEAN_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
resetAPIStatistics
public void resetAPIStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset JMX API statistic collection.- Specified by:
resetAPIStatistics
in interfaceStatisticCollectionViewMXBean
-
resetProxyStatistics
public void resetProxyStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset JMX Proxy statistic collection.- Specified by:
resetProxyStatistics
in interfaceStatisticCollectionViewMXBean
-
resetSequenceStatistics
public void resetSequenceStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset JMX Sequence statistic collection.- Specified by:
resetSequenceStatistics
in interfaceStatisticCollectionViewMXBean
-
resetInboundEndpointStatistics
public void resetInboundEndpointStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset JMX Inbound Endpoint statistic collection.- Specified by:
resetInboundEndpointStatistics
in interfaceStatisticCollectionViewMXBean
-
resetEndpointStatistics
public void resetEndpointStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset JMX Endpoint statistic collection.- Specified by:
resetEndpointStatistics
in interfaceStatisticCollectionViewMXBean
-
resetAllStatistics
public void resetAllStatistics()
Description copied from interface:StatisticCollectionViewMXBean
Reset all JMX statistics.- Specified by:
resetAllStatistics
in interfaceStatisticCollectionViewMXBean
-
getProxyServiceJmxStatistics
public StatisticsCompositeObject getProxyServiceJmxStatistics(String proxyName)
Description copied from interface:StatisticCollectionViewMXBean
Returns statistics related to a Proxy Service.- Specified by:
getProxyServiceJmxStatistics
in interfaceStatisticCollectionViewMXBean
- Parameters:
proxyName
- Name of the proxy service.- Returns:
- Composite Data Object that contains Proxy Statistics.
-
getSequenceJmxStatistics
public StatisticsCompositeObject getSequenceJmxStatistics(String sequenceName)
Description copied from interface:StatisticCollectionViewMXBean
Returns statistics related to a Sequence.- Specified by:
getSequenceJmxStatistics
in interfaceStatisticCollectionViewMXBean
- Parameters:
sequenceName
- Name of the Sequence.- Returns:
- Composite Data Object that contains Sequence Statistics.
-
getApiJmxStatistics
public StatisticsCompositeObject getApiJmxStatistics(String apiName)
Description copied from interface:StatisticCollectionViewMXBean
Returns statistics related to a API.- Specified by:
getApiJmxStatistics
in interfaceStatisticCollectionViewMXBean
- Parameters:
apiName
- Name of the API.- Returns:
- Composite Data Object that contains API Statistics.
-
getInboundEndpointJmxStatistics
public StatisticsCompositeObject getInboundEndpointJmxStatistics(String inboundEndpointName)
Description copied from interface:StatisticCollectionViewMXBean
Returns statistics related to a Inbound Endpoint.- Specified by:
getInboundEndpointJmxStatistics
in interfaceStatisticCollectionViewMXBean
- Parameters:
inboundEndpointName
- Name of the Inbound Endpoint.- Returns:
- Composite Data Object that contains Inbound Endpoint Statistics.
-
getEndpointJmxStatistics
public StatisticsCompositeObject getEndpointJmxStatistics(String endpointName)
Description copied from interface:StatisticCollectionViewMXBean
Returns statistics related to a Endpoint.- Specified by:
getEndpointJmxStatistics
in interfaceStatisticCollectionViewMXBean
- Parameters:
endpointName
- Name of the Endpoint.- Returns:
- Composite Data Object that contains Endpoint Statistics.
-
destroy
public void destroy()
Description copied from interface:MessageFlowObserver
Clean up this observer and prepare for shutdown- Specified by:
destroy
in interfaceMessageFlowObserver
-
updateStatistics
public void updateStatistics(org.apache.synapse.aspects.flow.statistics.publishing.PublishingFlow snapshot)
Description copied from interface:MessageFlowObserver
Receive a statistics update from the statistics store/provider. The cumulative records received from this method will be 'null' for the very first update sent by the data store. This is because for the very first update there are no cumulative data in the store. The implementations of this method should not attempt to modify the provided StatisticsRecord instances. If such modifications are necessary the StatisticsRecord objects should be first copied using the copy constructor. Also implementations of the updateStatistics method should finish quickly. Long running tasks should be executed using separate threads to prevent the notifier thread getting blocked.- Specified by:
updateStatistics
in interfaceMessageFlowObserver
- Parameters:
snapshot
- Current latest update containing resource specific data, category specific data, cumulative data and error logs
-
getTenantId
public int getTenantId()
Description copied from interface:TenantInformation
Get the tenant id for the observer- Specified by:
getTenantId
in interfaceTenantInformation
- Returns:
- tenantId
-
setTenantId
public void setTenantId(int i)
Description copied from interface:TenantInformation
Set the tenantId for the observer- Specified by:
setTenantId
in interfaceTenantInformation
- Parameters:
i
- tenantId of the observer
-
-