Methods Summary |
---|
protected org.jboss.console.manager.interfaces.TreeNodeMenuEntry[] | createMenus(java.lang.String[] content)
TreeNodeMenuEntry[] menuEntries = null;
if (content != null && content.length > 0)
{
menuEntries = new TreeNodeMenuEntry[content.length];
int i=0;
while (i< content.length)
{
if (content[i] == null)
{
menuEntries[i] = new SeparatorTreeNodeMenuEntry();
i++;
}
else
{
String text = content[i];
TreeAction action = new HttpLinkTreeAction(fixUrl(content[i+1]));
menuEntries[i] = new SimpleTreeNodeMenuEntryImpl ( text, action );
i+=2;
}
}
}
else
{
menuEntries = new TreeNodeMenuEntry[0];
}
return menuEntries;
|
protected org.jboss.console.manager.interfaces.impl.SimpleResourceTreeNode | createResourceNode(java.lang.String name, java.lang.String description, java.lang.String iconUrl, java.lang.String defaultUrl, org.jboss.console.manager.interfaces.TreeNodeMenuEntry[] menuEntries, org.jboss.console.manager.interfaces.TreeNode[] subNodes, org.jboss.console.manager.interfaces.ResourceTreeNode[] subResNodes, java.lang.String jmxObjectName, java.lang.String jmxClassName)
TreeAction action = new HttpLinkTreeAction (fixUrl(defaultUrl));
ManageableResource res = new MBeanResource (new ObjectName(jmxObjectName), jmxClassName);
return new SimpleResourceTreeNode (name, description, fixUrl(iconUrl), action, menuEntries, subNodes, subResNodes, res);
|
protected org.jboss.console.manager.interfaces.impl.SimpleResourceTreeNode | createResourceNode(java.lang.String name, java.lang.String description, java.lang.String iconUrl, java.lang.String defaultUrl, org.jboss.console.manager.interfaces.TreeNodeMenuEntry[] menuEntries, org.jboss.console.manager.interfaces.TreeNode[] subNodes, org.jboss.console.manager.interfaces.ResourceTreeNode[] subResNodes, org.jboss.console.manager.interfaces.ManageableResource resource)
TreeAction action = new HttpLinkTreeAction (fixUrl(defaultUrl));
return new SimpleResourceTreeNode (name, description, fixUrl(iconUrl), action, menuEntries, subNodes, subResNodes, resource);
|
protected org.jboss.console.manager.interfaces.impl.SimpleTreeNode | createTreeNode(java.lang.String name, java.lang.String description, java.lang.String iconUrl, java.lang.String defaultUrl, org.jboss.console.manager.interfaces.TreeNodeMenuEntry[] menuEntries, org.jboss.console.manager.interfaces.TreeNode[] subNodes, org.jboss.console.manager.interfaces.ResourceTreeNode[] subResNodes)
TreeAction action = new HttpLinkTreeAction (fixUrl(defaultUrl));
return new SimpleTreeNode (name, description, fixUrl(iconUrl), action, menuEntries, subNodes, subResNodes);
|
public void | destroy()
if( pm != null )
pm.unregisterPlugin(this);
|
protected java.lang.String | encode(java.lang.String source)
try
{
return java.net.URLEncoder.encode(source);
}
catch (Exception e)
{
return source;
}
|
protected void | findJBossMBeanServer()
this.mbeanServer = MBeanServerLocator.locateJBoss();
|
protected void | findPluginManager()
this.pm = (PluginManager) Registry.lookup (PluginManager.PLUGIN_MANAGER_NAME);
|
protected java.lang.String | fixUrl(java.lang.String source)
if (source == null)
{
return null;
}
else if (source.toLowerCase().startsWith("http://") ||
source.toLowerCase().startsWith("https://"))
{
return source;
}
else if (source.startsWith("/"))
{
return source; // already absolute
}
else
{
return this.rootContextName + "/" + source;
}
|
public java.lang.String | getIdentifier()
if (this.pluginName != null)
{
return this.pluginName + " (Wrapped by ServletPluginHelper)";
}
else
{
return getPluginIdentifier();
}
|
protected javax.management.MBeanServer | getMBeanServer()
return this.mbeanServer;
|
protected javax.management.ObjectInstance[] | getMBeansForClass(java.lang.String scope, java.lang.String className)
try
{
Set result = mbeanServer.queryMBeans(new ObjectName(scope),
Query.eq (Query.classattr(), Query.value(className)));
return (ObjectInstance[])result.toArray(new ObjectInstance[result.size()]);
}
catch (MalformedObjectNameException e)
{
log.debug (e);
return new ObjectInstance[0];
}
|
protected javax.management.ObjectInstance[] | getMBeansForQuery(java.lang.String scope, javax.management.QueryExp query)
try
{
Set result = mbeanServer.queryMBeans(new ObjectName(scope), query);
return (ObjectInstance[])result.toArray(new ObjectInstance[result.size()]);
}
catch (MalformedObjectNameException e)
{
log.debug (e);
return new ObjectInstance[0];
}
|
protected java.lang.String | getPluginIdentifier()
return "AbstractPluginWrapper (" + this.getClass() + ")";
|
protected java.lang.String | getPluginVersion()
return "unknown version";
|
public org.jboss.console.manager.interfaces.TreeNode | getSubTreeForResource(org.jboss.console.manager.PluginManager master, java.lang.String profile, org.jboss.console.manager.interfaces.ManageableResource resource)
if (!ConsolePlugin.WEB_PROFILE.equalsIgnoreCase(profile))
{
return null;
}
else
{
if (isResourceToBeManaged (resource))
{
return getTreeForResource(
profile,
resource);
}
else
{
return null;
}
}
|
public java.lang.String[] | getSupportedProfiles()
return new String[] {ConsolePlugin.WEB_PROFILE};
|
protected abstract org.jboss.console.manager.interfaces.TreeNode | getTreeForResource(java.lang.String profile, org.jboss.console.manager.interfaces.ManageableResource resource)
|
public java.lang.String | getVersion()
if (this.pluginVersion != null)
{
return this.pluginVersion;
}
else
{
return getPluginVersion ();
}
|
public void | init(javax.servlet.ServletConfig servletConfig)
findJBossMBeanServer ();
findPluginManager ();
readConfigurationParameters (servletConfig);
this.pm.registerPlugin(this);
|
protected boolean | isResourceToBeManaged(org.jboss.console.manager.interfaces.ManageableResource resource)
if (checker == null)
{
return false;
}
else
{
return checker.isResourceToBeManaged(resource);
}
|
public void | readConfigurationParameters(javax.servlet.ServletConfig config)
this.pluginName = config.getInitParameter("PluginName");
this.pluginVersion = config.getInitParameter("PluginVersion");
this.folderName = config.getInitParameter(FOLDER_NAME_PARAM);
this.objectName = config.getInitParameter(OBJECT_NAME_PARAM);
this.mbeanClass = config.getInitParameter(MBEAN_CLASS_PARAM);
this.rootContextName = config.getInitParameter("ContextName");
String tmp = this.objectName;
if (tmp != null && !"".equals(tmp))
{
// this kind of plugin is associated with a single MBean
// which has a give JMX ObjectName
//
checker = new SingleMBeanChecker ();
}
tmp = this.folderName;
if (tmp != null && !"".equals(tmp))
{
// this kind of plugins is associated with one of the static folder of the tree
//
checker = new SubFolderChecker ();
}
tmp = config.getInitParameter(IS_ROOT_NODE_PARAM);
if (tmp != null && !"".equals(tmp) && "true".equalsIgnoreCase(tmp))
{
// this kind of plugins is associated with the root of the tree
//
checker = new RootTreeChecker ();
}
tmp = this.mbeanClass;
if (tmp != null && !"".equals(tmp))
{
// this kind of plugins is associated with all MBean
// that share a given interface
//
checker = new StandardMBeanChecker ();
}
|