Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.geronimo.gbean.runtime
Class GBeanInstanceState  view GBeanInstanceState download GBeanInstanceState.java

java.lang.Object
  extended byorg.apache.geronimo.gbean.runtime.GBeanInstanceState

public class GBeanInstanceState
extends java.lang.Object

Version:
$Rev$ $Date$

Field Summary
private  org.apache.geronimo.kernel.lifecycle.LifecycleListener blockerListener
          The listener for the of the object blocking the start of this gbean.
private  org.apache.geronimo.kernel.DependencyManager dependencyManager
          The dependency manager
private  GBeanInstance gbeanInstance
          The GBeanInstance in which this server is registered.
private  org.apache.geronimo.kernel.Kernel kernel
          The kernel in which this server is registered.
private  LifecycleBroadcaster lifecycleBroadcaster
          The broadcaster of lifecycle events
private static org.apache.commons.logging.Log log
           
private  javax.management.ObjectName objectName
          The unique name of this service.
private  org.apache.geronimo.kernel.management.State state
           
 
Constructor Summary
(package private) GBeanInstanceState(javax.management.ObjectName objectName, org.apache.geronimo.kernel.Kernel kernel, org.apache.geronimo.kernel.DependencyManager dependencyManager, GBeanInstance gbeanInstance, LifecycleBroadcaster lifecycleBroadcaster)
           
 
Method Summary
(package private)  void attemptFullStart()
          Attempts to bring the component into State.RUNNING>State.RUNNING 55 state.
(package private)  void attemptFullStop()
          Attempt to bring the component into the fully stopped state.
(package private)  void fail()
          Moves this MBean to the FAILED state.
 int getState()
           
 org.apache.geronimo.kernel.management.State getStateInstance()
           
private  void setStateInstance(org.apache.geronimo.kernel.management.State newState)
          Set the Component state.
 void start()
          Moves this MBean to the State.STARTING>State.STARTING 55 state and then attempts to move this MBean immediately to the State.RUNNING>State.RUNNING 55 state.
 void startRecursive()
          Starts this MBean and then attempts to start all of its start dependent children.
 void stop()
          Moves this MBean to the STOPPING state, calls stop on all start dependent children, and then attempt to move this MBean to the STOPPED state.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

gbeanInstance

private final GBeanInstance gbeanInstance
The GBeanInstance in which this server is registered.


kernel

private final org.apache.geronimo.kernel.Kernel kernel
The kernel in which this server is registered.


objectName

private final javax.management.ObjectName objectName
The unique name of this service.


dependencyManager

private final org.apache.geronimo.kernel.DependencyManager dependencyManager
The dependency manager


lifecycleBroadcaster

private final LifecycleBroadcaster lifecycleBroadcaster
The broadcaster of lifecycle events


blockerListener

private org.apache.geronimo.kernel.lifecycle.LifecycleListener blockerListener
The listener for the of the object blocking the start of this gbean. When the blocker dies we attempt to start.


state

private volatile org.apache.geronimo.kernel.management.State state
Constructor Detail

GBeanInstanceState

GBeanInstanceState(javax.management.ObjectName objectName,
                   org.apache.geronimo.kernel.Kernel kernel,
                   org.apache.geronimo.kernel.DependencyManager dependencyManager,
                   GBeanInstance gbeanInstance,
                   LifecycleBroadcaster lifecycleBroadcaster)
Method Detail

start

public final void start()
Moves this MBean to the State.STARTING>State.STARTING 55 state and then attempts to move this MBean immediately to the State.RUNNING>State.RUNNING 55 state.

Note: This method cannot be called while the current thread holds a synchronized lock on this MBean, because this method sends JMX notifications. Sending a general notification from a synchronized block is a bad idea and therefore not allowed.


startRecursive

public final void startRecursive()
Starts this MBean and then attempts to start all of its start dependent children.

Note: This method cannot be call while the current thread holds a synchronized lock on this MBean, because this method sends JMX notifications. Sending a general notification from a synchronized block is a bad idea and therefore not allowed.


stop

public final void stop()
Moves this MBean to the STOPPING state, calls stop on all start dependent children, and then attempt to move this MBean to the STOPPED state.

Note: This method can not be call while the current thread holds a syncronized lock on this MBean, because this method sends JMX notifications. Sending a general notification from a synchronized block is a bad idea and therefore not allowed.


fail

final void fail()
Moves this MBean to the FAILED state. There are no calls to dependent children, but they will be notified using standard J2EE management notification.

Note: This method can not be call while the current thread holds a syncronized lock on this MBean, because this method sends JMX notifications. Sending a general notification from a synchronized block is a bad idea and therefore not allowed.


attemptFullStart

void attemptFullStart()
Attempts to bring the component into State.RUNNING>State.RUNNING 55 state. If an Exception occurs while starting the component, the component will be failed.

Note: Do not call this from within a synchronized block as it makes may send a JMX notification


attemptFullStop

void attemptFullStop()
Attempt to bring the component into the fully stopped state. If an exception occurs while stopping the component, the component will be failed.

Note: Do not call this from within a synchronized block as it may send a JMX notification


getState

public int getState()

getStateInstance

public final org.apache.geronimo.kernel.management.State getStateInstance()

setStateInstance

private void setStateInstance(org.apache.geronimo.kernel.management.State newState)
                       throws java.lang.IllegalStateException
Set the Component state.


toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).