alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * EventLog.java
 *
 * Created on July 11, 2003, 4:17 PM
 */

package org.netbeans.modules.j2ee.deployment.impl;

import javax.management.Notification;
import javax.management.NotificationListener;
import org.openide.windows.IOProvider;
import org.openide.windows.InputOutput;
//import java.text.DateFormat;

/**
 *
 * @author  nn136682
 */
public class EventLog implements NotificationListener {
    private String name;
    //DateFormat format;
    
    /** Creates a new instance of EventLog */
    public EventLog(String name) {
        this.name = name;
        //format = DateFormat.getInstance();
    }
    
    public void handleNotification(Notification notification, Object obj) {
        InputOutput io = IOProvider.getDefault().getIO(name, false);
        io.select();
        io.setFocusTaken(true);
        //PENDING: is formatting needed?
        //StringBuffer sb = new StringBuffer(256);
        //formatDate(notification.getTimeStamp(), sb);

        io.getOut().println(notification.toString());
    }
    
    public void open() {
        IOProvider.getDefault().getIO(name, false).select();
    }

    public void close() {
        IOProvider.getDefault().getIO(name, false).closeInputOutput();
    }
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.