Methods Summary |
---|
protected javax.management.ObjectName | createChildElementByType(java.lang.String childElementName, javax.management.Attribute[] attrs)
return createChildElementByType(childElementName, attrs, true, false);
|
protected javax.management.ObjectName | createChildElementByType(java.lang.String childElementName, javax.management.Attribute[] attrs, boolean bSkipNullValued)
return createChildElementByType(childElementName, attrs, bSkipNullValued, false);
|
protected javax.management.ObjectName | createChildElementByType(java.lang.String childElementName, javax.management.Attribute[] attrs, boolean bSkipNullValued, boolean bOnlyOne)
AttributeList list = new AttributeList();
for(int i=0; i<attrs.length; i++)
{
if(!bSkipNullValued || attrs[i].getValue()!=null)
list.add(attrs[i]);
}
ConfigBean bean = mcb.createChildByType(childElementName, list, null, bOnlyOne);
return ConfigMBeanHelper.getChildObjectName(m_registry, info, bean);
|
public boolean | destroyConfigElement()
if(mcb==null)
{//FIXME: should be exception if null
return false;
}
mcb.deleteSelf();
//now unregister MBean
ObjectName objectName = ConfigMBeanHelper.getOwnObjectName(m_registry, info);
if(objectName!=null)
{
try{
MBeanServer server = (MBeanServer)(MBeanServerFactory.findMBeanServer(null)).get(0);
server.unregisterMBean(objectName);
}
catch (Throwable t)
{
_sLogger.fine("!!!!!!!!!!!!!! Can not unregister MBean: "+objectName);
}
return true;
}
return false;
//FIXME handle exceptions
//return false;
|
public java.lang.Object | getAttribute(java.lang.String name)Obtain and return the value of a specific attribute of this MBean.
name = MBeanMetaHelper.mapToMBeanAttributeName(name);
ModelMBeanAttributeInfo attrInfo = (ModelMBeanAttributeInfo)MBeanHelper.findMatchingAttributeInfo((MBeanInfo)info, name);
if(attrInfo==null)
throw new AttributeNotFoundException(name);
//FIXME add check "is readable"
Object o = null;
try {
o = super.getAttribute(name);
} catch (Exception e) {
// try {
// if(mcb!=null)
o=mcb.getAttribute(attrInfo, name);
// } catch(Exception e1) {e1.printStackTrace();}
}
return o;
|
public javax.management.AttributeList | getAttributes(java.lang.String[] attributeNames)
ArrayList names = mcb.getSimpleAttributeNames(attributeNames);
AttributeList attrs = new AttributeList();
for(int i=0; i<names.size(); i++) {
try {
String name = MBeanMetaHelper.mapToMBeanAttributeName((String)names.get(i));
Object value = getAttribute(name);
attrs.add(new Attribute(name, value));
} catch (Exception e) {
// attrs.add(new Attribute((String)names.get(i), null));
}
}
return attrs;
|
public com.sun.enterprise.config.ConfigBean | getBaseConfigBean()Get base node Config Bean;
if(mcb!=null) {
return mcb.getBaseConfigBean();
}
return null;
|
protected javax.management.ObjectName | getChildObjectName(java.lang.String childMBeanType, java.lang.String name)
if(m_registry==null)
return null;
String[] parentLocation = MBeanHelper.getLocation((ModelMBeanInfo)getMBeanInfo());
if(parentLocation==null || parentLocation.length==0)
return null;
if(name==null)
return m_registry.getMbeanObjectName(childMBeanType, parentLocation);
String[] childLocation = new String[parentLocation.length+1];
for(int i=0; i<parentLocation.length; i++)
childLocation[i] = parentLocation[i];
childLocation[parentLocation.length] = name;
return m_registry.getMbeanObjectName(childMBeanType, childLocation);
|
protected javax.management.ObjectName | getClusterObjectName(java.lang.String name)
return m_registry.getMbeanObjectName("cluster", new String[]{
getDomainName(), name});
|
public javax.management.ObjectName | getConfigBeanObjectName(com.sun.enterprise.config.ConfigBean configBean)
return ConfigMBeanHelper.getConfigBeanObjectName(
m_registry, getDomainName(), configBean);
|
protected com.sun.enterprise.config.ConfigContext | getConfigContext()
if(mcb!=null) {
return mcb.getConfigContext();
}
return null;
|
protected javax.management.ObjectName | getConfigurationObjectName(java.lang.String name)
return m_registry.getMbeanObjectName("config", new String[]{
getDomainName(), name});
|
protected java.lang.String | getDomainName()
final ModelMBeanInfo info = (ModelMBeanInfo)getMBeanInfo();
if (info != null) {
String[] location = MBeanHelper.getLocation(info);
if(location!=null && location.length>0) {
return location[0];
}
}
return null;
|
protected javax.management.MBeanServer | getMBeanServer()
return (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
|
protected ManagedConfigBean | getManagedConfigBean(com.sun.enterprise.config.ConfigBean cb)
return new ManagedConfigBean(cb, m_registry, getDomainName());
|
protected javax.management.ObjectName | getNodeAgentObjectName(java.lang.String name)
return m_registry.getMbeanObjectName("node-agent", new String[]{
getDomainName(), name});
|
protected javax.management.ObjectName | getServerObjectName(java.lang.String server)
return m_registry.getMbeanObjectName("server", new String[]{
getDomainName(), server});
|
public java.lang.Object | invoke(java.lang.String name, java.lang.Object[] params, java.lang.String[] signature)Invoke a particular method on this MBean, and return any returned
value.
IMPLEMENTATION NOTE - This implementation will
attempt to invoke this method on the MBean itself, or (if not
available) on the managed resource object associated with this
MBean.
ModelMBeanOperationInfo opInfo = (ModelMBeanOperationInfo)MBeanHelper.findMatchingOperationInfo((MBeanInfo)info, name, signature);
if (opInfo == null)
{
String msg = _localStrings.getString( "admin.server.core.mbean.config.base.operation_is_not_found", mbeanType, name);
throw new MBeanException
(new ServiceNotFoundException(msg), msg);
}
Descriptor descr = opInfo.getDescriptor();
Object ret;
//try MBean self
try
{
ret = MBeanHelper.invokeOperationInBean(opInfo, this, params);
if(ret!=MBeanHelper.INVOKE_ERROR_SIGNAL_OBJECT)
{
return ret;
}
//invoke in config bean
if(mcb!=null &&
(ret=mcb.invokeOperation(opInfo, params, signature))!=MBeanHelper.INVOKE_ERROR_SIGNAL_OBJECT)
{
return ret;
}
return super.invoke(name, params, signature);
}
catch (MBeanException mbe)
{
_sLogger.log(Level.FINE, "mbean.baseconfig.invoke_exception",mbe);
throw mbe;
}
catch (Exception e)
{
_sLogger.log(Level.FINE, "mbean.baseconfig.invoke_exception",e);
String msg = _localStrings.getString( "admin.server.core.mbean.config.base.invoke_error", mbeanType, name);
throw MBeanHelper.extractAndWrapTargetException(e, msg);
}
|
public void | postDeregister()
/*
ObjectName oName=null;
try
{
oName = ConfigMBeanHelper.getOwnObjectName(m_registry, info);
m_registry.notifyUnregisterMBean(oName, getConfigContext());
}
catch(Exception e)
{
}
*/
|
public void | postRegister(java.lang.Boolean registrationDone)
|
public void | preDeregister()
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
/* try
{
m_registry.notifyRegisterMBean(name, getConfigContext());
}
catch(Exception e)
{
}
*/
return name;
|
public void | setAttribute(javax.management.Attribute attribute)Set the value of a specific attribute of this MBean.
attribute = new Attribute(MBeanMetaHelper.mapToMBeanAttributeName(attribute.getName()), attribute.getValue());
ModelMBeanAttributeInfo attrInfo = (ModelMBeanAttributeInfo)MBeanHelper.findMatchingAttributeInfo((MBeanInfo)info, attribute.getName());
if(attrInfo==null)
throw new AttributeNotFoundException();
//FIXME add check "is writable"
try {
super.setAttribute(attribute);
} catch (Exception e) {
// try {
//no toString(). remove it. FIXME
if(mcb!=null)
mcb.setAttribute(attrInfo, attribute);
// } catch(Exception e1) {e1.printStackTrace();}
}
|
public javax.management.AttributeList | setAttributes(javax.management.AttributeList list)Sets the values of several MBean's attributes.
try {
return super.setAttributes(list);
} catch (Exception e) {
// try {
//no toString(). remove it. FIXME
if(mcb!=null)
return mcb.setAttributes(list);
// } catch(Exception e1) {e1.printStackTrace();}
}
return null;
|
public void | setManagedResource(java.lang.Object resource, java.lang.String type)Set the instance handle of the object against which we will execute
all methods in this ModelMBean management interface.
if (resource == null)
{
String msg = _localStrings.getString( "admin.server.core.mbean.config.base.managed_resource_is_null", mbeanType);
throw new RuntimeOperationsException(new IllegalArgumentException(msg), msg);
}
if (MBeanMetaConstants.CONFIG_BEAN_REF.equalsIgnoreCase(type)) {
if(! (resource instanceof ConfigBean))
{
String msg = _localStrings.getString( "admin.server.core.mbean.config.base.managed_resource_is_not_configbean", mbeanType);
throw new RuntimeOperationsException(new ClassCastException(msg), msg);
}
this.mcb = new ManagedConfigBean(this, (ConfigBean) resource, m_registry);
//Also add all attributes (and methods) to model mbean info
// mcb.addResourceInfo();
} else {
// super.setManagedResource(resource, type);
}
|
protected javax.management.ObjectName[] | toClusterONArray(java.lang.String[] ca)
int num = ca.length;
final ObjectName[] result = new ObjectName[num];
for (int i = 0; i < num; i++)
{
result[i] = getClusterObjectName(ca[i]);
}
return result;
|
protected javax.management.ObjectName[] | toConfigurationONArray(java.lang.String[] ca)
int num = ca.length;
final ObjectName[] result = new ObjectName[num];
for (int i = 0; i < num; i++)
{
result[i] = getConfigurationObjectName(ca[i]);
}
return result;
|
protected javax.management.ObjectName[] | toNodeAgentONArray(java.lang.String[] names)
int numNames = names.length;
final ObjectName[] result = new ObjectName[numNames];
for (int i = 0; i < numNames; i++) {
result[i] = getNodeAgentObjectName(names[i]);
}
return result;
|
protected javax.management.ObjectName[] | toServerONArray(java.lang.String[] ca)
int num = ca.length;
final ObjectName[] result = new ObjectName[num];
for (int i = 0; i < num; i++)
{
result[i] = getServerObjectName(ca[i]);
}
return result;
|