Package javax.naming.event

Examples of javax.naming.event.NamingEvent


    {
        try
        {
            Binding binding = new Binding( opContext.getDn().getName(),
                ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
            NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_ADDED,
                binding, null, opContext );

            if ( listener instanceof NamespaceChangeListener )
            {
                ( ( NamespaceChangeListener ) listener ).objectAdded( evt );
View Full Code Here


        {
            if ( listener instanceof NamespaceChangeListener )
            {
                Binding binding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_REMOVED, null,
                    binding, opContext );
                ( ( NamespaceChangeListener ) listener ).objectAdded( evt );
            }
        }
        catch ( Exception e )
View Full Code Here

        {
            Binding newBinding = new Binding( opContext.getDn().getName(),
                ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
            Binding oldBinding = new Binding( opContext.getDn().getName(),
                ServerEntryUtils.toBasicAttributes( opContext.getEntry().getOriginalEntry() )false );
            NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_CHANGED,
                newBinding, oldBinding, opContext );

            if ( listener instanceof ObjectChangeListener )
            {
                ( ( ObjectChangeListener ) listener ).objectChanged( evt );
View Full Code Here

            {
                Binding newBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
                Binding oldBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry().getOriginalEntry() ), false );
                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED,
                    newBinding, oldBinding, opContext );
                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
            }
        }
        catch ( Exception e )
View Full Code Here

            {
                Binding newBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
                Binding oldBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry().getOriginalEntry() ), false );
                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED,
                    newBinding, oldBinding, opContext );
                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
            }
        }
        catch ( Exception e )
View Full Code Here

            {
                Binding newBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry() ), false );
                Binding oldBinding = new Binding( opContext.getDn().getName(),
                    ServerEntryUtils.toBasicAttributes( opContext.getEntry().getOriginalEntry() ), false );
                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED,
                    newBinding, oldBinding, null );
                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
            }
        }
        catch ( Exception e )
View Full Code Here

     * @param scopes The scopes this event should be fired against
     */
    void fireEvent(final EventContext context, final Name name, final Binding existingBinding, final Binding newBinding, int type, final String changeInfo, final Integer... scopes) {
        final String target = name.toString();
        final Set<Integer> scopeSet = new HashSet<Integer>(Arrays.asList(scopes));
        final NamingEvent event = new NamingEvent(context, type, newBinding, existingBinding, changeInfo);

        final Set<ListenerHolder> holdersToFire = new HashSet<ListenerHolder>();

        // Check for OBJECT_SCOPE based listeners
        if (scopeSet.contains(EventContext.OBJECT_SCOPE)) {
View Full Code Here

     * @param scopes The scopes this event should be fired against
     */
    void fireEvent(final EventContext context, final Name name, final Binding existingBinding, final Binding newBinding, int type, final String changeInfo, final Integer... scopes) {
        final String target = name.toString();
        final Set<Integer> scopeSet = new HashSet<Integer>(Arrays.asList(scopes));
        final NamingEvent event = new NamingEvent(context, type, newBinding, existingBinding, changeInfo);

        final Set<ListenerHolder> holdersToFire = new HashSet<ListenerHolder>();

        // Check for OBJECT_SCOPE based listeners
        if (scopeSet.contains(EventContext.OBJECT_SCOPE)) {
View Full Code Here

         */
        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;
                    namingEvent
                            .dispatch((UnsolicitedNotificationListener) listener);
                }

            }

View Full Code Here

            // FIXME: how to get old binding?
            oldBinding = new Binding(relativeName, null);
            oldBinding.setNameInNamespace(result.getDn());
        }

        NamingEvent event = new NamingEvent(this, control.getJNDIChangeType(),
                newBinding, oldBinding, Integer.valueOf(control
                        .getChangeNumber()));

        return event;
    }
View Full Code Here

TOP

Related Classes of javax.naming.event.NamingEvent

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.