Re: [Aglets-users] Running my own Aglet
Status: Beta
Brought to you by:
cat4hire
From: Thomas H. <max...@us...> - 2012-03-31 18:22:44
|
Hello, everybody! My previous e-mail in this thread described a way to get your own aglets off the ground, but while it is quick, it is also dirty. Aglets are not meant to be in the class path for following reasons. The directories in CLASSPATH (actually in the LOCALCLASSPATH variable built inside bin/agletsd[.bat]) are used for finding the classes that make up the server (like com.ibm.awb.launcher.Main) and also classes that have to be available to all aglets (like com.ibm.aglet.Aglet). But the custom classes of the aglets themselves (let's say, org.somewhere.MyAglet) are loaded by a specialised classloader (com.ibm.aglets.tahiti.AgletClassLoader, which extends java.lang.ClassLoader). We can not expect org.somewhere.MyAglet to always be in the CLASSPATH, it might be in a remote location! Besides, there are security implications: classes loaded by different classloaders can be subject to different security policies and Agletstakes advantage of that (I think). Classes on the CLASSPATH (belonging to the platform itself) should be much more trusted than classes belonging to Aglets, that can potentially arrive from a hostile sender. It was in trying to give a decent answer to this question of how to specify the aglet to launch that I experimented again with Aglets and discovered that it was not clear how one can do it properly (if there even was a way to do it properly). That got me started on making the changes that have become version 2.5-gamma of Aglets. So, for launching your aglets without the CLASSPATH hack, install version 2.5-gamma and imitate one of the many ways illustrated by the default "address book" of example aglets. Good luck! Thomas On Mon, Mar 12, 2012 at 16:27, Thomas Herlea < max...@us...> wrote: > The following is just my experience with aglets and should be considered > something that may work, but not an authoritative answer. It would be > really nice if everybody reading this could reply and write how you would > LIKE to be able to launch aglets.If you don't have an idea about how to > implement it, just describe the experience you would like to have. > > Aglets are launched by having the Tahiti aglets server "pick them up" from > the hard disk. The easiest way I know to get an aglet up and running is the > following. Before you start Tahiti, add the directory containing your > aglet's packages to the CLASSPATH environment variable. After you start > Tahiti, you launch your aglets by pressing the "Create" toolbar button, > then providing the full class name of your aglet in the "Code Base" field > and pressing the "Create" button of the dialog. > > An optimisation is to "bookmark" the "Code Base" value to the list of > "Saved Aglets" by clicking the "Add to the list" button. It will save it in > a persistent way, such that the "bookmark" will be available next time you > want to launch an instance of that aglet and even next time you run Tahiti. > > Another optimisation, on by default, is to have the checkbox "Reload the > agent as new" checked. Like that, every time you launch an instance of that > aglet, it will take the classes from disk, not from its cache. The > advantage is that like that you can develop and rebuild the aglet and > launch the new version without having to restart Tahiti. > > Thomas > > > > On Mon, Mar 12, 2012 at 12:04, shruti nagani <shr...@gm...>wrote: > >> >> Hi, >> >> Sorry the image is attached. >> >> On Mon, Mar 12, 2012 at 4:12 PM, shruti nagani <shr...@gm...>wrote: >> >>> Hi, >>> >>> I am using Eclipse IDE on Windows 7. I want to know how to run my own >>> created aglet. Do I have to run it via the Tahiti server? Is there no other >>> possible way I can do that? I am using Windows and don't want to switch to >>> Linux, and I am not aware how to use/install Tahiti on Windows. Also, the >>> aglet that I have developed is in a java project form(see the screenshot >>> below), how can I run it via Tahiti, in any case? >>> >>> Any help would be appreciated! >>> Regards >>> Shruti >>> >>> >>> >>> >> Regards >> Shruti >> > > |