Search Mailing List Archives
[protege-discussion] Listening for FrameEvents and KnowledgebaseEvents on ProtegeServer (3.4)
Hanno Wunderlich
hannowun at googlemail.com
Thu Aug 27 23:15:10 PDT 2009
Hi Timothy,
many thanks. Your hint solved my problem.
Regards,
Hanno
On Thu, Aug 27, 2009 at 7:08 PM, Timothy Redmond <tredmond at stanford.edu>wrote:
>
> I think that I know what is missing. Event dispatch on the server is
> sometimes non-optimal so we turn it off on the server by default. Some
> plugins do work that is unnecessary on the server. What you need to do
> to turn it on is a bit of code
>
> if (p.isMultiUserServer()) {
> ServerFrameStore.requestEventDispatch(p.getKnowledgeBase());
> }
>
> This will tell the server that events need to be started for this
> knowledgebase. There are several of our projects that do this bit of
> code so as to run properly on the server.
>
> -Timothy
>
>
> On Thu, 2009-08-27 at 18:28 +0200, Hanno Wunderlich wrote:
> > Hi,
> >
> > i've written a small ProjectPlugin that listens for changes in the
> > KnowledgeBase of a project and then writes a logfile about the
> > changes. For local projects and RemoteClientProjects the plug-in works
> > as expected. But now i had to modify the plugin to work on the server
> > side. Without success. I am adding my EventListener in the same way as
> > i did before. But no events were send to the listener.
> >
> > Perhaps someone can tell me what i've to do to get this working on the
> > ProtegeServer.
> >
> > Greetings
> > Hanno
> >
> >
> > My test code from the ProjectPlugin:
> >
> > afterLoad(Project p){
> > MyListener l=new MyListener();
> > p.getKnowledgeBase().addFrameListener(l);
> > p.getKnowledgeBase().addKnowledgeBaseListener(l);
> > }
> >
> > My test code from MyListener.java
> >
> > public MyListener implements FrameListener, KnowledgeBaseListener{
> >
> > //The important part from the FrameListener
> > public void ownSlotValueChanged(FrameEvent e){
> > System.out.println("Someone changed some slotvlaue");
> > }
> >
> > //The important part from the FrameListener
> > public void instanceCreated(KnowledgeBaseEvent e){
> > System.out.println("Someone created a new instance");
> > }
> >
> > public void deleteCreated(KnowledgeBaseEvent e){
> > System.out.println("Someone deleted an instance");
> > }
> >
> > .....
> > }
> >
> > _______________________________________________
> > protege-discussion mailing list
> > protege-discussion at lists.stanford.edu
> > https://mailman.stanford.edu/mailman/listinfo/protege-discussion
> >
> > Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20090828/ac43e248/attachment.html>
More information about the protege-discussion
mailing list