站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 varia API Documentation 英文版文档

TrapdService (Various API) - JBoss 4.0.1 sp1 varia API Documentation 英文版文档


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

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.jmx.adaptor.snmp.trapd.TrapdService
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, TrapdServiceMBean

public class TrapdService
extends org.jboss.system.ServiceMBeanSupport
implements TrapdServiceMBean

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.

Version:
$Revision: 1.2.6.2 $
Author:
Spyros Pollatos, Dimitris Andreadis

Field Summary
protected  org.opennms.protocols.snmp.SnmpTrapSession trapSession
          The snmp session used to receive the traps
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
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
 String getBindAddress()
          Gets the interface that will be bound
 int getPort()
          Gets the port that will be used to receive traps
 void setBindAddress(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
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
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

trapSession

protected org.opennms.protocols.snmp.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

Specified by:
setPort in interface TrapdServiceMBean
Parameters:
port - the port to listen for traps

getPort

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

Specified by:
getPort in interface TrapdServiceMBean
Returns:
the port to listen for traps

setBindAddress

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

Specified by:
setBindAddress in interface TrapdServiceMBean
Parameters:
host - the interface to bind
Throws:
UnknownHostException

getBindAddress

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

Specified by:
getBindAddress in interface TrapdServiceMBean
Returns:
the interface to bind

startService

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

Throws:
Exception

stopService

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

Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.