Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.product.server.mbean
Class ProductPluginDeployer

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.deployment.SubDeployerSupport
              extended by org.hyperic.hq.product.server.mbean.ProductPluginDeployer
All Implemented Interfaces:
java.util.Comparator, java.util.EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean, org.jboss.deployment.SubDeployer, org.jboss.deployment.SubDeployerExt, org.jboss.deployment.SubDeployerExtMBean, org.jboss.deployment.SubDeployerMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class ProductPluginDeployer
extends org.jboss.deployment.SubDeployerSupport
implements javax.management.NotificationBroadcaster, javax.management.NotificationListener, org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean, java.util.Comparator

ProductPlugin deployer. We accept $PLUGIN_DIR/*.{jar,xml}


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.deployment.SubDeployerSupport
org.jboss.deployment.SubDeployerSupport.ClassConfiguration
 
Field Summary
 
Fields inherited from class org.jboss.deployment.SubDeployerSupport
CONFIGURATION, enhancedSuffixes, mainDeployer, nativePrefix, nativeSuffix, relativeOrder, suffixes, tempDeployDir
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Fields inherited from interface org.jboss.deployment.SubDeployer
CREATE_NOTIFICATION, DESTROY_NOTIFICATION, INIT_NOTIFICATION, RELATIVE_ORDER_100, RELATIVE_ORDER_200, RELATIVE_ORDER_300, RELATIVE_ORDER_400, RELATIVE_ORDER_500, RELATIVE_ORDER_600, RELATIVE_ORDER_700, RELATIVE_ORDER_800, RELATIVE_ORDER_900, START_NOTIFICATION, STOP_NOTIFICATION
 
Constructor Summary
ProductPluginDeployer()
           
 
Method Summary
 boolean accepts(org.jboss.deployment.DeploymentInfo di)
           
 void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 int getAutoInventoryPluginCount()
           
 int getConfigTrackPluginCount()
           
 int getControlPluginCount()
           
 int getLogTrackPluginCount()
           
 int getMeasurementPluginCount()
           
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
           
 java.lang.String getPluginDir()
           
 PluginInfo getPluginInfo(java.lang.String name)
           
 int getProductPluginCount()
           
 ProductPluginManager getProductPluginManager()
           
 java.lang.String getProperty(java.lang.String name)
           
 java.util.ArrayList getRegisteredPluginNames()
           
 java.util.ArrayList getRegisteredPluginNames(java.lang.String type)
           
 void handleNotification(javax.management.Notification n, java.lang.Object o)
          This is called when the full server startup has occurred, and you get the "Started in 30s:935ms" message.
protected  boolean isDeployable(java.lang.String name, java.net.URL url)
           
 boolean isReady()
           
 void removeNotificationListener(javax.management.NotificationListener listener)
           
 void setPluginDir(java.lang.String name)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
 void start()
          MBean Service start method.
 void start(org.jboss.deployment.DeploymentInfo di)
           
 void stop()
           
 void stop(org.jboss.deployment.DeploymentInfo di)
           
 
Methods inherited from class org.jboss.deployment.SubDeployerSupport
addDeployableFiles, addDeployableJar, create, createService, deployUrl, destroy, destroyService, emitNotification, getEnhancedSuffixes, getRelativeOrder, getSuffixes, init, processNestedDeployments, setEnhancedSuffixes, setRelativeOrder, setSuffixes, startService, stopService
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
handleNotification, nextNotificationSequenceNumber, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployment.SubDeployerMBean
create, destroy, getRelativeOrder, getServiceName, getSuffixes, init
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy
 
Methods inherited from interface java.util.Comparator
equals
 
Methods inherited from interface org.jboss.deployment.SubDeployer
getServiceName
 

Constructor Detail

ProductPluginDeployer

public ProductPluginDeployer()
Method Detail

handleNotification

public void handleNotification(javax.management.Notification n,
                               java.lang.Object o)
This is called when the full server startup has occurred, and you get the "Started in 30s:935ms" message. We load all startup classes, then initialize the plugins. Currently this is necesssary, since startup classes need to initialize the application (creating callbacks, etc.), and plugins can't hit the app until that's been done. Unfortunately, it also means that any startup listeners that depend on plugins loaded through the deployer won't work. So far that doesn't seem to be a problem, but if it ends up being one, we can split the plugin loading into more stages so that everyone has access to everyone.

Specified by:
handleNotification in interface javax.management.NotificationListener
Specified by:
handleNotification in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

isDeployable

protected boolean isDeployable(java.lang.String name,
                               java.net.URL url)
Overrides:
isDeployable in class org.jboss.deployment.SubDeployerSupport

addNotificationListener

public void addNotificationListener(javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
Specified by:
addNotificationListener in interface javax.management.NotificationBroadcaster
Overrides:
addNotificationListener in class org.jboss.mx.util.JBossNotificationBroadcasterSupport

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener)
                                throws javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.NotificationBroadcaster
Overrides:
removeNotificationListener in class org.jboss.mx.util.JBossNotificationBroadcasterSupport
Throws:
javax.management.ListenerNotFoundException

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Overrides:
getNotificationInfo in class org.jboss.mx.util.JBossNotificationBroadcasterSupport

getProductPluginManager

public ProductPluginManager getProductPluginManager()
Specified by:
getProductPluginManager in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

setPluginDir

public void setPluginDir(java.lang.String name)
Specified by:
setPluginDir in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

getPluginDir

public java.lang.String getPluginDir()
Specified by:
getPluginDir in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

getRegisteredPluginNames

public java.util.ArrayList getRegisteredPluginNames(java.lang.String type)
                                             throws PluginException
Specified by:
getRegisteredPluginNames in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getRegisteredPluginNames

public java.util.ArrayList getRegisteredPluginNames()
                                             throws PluginException
Specified by:
getRegisteredPluginNames in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getProductPluginCount

public int getProductPluginCount()
                          throws PluginException
Specified by:
getProductPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getMeasurementPluginCount

public int getMeasurementPluginCount()
                              throws PluginException
Specified by:
getMeasurementPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getControlPluginCount

public int getControlPluginCount()
                          throws PluginException
Specified by:
getControlPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getAutoInventoryPluginCount

public int getAutoInventoryPluginCount()
                                throws PluginException
Specified by:
getAutoInventoryPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getLogTrackPluginCount

public int getLogTrackPluginCount()
                           throws PluginException
Specified by:
getLogTrackPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

getConfigTrackPluginCount

public int getConfigTrackPluginCount()
                              throws PluginException
Specified by:
getConfigTrackPluginCount in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Specified by:
setProperty in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

getProperty

public java.lang.String getProperty(java.lang.String name)
Specified by:
getProperty in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

getPluginInfo

public PluginInfo getPluginInfo(java.lang.String name)
                         throws PluginException
Specified by:
getPluginInfo in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Throws:
PluginException

accepts

public boolean accepts(org.jboss.deployment.DeploymentInfo di)
Specified by:
accepts in interface org.jboss.deployment.SubDeployer
Specified by:
accepts in interface org.jboss.deployment.SubDeployerMBean
Overrides:
accepts in class org.jboss.deployment.SubDeployerSupport

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

isReady

public boolean isReady()
Specified by:
isReady in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean

start

public void start()
           throws java.lang.Exception
MBean Service start method. This method is called when JBoss is deploying the MBean, unfortunately, the dependencies that this has with HighAvailService and with other components is such that the only thing this method does is queue up the plugins that are ready for deployment. The actual deployment occurs when the startDeployer() method is called.

Specified by:
start in interface org.jboss.system.Service
Overrides:
start in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

stop

public void stop()
Specified by:
stop in interface org.hyperic.hq.product.server.mbean.ProductPluginDeployerMBean
Specified by:
stop in interface org.jboss.system.Service
Overrides:
stop in class org.jboss.system.ServiceMBeanSupport

start

public void start(org.jboss.deployment.DeploymentInfo di)
           throws org.jboss.deployment.DeploymentException
Specified by:
start in interface org.jboss.deployment.SubDeployer
Specified by:
start in interface org.jboss.deployment.SubDeployerMBean
Overrides:
start in class org.jboss.deployment.SubDeployerSupport
Throws:
org.jboss.deployment.DeploymentException

stop

public void stop(org.jboss.deployment.DeploymentInfo di)
          throws org.jboss.deployment.DeploymentException
Specified by:
stop in interface org.jboss.deployment.SubDeployer
Specified by:
stop in interface org.jboss.deployment.SubDeployerMBean
Overrides:
stop in class org.jboss.deployment.SubDeployerSupport
Throws:
org.jboss.deployment.DeploymentException

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.