Package org.apache.synapse.statistics

Examples of org.apache.synapse.statistics.StatisticsStack


        if (synCtx.isResponse()) {
            StatisticsUtils.processAllSequenceStatistics(synCtx);
        }

        //put the required property for the collecttng statistics for the message mediation
        StatisticsStack sequenceStack = (StatisticsStack) synCtx.getProperty(
                SynapseConstants.SEQUENCE_STATS);
        if (sequenceStack == null) {
            sequenceStack = new SequenceStatisticsStack();
            synCtx.setProperty(SynapseConstants.SEQUENCE_STATS,sequenceStack);
        }
        String seqName = "MainSequence";
        boolean isFault = synCtx.getEnvelope().getBody().hasFault();
        sequenceStack.put(seqName,System.currentTimeMillis(),!synCtx.isResponse(),true,isFault);

        boolean result = super.mediate(synCtx);

        if (traceOrDebugOn) {
            if (traceOn && trace.isTraceEnabled()) {
View Full Code Here


            // mediation through this sequence
            Mediator errorHandlerMediator = null;

            // Setting Required property to collect the sequence statistics
            if (statsOn) {
                StatisticsStack sequenceStack = (StatisticsStack)
                    synCtx.getProperty(SynapseConstants.SEQUENCE_STATS);
                if (sequenceStack == null) {
                    sequenceStack = new SequenceStatisticsStack();
                    synCtx.setProperty(SynapseConstants.SEQUENCE_STATS, sequenceStack);
                }
                String seqName = (name == null ? SynapseConstants.ANONYMOUS_SEQUENCE : name);
                boolean isFault = synCtx.getEnvelope().getBody().hasFault();
                sequenceStack.put(seqName, System.currentTimeMillis(),
                        !synCtx.isResponse(), statsOn, isFault);
            }
            try {

                // push the errorHandler sequence into the current message as the fault handler
View Full Code Here

            log.debug("Body : \n" + mc.getEnvelope());
        }

        MessageContext synCtx = MessageContextCreatorForAxis2.getSynapseMessageContext(mc);
        try {
            StatisticsStack synapseServiceStack =
                    (StatisticsStack) synCtx.getProperty(
                            org.apache.synapse.Constants.SYNAPSESERVICE_STATISTICS_STACK);
            if (synapseServiceStack == null) {
                synapseServiceStack = new ProxyServiceStatisticsStack();
                synCtx.setProperty(org.apache.synapse.Constants.SYNAPSESERVICE_STATISTICS_STACK,
                        synapseServiceStack);
            }
            String name = "SynapseService";
            boolean isFault = synCtx.getEnvelope().getBody().hasFault();
            synapseServiceStack.put(name, System.currentTimeMillis(), !synCtx.isResponse(),
                    true, isFault);

            // invoke synapse message mediation
            synCtx.getEnvironment().injectMessage(synCtx);
        } catch (SynapseException syne) {
View Full Code Here

    public boolean mediate(MessageContext synCtx) {
        log.debug("Synapse main mediator :: mediate()");
        if(synCtx.isResponse()) {
            StatisticsUtils.processAllSequenceStatistics(synCtx);
        }
        StatisticsStack sequenceStack = (StatisticsStack) synCtx.getProperty(
                Constants.SEQUENCE_STATISTICS_STACK);
        if (sequenceStack == null) {
            sequenceStack = new SequenceStatisticsStack();
            synCtx.setProperty(Constants.SEQUENCE_STATISTICS_STACK, sequenceStack);
        }
        String seqName = "MainSequence";
        boolean isFault = synCtx.getEnvelope().getBody().hasFault();
        sequenceStack.put(seqName, System.currentTimeMillis(), !synCtx.isResponse(), true, isFault);
        boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         try {
            if (shouldTrace) {
                trace.trace("Start : Synapse main mediator");
            }
View Full Code Here

        if (key == null) {
            // Setting Required property to collect the sequence statistics
            boolean isStatisticsEnable
                    = (org.apache.synapse.Constants.STATISTICS_ON == statisticsEnable);
            if (isStatisticsEnable) {
                StatisticsStack sequenceStack
                        = (StatisticsStack) synCtx.getProperty(Constants.SEQUENCE_STATISTICS_STACK);
                if (sequenceStack == null) {
                    sequenceStack = new SequenceStatisticsStack();
                    synCtx.setProperty(Constants.SEQUENCE_STATISTICS_STACK, sequenceStack);
                }
                String seqName = (name == null ? Constants.ANONYMOUS_SEQUENCES : name);
                boolean isFault =synCtx.getEnvelope().getBody().hasFault();
                sequenceStack.put(seqName,System.currentTimeMillis(),
                        !synCtx.isResponse(), isStatisticsEnable,isFault);
            }
            try {
                if (shouldTrace) {
                    trace.trace("Start : Sequence <" + (name == null ? "anonymous" : name) + ">");
View Full Code Here

        if (synCtx.isResponse()) {
            StatisticsUtils.processAllSequenceStatistics(synCtx);
        }

        //put the required property for the collecttng statistics for the message mediation
        StatisticsStack sequenceStack = (StatisticsStack) synCtx.getProperty(
                SynapseConstants.SEQUENCE_STATS);
        if (sequenceStack == null) {
            sequenceStack = new SequenceStatisticsStack();
            synCtx.setProperty(SynapseConstants.SEQUENCE_STATS,sequenceStack);
        }
        String seqName = "MainSequence";
        boolean isFault = synCtx.getEnvelope().getBody().hasFault();
        sequenceStack.put(seqName,System.currentTimeMillis(),!synCtx.isResponse(),true,isFault);

        boolean result = super.mediate(synCtx);

        if (traceOrDebugOn) {
            if (traceOn && trace.isTraceEnabled()) {
View Full Code Here

            // mediation through this sequence
            Mediator errorHandlerMediator = null;

            // Setting Required property to collect the sequence statistics
            if (statsOn) {
                StatisticsStack sequenceStack = (StatisticsStack)
                    synCtx.getProperty(SynapseConstants.SEQUENCE_STATS);
                if (sequenceStack == null) {
                    sequenceStack = new SequenceStatisticsStack();
                    synCtx.setProperty(SynapseConstants.SEQUENCE_STATS, sequenceStack);
                }
                String seqName = (name == null ? SynapseConstants.ANONYMOUS_SEQUENCE : name);
                boolean isFault = synCtx.getEnvelope().getBody().hasFault();
                sequenceStack.put(seqName, System.currentTimeMillis(),
                        !synCtx.isResponse(), statsOn, isFault);
            }
            try {

                // push the errorHandler sequence into the current message as the fault handler
View Full Code Here

            SynapseConstants.SYNAPSE_SERVICE_NAME);
        ((Axis2MessageContext) synCtx).setServiceLog(serviceLog);

        try {
            // set the statistics collection stack for this message
            StatisticsStack synapseServiceStack = new ProxyServiceStatisticsStack();
            boolean isFault = synCtx.getEnvelope().getBody().hasFault();
            synapseServiceStack.put(SynapseConstants.SYNAPSE_SERVICE_NAME,
                System.currentTimeMillis(), !synCtx.isResponse(), true, isFault);
            synCtx.setProperty(SynapseConstants.SERVICE_STATS, synapseServiceStack);

            // set default fault handler
            synCtx.pushFaultHandler(new MediatorFaultHandler(
View Full Code Here

            SynapseConstants.SYNAPSE_SERVICE_NAME);
        ((Axis2MessageContext) synCtx).setServiceLog(serviceLog);

        try {
            // set the statistics collection stack for this message
            StatisticsStack synapseServiceStack = new ProxyServiceStatisticsStack();
            boolean isFault = synCtx.getEnvelope().getBody().hasFault();
            synapseServiceStack.put(SynapseConstants.SYNAPSE_SERVICE_NAME,
                System.currentTimeMillis(), !synCtx.isResponse(), true, isFault);
            synCtx.setProperty(SynapseConstants.SERVICE_STATS, synapseServiceStack);

            // set default fault handler
            synCtx.pushFaultHandler(new MediatorFaultHandler(
View Full Code Here

TOP

Related Classes of org.apache.synapse.statistics.StatisticsStack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.