Package javax.naming.event

Examples of javax.naming.event.NamingEvent.dispatch()


        Thread thread = new Thread(new Runnable() {

            public void run() {
                if (event instanceof NamingEvent) {
                    NamingEvent namingEvent = (NamingEvent) event;
                    namingEvent.dispatch(listener);
                } else if (event instanceof NamingExceptionEvent) {
                    NamingExceptionEvent exceptionEvent = (NamingExceptionEvent) event;
                    listener.namingExceptionThrown(exceptionEvent);
                } else if (event instanceof UnsolicitedNotificationEvent) {
                    UnsolicitedNotificationEvent namingEvent = (UnsolicitedNotificationEvent) event;
View Full Code Here


                } else if (event instanceof NamingExceptionEvent) {
                    NamingExceptionEvent exceptionEvent = (NamingExceptionEvent) event;
                    listener.namingExceptionThrown(exceptionEvent);
                } else if (event instanceof UnsolicitedNotificationEvent) {
                    UnsolicitedNotificationEvent namingEvent = (UnsolicitedNotificationEvent) event;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
                }

            }
View Full Code Here

        NamingEvent event;

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_ADDED, binding1, binding2,
                "anything");

        event.dispatch(new TestAllListener(event));
    }

    public void testDispatch_REMOVED() {
        log.setMethod("testDispatch_REMOVED()");
        NamingEvent event;
View Full Code Here

        NamingEvent event;

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_REMOVED, binding1, binding2,
                "anything");

        event.dispatch(new TestAllListener(event));
    }

    public void testDispatch_RENAMED() {
        log.setMethod("testDispatch_RENAMED()");
        NamingEvent event;
View Full Code Here

        NamingEvent event;

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_RENAMED, binding1, binding2,
                "anything");

        event.dispatch(new TestAllListener(event));
    }

    public void testDispatch_CHANGED() {
        log.setMethod("testDispatch_CHANGED()");
        NamingEvent event;
View Full Code Here

        NamingEvent event;

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_CHANGED, binding1, binding2,
                "anything");

        event.dispatch(new TestAllListener(event));
    }

    public void testDispatch_ADDED_BadListenerType() {
        log.setMethod("testDispatch_ADDED_BadListenerType()");
        NamingEvent event;
View Full Code Here

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_ADDED, binding1, binding2,
                "anything");

        try {
            event.dispatch(new TestEmptyListener(event));
            fail("should throw ClassCastException");
        } catch (ClassCastException e) {
        }
    }
View Full Code Here

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_REMOVED, binding1, binding2,
                "anything");

        try {
            event.dispatch(new TestEmptyListener(event));
            fail("should throw ClassCastException");
        } catch (ClassCastException e) {
        }
    }
View Full Code Here

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_RENAMED, binding1, binding2,
                "anything");

        try {
            event.dispatch(new TestEmptyListener(event));
            fail("should throw ClassCastException");
        } catch (ClassCastException e) {
        }
    }
View Full Code Here

        event = new NamingEvent(eventctx, NamingEvent.OBJECT_CHANGED, binding1, binding2,
                "anything");

        try {
            event.dispatch(new TestEmptyListener(event));
            fail("should throw ClassCastException");
        } catch (ClassCastException e) {
        }
    }
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.