Package org.oddjob.jmx.server
Class ServerContextImpl
java.lang.Object
org.oddjob.jmx.server.ServerContextImpl
- All Implemented Interfaces:
ServerContext,AncestorContext
Provide a server context which can be passed down through the nodes
of the server and used to look up useful things.
- Author:
- Rob Gordon.
-
Constructor Summary
ConstructorsConstructorDescriptionServerContextImpl(Object root, ServerModel model, ServerContext parent) A constructor for the top most server context. -
Method Summary
Modifier and TypeMethodDescriptionAdd a child component to the context.The address.Get the bean directory that the component this is the context for belongs to.Get the console archiver for the component this is the context for.Get the log archiver for the component this is the context for.getModel()Get the model.Get the parent context of this context.The server id.Get the component this is the context for.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.oddjob.monitor.context.AncestorContext
findAncestorOfType
-
Constructor Details
-
ServerContextImpl
A constructor for the top most server context.
-
-
Method Details
-
getThisComponent
Description copied from interface:AncestorContextGet the component this is the context for.- Specified by:
getThisComponentin interfaceAncestorContext- Returns:
-
getParent
Description copied from interface:AncestorContextGet the parent context of this context.- Specified by:
getParentin interfaceAncestorContext- Returns:
- The parent, or null if this is the root.
-
addChild
Description copied from interface:ServerContextAdd a child component to the context.- Specified by:
addChildin interfaceServerContext- Parameters:
child- A child.- Returns:
- The new server context.
- Throws:
ServerLoopBackException- When the child has already been exported by a previous server in the hierarchy.
-
getModel
Description copied from interface:ServerContextGet the model.- Specified by:
getModelin interfaceServerContext- Returns:
- The model.
-
getLogArchiver
Description copied from interface:ServerContextGet the log archiver for the component this is the context for.- Specified by:
getLogArchiverin interfaceServerContext- Returns:
- A log archiver.
-
getConsoleArchiver
Description copied from interface:ServerContextGet the console archiver for the component this is the context for.- Specified by:
getConsoleArchiverin interfaceServerContext- Returns:
- A console archiver.
-
getServerId
Description copied from interface:ServerContextThe server id.- Specified by:
getServerIdin interfaceServerContext- Returns:
- The server id of this component.
-
getAddress
Description copied from interface:ServerContextThe address. This will only be known if the component and all it's parentBeanDirectoryOwners have an id within theirBeanDirectory.- Specified by:
getAddressin interfaceServerContext- Returns:
- The address of this component. Null if there is no path of id's to the component.
-
getBeanDirectory
Description copied from interface:ServerContextGet the bean directory that the component this is the context for belongs to. This is used to discover the address. It need not be exposed apart from children to search the hierarchy.- Specified by:
getBeanDirectoryin interfaceServerContext- Returns:
- The bean directory.
-