Examples of Watch


Examples of org.apache.qpid.proton.hawtdispatch.impl.Watch

            tagCache.add(data);
        }
    }

    public void onOverflowBufferDrained(final Callback<Void> cb) {
        addWatch(new Watch() {
            @Override
            public boolean execute() {
                if (outboundBufferSize==0) {
                    cb.onSuccess(null);
                    return true;
View Full Code Here

Examples of org.kie.api.definition.rule.Watch

    }

    protected void processListenedPropertiesAnnotation(RuleBuildContext context, PatternDescr patternDescr, Pattern pattern) {
        String watchedValues = null;
        try {
            Watch watch = patternDescr.getTypedAnnotation(Watch.class);
            watchedValues = watch == null ? null : watch.value();
        } catch (Exception e) {
            context.addError( new DescrBuildError( context.getParentDescr(),
                                                   patternDescr,
                                                   null,
                                                   e.getMessage() ) );
View Full Code Here

Examples of org.netbeans.api.debugger.Watch

            System.arraycopy(result, 0, ch, 0, result.length);
           
            synchronized (watch2JspElWatch) {
               
                for (int i = from; i < allWatches.length; i++) {
                    Watch w = allWatches[i];
                    String expression = w.getExpression();
                    if (isCLJexpression(expression)) {
                        ClojureElWatch jw = (ClojureElWatch) watch2JspElWatch.get(w);
                        if (jw == null ) {
                            jw = new ClojureElWatch(w, debugger);
                            watch2JspElWatch.put(w, jw);
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

            wds.setConfiguration(EmptyConfiguration.INSTANCE);
            wds.initialize();
            //wds.setID(id);
            //wds.initialize();

            Watch watch = construct4(wds, id);
            Assert.assertEquals(id, watch.getId());
            testInstance(watch);
            Utils.close(watch.getWatchDataSource());
        }

        // Illegal id
        try {
            String id = null;
            WatchDataSourceImpl wdsi = new WatchDataSourceImpl();
            wdsi.setID("");
            wdsi.setConfiguration(EmptyConfiguration.INSTANCE);
            WatchDataSource wds = wdsi.export();

            construct4(wds, id);
            Assert.fail("IllegalArgumentException expected but not thrown");
        } catch (IllegalArgumentException e) {
        }
        try {
            String id = "";
            construct1(id);
            Assert.fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
        }

        // watchDataSource
        final int collectionSizes[] = new int[]{1, 1000, 5000};
        for (int collectionSize : collectionSizes) {
            DynamicConfiguration config = new DynamicConfiguration();
            config.setEntry("org.rioproject.watch", "collectionSize",
                            collectionSize);
            //WatchDataSource wds = new WatchDataSourceImpl("", null,
            //                                              config).export();
            WatchDataSource wds = new WatchDataSourceImpl();
            wds.setConfiguration(config);

            Watch watch = construct4(wds, "watch");
            Assert.assertSame(wds, watch.getWatchDataSource());
            checkInstance(watch, collectionSize, false);
            Utils.close(watch.getWatchDataSource());
        }

        // Illegal watchDataSource
        try {
            WatchDataSource wds = null;
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

     * @throws Exception if the test fails
     */
    @Test
    public void testAddWatchRecord() throws Exception {

        Watch watch1 = construct1("watch1");
        checkInstance(watch1, 1000, false);
        Utils.close(watch1.getWatchDataSource());

        Watch watch2 = construct1("watch2");
        try {
            checkInstance(watch2, 1000, true);
            Assert.fail("IllegalArgumentException expected but not thrown");
        } catch (IllegalArgumentException e) {
        }
        Utils.close(watch2.getWatchDataSource());
    }
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

     *
     * @throws Exception if the test fails
     */
    @Test
    public void testEquals() throws Exception {
        Watch watch1 = construct1("abc");
        Watch watch2 = construct1("abc");
        Watch watch3 = construct1("1-2");
        Watch watch4 = construct1("1.2");
        Assert.assertTrue(watch1.equals(watch2));
        Assert.assertFalse(watch1.equals(watch3));
        Assert.assertFalse(watch1.equals(watch4));
        Assert.assertFalse(watch1.equals(new Object()));
        Assert.assertFalse(watch1.equals("abc"));
        Utils.close(watch1.getWatchDataSource());
        Utils.close(watch2.getWatchDataSource());
        Utils.close(watch3.getWatchDataSource());
        Utils.close(watch4.getWatchDataSource());
    }
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

     */
    @Test
    public void testGetId() throws Exception {
        String ids[] = new String[]{"1-2", "abc"};
        for (String id : ids) {
            Watch watch = construct1(id);
            Assert.assertEquals(id, watch.getId());
            Utils.close(watch.getWatchDataSource());
        }
    }
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

     *
     * @throws Exception if the test fails
     */
    @Test
    public void testGetSetView() throws Exception {
        Watch watch = construct1("watch");
        Assert.assertEquals(expectedView, watch.getView());

        watch.setView("MyView");
        Assert.assertEquals("MyView", watch.getView());

        try {
            watch.setView(null);
            Assert.fail("IllegalArgumentException expected but not thrown");
        } catch (IllegalArgumentException e) {
        }

        Utils.close(watch.getWatchDataSource());
    }
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

    public void testGetSetWatchDataSource() throws Exception {
        WatchDataSourceImpl wdsi = new WatchDataSourceImpl();
        wdsi.setID("wds");
        wdsi.setConfiguration(EmptyConfiguration.INSTANCE);
        WatchDataSource wds = wdsi.export();
        Watch watch = construct4(wds, "watch");
        Assert.assertSame(wds, watch.getWatchDataSource());

        WatchDataSourceImpl wdsi2 = new WatchDataSourceImpl();
        wdsi2.setID("otherWds");
        wdsi2.setConfiguration(EmptyConfiguration.INSTANCE);
        WatchDataSource otherWds = wdsi2.export();
               
        watch.setWatchDataSource(otherWds);
        Assert.assertSame(otherWds, watch.getWatchDataSource());

        watch.setWatchDataSource(null);
        Assert.assertSame(otherWds, watch.getWatchDataSource());

        Utils.close(watch.getWatchDataSource());
    }
View Full Code Here

Examples of org.rioproject.impl.watch.Watch

     */
    @Test
    public void testHashCode() throws Exception {
        String ids[] = new String[]{"1-2", "abc"};
        for (String id : ids) {
            Watch watch = construct1(id);
            watch.hashCode();
            Utils.close(watch.getWatchDataSource());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.