All Packages Class Hierarchy This Package Previous Next Index
Class examples.recover.CounterBean
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Frame
|
+----examples.recover.CounterBean
- public class CounterBean
- extends Frame
- implements Runnable, ActivatableIf
This class is a simple m-bean that implements a counter.
The counter is incremented through the framework to ensure that
the repository is updated. To be registered with the Restart service
it implements the ActivatableIf interface. The counter is
displayed in a small frame on the screen. If the frame is closed the
agent will be stopped with the counter.
- See Also:
- RecoveryRepSrv
-
CounterBean()
- Default constructor.
-
deleteCmf()
- Calls the
performStop method if counter is active.
-
draw(Graphics)
- Draws the counter.
-
getCount()
- Gets the count value of the counter.
-
init()
- Initializes the counter.
-
initCmf(Framework, ObjectName, boolean, ModificationList)
- Initializes this m-bean and calls the
performStart() method
to start the counter thread.
-
isActive()
- Tests if the counter is active.
-
paint(Graphics)
- Paints the counter.
-
performStart()
- Starts the counter.
-
performStop()
- Stops the counter.
-
processEvent(AWTEvent)
- Processes events occurring on the counter.
-
processMouseEvent(MouseEvent)
- Processes mouse events occurring on the counter.
-
run()
- Increments the counter and update the counter display.
-
setCount(int)
- Sets the count value of the counter.
-
update(Graphics)
- Updates the counter.
CounterBean
public CounterBean()
- Default constructor.
initCmf
public void initCmf(Framework cmf,
ObjectName name,
boolean db,
ModificationList list) throws InstanceAlreadyExistException
- Initializes this m-bean and calls the
performStart() method
to start the counter thread.
For internal use only.
- Parameters:
- cmf - The core management framework to register the service with.
- name - Object name.
- db - Indicates if persistent storage is required.
- list - The modification list to use for setting up parameters.
- Throws: InstanceAlreadyExistException
- The m-bean is already registered in the repository.
deleteCmf
public void deleteCmf()
- Calls the
performStop method if counter is active.
performStart
public void performStart()
- Starts the counter.
performStop
public void performStop()
- Stops the counter.
isActive
public boolean isActive()
- Tests if the counter is active.
- Returns:
- Returns true if the counter is active, otherwise false.
- Overrides:
- isActive in class Window
setCount
public void setCount(int count)
- Sets the count value of the counter.
- Parameters:
- count - The new counter value.
getCount
public int getCount()
- Gets the count value of the counter.
- Returns:
- A snap shot of the counter value.
run
public void run()
- Increments the counter and update the counter display.
init
public void init()
- Initializes the counter.
update
public void update(Graphics g)
- Updates the counter.
- Parameters:
- g - The graphics context to use for printing.
- Overrides:
- update in class Container
draw
public void draw(Graphics g)
- Draws the counter.
- Parameters:
- g - The graphics context to use for printing.
paint
public void paint(Graphics g)
- Paints the counter.
- Parameters:
- g - The graphics context to use for printing.
- Overrides:
- paint in class Container
processMouseEvent
public void processMouseEvent(MouseEvent e)
- Processes mouse events occurring on the counter.
- Parameters:
- The - mouse event.
- Overrides:
- processMouseEvent in class Component
processEvent
public void processEvent(AWTEvent e)
- Processes events occurring on the counter.
- Parameters:
- e - The event.
- Overrides:
- processEvent in class Window
All Packages Class Hierarchy This Package Previous Next Index