FileDocCategorySizeDatePackage
MonitoredObjectImpl.javaAPI DocJava SE 5 API3422Fri Aug 26 14:54:26 BST 2005com.sun.corba.se.impl.monitoring

MonitoredObjectImpl

public class MonitoredObjectImpl extends Object implements com.sun.corba.se.spi.monitoring.MonitoredObject

Fields Summary
private final String
name
private final String
description
private Map
children
private Map
monitoredAttributes
private com.sun.corba.se.spi.monitoring.MonitoredObject
parent
Constructors Summary
MonitoredObjectImpl(String name, String description)



    // Constructor
          
        this.name = name;
        this.description = description;
    
Methods Summary
public voidaddAttribute(com.sun.corba.se.spi.monitoring.MonitoredAttribute value)

        if (value != null) {
            synchronized( this ) {
                monitoredAttributes.put( value.getName(), value );
            }
        }
    
public voidaddChild(com.sun.corba.se.spi.monitoring.MonitoredObject m)

        if (m != null){
            synchronized( this ) {
                children.put( m.getName(), m);
                m.setParent( this );
            }
        }         
    
public voidclearState()
calls clearState() on all the registered children MonitoredObjects and MonitoredAttributes.

        synchronized( this ) {
            Iterator i = monitoredAttributes.values().iterator();
            // First call clearState on all the local attributes
            while( i.hasNext( ) ) {
                ((MonitoredAttribute)i.next()).clearState();
            }
            i = children.values().iterator();
            // next call clearState on all the children MonitoredObjects
            while( i.hasNext() ) {
                ((MonitoredObject)i.next()).clearState();
           }
        }
    
public com.sun.corba.se.spi.monitoring.MonitoredAttributegetAttribute(java.lang.String name)

        synchronized( this ) {
            return (MonitoredAttribute) monitoredAttributes.get( name );
        }
    
public java.util.CollectiongetAttributes()

 
        synchronized( this ) {
            return monitoredAttributes.values();
        }
    
public com.sun.corba.se.spi.monitoring.MonitoredObjectgetChild(java.lang.String name)

        synchronized( this ) {
            return (MonitoredObject) children.get( name );
        }
    
public java.util.CollectiongetChildren()

 
        synchronized( this ) {
            return children.values();
        }
    
public java.lang.StringgetDescription()

        return description;
    
public java.lang.StringgetName()

        return name;
    
public synchronized com.sun.corba.se.spi.monitoring.MonitoredObjectgetParent()

       return parent;
    
public voidremoveAttribute(java.lang.String name)

        if (name != null) {
            synchronized( this ) {
                monitoredAttributes.remove( name );
            }
        }
    
public voidremoveChild(java.lang.String name)

        if (name != null){
            synchronized( this ) {
                children.remove( name );
            }
        }         
    
public synchronized voidsetParent(com.sun.corba.se.spi.monitoring.MonitoredObject p)

        parent = p;