[SNMP4J] SNMP4J receiving traps in J2EE application server

Mathias Bogaert pathos at pandora.be
Fri Oct 15 08:32:57 CEST 2004


Steve,

Use a ServletContextListener:

http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ 
ServletContextListener.html

in the contextInitialized method, start the SNMP stack.

and in web.xml:

     <listener>
          
<listener-class>your.listener.here.StartupListener</listener-class>
     </listener>

Mathias Bogaert

On 14 Oct 2004, at 23:41, Frank Fock wrote:

> Hi Steve,
>
> Most application servers support something that is called
> "StartUpBean" (WebSphere). These kind of beans are
> called when an application is started. This is the right
> location to initialize your SNMP4J trap receiver.
>
> EJB 2.1 defines a timer service which could provide
> a more portable way than using StartUpBeans.
>
> Which one to choose primarily depends on your
> requirements and your environment (AppServer).
>
> Hope this helps anyway.
>
> Best regards,
> Frank
>
> steve.van_den_berghe at alcatel.be wrote:
>
>> Hi,
>> I am currently working with SNMP4J in BEA Weblogic. I have very good  
>> experiences with it and I would like to thank the authors for writing  
>> this software.
>> Now, I would like to receive traps inside the application server, for  
>> this I will create an transportmapping and snmp instance, add a  
>> commandresponder etc. and then finally call transport.listen... as  
>> was explained already on this board.
>> However, how/where should I do this in the application server as the  
>> server is completely in control of the creation and deletion of the  
>> objects/threads? I cannot do it in a EJB or the servlets.
>>
>> Can someone please explain how I can integrate a trap listening  
>> function within the application server?
>>
>> Thanks,
>> Steve
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>>
>>
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>
>




More information about the SNMP4J mailing list