Search Mailing List Archives
[protege-discussion] ProtegeJob class
Dr Michael Waters
quaestor at ntlworld.com
Fri May 2 02:36:38 PDT 2008
-----Original Message-----
From: Timothy Redmond <tredmond at stanford.edu>
Sent: 02 May 2008 05:40
To: User support for Core Protege and the Protege-Frames editor <protege-discussion at mailman.stanford.edu>
Subject: Re: [protege-discussion] ProtegeJob class
Your approach sounds good. ProtegeJob's are very flexible and are
good for performance and unanticipated extensions to the client-server
behavior.
> Does this require that I deploy the my .class file for my
> ProtegeJob on the server or is that all handled at runtime by the
> ProtegeJob abstract class?
> That is, there is no code deployment to the server required?
By default the Protege server class loaders must already be able to
find the ProtegeJob in question. So the jar containing the ProtegeJob
must already be in a plugin on the server.
However with rmi it is quite possible to have classes get loaded
dynamically. I have not tried this with the Protege server and so I
don't know whether their are any pitfalls.
The one thing that needs some explanation is the notion of
localization. I am not sure how best to explain this and will try to
write a wiki soon. The point is that knowledge bases are not
transfered in the usual serialization between the Protege server and
client. So after a remote object is transferred to or from the server
the knowledge base is lost from the transferred object. The localize
method is an opportunity for this knowledge base to be restored.
So for example, we might have the following
public class MyProtegeJob extends ProtegeJob {
private Frame frameToBeModifiedOnServer;
...
@Override
public localize(KnowledgeBase kb) {
super.localize(kb);
frameToBeModifiedOnServer.localize(kb);
}
}
The localize method ensures that when the ProtegeJob arrives on the
server the correct knowledge base is placed in the frameToBeModified.
This might sound complicated but it isn't too bad and generally it
just works.
-Timothy
On May 1, 2008, at 8:46 AM, Jonathan Carter wrote:
> Hi,
>
> I want to be able to schedule my Protege server to perform certain
> activities on projects.
> Having done some research around the wiki and so on, it seems that
> the ProtegeJob abstract class is just what I need.
> However, I'm a little unsure about how to use it and would like to
> confirm my approach before I go down a blind alley.
>
> So, my approach will be:
>
> 1. Create a class the extends ProtegeJob and in the run() method,
> performs the activities I want to perform.
> 2. Create a class that is a client of the Protege server which does
> the following:
> a. Connect to the server
> b. Instruct it to load the specified project (not the meta project)
> c. Instantiate my ProtegeJob class
> d. Call execute() on my ProtegeJob class
>
> I like the sound of the documentation that suggests that in this
> mode, the Protege job is copied to the server to be run there. Does
> this require that I deploy the my .class file for my ProtegeJob on
> the server or is that all handled at runtime by the ProtegeJob
> abstract class?
> That is, there is no code deployment to the server required?
>
> Thanks very much for your help
>
> Regards
>
> Jonathan
> _______________________________________
>
> Jonathan Carter - Head of Technical Architecture
> Enterprise Architecture Solutions Ltd
>
> Web: www.enterprise-architecture.com
> _______________________________________
>
> Assess your EA maturity at:
> www.enterprise-architecture.com/EAvaluator
> _______________________________________
>
> W O R L D C L A S S A R C H I T E C T U R E
>
>
>
>
> This message is confidential and may be privileged. It is for the
> exclusive use of the intended recipient(s). If you are not the
> intended recipient(s) please notify the sender and delete the
> message immediately. Unauthorised disclosure, distribution and
> copying of this email is strictly prohibited. The opinions expressed
> within this message are those of the individual author. Whilst EAS
> Ltd take reasonable steps to scan this email it does not accept
> liability for any virus that may be contained in it. EAS Ltd, 29
> Harley Street, London W1G 9QR. Telephone +44 (0)20 7612 4322 Fax +44
> (0)20 7182 6749
>
> _______________________________________________
> 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
More information about the protege-discussion
mailing list