FileDocCategorySizeDatePackage
MonitorableEntry.javaAPI DocGlassfish v2 API5974Fri May 04 22:35:42 BST 2007com.sun.enterprise.server

MonitorableEntry

public final class MonitorableEntry extends Object
Represents a monitor entry in dynamic reloading.
author
Nazrul Islam
since
JDK 1.4

Fields Summary
private String
id
private String
displayName
private File
monitoredFile
private long
lastReloadedAt
private MonitorListener
listener
Constructors Summary
MonitorableEntry(String id, String displayName, File monitoredFile, MonitorListener listener)
Constructor.

param
id registered name of the application or stand alone module
param
displayName the user-friendly display name
param
monitoredFile file to be monitored
param
listener listener that handles the callback


        this.id              = id;
        this.displayName     = displayName;
        this.monitoredFile   = monitoredFile;
        this.lastReloadedAt  = monitoredFile.lastModified();
        this.listener        = listener;
    
MonitorableEntry(String id, File monitoredFile, MonitorListener listener)
Constructor.

param
id registered name of the application or stand alone module
param
monitoredFile file to be monitored
param
listener listener that handles the callback


        this(id, id, monitoredFile, listener);
    
MonitorableEntry(File monitoredFile, MonitorListener listener)
Constructor. Use this when "id" is not necessary.

param
monitoredFile file to be monitored
param
listener listener that handles the callback


        this("AutoDeployDirectory", monitoredFile, listener);
    
Methods Summary
public booleanequals(java.lang.Object other)
Indicates whether the given object is equal to this one.

return
true if the given object is equal

        return monitoredFile.equals(((MonitorableEntry) other).monitoredFile);
    
java.lang.StringgetDisplayName()
Returns the display name of the entry (usually this is the same as the id).

return
the display name of the entry

        return this.displayName;
    
java.lang.StringgetId()
Returns the id of the entry.

return
the id of the entry

        return this.id;
    
longgetLastReloadedTimeStamp()
Returns the last attempted reload time stamp of the monitored entry.

return
last attempted reload time stamp of the monitored entry

        return this.lastReloadedAt;
    
MonitorListenergetListener()
Returns the listener for this entry

return
the listener for this entry

        return this.listener;
    
java.io.FilegetMonitoredFile()
Returns the monitored file for this entry.

return
the monitored file for this entry

        return this.monitoredFile;
    
public inthashCode()
Returns a hash code for this object.

return
hash code for this object

        return id.hashCode();
    
voidsetLastReloadedTimeStamp(long ts)
Sets the time stamp of last reload attempt.

param
ts new time stamp

        this.lastReloadedAt = ts;