Version 2



    <?xml version="1.0" encoding="UTF-8"?>
    <!-- $Id:$ -->
        In this example we have the BarrierController controlling a Barrier
        that is started when we receive the "jboss.tomcat.connectors.started"
        notification from the Tomcat mbean, and stopped when we receive the
        "org.jboss.system.server.stopped" notification from the server mbean.
        The dependent services need only define a dependency on the Barrier mbean!
      <mbean code="org.jboss.system.BarrierController"
        <!-- Whether to have the Barrier initially started or not -->
        <attribute name="BarrierEnabledOnStartup">false</attribute>
        <!-- Whether to subscribe for notifications after startup -->
        <attribute name="DynamicSubscriptions">true</attribute>
        <!-- Dependent services will depend on this mbean -->
        <attribute name="BarrierObjectName">jboss:name=TomcatConnector,type=Barrier</attribute>
        <!-- The notification subscription handback that starts the barrier -->
        <attribute name="StartBarrierHandback">start</attribute>
        <!-- The notification subscription handback that stops the barrier -->
        <attribute name="StopBarrierHandback">stop</attribute>
        <!-- The notifications to subscribe for, along with their handbacks -->
        <attribute name="SubscriptionList">
            <mbean name="jboss.web:service=WebServer" handback="start">
              <filter factory="NotificationFilterSupportFactory">
                <enable type="jboss.tomcat.connectors.started"></enable>
            <mbean name="jboss.system:type=Server" handback="stop">
              <filter factory="NotificationFilterSupportFactory">
                <enable type="org.jboss.system.server.stopped"></enable>
        An example service that depends on the Barrier we declared above.
        This services creates a background thread and monitors the memory
        usage. When it exceeds the defined thresholds it emits notifications
      <mbean code=""
        <attribute name="FreeMemoryWarningThreshold">20m</attribute>
        <attribute name="FreeMemoryCriticalThreshold">15m</attribute>
        <!-- The BarrierObjectName configured in the BarrierController -->


    Referenced by: