|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.gbean.runtime.GBeanInstance
public final class GBeanInstance
A GBeanInstance is a J2EE Management Managed Object, and is standard base for Geronimo services.
Field Summary | |
---|---|
static String |
RAW_INVOKER
Attribute name used to retrieve the RawInvoker for the GBean |
Constructor Summary | |
---|---|
GBeanInstance(GBeanData gbeanData,
Kernel kernel,
DependencyManager dependencyManager,
LifecycleBroadcaster lifecycleBroadcaster,
ClassLoader classLoader)
Construct a GBeanMBean using the supplied GBeanData and class loader |
Method Summary | |
---|---|
void |
die()
|
boolean |
equals(Object obj)
|
AbstractName |
getAbstractName()
|
Object |
getAttribute(int index)
Gets the attribute value using the attribute index. |
Object |
getAttribute(String attributeName)
Gets an attribute's value by name. |
Map |
getAttributeIndex()
Gets an unmodifiable map from attribute names to index number (Integer). |
ClassLoader |
getClassLoader()
The class loader used to build this gbean. |
GBeanData |
getGBeanData()
Gets the gbean data for the gbean held by this gbean mbean. |
GBeanInfo |
getGBeanInfo()
Gets the GBeanInfo used to build this gbean. |
String |
getName()
Gets the name of the GBean as defined in the gbean info. |
String |
getObjectName()
|
ObjectName |
getObjectNameObject()
|
Map |
getOperationIndex()
Gets an unmodifiable map from operation signature (GOperationSignature) to index number (Integer). |
long |
getStartTime()
Gets the start time of this component |
int |
getState()
Gets the state of this component as an int. |
State |
getStateInstance()
Gets the state of this component as a State instance. |
String |
getStateReason()
Gets the reason we are in the current state. |
Object |
getTarget()
|
Class |
getType()
The java type of the wrapped gbean instance |
int |
hashCode()
|
Object |
invoke(int index,
Object[] arguments)
Invokes an opreation using the operation index. |
Object |
invoke(String operationName,
Object[] arguments,
String[] types)
Invokes an operation on the target gbean by method signature. |
boolean |
isDead()
Has this gbean instance been destroyed. |
void |
setAttribute(int index,
Object value)
Sets the attribute value using the attribute index. |
void |
setAttribute(String attributeName,
Object value)
Sets an attribute's value by name. |
void |
setAttribute(String attributeName,
Object value,
boolean manage)
|
void |
setInstanceRegistry(InstanceRegistry instanceRegistry)
|
void |
setStateReason(String reason)
Sets the reason we are in the current state. |
void |
start()
Moves this GBeanInstance to the starting state and then attempts to move this MBean immediately to the running state. |
void |
startRecursive()
Starts this GBeanInstance and then attempts to start all of its start dependent children. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String RAW_INVOKER
Constructor Detail |
---|
public GBeanInstance(GBeanData gbeanData, Kernel kernel, DependencyManager dependencyManager, LifecycleBroadcaster lifecycleBroadcaster, ClassLoader classLoader) throws InvalidConfigurationException
gbeanData
- the data for the new GBean including GBeanInfo, intial attribute values, and reference patternsclassLoader
- the class loader used to load the gbean instance and attribute/reference types
InvalidConfigurationException
- if the gbeanInfo is inconsistent with the actual java classes, such as
mismatched attribute types or the intial data cannot be setMethod Detail |
---|
public void die() throws GBeanNotFoundException
GBeanNotFoundException
public void setInstanceRegistry(InstanceRegistry instanceRegistry)
public String getName()
public ClassLoader getClassLoader()
public boolean isDead()
public String getStateReason()
public void setStateReason(String reason)
reason
- The reason we are in the current statepublic Class getType()
public Object getTarget()
public final String getObjectName()
public final ObjectName getObjectNameObject()
public final AbstractName getAbstractName()
public final long getStartTime()
StateManageable
getStartTime
in interface StateManageable
public int getState()
StateManageable
getState
in interface StateManageable
to obtain the State instance
public final State getStateInstance()
StateManageable
getStateInstance
in interface StateManageable
public Map getAttributeIndex()
public Map getOperationIndex()
public GBeanInfo getGBeanInfo()
public final void start()
start
in interface StateManageable
IllegalStateException
- If the gbean is disabledpublic final void startRecursive()
startRecursive
in interface StateManageable
IllegalStateException
- If the gbean is disabledpublic final void stop()
stop
in interface StateManageable
public GBeanData getGBeanData()
public Object getAttribute(int index) throws Exception
index
- the index of the attribute
Exception
- if a target instance throws and exception
IndexOutOfBoundsException
- if the index is invalidpublic Object getAttribute(String attributeName) throws NoSuchAttributeException, Exception
attributeName
- the name of the attribute to retrieve
Exception
- if a problem occurs while getting the value
NoSuchAttributeException
- if the attribute name is not found in the mappublic void setAttribute(int index, Object value) throws Exception, IndexOutOfBoundsException
index
- the index of the attributevalue
- the new value of attribute value
Exception
- if a target instance throws and exception
IndexOutOfBoundsException
- if the index is invalidpublic void setAttribute(String attributeName, Object value) throws Exception, NoSuchAttributeException
attributeName
- the name of the attribute to retrievevalue
- the new attribute value
Exception
- if a target instance throws and exception
NoSuchAttributeException
- if the attribute name is not found in the mappublic void setAttribute(String attributeName, Object value, boolean manage) throws Exception, NoSuchAttributeException
Exception
NoSuchAttributeException
public Object invoke(int index, Object[] arguments) throws Exception
index
- the index of the attributearguments
- the arguments to the operation
Exception
- if a target instance throws and exception
IndexOutOfBoundsException
- if the index is invalid
IllegalStateException
- if the gbean instance has been destroyedpublic Object invoke(String operationName, Object[] arguments, String[] types) throws Exception, NoSuchOperationException
operationName
- the name of the operation to invokearguments
- arguments to the operationtypes
- types of the operation arguemtns
Exception
- if a target instance throws and exception
NoSuchOperationException
- if the operation signature is not found in the map
IllegalStateException
- if the gbean instance has been destroyedpublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |