Re: how to intercept CVS Events from other netbeans module ?

Milos Kleint <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Message-ID <[email protected]>
Cristiano Cumer wrote:
> We had no luck!
> So an symply question:
>  It's possible to intercept the list of files that are to be/have been
> commited to the CVS ?
> You said that to intercept any command might be a problem ...
> This sort of problem being possible to solve or isn't there some solution
> yet ?

I've been thinking about a possible solution:

The NbJavaCvsFileSystem has a method

public JavaCvsRuntimeCommand prepareCommand(FileSystemCommand command);

this method is used to add the runtime tab's subnode when a command is started to keep track of the 
command's progress.

Even though it returns JavaCvsRuntimeCommand, it's return value is usually ignored.
If you create a infrastructure for registering global listeners, this method is the place to hook 
the registered ones to the FileSystemCommand.

That's probably the "least-ressistance" approach I can think of.

Regards.

Milos


> 
> TIA
> 
> Cristiano
> 
> "Milos Kleint" <[email protected]> ha scritto nel messaggio
> news:netbeans.modules.javacvs.dev/[email protected]...
> 
>>NetBeans wrote:
>>
>>
>>>Project :
>>>   Metric extraction through (NetBeans--> WebMetric) from local files
>>
> and
> 
>>>cvs projects
>>>
>>>Status :
>>>  local part solved
>>>  trying to implement the cvs part
>>>
>>>Problem :
>>>  catch the CVS-Events on various cvs commands
>>>
>>
>>you want to intercept any command that the user executes? or want to run
>>a command on your own and use the info?
>>the first possibility might be a problem..
>>
>>
>>
>>>from what we read on the newsgroups and/or netbeans.org pages the only
> 
> way
> 
>>>to catch this events is to pass through the EventManger of the client. If
>>>this is true how do we find the active EventManager and how do we add a
>>>"CVS-Command listener" to the classes in the NB explorer ?
>>>
>>
>>In netbeans code there's another layer above the cvs library.. so you
>>don't need access to the event manager..subclasses of FileSystemCommand
>>are wrappers around the library commands.. they have a way to add
> 
> listener..
> 
>>>Or even better how do we get the list of files that are being submitted ,
>>>intercept them before CVS-Command execution, pass them to out metrics
>>
> method
> 
>>>and pass them back to the JavaCVS flow ?
>>>
>>
>>it seems like you would need a general listener that would be attached
>>to every command, right? that's not possible right now. However you can
>>add such functionality I suppose... the filesystem will have a pool of
>>global listeners that it would attach to every command issued. that's
>>already happening however behind the scenes..
>>
>>Hope that helps..
>>
>>Milos
>>
>>
>>>
>>>T.i.a.
>>>
>>>Karbon Georg
>>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.