org.friendlysnmp
Class FHandler

java.lang.Object
  extended by org.friendlysnmp.FHandler
Direct Known Subclasses:
CoreAppInfoHandler, CoreDeadlockHandler, CoreExceptionsHandler, CoreLifeHandler, CorePersistenceHandler

public abstract class FHandler
extends java.lang.Object

Base class for handlers which are dealing with XxxMibFriend classes.

Version:
$Revision: 1.13 $

Nested Class Summary
static class FHandler.AgentStartType
           
 
Field Summary
protected  AgentWorker agent
           
protected  BaseMib mibBase
           
 
Constructor Summary
FHandler()
           
 
Method Summary
static java.lang.String getTimestampNow()
          Current timestamp in string format.
 void init()
          The method is called by SNMP agent when it's initialized.
static boolean isIntegerEqual(java.lang.Object obj, int value)
          This method is a shortcut for Integer.valueOf(n).equals(obj)
 void registerMib(BaseMib mibBase)
           
 void setAgent(AgentWorker agent)
           
 void shutdown()
          The method is called by SNMP agent when it's shutdown.
 void start(FHandler.AgentStartType startType)
          The method is called by SNMP agent when it's started or restarted.
 void stop()
          The method is called by SNMP agent when it's stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

protected AgentWorker agent

mibBase

protected BaseMib mibBase
Constructor Detail

FHandler

public FHandler()
Method Detail

setAgent

public void setAgent(AgentWorker agent)

registerMib

public void registerMib(BaseMib mibBase)
                 throws FException
Throws:
FException

init

public void init()
          throws FException
The method is called by SNMP agent when it's initialized. Default implementation does nothing. Override this method in derived class, for example, to initialize static scalars and tables.

Throws:
FException

start

public void start(FHandler.AgentStartType startType)
The method is called by SNMP agent when it's started or restarted. Default implementation does nothing. Override this method in derived class, for example, to start threads.


stop

public void stop()
The method is called by SNMP agent when it's stopped. Default implementation does nothing. Override this method in derived class, for example, to stop threads.


shutdown

public void shutdown()
The method is called by SNMP agent when it's shutdown. Default implementation does nothing. Override this method in derived class has, for example, to shutdown threads.


isIntegerEqual

public static final boolean isIntegerEqual(java.lang.Object obj,
                                           int value)
This method is a shortcut for Integer.valueOf(n).equals(obj)

Parameters:
obj - any object, possibly null
value - int value
Returns:
result of comparison

getTimestampNow

public static final java.lang.String getTimestampNow()
Current timestamp in string format.

Returns:
current timestamp