Package org.rioproject.watch

Examples of org.rioproject.watch.WatchDescriptor


     * ThreadDeadlockDetector
     *
     * @throws IllegalArgumentException if the ServiceElement parameter is null
     */
    public static void setThreadDeadlockDetector(ServiceElement sElem, MBeanServerConnection mbsc) {
        WatchDescriptor threadDeadlockDesc = getWatchDescriptor(sElem, ThreadDeadlockMonitor.ID);

        if(threadDeadlockDesc == null) {
            SLA sla = new SLA(ThreadDeadlockMonitor.ID, 0, 1);
            sla.setSlaPolicyHandler(SLAPolicyHandler.class.getName());
            threadDeadlockDesc = ThreadDeadlockMonitor.getWatchDescriptor();
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
            sla.setWatchDescriptors(threadDeadlockDesc);
            sElem.getServiceLevelAgreements().addServiceSLA(sla);
        } else {
            threadDeadlockDesc.setMBeanServerConnection(mbsc);
        }
    }
View Full Code Here


    public static WatchDescriptor getWatchDescriptor(ServiceElement sElem, String name) {
        if(sElem == null)
            throw new IllegalArgumentException("ServiceElement cannot be null");
        if(name == null)
            throw new IllegalArgumentException("name cannot be null");
        WatchDescriptor wDesc = null;
        ServiceLevelAgreements slas = sElem.getServiceLevelAgreements();
        for(SLA sla : slas.getServiceSLAs()) {
            WatchDescriptor[] wDescs = sla.getWatchDescriptors();
            for(WatchDescriptor wd : wDescs) {
                if(wd.getName().equals(name)) {
View Full Code Here

     *
     * @return A <tt>WatchDescriptor</tt> set to poll every 5 seconds, checking
     * if any threads are deadlocked.
     */
    public static WatchDescriptor getWatchDescriptor() {
        return new WatchDescriptor(ID, ACCESSOR, 5000);
    }
View Full Code Here

        long threadDeadlockCheck = (Long)config.getEntry(CONFIG_COMPONENT,
                                                         "threadDeadlockCheck",
                                                         long.class, (long)5000);
        if(threadDeadlockCheck>=1000) {

            WatchDescriptor threadDeadlockDescriptor = ThreadDeadlockMonitor.getWatchDescriptor();
            threadDeadlockDescriptor.setPeriod(threadDeadlockCheck);
            Method getThreadDeadlockCalculable = ThreadDeadlockMonitor.class.getMethod("getThreadDeadlockCalculable");
            ThreadDeadlockMonitor threadDeadlockMonitor = new ThreadDeadlockMonitor();
            threadDeadlockMonitor.setThreadMXBean(ManagementFactory.getThreadMXBean());

            WatchInjector watchInjector = new WatchInjector(this, context);
View Full Code Here

TOP

Related Classes of org.rioproject.watch.WatchDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.