com.ibm.btt.channel.smart.server
Class AbstractSmartCollector
java.lang.Object
com.ibm.btt.channel.smart.server.AbstractSmartCollector
- All Implemented Interfaces:
- SmartCollectorHandler
public abstract class AbstractSmartCollector
- extends java.lang.Object
- implements SmartCollectorHandler
The abstract class of smart collector implementation. It uses the smartCollectorConfig
defined in the btt.xml channel handler section to connect to the rule engine and collect the smart data.
The subclass needs to implement
1)processResult method to process the result after checking the rule.
Method Summary |
void |
collectData(ChannelContext ctx)
check the smart sampleRateRule and collect the smart data,in this method will do the following step
1)init the smartCollectorConfig
2)get the SmartDataCollectDAO instance
3)check the transaction's operationName or processorId if match the SmartCollectorConfig4Transaction's transactionId
if match get the transaction sample rate rule and execute it.
4)if process rule result is true,collect the smart data |
protected java.util.Map<java.lang.String,java.lang.Object> |
getInputParameter(ChannelContext ctx,
java.util.Map map)
Construct the input parameters using the data from the operation context
or getting from data store. |
protected void |
saveSmartBehavior(ChannelContext ctx,
java.lang.String operationName,
java.util.Map dataMap,
java.util.Map<java.lang.String,java.lang.Object> input)
save smart behavior data,it will dynamic map the input data to JPA bean |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
elementFactory
protected static ElementFactory elementFactory
config
protected static SmartCollectorConfig config
smartDAO
protected static SmartDataCollectDAO smartDAO
AbstractSmartCollector
public AbstractSmartCollector()
collectData
public void collectData(ChannelContext ctx)
- check the smart sampleRateRule and collect the smart data,in this method will do the following step
1)init the smartCollectorConfig
2)get the SmartDataCollectDAO instance
3)check the transaction's operationName or processorId if match the SmartCollectorConfig4Transaction's transactionId
if match get the transaction sample rate rule and execute it.
4)if process rule result is true,collect the smart data
- Specified by:
collectData
in interface SmartCollectorHandler
- Parameters:
ChannelContext
- ctx
getInputParameter
protected java.util.Map<java.lang.String,java.lang.Object> getInputParameter(ChannelContext ctx,
java.util.Map map)
- Construct the input parameters using the data from the operation context
or getting from data store.
- Parameters:
ChannelContext
- ctxMap
- map
- Returns:
- Map
saveSmartBehavior
protected void saveSmartBehavior(ChannelContext ctx,
java.lang.String operationName,
java.util.Map dataMap,
java.util.Map<java.lang.String,java.lang.Object> input)
throws java.lang.Exception
- save smart behavior data,it will dynamic map the input data to JPA bean
- Parameters:
ChannelContext
- ctxString
- operationNameMap
- dataMapMap
- input
- Throws:
java.lang.Exception
(c) Copyright IBM Corporation 1998, 2010