org.oddjob.jmx.server
Class ServerContextImpl

java.lang.Object
  extended by org.oddjob.jmx.server.ServerContextImpl
All Implemented Interfaces:
ServerContext

public class ServerContextImpl
extends Object
implements ServerContext

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
ServerContextImpl(Object root, ServerModel model, BeanDirectory componentRegistry)
          A constructor for the top most server context.
 
Method Summary
 ServerContext addChild(Object child)
          Add a child component to the context.
 Address getAddress()
          The address.
 BeanDirectory getBeanDirectory()
          Get the bean directory that the component this is the context for belongs to.
 Object getComponent()
           
 ConsoleArchiver getConsoleArchiver()
          Get the console archiver for the component this is the context for.
 LogArchiver getLogArchiver()
          Get the log archiver for the component this is the context for.
 ServerModel getModel()
          Get the model.
 ServerId getServerId()
          The server id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerContextImpl

public ServerContextImpl(Object root,
                         ServerModel model,
                         BeanDirectory componentRegistry)
A constructor for the top most server context.

Method Detail

addChild

public ServerContext addChild(Object child)
                       throws ServerLoopBackException
Description copied from interface: ServerContext
Add a child component to the context.

Specified by:
addChild in interface ServerContext
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.

getComponent

public Object getComponent()

getModel

public ServerModel getModel()
Description copied from interface: ServerContext
Get the model.

Specified by:
getModel in interface ServerContext
Returns:
The model.

getLogArchiver

public LogArchiver getLogArchiver()
Description copied from interface: ServerContext
Get the log archiver for the component this is the context for.

Specified by:
getLogArchiver in interface ServerContext
Returns:
A log archiver.

getConsoleArchiver

public ConsoleArchiver getConsoleArchiver()
Description copied from interface: ServerContext
Get the console archiver for the component this is the context for.

Specified by:
getConsoleArchiver in interface ServerContext
Returns:
A console archiver.

getServerId

public ServerId getServerId()
Description copied from interface: ServerContext
The server id.

Specified by:
getServerId in interface ServerContext
Returns:
The server id of this component.

getAddress

public Address getAddress()
Description copied from interface: ServerContext
The address.

Specified by:
getAddress in interface ServerContext
Returns:
The address of this component.

getBeanDirectory

public BeanDirectory getBeanDirectory()
Description copied from interface: ServerContext
Get the bean directory that the component this is the context for belongs to.

Specified by:
getBeanDirectory in interface ServerContext
Returns:
The bean directory.