Code example for EventObject

Methods: getSource

0
            this.cj = cj;
        } 
         
        @SuppressWarnings("unchecked") 
        public void progressStatisticsEvent(final EventObject e) {
            super.progressStatisticsEvent(e);
            if (this.cj.getMbeanName() == null) {
                // Can be null around job startup.  Return w/o doing anything. 
                return; 
            } 
                 
            Map s = ((StatisticsTracking)e.getSource()).getProgressStatistics();
            // Convert the statistics to OpenType CompositeData and add as 
            // user data to Notification. 
            CompositeData cd = null;
            try { 
                if (this.ct == null) {
                    this.ct = JmxUtils.createCompositeType(s, PROG_STATS,
                        PROG_STATS + " for " + this.cj.getMbeanName());
                } 
                cd = new CompositeDataSupport(this.ct, s);
            } catch (OpenDataException ode) {
                ode.printStackTrace();
            } 
            if (cd != null) {
                Notification n = new Notification(PROG_STATS,
                    this.cj.getMbeanName(), getNotificationsSequenceNumber(),
                    ((StatisticsTracking)e.getSource()).
                        getProgressStatisticsLine()); 
                n.setUserData(cd);
                this.cj.sendNotification(n);
            } 
        }