use of org.apache.synapse.aspects.AspectConfiguration in project wso2-synapse by wso2.
the class SynapseConfigUtils method setDefaultMainSequence.
/**
* Return the main sequence if one is not defined. This implementation defaults to
* a simple sequence with a <send/>
*
* @param config the configuration to be updated
*/
public static void setDefaultMainSequence(SynapseConfiguration config) {
SequenceMediator main = new SequenceMediator();
main.setName(SynapseConstants.MAIN_SEQUENCE_KEY);
main.addChild(new LogMediator());
main.addChild(new DropMediator());
config.addSequence(SynapseConstants.MAIN_SEQUENCE_KEY, main);
// set the aspect configuration
AspectConfiguration configuration = new AspectConfiguration(main.getName());
main.configure(configuration);
}
use of org.apache.synapse.aspects.AspectConfiguration in project wso2-synapse by wso2.
the class SendMediator method setComponentStatisticsId.
@Override
public void setComponentStatisticsId(ArtifactHolder holder) {
if (getAspectConfiguration() == null) {
configure(new AspectConfiguration(getMediatorName()));
}
String cloneId = StatisticIdentityGenerator.getIdForComponent(getMediatorName(), ComponentType.MEDIATOR, holder);
getAspectConfiguration().setUniqueId(cloneId);
if (endpoint != null) {
endpoint.setComponentStatisticsId(holder);
}
if (receivingSequence != null) {
String childId = StatisticIdentityGenerator.getIdReferencingComponent(receivingSequence.getName(), ComponentType.SEQUENCE, holder);
StatisticIdentityGenerator.reportingEndEvent(childId, ComponentType.SEQUENCE, holder);
}
StatisticIdentityGenerator.reportingEndEvent(cloneId, ComponentType.MEDIATOR, holder);
}
use of org.apache.synapse.aspects.AspectConfiguration in project wso2-synapse by wso2.
the class InboundEndpoint method setComponentStatisticsId.
public void setComponentStatisticsId(ArtifactHolder holder) {
if (aspectConfiguration == null) {
aspectConfiguration = new AspectConfiguration(name);
}
String apiId = StatisticIdentityGenerator.getIdForComponent(name, ComponentType.INBOUNDENDPOINT, holder);
aspectConfiguration.setUniqueId(apiId);
String childId = null;
if (injectingSeq != null) {
childId = StatisticIdentityGenerator.getIdReferencingComponent(injectingSeq, ComponentType.SEQUENCE, holder);
StatisticIdentityGenerator.reportingEndEvent(childId, ComponentType.SEQUENCE, holder);
}
if (onErrorSeq != null) {
childId = StatisticIdentityGenerator.getIdReferencingComponent(onErrorSeq, ComponentType.SEQUENCE, holder);
StatisticIdentityGenerator.reportingEndEvent(childId, ComponentType.SEQUENCE, holder);
}
StatisticIdentityGenerator.reportingEndEvent(apiId, ComponentType.INBOUNDENDPOINT, holder);
}
use of org.apache.synapse.aspects.AspectConfiguration in project wso2-synapse by wso2.
the class AggregateMediator method setComponentStatisticsId.
@Override
public void setComponentStatisticsId(ArtifactHolder holder) {
if (getAspectConfiguration() == null) {
configure(new AspectConfiguration(getMediatorName()));
}
String mediatorId = StatisticIdentityGenerator.getIdForFlowContinuableMediator(getMediatorName(), ComponentType.MEDIATOR, holder);
getAspectConfiguration().setUniqueId(mediatorId);
if (onCompleteSequence != null) {
onCompleteSequence.setComponentStatisticsId(holder);
} else if (onCompleteSequenceRef != null) {
String childId = StatisticIdentityGenerator.getIdReferencingComponent(onCompleteSequenceRef, ComponentType.SEQUENCE, holder);
StatisticIdentityGenerator.reportingEndEvent(childId, ComponentType.SEQUENCE, holder);
}
StatisticIdentityGenerator.reportingFlowContinuableEndEvent(mediatorId, ComponentType.MEDIATOR, holder);
}
use of org.apache.synapse.aspects.AspectConfiguration in project wso2-synapse by wso2.
the class AbstractMediator method setComponentStatisticsId.
public void setComponentStatisticsId(ArtifactHolder holder) {
if (aspectConfiguration == null) {
aspectConfiguration = new AspectConfiguration(getMediatorName());
}
String sequenceId = StatisticIdentityGenerator.getIdForComponent(getMediatorName(), ComponentType.MEDIATOR, holder);
getAspectConfiguration().setUniqueId(sequenceId);
StatisticIdentityGenerator.reportingEndEvent(sequenceId, ComponentType.MEDIATOR, holder);
}
Aggregations