Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (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 11:41 Go to next message
Fred Bricon is currently offline Fred Bricon
Messages: 14
Registered: July 2009
Junior Member
Hi,

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.

regards,

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 17:46 Go to previous message
Elson Yuen is currently offline Elson Yuen
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.

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


Current Time: Tue Jul 22 17:35:45 EDT 2014

Powered by FUDForum. Page generated in 0.08201 seconds