Package gov.nasa.arc.mct.util.internal

Examples of gov.nasa.arc.mct.util.internal.ElapsedTimer


   
    protected class NodeViewManifestationListener extends AbstractViewListener {
       
        @Override
        public void actionPerformed(TreeExpansionEvent event) {
            final ElapsedTimer timer = new ElapsedTimer();
            timer.startInterval();
           
            JTree tree = (JTree) event.getSource();
            final DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel();

            final MCTMutableTreeNode selectedNode = node;

            AbstractComponent component = getManifestedComponent();

            for (AbstractComponent childComponent : component.getComponents()) {
                Set<ViewInfo> nodeViews = childComponent.getViewInfos(ViewType.NODE);
                if (!nodeViews.isEmpty()) {
                    ViewInfo nextViewInfo = nodeViews.iterator().next();
                   
                    // Children are only allowed if the component is not a leaf or the component is another users drop box
                    boolean allowsChildren =!childComponent.isLeaf();
                   
                    View childNodeView = nextViewInfo.createView(childComponent);
                    MCTMutableTreeNode childNode = new MCTMutableTreeNode(childNodeView, tree, allowsChildren);

                    if (allowsChildren){
                        MCTMutableTreeNode grandChildNode = new MCTMutableTreeNode(View.NULL_VIEW_MANIFESTATION, tree);
                        childNode.add(grandChildNode);
                        childNode.setProxy(true);
                    }
                    selectedNode.add(childNode);
                    childNodeView.addPropertyChangeListener(VIEW_STALE_PROPERTY, objectStaleListener);
                }
            }
            treeModel.reload(selectedNode);
           
            timer.stopInterval();
            PERF_LOGGER.debug("Time to expand node {}: {}", component.getId(), timer.getIntervalInMillis());
        }
View Full Code Here


  public ExecutionResult execute(String categoryKey, PolicyContext context) {
    ExecutionResult result; 
    List<Policy> list = map.get(categoryKey);
    if (list == null)
      return new ExecutionResult(context, true, "No policies registered for " + categoryKey);
    ElapsedTimer categoryTimer = new ElapsedTimer();
    categoryTimer.startInterval();
    for (Policy policy : list) {
      ElapsedTimer policyTimer = new ElapsedTimer();
      policyTimer.startInterval();
      result = policy.execute(context);
      policyTimer.stopInterval();
      PERF_LOGGER.debug("time to execute policy {0} {1}", policy.getClass().getName(), policyTimer.getIntervalInMillis());
      if (!result.getStatus()) {
        LOGGER.debug("Policy category {} failed on policy {}", categoryKey, policy.getClass().getName());
        return result;
      }
    }
View Full Code Here

   
   
    @BeforeMethod
    public void setup() {
        time = 1;
        timer = new ElapsedTimer() {
            @Override
            long getCurrentTime() {
                return time;
            }
        };
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.util.internal.ElapsedTimer

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.