Package javax.naming

Examples of javax.naming.Binding


  private static Binding getBinding(Context ctx, String name, String path)
      throws NamingException {
    NamingEnumeration<Binding> ne = ctx.listBindings(name);
    while (ne.hasMore()) {
      Binding b = ne.next();
      if (LOG.isDebugEnabled()) {
        LOG.debug("Property: " + b.getName());
      }
      if (path.equals(b.getName())) {
        return b;
      }
    }
    return null;
  }
View Full Code Here


     */
    public void entryAdded( AddOperationContext opContext )
    {
        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 )
View Full Code Here

    {
        try
        {
            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 );
            }
View Full Code Here

     */
    public void entryModified( ModifyOperationContext opContext )
    {
        try
        {
            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 )
View Full Code Here

    {
        try
        {
            if ( listener instanceof NamespaceChangeListener )
            {
                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 );
            }
View Full Code Here

    {
        try
        {
            if ( listener instanceof NamespaceChangeListener )
            {
                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 );
            }
View Full Code Here

    {
        try
        {
            if ( listener instanceof NamespaceChangeListener )
            {
                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 );
            }
View Full Code Here

        NamingEnumeration bindings = context.listBindings("");
        while (bindings.hasMore()) {
            Object next=bindings.next();
            if( next instanceof Binding ) {
                Binding binding = (Binding) next;
                String name = prefix + binding.getName();
                Object value = context.lookup(binding.getName());
                if (debug >= 1 && name!=null) {
                    log("Processing resource " + name + " " + name.getClass().getName());
                }
                try {
                    if (value instanceof Context) {
View Full Code Here

            } catch (Exception e) {
                throw new NamingException(e.getMessage());
            }
        }
       
        return new Binding(entry.name, entry.value.getClass().getName(),
                           entry.value, true);
    }
View Full Code Here

        try
        {
            NamingEnumeration nenum = context.listBindings("");
            while (nenum.hasMoreElements())
            {
                Binding binding = (Binding)nenum.next();
                if (binding.getObject() instanceof Context)
                    lookupNamingEntries (list, (Context)binding.getObject(), clazz);
                else if (clazz.isInstance(binding.getObject()))
                  list.add(binding.getObject());
            }
        }
        catch (NameNotFoundException e)
        {
            Log.debug("No entries of type "+clazz.getName()+" in context="+context);
View Full Code Here

TOP

Related Classes of javax.naming.Binding

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.