Package org.wso2.carbon.bam.data.publisher.clientstats

Examples of org.wso2.carbon.bam.data.publisher.clientstats.Counter


*/
public class InOperationCountHandler extends AbstractHandler {
    private static Log log = LogFactory.getLog(InOperationCountHandler.class);

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
        Counter counter = new Counter();
        String operation = "";
        if (msgContext.getConfigurationContext().getProperty(
                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_PROPERTY) != null) {
            operation = msgContext.getConfigurationContext().getProperty(
                    ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_PROPERTY)
                    .toString();
        } else {
            log.error("OperationName property not found");
        }

        if (operation != null) {
            Object inOperationCountObj = msgContext
                    .getConfigurationContext()
                    .getProperty(
                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_IN_OPERATION_COUNTER_PROPERTY);

            if (inOperationCountObj != null) {
                if (inOperationCountObj instanceof Counter) {
                    counter.increment(((Counter) inOperationCountObj).getCount());
                }
            } else {

                counter.increment();
                msgContext
                        .getConfigurationContext()
                        .setProperty(
                                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_IN_OPERATION_COUNTER_PROPERTY,
                                counter);
View Full Code Here


*/
public class ServiceRequestCountHandler extends AbstractHandler {
    private static Log log = LogFactory.getLog(ServiceRequestCountHandler.class);

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
        Counter counter = new Counter();
        String service = "";
        if (msgContext.getConfigurationContext().getProperty(
                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_PROPERTY) != null) {
            service = msgContext.getConfigurationContext().getProperty(
                    ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_PROPERTY)
                    .toString();
        } else {
            log.error("ServiceName property not found");
        }

        if (service != null) {
            Object serviceCountObj = msgContext
                    .getConfigurationContext()
                    .getProperty(
                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_REQUEST_COUNTER_PROPERTY);

            if (serviceCountObj != null) {
                if (serviceCountObj instanceof Counter) {
                    counter.increment(((Counter) serviceCountObj).getCount());
                }
            } else {

                counter.increment();
                msgContext
                        .getConfigurationContext()
                        .setProperty(
                                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_REQUEST_COUNTER_PROPERTY,
                                counter);
View Full Code Here

public class GlobalResponseCountHandler extends AbstractHandler {
    private static Log log = LogFactory.getLog(GlobalResponseCountHandler.class);

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
        AxisService axisService = msgContext.getAxisService();
        Counter counter = new Counter();
        if (axisService == null
                || SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup())) {
            return InvocationResponse.CONTINUE;
        }

        Object globalResponseCountObj = msgContext.getConfigurationContext().getProperty(
                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_RESPONSE_COUNTER_PROPERTY);

        if (globalResponseCountObj != null) {
            if (globalResponseCountObj instanceof Counter) {
                counter.increment(((Counter) globalResponseCountObj).getCount());
            }
        } else {
            log
                    .warn(ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_RESPONSE_COUNTER_PROPERTY
                            + " is null");
View Full Code Here

*/
public class GlobalRequestCountHandler extends AbstractHandler {

    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
        AxisService axisService = msgContext.getAxisService();
        Counter counter = new Counter();
        if (axisService == null ||
            SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup())) {
            return InvocationResponse.CONTINUE;
        }
        msgContext.getConfigurationContext()
                .setProperty(
                             ClientStatisticsPublisherConstants.BAM_USER_DEFINED_REQUEST_RECEIVED_TIME_PROPERTY,
                               "" + System.currentTimeMillis());
    
        Object globalrequestCountObj = msgContext.getConfigurationContext()
                .getProperty(
                ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_REQUEST_COUNTER_PROPERTY);
        if (globalrequestCountObj != null) {
            if (globalrequestCountObj instanceof Counter) {
            counter.increment(((Counter) globalrequestCountObj).getCount());
        }
        }
        return InvocationResponse.CONTINUE;
    }
View Full Code Here

    public void init(ConfigurationContext configurationContext, AxisModule axisModule)
                                                                                      throws AxisFault {

        {
           Counter globalRequestCounter = new Counter();
            configurationContext
                    .setProperty(
                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_REQUEST_COUNTER_PROPERTY,
                            globalRequestCounter);
        }

        {
            Counter globalResponseCounter = new Counter();
            configurationContext
                    .setProperty(
                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_RESPONSE_COUNTER_PROPERTY,
                            globalResponseCounter);
        }

        {
            Counter globalFaultCounter = new Counter();
            configurationContext
                    .setProperty(
                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_GLOBAL_FAULT_COUNTER_PROPERTY,
                            globalFaultCounter);
        }
View Full Code Here

     * @return The end line number, or -1 if could not be determined
     */
    public int getEndLineNumber() {
      int ret=-1;
     
      ActivityInterface parent=getParent();
     
      if (parent != null) {
        int index=parent.getSubActivities().indexOf(this);
       
        if (index != -1) {
          if (index < (parent.getSubActivities().size()-1)) {
            ActivityInterface other=parent.getSubActivities().get(index+1);
           
            ret = other.getStartLineNumber()-1;
          } else {
            ret = parent.getEndLineNumber();
          }
        }
      }
View Full Code Here

     *
     * @param lineNumber The line number
     * @return The activity, or null if not found
     */
    public ActivityInterface getActivityAtLineNumber(int lineNumber) {
      ActivityInterface ret=null;
     
      int endline=getEndLineNumber();
     
      if (getStartLineNumber() <= lineNumber && (endline == -1 || endline >= lineNumber)) {
       
View Full Code Here

            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }
View Full Code Here

    protected Element getArrows(SVGDocument doc) {
        Element subGroup = null;
        subGroup = doc.createElementNS("http://www.w3.org/2000/svg", "g");

        if (subActivities != null) {
            ActivityInterface prevActivity = null;
            ActivityInterface activity = null;
            String id = null;
            org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates exitCoords = null;
            SVGCoordinates entryCoords = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = subActivities.iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                if (prevActivity != null) {
                    exitCoords = prevActivity.getExitArrowCoords();
                    entryCoords = activity.getEntryArrowCoords();
                    id = prevActivity.getId() + "-" + activity.getId();
                    subGroup.appendChild(getArrowDefinition(doc, exitCoords.getXLeft(),
                        exitCoords.getYTop(), entryCoords.getXLeft(),
                        entryCoords.getYTop(), id, prevActivity, activity));
                }
                prevActivity = activity;
View Full Code Here

    @Override
    public org.wso2.carbon.bpel.ui.bpel2svg.SVGCoordinates getExitArrowCoords() {
        SVGCoordinates coords = getStartIconExitArrowCoords();

        if (subActivities != null && subActivities.size() > 0) {
            ActivityInterface activity = subActivities.get(subActivities.size() - 1);
            coords = activity.getExitArrowCoords();
        }
        return coords;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.data.publisher.clientstats.Counter

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.