private void run() throws Exception {
        /* in a "real" application, the registration instance would probably be
         * saved in a field for subsequent unregistration */
        new MBeanRegistration(this).register();
        for (;;) {
            System.out.println("counter = " + getCounter());
            incrementCounter(1);
            Thread.sleep(1000); // one second
        }
    }