flex.management
Class ManageableComponent

java.lang.Object
  extended by flex.management.ManageableComponent
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable
Direct Known Subclasses:
AbstractEndpoint, AbstractService, Destination, LogManager, MessageBroker, ServiceAdapter

public abstract class ManageableComponent
extends Object
implements Manageable, FlexComponent

An abstract base class that implements the Manageable and FlexComponent interfaces. This is an excellent starting point for a server component that may be instantiated, initialized, started and stopped, as well as exposing an optional management interface via a peer MBean.

Support for changing component properties while the component is started should be determined on a per-property basis, and the started property is volatile to ensure consistent reads of the start state of the component across threads. This class performs no synchronization and is not safe for modification by multiple concurrent threads in the absence of external synchronization.


Constructor Summary
ManageableComponent(boolean enableManagement)
          Constructs a ManageableComponent instance, specifying whether to enable management.
 
Method Summary
 BaseControl getControl()
          Returns the control MBean used to manage the component.
 String getId()
          Returns the id of the ManageableComponent.
 Manageable getParent()
          Returns the parent of the component.
 void initialize(String id, ConfigMap properties)
          Invoked to initialize the ManageableComponent.
 boolean isManaged()
          Returns true if the component is enabled for management.
 boolean isStarted()
          Returns if the component is started or not.
 boolean isValid()
          Returns if the component is valid.
 void setControl(BaseControl control)
          Set the control MBean used to manage the component.
 void setId(String id)
          Sets the id of the ManageableComponent.
 void setManaged(boolean enableManagement)
          Enables or disables management for the component.
 void setParent(Manageable parent)
          Sets the parent of the component.
 void start()
          Validates and starts the component.
 void stop()
          Invalidates and stops the component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManageableComponent

public ManageableComponent(boolean enableManagement)
Constructs a ManageableComponent instance, specifying whether to enable management. Enabling management will trigger the creation of a peer MBean that exposes the management interface for this component.

Parameters:
enableManagement - true to enable management, false to disable management.
Method Detail

getControl

public BaseControl getControl()
Description copied from interface: Manageable
Returns the control MBean used to manage the component.

Specified by:
getControl in interface Manageable
Returns:
The control MBean used to manage the component.
See Also:
Manageable.getControl()

setControl

public void setControl(BaseControl control)
Description copied from interface: Manageable
Set the control MBean used to manage the component.

Specified by:
setControl in interface Manageable
Parameters:
control - The BaseControl MBean used to manage the component.
See Also:
Manageable.setControl(BaseControl)

getId

public String getId()
Returns the id of the ManageableComponent.

Returns:
The id of the ManageableComponent.

setId

public void setId(String id)
Sets the id of the ManageableComponent. The id cannot be null and it cannot be changed after startup.

Parameters:
id - The id of the ManageableComponent.

isManaged

public boolean isManaged()
Description copied from interface: Manageable
Returns true if the component is enabled for management.

Specified by:
isManaged in interface Manageable
Returns:
true if the component is enabled for management.
See Also:
Manageable.isManaged()

setManaged

public void setManaged(boolean enableManagement)
Enables or disables management for the component. Management cannot be changed once the component is started and management cannot be true if the parent of the component is not managed.

Specified by:
setManaged in interface Manageable
Parameters:
enableManagement - true to enable management, false to disable management.

getParent

public Manageable getParent()
Returns the parent of the component.

Returns:
The parent of the component.

setParent

public void setParent(Manageable parent)
Sets the parent of the component. The parent cannot be changed after component startup and it cannot be null.

Parameters:
parent - The parent of the component.

isStarted

public boolean isStarted()
Returns if the component is started or not.

Specified by:
isStarted in interface FlexComponent
Returns:
true if the component is started.

isValid

public boolean isValid()
Returns if the component is valid.

Returns:
true if the component is valid.

initialize

public void initialize(String id,
                       ConfigMap properties)
Invoked to initialize the ManageableComponent. This base implementation calls setId() passing the provided id and ignores the properties map argument. Subclasses should call super.initialize().

Specified by:
initialize in interface FlexConfigurable
Parameters:
id - Id of the ManageableComponent.
properties - Properties for the ManageableComponent.

start

public void start()
Validates and starts the component. Subclasses should call super.start().

Specified by:
start in interface FlexComponent

stop

public void stop()
Invalidates and stops the component. Subclasses should call super.stop().

Specified by:
stop in interface FlexComponent


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/management/ManageableComponent.html