QuickServer
v1.4.5

org.quickserver.net.server
Class ObjectCleaner

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.quickserver.net.server.ObjectCleaner
All Implemented Interfaces:
java.lang.Runnable, ServerHook

public class ObjectCleaner
extends java.lang.Thread
implements ServerHook

Class (Server Hook) that forces the garbage collection.

It runs as a daemon thread with MIN_PRIORITY. It will look for ServerHook-ObjectCleaner-Time-Minute key in ApplicationConfiguration of QuickServer. Default time interval is 60 min. Use of this hook is highly discouraged unless you have a specific need to do so.

Since:
1.3.3
Author:
Akshathkumar Shetty
See Also:
ApplicationConfiguration

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface org.quickserver.net.ServerHook
POST_SHUTDOWN, POST_STARTUP, PRE_SHUTDOWN, PRE_STARTUP
 
Constructor Summary
ObjectCleaner()
           
ObjectCleaner(int min)
          Creates a new ObjectCleaner object as a daemon thread.
 
Method Summary
 boolean handleEvent(int event)
          Invoked pre/post server event.
 java.lang.String info()
          Information about the server hook.
 void initHook(QuickServer quickserver)
          Method called to perform any initialisation
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectCleaner

public ObjectCleaner()

ObjectCleaner

public ObjectCleaner(int min)
Creates a new ObjectCleaner object as a daemon thread.

Parameters:
min - Time in minute to sleep before trying to cleanup, is set only if > 0 else set to 5 min.
Method Detail

initHook

public void initHook(QuickServer quickserver)
Description copied from interface: ServerHook
Method called to perform any initialisation

Specified by:
initHook in interface ServerHook
Parameters:
quickserver - is the server to which hook belongs to.

handleEvent

public boolean handleEvent(int event)
Description copied from interface: ServerHook
Invoked pre/post server event. If the hook is doing some action for the even passed it should return true indicating the same.

Specified by:
handleEvent in interface ServerHook
See Also:
ServerHook.PRE_STARTUP, ServerHook.POST_STARTUP, ServerHook.PRE_SHUTDOWN, ServerHook.POST_SHUTDOWN

info

public java.lang.String info()
Description copied from interface: ServerHook
Information about the server hook.

Specified by:
info in interface ServerHook

run

public void run()
Specified by:
run in interface java.lang.Runnable

QuickServer
v1.4.5

Copyright © 2003-2005 QuickServer.org