FAQ
Hi

How do I test whether a context is a child of another one?
I looked up the javadocs and code for this functionality,
but I failed to find any. The relationship between
contexts seems to be resolved on DataChannel level, but I
cannot grasp how it actually happens.
I think methods like getParentContext() and
getChildContexts() can be useful.

Best regards
Marcin

Search Discussions

  • Andrus Adamchik at Jan 14, 2009 at 8:54 am
    getParentContext()
    Parent context is a DataChannel of a child, so getChannel() would
    return a parent DataContext in case of a nested context and DataDomain
    in case of a top-level context.
    getChildContexts()
    Context doesn't track its child contexts, only indirectly via event
    manager. If somebody describes a case of why enumerating through a
    context children might be useful (other then sending events, which is
    already implemented), we may add it, storing children via weak
    references to avoid introducing a requirement of explicitly closing
    the child context.

    Andrus

    On Jan 14, 2009, at 3:52 AM, Marcin Skladaniec wrote:

    Hi

    How do I test whether a context is a child of another one? I looked
    up the javadocs and code for this functionality, but I failed to
    find any. The relationship between contexts seems to be resolved on
    DataChannel level, but I cannot grasp how it actually happens.
    I think methods like getParentContext() and getChildContexts() can
    be useful.

    Best regards
    Marcin
  • Marcin Skladaniec at Jan 14, 2009 at 12:29 pm

    On Wed, 14 Jan 2009 10:53:51 +0200 Andrus Adamchik wrote:
    getParentContext()
    Parent context is a DataChannel of a child, so
    getChannel() would return a parent DataContext in case
    of a nested context and DataDomain in case of a
    top-level context.
    thank you, that was what I did not understand.
    getChildContexts()
    Context doesn't track its child contexts, only
    indirectly via event manager. If somebody describes a
    case of why enumerating through a context children might
    be useful (other then sending events, which is already
    implemented), we may add it, storing children via weak
    references to avoid introducing a requirement of
    explicitly closing the child context.
    indeed, I cannot think about the use of it now.
    Thank you for help.
    Marcin
    Andrus

    On Jan 14, 2009, at 3:52 AM, Marcin Skladaniec wrote:

    Hi

    How do I test whether a context is a child of another
    one? I looked
    up the javadocs and code for this functionality, but I
    failed to
    find any. The relationship between contexts seems to be
    resolved on
    DataChannel level, but I cannot grasp how it actually
    happens.
    I think methods like getParentContext() and
    getChildContexts() can
    be useful.

    Best regards
    Marcin

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedJan 14, '09 at 1:52a
activeJan 14, '09 at 12:29p
posts3
users2
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase