org.jboss.jmx.adaptor.snmp.trapd
Class TrapdService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.jmx.adaptor.snmp.trapd.TrapdService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class TrapdService
extends ServiceMBeanSupport (src)

MBean wrapper class that acts as an SNMP trap receiver/logger. It logs traps as INFO messages - change log4j configuration to redirect logging output. To reconfigure the listening port the MBean needs to be stopped and re-started.


Field Summary
protected  SnmpTrapSession trapSession
          The snmp session used to receive the traps
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
TrapdService()
          Empty CTOR
 
Method Summary
 java.lang.String getBindAddress()
          Gets the interface that will be bound
 int getPort()
          Gets the port that will be used to receive traps
 void setBindAddress(java.lang.String host)
          Sets the interface that will be bound
 void setPort(int port)
          Sets the port that will be used to receive traps
protected  void startService()
          Performs service start-up by instantiating an SnmpTrapSession
protected  void stopService()
          Performs service shutdown by stopping SnmpTrapSession
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trapSession

protected SnmpTrapSession trapSession
The snmp session used to receive the traps

Constructor Detail

TrapdService

public TrapdService()
Empty CTOR

Method Detail

setPort

public void setPort(int port)
Sets the port that will be used to receive traps

Parameters:
port - the port to listen for traps

getPort

public int getPort()
Gets the port that will be used to receive traps

Returns:
the port to listen for traps

setBindAddress

public void setBindAddress(java.lang.String host)
                    throws java.net.UnknownHostException
Sets the interface that will be bound

Parameters:
host - the interface to bind
Throws:
java.net.UnknownHostException

getBindAddress

public java.lang.String getBindAddress()
Gets the interface that will be bound

Returns:
the interface to bind

startService

protected void startService()
                     throws java.lang.Exception
Performs service start-up by instantiating an SnmpTrapSession

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Performs service shutdown by stopping SnmpTrapSession

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception