[omniORB] Authentication; Garbage Collection
Alex Suzuki (ML)
ml at cynox.ch
Thu Jul 22 09:13:27 BST 2004
Hi folks,
I just started using omniORBpy (and CORBA in general) a week ago, and I'm
quite confused about a couple of things. Perhaps this isn't the right place
to ask, since some of my questions are probably not specific to omniORB but
are general CORBA questions. I have tried Google but it didn't give me any
promising results.
1) Authentication
I'm writing an application that has a server which manages objects which
basically represent entities in an RDBMS. I have several GUI clients
accessing and modifying those objects. Users using the GUI have to
somehow authenticate, because there is a rights system which is supposed
to give some users the possibility to modify objects, others only have
read-only access. Can this be done easily with omniORBpy/CORBA?
I thought about having an authenication object with an Interface like
interface SessionCookie {
readonly attribute long access_level;
};
interface Authenticator {
SessionCookie login(in string username, in string password);
};
However, with this approach it seems I have to add an additional parameter
to every interesting method of the shared objects which feels unnatural
and very unelegant. I saw a post on the mico-devel mailing list from a guy
who had the same problem, he solved it with interceptors, which are AFAIK
not implemented yet in omniORBpy (but are in omniORB).
Is there an easy way to do this in a transparent way with omniORBpy?
2) Garbage collection
This is probably not related to omniORB in any way, but I'd be glad for
some feedback anyway. My clients use a factory operation
getObject(in string key);
to get a reference to an object. If the object with that key has already
been instantiated, the server returns the already instantiated object
(it maintains a (key -> obj) mapping), otherwise it instantiates a new
servant, activates it and passes out the reference.
So I need to do some kind of primitive garbage collection on the server.
I was thinking along the lines of reference counting, where the reference
count is implicitly incremented by getObject() and the client has to call
an inverse
freeObject(in SharedObject obj);
to decrement it. I have a background thread on the server iterating through
its mapping, checking refcounts, and deactivating objects when they have
no more clients referencing them. What steps have to be taken exactly?
Does a poa.deactivate_object(obj_id) suffice or do I have to deallocate
the python servant aswell? How would I do that? What are the pitfalls
to this approach? There are no circular references, and I trust my clients
to call freeObject() when they no longer need access to that object.
Thanks for any help.
cheers,
Alex
More information about the omniORB-list
mailing list