Methods Summary |
---|
private void | changeHttpListenerRef(java.lang.String oldVs, java.lang.String newVs)
HttpListenerVirtualServerAssociationMgr mgr =
new HttpListenerVirtualServerAssociationMgr(
super.getConfigContext(), on.getKeyProperty("config"));
final String id = on.getKeyProperty("id");
mgr.changeHttpListenerRef(id, oldVs, newVs);
|
private java.lang.String | getDefaultVirtualServer(javax.management.AttributeList al)
final Map map = AttributeListUtils.asNameMap(al);
final Attribute val = (Attribute)map.get(DEFAULT_VIRTUAL_SERVER);
return (String)val.getValue();
|
private boolean | isDefaultVirtualServer(javax.management.Attribute a)
return a.getName().equals(DEFAULT_VIRTUAL_SERVER);
|
private boolean | isDefaultVirtualServerExists(javax.management.AttributeList al)
return AttributeListUtils.containsNamedAttribute(al,
DEFAULT_VIRTUAL_SERVER);
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
on = super.preRegister(server, name);
return on;
|
public void | setAttribute(javax.management.Attribute attribute)
String oldVs = null;
if (isDefaultVirtualServer(attribute))
{
oldVs = (String)super.getAttribute(DEFAULT_VIRTUAL_SERVER);
}
super.setAttribute(attribute);
if (isDefaultVirtualServer(attribute))
{
try
{
changeHttpListenerRef(oldVs, (String)attribute.getValue());
}
catch (ConfigException ce)
{
throw new MBeanException(ce);
}
}
|
public javax.management.AttributeList | setAttributes(javax.management.AttributeList list)
String oldVs = null;
if (isDefaultVirtualServerExists(list))
{
try
{
oldVs = (String)super.getAttribute(DEFAULT_VIRTUAL_SERVER);
}
catch (JMException e)
{
//Ignoring. This should not occur.
}
}
AttributeList al = super.setAttributes(list);
if (isDefaultVirtualServerExists(list) &&
isDefaultVirtualServerExists(al))
{
try
{
changeHttpListenerRef(oldVs, getDefaultVirtualServer(list));
}
catch (ConfigException ce)
{
_sLogger.log(Level.WARNING,
"httplistenerMBean.failed_to_add_http_listener_ref",ce);
}
}
return al;
|