org.omg.CosNaming.NamingContextPackage.NotFound Java Examples

The following examples show how to use org.omg.CosNaming.NamingContextPackage.NotFound. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NamingContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #2
Source File: NamingContextImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #3
Source File: NamingContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #4
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #5
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #6
Source File: NamingContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #7
Source File: NamingContextImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This operation resolves the Stringified name into the object
 * reference.
 * @param sn Stringified Name of the object <p>
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound
 * Indicates there is no object reference for the given name. <p>
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed
 * Indicates that the given compound name is incorrect <p>
 * @exception org.omg.CosNaming.NamingContextExtPackage.InvalidName
 * Indicates the name does not identify a binding.<p>
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound
 * Indicates the name is already bound.<p>
 *
 */
public org.omg.CORBA.Object resolve_str(String sn)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    org.omg.CORBA.Object theObject = null;
    // Name valid?
    if  ( (sn == null ) || (sn.length() == 0) )
    {
            throw new InvalidName();
    }
    NamingContextDataStore impl = (NamingContextDataStore)this;
    org.omg.CosNaming.NameComponent[] theNameComponents =
            insImpl.convertToNameComponent( sn );

    if( ( theNameComponents == null ) || (theNameComponents.length == 0 ) )
    {
            throw new InvalidName();
    }
    theObject = resolve( theNameComponents );
    return theObject;
}
 
Example #8
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
* Implements resolving a NameComponent in this context and
* narrowing it to CosNaming::NamingContext. It will throw appropriate
* exceptions if not found or not narrowable.
* @param impl an implementation of NamingContextDataStore
* @param n a NameComponents which is the name to be found.
* @exception org.omg.CosNaming.NamingContextPackage.NotFound The
* first component could not be resolved.
* @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed
* in resolving the first component of the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
* @see resolve
*/
 protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl,
                                                      NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound {
     org.omg.CORBA.Object topRef = null;
     BindingTypeHolder bth = new BindingTypeHolder();
     NamingContext context = null;

     synchronized (impl) {
         // Resolve first  - must be resolveable
         topRef = impl.Resolve(n[0],bth);
         if (topRef == null) {
             // It was not bound
             throw new NotFound(NotFoundReason.missing_node,n);
         }
     }

     // Was it bound as a context?
     if (bth.value != BindingType.ncontext) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Narrow to a naming context
     try {
         context = NamingContextHelper.narrow(topRef);
     } catch (org.omg.CORBA.BAD_PARAM ex) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Hmm. must be ok
     return context;
 }
 
Example #9
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #10
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
* Implements resolving a NameComponent in this context and
* narrowing it to CosNaming::NamingContext. It will throw appropriate
* exceptions if not found or not narrowable.
* @param impl an implementation of NamingContextDataStore
* @param n a NameComponents which is the name to be found.
* @exception org.omg.CosNaming.NamingContextPackage.NotFound The
* first component could not be resolved.
* @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed
* in resolving the first component of the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
* @see resolve
*/
 protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl,
                                                      NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound {
     org.omg.CORBA.Object topRef = null;
     BindingTypeHolder bth = new BindingTypeHolder();
     NamingContext context = null;

     synchronized (impl) {
         // Resolve first  - must be resolveable
         topRef = impl.Resolve(n[0],bth);
         if (topRef == null) {
             // It was not bound
             throw new NotFound(NotFoundReason.missing_node,n);
         }
     }

     // Was it bound as a context?
     if (bth.value != BindingType.ncontext) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Narrow to a naming context
     try {
         context = NamingContextHelper.narrow(topRef);
     } catch (org.omg.CORBA.BAD_PARAM ex) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Hmm. must be ok
     return context;
 }
 
Example #11
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #12
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind an object under a name in this NamingContext. If the name
 * contains multiple (n) components, n-1 will be resolved in this
 * NamingContext and the object bound in resulting NamingContext.
 * If a binding under the supplied name already exists it will be
 * unbound first. If the
 * object to be bound is a NamingContext it will not participate in
 * a recursive resolve.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind(NameComponent[] n, org.omg.CORBA.Object obj)
    throws       org.omg.CosNaming.NamingContextPackage.NotFound,
                 org.omg.CosNaming.NamingContextPackage.CannotProceed,
                 org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( obj == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Object cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,obj,true,BindingType.nobject);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a Naming Context" );
        // This should not happen
        throw wrapper.namingCtxRebindAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE  ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #13
Source File: NamingContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #14
Source File: NamingContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #15
Source File: NamingContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #16
Source File: NamingContextImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
* Implements resolving a NameComponent in this context and
* narrowing it to CosNaming::NamingContext. It will throw appropriate
* exceptions if not found or not narrowable.
* @param impl an implementation of NamingContextDataStore
* @param n a NameComponents which is the name to be found.
* @exception org.omg.CosNaming.NamingContextPackage.NotFound The
* first component could not be resolved.
* @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed
* in resolving the first component of the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
* @see resolve
*/
 protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl,
                                                      NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound {
     org.omg.CORBA.Object topRef = null;
     BindingTypeHolder bth = new BindingTypeHolder();
     NamingContext context = null;

     synchronized (impl) {
         // Resolve first  - must be resolveable
         topRef = impl.Resolve(n[0],bth);
         if (topRef == null) {
             // It was not bound
             throw new NotFound(NotFoundReason.missing_node,n);
         }
     }

     // Was it bound as a context?
     if (bth.value != BindingType.ncontext) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Narrow to a naming context
     try {
         context = NamingContextHelper.narrow(topRef);
     } catch (org.omg.CORBA.BAD_PARAM ex) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Hmm. must be ok
     return context;
 }
 
Example #17
Source File: NamingContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind an object under a name in this NamingContext. If the name
 * contains multiple (n) components, n-1 will be resolved in this
 * NamingContext and the object bound in resulting NamingContext.
 * If a binding under the supplied name already exists it will be
 * unbound first. If the
 * object to be bound is a NamingContext it will not participate in
 * a recursive resolve.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind(NameComponent[] n, org.omg.CORBA.Object obj)
    throws       org.omg.CosNaming.NamingContextPackage.NotFound,
                 org.omg.CosNaming.NamingContextPackage.CannotProceed,
                 org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( obj == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Object cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,obj,true,BindingType.nobject);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a Naming Context" );
        // This should not happen
        throw wrapper.namingCtxRebindAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE  ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #18
Source File: NamingContextImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #19
Source File: NamingContextImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #20
Source File: NamingContextImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #21
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #22
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Bind an object under a name in this NamingContext. If the name
 * contains multiple (n) components, n-1 will be resolved in this
 * NamingContext and the object bound in resulting NamingContext.
 * If a binding under the supplied name already exists it will be
 * unbound first. If the
 * object to be bound is a NamingContext it will not participate in
 * a recursive resolve.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind(NameComponent[] n, org.omg.CORBA.Object obj)
    throws       org.omg.CosNaming.NamingContextPackage.NotFound,
                 org.omg.CosNaming.NamingContextPackage.CannotProceed,
                 org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( obj == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Object cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,obj,true,BindingType.nobject);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a Naming Context" );
        // This should not happen
        throw wrapper.namingCtxRebindAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE  ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #23
Source File: NamingContextImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #24
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #25
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Create a new NamingContext, bind it in this Naming Context and return
 * its object reference. This is equivalent to using new_context() followed
 * by bind_context() with the supplied name and the object reference for
 * the newly created NamingContext.
 * @param n a sequence of NameComponents which is the name to be unbound.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server, bound to the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.AlreadyBound An object
 * is already bound under the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see new_context
 * @see bind_context
 */
public  NamingContext bind_new_context(NameComponent[] n)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.AlreadyBound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    NamingContext nc = null;
    NamingContext rnc = null;
    try {
        if (debug)
            dprint("bind_new_context " + nameToString(n));
        // The obvious solution:
        nc = this.new_context();
        this.bind_context(n,nc);
        rnc = nc;
        nc = null;
    } finally {
        try {
            if(nc != null)
                nc.destroy();
        } catch (org.omg.CosNaming.NamingContextPackage.NotEmpty e) {
        }
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine ( LogKeywords.NAMING_BIND +
            "New Context Bound To " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
    return rnc;
}
 
Example #26
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind an object under a name in this NamingContext. If the name
 * contains multiple (n) components, n-1 will be resolved in this
 * NamingContext and the object bound in resulting NamingContext.
 * If a binding under the supplied name already exists it will be
 * unbound first. If the
 * object to be bound is a NamingContext it will not participate in
 * a recursive resolve.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind(NameComponent[] n, org.omg.CORBA.Object obj)
    throws       org.omg.CosNaming.NamingContextPackage.NotFound,
                 org.omg.CosNaming.NamingContextPackage.CannotProceed,
                 org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( obj == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Object cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,obj,true,BindingType.nobject);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a Naming Context" );
        // This should not happen
        throw wrapper.namingCtxRebindAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE  ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #27
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
* Implements resolving a NameComponent in this context and
* narrowing it to CosNaming::NamingContext. It will throw appropriate
* exceptions if not found or not narrowable.
* @param impl an implementation of NamingContextDataStore
* @param n a NameComponents which is the name to be found.
* @exception org.omg.CosNaming.NamingContextPackage.NotFound The
* first component could not be resolved.
* @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed
* in resolving the first component of the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
* @see resolve
*/
 protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl,
                                                      NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound {
     org.omg.CORBA.Object topRef = null;
     BindingTypeHolder bth = new BindingTypeHolder();
     NamingContext context = null;

     synchronized (impl) {
         // Resolve first  - must be resolveable
         topRef = impl.Resolve(n[0],bth);
         if (topRef == null) {
             // It was not bound
             throw new NotFound(NotFoundReason.missing_node,n);
         }
     }

     // Was it bound as a context?
     if (bth.value != BindingType.ncontext) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Narrow to a naming context
     try {
         context = NamingContextHelper.narrow(topRef);
     } catch (org.omg.CORBA.BAD_PARAM ex) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Hmm. must be ok
     return context;
 }
 
Example #28
Source File: NamingContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind an object under a name in this NamingContext. If the name
 * contains multiple (n) components, n-1 will be resolved in this
 * NamingContext and the object bound in resulting NamingContext.
 * If a binding under the supplied name already exists it will be
 * unbound first. If the
 * object to be bound is a NamingContext it will not participate in
 * a recursive resolve.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind(NameComponent[] n, org.omg.CORBA.Object obj)
    throws       org.omg.CosNaming.NamingContextPackage.NotFound,
                 org.omg.CosNaming.NamingContextPackage.CannotProceed,
                 org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( obj == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Object cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,obj,true,BindingType.nobject);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a Naming Context" );
        // This should not happen
        throw wrapper.namingCtxRebindAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE  ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #29
Source File: NamingContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Bind a NamingContext under a name in this NamingContext. If the name
 * contains multiple (n) components, the first n-1 components will be
 * resolved in this NamingContext and the object bound in resulting
 * NamingContext. If a binding under the supplied name already exists it
 * will be unbound first. The NamingContext will participate in recursive
 * resolving.
 * @param n a sequence of NameComponents which is the name under which
 * the object will be bound.
 * @param obj the object reference to be bound.
 * @exception org.omg.CosNaming.NamingContextPackage.NotFound A name with
 * multiple components was supplied, but the first component could not be
 * resolved.
 * @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not
 * proceed in resolving the n-1 components of the supplied name.
 * @exception org.omg.CosNaming.NamingContextPackage.InvalidName The
 * supplied name is invalid (i.e., has length less than 1).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see doBind
 */
public  void rebind_context(NameComponent[] n, NamingContext nc)
    throws org.omg.CosNaming.NamingContextPackage.NotFound,
           org.omg.CosNaming.NamingContextPackage.CannotProceed,
           org.omg.CosNaming.NamingContextPackage.InvalidName
{
    if( nc == null )
    {
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            " NULL Context cannot be Bound " );
        throw wrapper.objectIsNull() ;
    }
    try {
        // doBind implements all four flavors of binding
        NamingContextDataStore impl = (NamingContextDataStore)this;
        doBind(impl,n,nc,true,BindingType.ncontext);
    } catch (org.omg.CosNaming.NamingContextPackage.AlreadyBound ex) {
        // This should not happen
        updateLogger.warning( LogKeywords.NAMING_REBIND_FAILURE +
            NamingUtils.getDirectoryStructuredName( n ) +
            " is already bound to a CORBA Object" );
        throw wrapper.namingCtxRebindctxAlreadyBound( ex ) ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        updateLogger.fine( LogKeywords.NAMING_REBIND_SUCCESS + " Name = " +
            NamingUtils.getDirectoryStructuredName( n ) );
    }
}
 
Example #30
Source File: NamingContextImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
* Implements resolving a NameComponent in this context and
* narrowing it to CosNaming::NamingContext. It will throw appropriate
* exceptions if not found or not narrowable.
* @param impl an implementation of NamingContextDataStore
* @param n a NameComponents which is the name to be found.
* @exception org.omg.CosNaming.NamingContextPackage.NotFound The
* first component could not be resolved.
* @exception org.omg.CosNaming.NamingContextPackage.CannotProceed Could not proceed
* in resolving the first component of the supplied name.
* @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions.
* @see resolve
*/
 protected static NamingContext resolveFirstAsContext(NamingContextDataStore impl,
                                                      NameComponent[] n)
     throws org.omg.CosNaming.NamingContextPackage.NotFound {
     org.omg.CORBA.Object topRef = null;
     BindingTypeHolder bth = new BindingTypeHolder();
     NamingContext context = null;

     synchronized (impl) {
         // Resolve first  - must be resolveable
         topRef = impl.Resolve(n[0],bth);
         if (topRef == null) {
             // It was not bound
             throw new NotFound(NotFoundReason.missing_node,n);
         }
     }

     // Was it bound as a context?
     if (bth.value != BindingType.ncontext) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Narrow to a naming context
     try {
         context = NamingContextHelper.narrow(topRef);
     } catch (org.omg.CORBA.BAD_PARAM ex) {
         // It was not a context
         throw new NotFound(NotFoundReason.not_context,n);
     }

     // Hmm. must be ok
     return context;
 }