Package javax.naming.event

Examples of javax.naming.event.NamingExceptionEvent


   
   
    private void deliverNamingExceptionEvent( Exception e, OperationContext opContext )
    {
        LOG.error( I18n.err( I18n.ERR_118 ), e );
        NamingExceptionEvent evt = null;
       
        if ( e instanceof NamingException )
        {
            evt = new NamingExceptionEvent( source, ( NamingException ) e );
        }
        else
        {
            NamingException ne = new NamingException( I18n.err( I18n.ERR_119 ) );
            ne.setRootCause( e );
            evt = new NamingExceptionEvent( source, ne );
        }
       
        listener.namingExceptionThrown( evt );
    }
View Full Code Here


                EventObject event = null;
                try {
                    un.setControls(narrowingControls(cs));
                    event = new UnsolicitedNotificationEvent(this, un);
                } catch (NamingException e) {
                    event = new NamingExceptionEvent(LdapContextImpl.this, e);
                }

                for (UnsolicitedNotificationListener listener : unls) {
                    notifyNamingListener(listener, event);
                }
View Full Code Here

                    // may not happen
                    if (ex == null) {
                        return;
                    }

                    event = new NamingExceptionEvent(LdapContextImpl.this, ex);
                }

                // notify listener
                notifyNamingListener(listener, event);
            }
View Full Code Here

            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;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
View Full Code Here


    private void deliverNamingExceptionEvent( Exception e )
    {
        LOG.error( I18n.err( I18n.ERR_118 ), e );
        NamingExceptionEvent evt = null;

        if ( e instanceof NamingException )
        {
            evt = new NamingExceptionEvent( source, ( NamingException ) e );
        }
        else
        {
            NamingException ne = new NamingException( I18n.err( I18n.ERR_119 ) );
            ne.setRootCause( e );
            evt = new NamingExceptionEvent( source, ne );
        }

        listener.namingExceptionThrown( evt );
    }
View Full Code Here

   
   
    private void deliverNamingExceptionEvent( Exception e )
    {
        LOG.error( I18n.err( I18n.ERR_118 ), e );
        NamingExceptionEvent evt = null;
       
        if ( e instanceof NamingException )
        {
            evt = new NamingExceptionEvent( source, ( NamingException ) e );
        }
        else
        {
            NamingException ne = new NamingException( I18n.err( I18n.ERR_119 ) );
            ne.setRootCause( e );
            evt = new NamingExceptionEvent( source, ne );
        }
       
        listener.namingExceptionThrown( evt );
    }
View Full Code Here


    private void deliverNamingExceptionEvent( Exception e )
    {
        LOG.error( I18n.err( I18n.ERR_118 ), e );
        NamingExceptionEvent evt = null;

        if ( e instanceof NamingException )
        {
            evt = new NamingExceptionEvent( source, ( NamingException ) e );
        }
        else
        {
            NamingException ne = new NamingException( I18n.err( I18n.ERR_119 ) );
            ne.setRootCause( e );
            evt = new NamingExceptionEvent( source, ne );
        }

        listener.namingExceptionThrown( evt );
    }
View Full Code Here

  static EventContext ctx = new EventContextMockUp();

  public void testConstructorAndGetters() {
    log.setMethod("testConstructorAndGetters()");
    NamingExceptionEvent event;

    event = new NamingExceptionEvent(ctx, ex);
    assertSame(ctx, event.getEventContext());
    assertSame(ctx, event.getSource());
    assertSame(ex, event.getException());
  }
View Full Code Here

    assertSame(ex, event.getException());
  }

  public void testConstructor_ValidateArgs() {
    log.setMethod("testConstructor_ValidateArgs()");
    NamingExceptionEvent event;

    try {
      event = new NamingExceptionEvent(null, ex);
      fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    }

    event = new NamingExceptionEvent(ctx, null);
    assertNull(event.getException());
  }
View Full Code Here

    assertNull(event.getException());
  }

  public void testDispatch() {
    log.setMethod("testDispatch()");
    NamingExceptionEvent event;

    event = new NamingExceptionEvent(ctx, ex);
    event.dispatch(new TestListener(event));
  }
View Full Code Here

TOP

Related Classes of javax.naming.event.NamingExceptionEvent

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.