Package com.springsource.insight.collection

Examples of com.springsource.insight.collection.OperationCollector


        return runner;
    }

    @Override
    public void run() {
        OperationCollector collector = getCollector();
        Operation op = createRootOperation(Thread.currentThread());
        collector.enter(op);
        try {
            Runnable command = getRunner();
            command.run();
            collector.exitNormal();
        } catch (RuntimeException e) {
            collector.exitAbnormal(e);
            throw e;
        }
    }
View Full Code Here


    private void runNonLdapSearchControlsActions(DirContext context) throws NamingException {
        OperationCollectionAspectSupport aspectInstance = getAspect();

        for (final SearchControlsActions action : SearchControlsActions.values()) {
            aspectInstance.setCollector(new OperationCollector() {
                public void enter(Operation operation) {
                    fail(action + ": Unexpected enter call");
                }

                public void exitNormal() {
View Full Code Here

    @Test
    public void testUntrackedConnectionClose() throws SQLException {
        OperationCollectionAspectSupport aspectInstance = getAspect();
        final AtomicReference<Operation> opRef = new AtomicReference<Operation>(null);
        aspectInstance.setCollector(new OperationCollector() {
            public void enter(Operation operation) {
                Operation prev = opRef.getAndSet(operation);
                assertNull("Multiple enter calls", prev);
            }
View Full Code Here

        }
    }

    protected void assertLifecycleMethodsNotIntercepted(AbstractBean beanInstance) throws Exception {
        OperationCollectionAspectSupport aspectInstance = getAspect();
        OperationCollector orgCollector = aspectInstance.getCollector();
        OperationListCollector collector = new OperationListCollector();
        aspectInstance.setCollector(collector);

        List<Operation> collectedOps = collector.getCollectedOperations();
        try {
View Full Code Here

        return opsList.get(opsList.size() - 1);
    }

    protected Operation getFirstEntered() {
        OperationCollectionAspectSupport aspectInstance = getAspect();
        OperationCollector spiedCollector = aspectInstance.getCollector();
        assertTrue("Spied collector type mismatch", spiedCollector instanceof TestDummyOperationCollector);

        List<Operation> opsList = ((TestDummyOperationCollector) spiedCollector).getCapturedOperations();
        assertNotNull("No operations list data", opsList);
        assertTrue("No operations collected", opsList.size() > 0);
View Full Code Here

        assertNotNull("Null key", key);
        assertNotNull("Null value", value);

        final Element elem = new Element(key, value);
        final OperationCollectionAspectSupport collAspect = getAspect();
        final OperationCollector current = collAspect.getCollector();
        try {
            collAspect.setCollector(IgnoringOperationCollector.DEFAULT);
            cache.put(elem);
            return elem;
        } finally {
View Full Code Here

    protected void runFilteredResourcesTest(
            String baseName, JndiTestContext context, ContextOperationExecutor executor)
            throws Exception {
        OperationCollectionAspectSupport aspectInstance = getAspect();
        OperationCollector collector = aspectInstance.getCollector();
        try {
            OperationListCollector testCollector = new OperationListCollector();
            aspectInstance.setCollector(testCollector);

            for (String suffix : JndiResourceCollectionFilter.DEFAULT_EXCLUSION_PATTERNS) {
View Full Code Here

        /*
         * NOTE: we generate a zero-duration frame since the purpose of this
         * plugin is to track the files. Furthermore, actually measuring the
         * duration of the open/close calls seems too complex (at least for now)
         */
        OperationCollector collector = getCollector();
        collector.enter(op);
        collector.exitNormal();
        return op;
    }
View Full Code Here

TOP

Related Classes of com.springsource.insight.collection.OperationCollector

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.