Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to listen to "Add and remove projects" to server event?
How to listen to "Add and remove projects" to server event? [message #524616] Thu, 01 April 2010 15:41 Go to next message
Fred Bricon is currently offline Fred BriconFriend
Messages: 14
Registered: July 2009
Junior Member

I'd like to monitor when a web project is added to a server using WTP's API.
I think I need to register some sort of listener for "add and remove projects" event (and run as ... server).
Then once a project is added to a server, I'll need to get its deployment path, so I can ultimately create/update some appropriate LaunchConfiguration.
Can anyone give me some pointers to the right classes / extension points/ patterns allowing me to achieve this?

Thanks in advance.


Fred Bricon

Fred Bricon
Re: How to listen to "Add and remove projects" to server event? [message #527913 is a reply to message #524616] Fri, 16 April 2010 21:46 Go to previous message
Elson Yuen is currently offline Elson YuenFriend
Messages: 1
Registered: July 2009
Junior Member
There will be a server change event issued when the modify modules are called during add/remove project. Therefore, you can use:
org.eclipse.wst.server.core.IServer.addServerListener(IServe rListener, int)

And pass in org.eclipse.wst.server.core.ServerEvent.SERVER_CHANGE
as the even mask on the second parameter.

Notice that you'll get notified when whenever the module changes. Therefore, you can figure out the change in module list by using IServer.getModules() to find out the existing list of modules after the change.

Previous Topic:Tomcat timeout - but started correctly
Next Topic:Javascript validation and jar files
Goto Forum:

Current Time: Thu Mar 04 09:46:51 GMT 2021

Powered by FUDForum. Page generated in 0.02440 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top