Search in sources :

Example 26 with AspectConfiguration

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);
}
Also used : LogMediator(org.apache.synapse.mediators.builtin.LogMediator) DropMediator(org.apache.synapse.mediators.builtin.DropMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator) AspectConfiguration(org.apache.synapse.aspects.AspectConfiguration)

Example 27 with AspectConfiguration

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);
}
Also used : AspectConfiguration(org.apache.synapse.aspects.AspectConfiguration)

Example 28 with AspectConfiguration

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);
}
Also used : AspectConfiguration(org.apache.synapse.aspects.AspectConfiguration)

Example 29 with AspectConfiguration

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);
}
Also used : AspectConfiguration(org.apache.synapse.aspects.AspectConfiguration)

Example 30 with AspectConfiguration

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);
}
Also used : AspectConfiguration(org.apache.synapse.aspects.AspectConfiguration)

Aggregations

AspectConfiguration (org.apache.synapse.aspects.AspectConfiguration)30 QName (javax.xml.namespace.QName)5 OMAttribute (org.apache.axiom.om.OMAttribute)5 Iterator (java.util.Iterator)3 OMElement (org.apache.axiom.om.OMElement)3 SynapseException (org.apache.synapse.SynapseException)3 InboundEndpoint (org.apache.synapse.inbound.InboundEndpoint)3 SequenceMediator (org.apache.synapse.mediators.base.SequenceMediator)3 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)2 DropMediator (org.apache.synapse.mediators.builtin.DropMediator)2 LogMediator (org.apache.synapse.mediators.builtin.LogMediator)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1 OMText (org.apache.axiom.om.OMText)1 OMTextImpl (org.apache.axiom.om.impl.llom.OMTextImpl)1 AxisOperation (org.apache.axis2.description.AxisOperation)1 Nameable (org.apache.synapse.Nameable)1 AspectConfigurable (org.apache.synapse.aspects.AspectConfigurable)1