Class ContextImpl


  • public final class ContextImpl
    extends Context
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String context_name()
      Retrieves the name of this Context object.
      Context create_child​(java.lang.String name)
      Creates a Context object with the given string as its name and with this Context object set as its parent.
      void delete_values​(java.lang.String propName)
      Deletes from this Context object the NamedValue object(s) whose name field matches the given property name.
      NVList get_values​(java.lang.String startScope, int opFlags, java.lang.String propName)
      Retrieves the NamedValue objects whose name field matches the given name or name pattern.
      Context parent()
      Retrieves the parent of this Context object.
      void set_one_value​(java.lang.String propName, Any propValue)
      Creates a NamedValue object and adds it to this Context object.
      void set_values​(NVList values)
      I Sets one or more property values in this Context object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContextImpl

        public ContextImpl​(ORB orb)
      • ContextImpl

        public ContextImpl​(Context parent)
    • Method Detail

      • context_name

        public java.lang.String context_name()
        Description copied from class: Context
        Retrieves the name of this Context object.
        Specified by:
        context_name in class Context
        Returns:
        the name of this Context object
      • parent

        public Context parent()
        Description copied from class: Context
        Retrieves the parent of this Context object.
        Specified by:
        parent in class Context
        Returns:
        the Context object that is the parent of this Context object
      • create_child

        public Context create_child​(java.lang.String name)
        Description copied from class: Context
        Creates a Context object with the given string as its name and with this Context object set as its parent.

        The new Context object is chained into its parent Context object. This means that in a search for matching property names, if a match is not found in this context, the search will continue in the parent. If that is not successful, the search will continue in the grandparent, if there is one, and so on.

        Specified by:
        create_child in class Context
        Parameters:
        name - the String object to be set as the name of the new Context object
        Returns:
        the newly-created child Context object initialized with the specified name
      • set_one_value

        public void set_one_value​(java.lang.String propName,
                                  Any propValue)
        Description copied from class: Context
        Creates a NamedValue object and adds it to this Context object. The name field of the new NamedValue object is set to the given string, the value field is set to the given Any object, and the flags field is set to zero.
        Specified by:
        set_one_value in class Context
        Parameters:
        propName - the name of the property to be set
        propValue - the Any object to which the value of the property will be set. The Any object's value field contains the value to be associated with the given propname; the kind field must be set to TCKind.tk_string.
      • set_values

        public void set_values​(NVList values)
        Description copied from class: Context
        I Sets one or more property values in this Context object. The NVList supplied to this method contains one or more NamedValue objects. In each NamedValue object, the name field holds the name of the property, and the flags field must be set to zero. The NamedValue object's value field contains an Any object, which, in turn, contains the value for the property. Since the value is always a string, the Any object must have the kind field of its TypeCode set to TCKind.tk_string.
        Specified by:
        set_values in class Context
        Parameters:
        values - an NVList containing the property names and associated values to be set
        See Also:
        Context.get_values(java.lang.String, int, java.lang.String), NamedValue, Any
      • delete_values

        public void delete_values​(java.lang.String propName)
        Description copied from class: Context
        Deletes from this Context object the NamedValue object(s) whose name field matches the given property name. If the String object supplied for propname has a trailing wildcard character ("*"), then all NamedValue objects whose name fields match will be deleted. The search scope is always limited to this Context object.

        If no matching property is found, an exception is returned.

        Specified by:
        delete_values in class Context
        Parameters:
        propName - name of the property to be deleted
      • get_values

        public NVList get_values​(java.lang.String startScope,
                                 int opFlags,
                                 java.lang.String propName)
        Description copied from class: Context
        Retrieves the NamedValue objects whose name field matches the given name or name pattern. This method allows for wildcard searches, which means that there can be multiple matches and therefore multiple values returned. If the property is not found at the indicated level, the search continues up the context object tree until a match is found or all Context objects in the chain have been exhausted.

        If no match is found, an error is returned and no property list is returned.

        Specified by:
        get_values in class Context
        Parameters:
        startScope - a String object indicating the context object level at which to initiate the search for the specified properties (for example, "_USER", "_GROUP", "_SYSTEM"). Valid scope names are implementation-specific. If a scope name is omitted, the search begins with the specified context object. If the specified scope name is not found, an exception is returned.
        opFlags - an operation flag. The one flag that may be specified is CTX_RESTRICT_SCOPE. If this flag is specified, searching is limited to the specified start_scope or this Context object.
        propName - the property name whose values are to be retrieved. pattern may be a name or a name with a trailing wildcard character ("*").
        Returns:
        an NVList containing all the property values (in the form of NamedValue objects) whose associated property name matches the given name or name pattern
        See Also:
        Context.set_values(org.omg.CORBA.NVList), NamedValue