com.sun.corba.se.impl.orbutil.LogKeywords Java Examples

The following examples show how to use com.sun.corba.se.impl.orbutil.LogKeywords. 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: TransientNamingContext.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Binds the object to the name component as the specified binding type.
 * It creates a InternalBindingKey object and a InternalBindingValue
 * object and inserts them in the hash table.
 * @param n A single org.omg.CosNaming::NameComponent under which the
 * object will be bound.
 * @param obj An object reference to be bound under the supplied name.
 * @param bt The type of the binding (i.e., as object or as context).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final void Bind(NameComponent n, org.omg.CORBA.Object obj,
                       BindingType bt)
    throws org.omg.CORBA.SystemException
{
    // Create a key and a value
    InternalBindingKey key = new InternalBindingKey(n);
    NameComponent[] name = new NameComponent[1];
    name[0] = n;
    Binding b = new Binding(name,bt);
    InternalBindingValue value = new InternalBindingValue(b,null);
    value.theObjectRef = obj;
    // insert it
    InternalBindingValue oldValue =
        (InternalBindingValue)this.theHashtable.put(key,value);

    if (oldValue != null) {
        updateLogger.warning( LogKeywords.NAMING_BIND + "Name " +
            getName( n ) + " Was Already Bound" );
        throw wrapper.transNcBindAlreadyBound() ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS +
            "Name Component: " + n.id + "." + n.kind );
    }
}
 
Example #2
Source File: NamingContextImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #3
Source File: NamingContextImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #4
Source File: TransientNamingContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #5
Source File: NamingContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #6
Source File: NamingContextImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #7
Source File: TransientNamingContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Binds the object to the name component as the specified binding type.
 * It creates a InternalBindingKey object and a InternalBindingValue
 * object and inserts them in the hash table.
 * @param n A single org.omg.CosNaming::NameComponent under which the
 * object will be bound.
 * @param obj An object reference to be bound under the supplied name.
 * @param bt The type of the binding (i.e., as object or as context).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final void Bind(NameComponent n, org.omg.CORBA.Object obj,
                       BindingType bt)
    throws org.omg.CORBA.SystemException
{
    // Create a key and a value
    InternalBindingKey key = new InternalBindingKey(n);
    NameComponent[] name = new NameComponent[1];
    name[0] = n;
    Binding b = new Binding(name,bt);
    InternalBindingValue value = new InternalBindingValue(b,null);
    value.theObjectRef = obj;
    // insert it
    InternalBindingValue oldValue =
        (InternalBindingValue)this.theHashtable.put(key,value);

    if (oldValue != null) {
        updateLogger.warning( LogKeywords.NAMING_BIND + "Name " +
            getName( n ) + " Was Already Bound" );
        throw wrapper.transNcBindAlreadyBound() ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS +
            "Name Component: " + n.id + "." + n.kind );
    }
}
 
Example #8
Source File: TransientNamingContext.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #9
Source File: NamingContextImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Create a NamingContext object and return its object reference.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public synchronized NamingContext new_context()
{
    // Create actually creates a new naming context
    lifecycleLogger.fine( "Creating New Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        NamingContext nctx = impl.NewContext();
        if( nctx != null ) {
            lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS );
        } else {
            // If naming context is null, then that must be a serious
            // error.
            lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE );
        }
        return nctx;
    }
}
 
Example #10
Source File: TransientNamingContext.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #11
Source File: TransientNamingContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #12
Source File: TransientNamingContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Binds the object to the name component as the specified binding type.
 * It creates a InternalBindingKey object and a InternalBindingValue
 * object and inserts them in the hash table.
 * @param n A single org.omg.CosNaming::NameComponent under which the
 * object will be bound.
 * @param obj An object reference to be bound under the supplied name.
 * @param bt The type of the binding (i.e., as object or as context).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final void Bind(NameComponent n, org.omg.CORBA.Object obj,
                       BindingType bt)
    throws org.omg.CORBA.SystemException
{
    // Create a key and a value
    InternalBindingKey key = new InternalBindingKey(n);
    NameComponent[] name = new NameComponent[1];
    name[0] = n;
    Binding b = new Binding(name,bt);
    InternalBindingValue value = new InternalBindingValue(b,null);
    value.theObjectRef = obj;
    // insert it
    InternalBindingValue oldValue =
        (InternalBindingValue)this.theHashtable.put(key,value);

    if (oldValue != null) {
        updateLogger.warning( LogKeywords.NAMING_BIND + "Name " +
            getName( n ) + " Was Already Bound" );
        throw wrapper.transNcBindAlreadyBound() ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS +
            "Name Component: " + n.id + "." + n.kind );
    }
}
 
Example #13
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #14
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a NamingContext object and return its object reference.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public synchronized NamingContext new_context()
{
    // Create actually creates a new naming context
    lifecycleLogger.fine( "Creating New Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        NamingContext nctx = impl.NewContext();
        if( nctx != null ) {
            lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS );
        } else {
            // If naming context is null, then that must be a serious
            // error.
            lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE );
        }
        return nctx;
    }
}
 
Example #15
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #16
Source File: NamingContextImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #17
Source File: TransientNamingContext.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #18
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a NamingContext object and return its object reference.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public synchronized NamingContext new_context()
{
    // Create actually creates a new naming context
    lifecycleLogger.fine( "Creating New Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        NamingContext nctx = impl.NewContext();
        if( nctx != null ) {
            lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS );
        } else {
            // If naming context is null, then that must be a serious
            // error.
            lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE );
        }
        return nctx;
    }
}
 
Example #19
Source File: NamingContextImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #20
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #21
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Create a NamingContext object and return its object reference.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public synchronized NamingContext new_context()
{
    // Create actually creates a new naming context
    lifecycleLogger.fine( "Creating New Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        NamingContext nctx = impl.NewContext();
        if( nctx != null ) {
            lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS );
        } else {
            // If naming context is null, then that must be a serious
            // error.
            lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE );
        }
        return nctx;
    }
}
 
Example #22
Source File: NamingContextImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #23
Source File: TransientNamingContext.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Binds the object to the name component as the specified binding type.
 * It creates a InternalBindingKey object and a InternalBindingValue
 * object and inserts them in the hash table.
 * @param n A single org.omg.CosNaming::NameComponent under which the
 * object will be bound.
 * @param obj An object reference to be bound under the supplied name.
 * @param bt The type of the binding (i.e., as object or as context).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final void Bind(NameComponent n, org.omg.CORBA.Object obj,
                       BindingType bt)
    throws org.omg.CORBA.SystemException
{
    // Create a key and a value
    InternalBindingKey key = new InternalBindingKey(n);
    NameComponent[] name = new NameComponent[1];
    name[0] = n;
    Binding b = new Binding(name,bt);
    InternalBindingValue value = new InternalBindingValue(b,null);
    value.theObjectRef = obj;
    // insert it
    InternalBindingValue oldValue =
        (InternalBindingValue)this.theHashtable.put(key,value);

    if (oldValue != null) {
        updateLogger.warning( LogKeywords.NAMING_BIND + "Name " +
            getName( n ) + " Was Already Bound" );
        throw wrapper.transNcBindAlreadyBound() ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS +
            "Name Component: " + n.id + "." + n.kind );
    }
}
 
Example #24
Source File: TransientNamingContext.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}
 
Example #25
Source File: NamingContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #26
Source File: NamingContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * List the contents of this NamingContest. A sequence of bindings
 * is returned (a BindingList) containing up to the number of requested
 * bindings, and a BindingIterator object reference is returned for
 * iterating over the remaining bindings.
 * @param how_many The number of requested bindings in the BindingList.
 * @param bl The BindingList as an out parameter.
 * @param bi The BindingIterator as an out parameter.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 * @see BindingListHolder
 * @see BindingIteratorImpl
 */
public  void list(int how_many, BindingListHolder bl,
    BindingIteratorHolder bi)
{
    // List actually generates the list
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        impl.List(how_many,bl,bi);
    }
    if( readLogger.isLoggable( Level.FINE ) && (bl.value != null )) {
        // isLoggable call to make sure that we save some precious
        // processor cycles, if there is no need to log.
        readLogger.fine ( LogKeywords.NAMING_LIST_SUCCESS +
            "list(" + how_many + ") -> bindings[" + bl.value.length +
            "] + iterator: " + bi.value);
    }
}
 
Example #27
Source File: NamingContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a NamingContext object and return its object reference.
 * @return an object reference for a new NamingContext object implemented
 * by this Name Server.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public synchronized NamingContext new_context()
{
    // Create actually creates a new naming context
    lifecycleLogger.fine( "Creating New Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        NamingContext nctx = impl.NewContext();
        if( nctx != null ) {
            lifecycleLogger.fine( LogKeywords.LIFECYCLE_CREATE_SUCCESS );
        } else {
            // If naming context is null, then that must be a serious
            // error.
            lifecycleLogger.severe ( LogKeywords.LIFECYCLE_CREATE_FAILURE );
        }
        return nctx;
    }
}
 
Example #28
Source File: NamingContextImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Destroy this NamingContext object. If this NamingContext contains
 * no bindings, the NamingContext is deleted.
 * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This
 * NamingContext is not empty (i.e., contains bindings).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public  void destroy()
    throws org.omg.CosNaming.NamingContextPackage.NotEmpty
{
    lifecycleLogger.fine( "Destroying Naming Context " );
    NamingContextDataStore impl = (NamingContextDataStore)this;
    synchronized (impl) {
        if (impl.IsEmpty() == true) {
            // The context is empty so it can be destroyed
            impl.Destroy();
            lifecycleLogger.fine ( LogKeywords.LIFECYCLE_DESTROY_SUCCESS );
        }
        else {
            // This context is not empty!
            // Not a fatal error, warning should do.
            lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE +
                " NamingContext children are not destroyed still.." );
            throw new NotEmpty();
        }
    }
}
 
Example #29
Source File: TransientNamingContext.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Binds the object to the name component as the specified binding type.
 * It creates a InternalBindingKey object and a InternalBindingValue
 * object and inserts them in the hash table.
 * @param n A single org.omg.CosNaming::NameComponent under which the
 * object will be bound.
 * @param obj An object reference to be bound under the supplied name.
 * @param bt The type of the binding (i.e., as object or as context).
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final void Bind(NameComponent n, org.omg.CORBA.Object obj,
                       BindingType bt)
    throws org.omg.CORBA.SystemException
{
    // Create a key and a value
    InternalBindingKey key = new InternalBindingKey(n);
    NameComponent[] name = new NameComponent[1];
    name[0] = n;
    Binding b = new Binding(name,bt);
    InternalBindingValue value = new InternalBindingValue(b,null);
    value.theObjectRef = obj;
    // insert it
    InternalBindingValue oldValue =
        (InternalBindingValue)this.theHashtable.put(key,value);

    if (oldValue != null) {
        updateLogger.warning( LogKeywords.NAMING_BIND + "Name " +
            getName( n ) + " Was Already Bound" );
        throw wrapper.transNcBindAlreadyBound() ;
    }
    if( updateLogger.isLoggable( Level.FINE ) ) {
        updateLogger.fine( LogKeywords.NAMING_BIND_SUCCESS +
            "Name Component: " + n.id + "." + n.kind );
    }
}
 
Example #30
Source File: TransientNamingContext.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes the binding with the supplied name. It creates a
 * InternalBindingKey and uses it to remove the value associated
 * with the key. If nothing is found an exception is thrown, otherwise
 * the element is removed from the hash table.
 * @param n a NameComponent which is the name to unbind
 * @return the object reference bound to the name, or null if not found.
 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA
 * system exceptions.
 */
public final org.omg.CORBA.Object Unbind(NameComponent n)
    throws org.omg.CORBA.SystemException
{
    // Create a key and remove it from the hashtable
    InternalBindingKey key = new InternalBindingKey(n);
    InternalBindingValue value =
        (InternalBindingValue)this.theHashtable.remove(key);

    // Return what was found
    if (value == null) {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_FAILURE +
                " There was no binding with the name " + getName( n ) +
                " to Unbind " );
        }
        return null;
    } else {
        if( updateLogger.isLoggable( Level.FINE ) ) {
            updateLogger.fine( LogKeywords.NAMING_UNBIND_SUCCESS +
                " NameComponent:  " + getName( n ) );
        }
        return value.theObjectRef;
   }
}