Home » geronimo-2.2-source-release » org.apache.geronimo.gbean.runtime » [javadoc | source]
org.apache.geronimo.gbean.runtime
public final class: GBeanInstance [javadoc | source]
java.lang.Object
   org.apache.geronimo.gbean.runtime.GBeanInstance

All Implemented Interfaces:
    StateManageable

A GBeanInstance is a J2EE Management Managed Object, and is standard base for Geronimo services.
Field Summary
public static final  String RAW_INVOKER    Attribute name used to retrieve the RawInvoker for the GBean 
Constructor:
 public GBeanInstance(GBeanData gbeanData,
    Kernel kernel,
    DependencyManager dependencyManager,
    LifecycleBroadcaster lifecycleBroadcaster,
    ClassLoader classLoader) throws InvalidConfigurationException 
    Construct a GBeanMBean using the supplied GBeanData and class loader
    Parameters:
    gbeanData - the data for the new GBean including GBeanInfo, intial attribute values, and reference patterns
    classLoader - the class loader used to load the gbean instance and attribute/reference types
    Throws:
    org.apache.geronimo.gbean.InvalidConfigurationException - if the gbeanInfo is inconsistent with the actual java classes, such as mismatched attribute types or the intial data cannot be set
Method from org.apache.geronimo.gbean.runtime.GBeanInstance Summary:
buildAttributes,   buildReferencesAndDependencies,   createInstance,   destroyInstance,   die,   equals,   getAbstractName,   getAttribute,   getAttribute,   getAttributeIndex,   getClassLoader,   getGBeanData,   getGBeanInfo,   getName,   getObjectName,   getObjectNameObject,   getOperationIndex,   getStartTime,   getState,   getStateInstance,   getStateReason,   getTarget,   getType,   hashCode,   invoke,   invoke,   isDead,   newObjectRecipe,   referenceFailed,   setAttribute,   setAttribute,   setAttribute,   setInstanceRegistry,   setStateReason,   start,   startRecursive,   stop,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.geronimo.gbean.runtime.GBeanInstance Detail:
 protected GBeanAttribute[] buildAttributes(GBeanInfo gbeanInfo) 
 protected  void buildReferencesAndDependencies(GBeanData gbeanData,
    GBeanInfo gbeanInfo,
    Set<GBeanReference> referencesSet,
    Set<GBeanDependency> dependencySet) 
 boolean createInstance() throws Exception 
 boolean destroyInstance(boolean stop) throws Exception 
 public  void die() throws GBeanNotFoundException 
 public boolean equals(Object obj) 
 public final AbstractName getAbstractName() 
 public Object getAttribute(int index) throws Exception 
    Gets the attribute value using the attribute index. This is the most efficient way to get an attribute as it avoids a HashMap lookup.
 public Object getAttribute(String attributeName) throws NoSuchAttributeException, Exception 
    Gets an attribute's value by name. This get style is less efficient becuse the attribute must first be looked up in a HashMap.
 public Map getAttributeIndex() 
    Gets an unmodifiable map from attribute names to index number (Integer). This index number can be used to efficiently set or retrieve an attribute value.
 public ClassLoader getClassLoader() 
    The class loader used to build this gbean. This class loader is set into the thread context class loader before callint the target instace.
 public GBeanData getGBeanData() 
    Gets the gbean data for the gbean held by this gbean mbean.
 public GBeanInfo getGBeanInfo() 
    Gets the GBeanInfo used to build this gbean.
 public String getName() 
    Gets the name of the GBean as defined in the gbean info.
 public final String getObjectName() 
 public final ObjectName getObjectNameObject() 
 public Map getOperationIndex() 
    Gets an unmodifiable map from operation signature (GOperationSignature) to index number (Integer). This index number can be used to efficciently invoke the operation.
 public final synchronized long getStartTime() 
 public int getState() 
 public final State getStateInstance() 
 public String getStateReason() 
    Gets the reason we are in the current state.
 public synchronized Object getTarget() 
 public Class getType() 
    The java type of the wrapped gbean instance
 public int hashCode() 
 public Object invoke(int index,
    Object[] arguments) throws Exception 
    Invokes an opreation using the operation index. This is the most efficient way to invoke an operation as it avoids a HashMap lookup.
 public Object invoke(String operationName,
    Object[] arguments,
    String[] types) throws Exception, NoSuchOperationException 
    Invokes an operation on the target gbean by method signature. This style if invocation is inefficient, because the target method must be looked up in a hashmap using a freshly constructed GOperationSignature object.
 public synchronized boolean isDead() 
    Has this gbean instance been destroyed. An destroyed gbean can no longer be used.
 protected ObjectRecipe newObjectRecipe(GBeanData gbeanData) 
 final  void referenceFailed() 
    Moves this GBeanInstance to the FAILED state. There are no calls to dependent children, but they will be notified using standard J2EE management notification.
 public  void setAttribute(int index,
    Object value) throws Exception, IndexOutOfBoundsException 
    Sets the attribute value using the attribute index. This is the most efficient way to set an attribute as it avoids a HashMap lookup.
 public  void setAttribute(String attributeName,
    Object value) throws Exception, NoSuchAttributeException 
    Sets an attribute's value by name. This set style is less efficient becuse the attribute must first be looked up in a HashMap.
 public  void setAttribute(String attributeName,
    Object value,
    boolean manage) throws Exception, NoSuchAttributeException 
 public synchronized  void setInstanceRegistry(InstanceRegistry instanceRegistry) 
 public  void setStateReason(String reason) 
    Sets the reason we are in the current state.
 public final  void start() 
    Moves this GBeanInstance to the starting state and then attempts to move this MBean immediately to the running state.
 public final  void startRecursive() 
    Starts this GBeanInstance and then attempts to start all of its start dependent children.
 public final  void stop() 
    Moves this GBeanInstance to the STOPPING state, calls stop on all start dependent children, and then attempt to move this MBean to the STOPPED state.
 public String toString()