Querying the Lighthouse repository from a resource adapter

I have a situation where I need to get some info out of the repository from inside my resource adapter.

I have tried a couple of different ways without success as follows:

1. Use the getContext() method of the ResourceAdapterBase class:

LighthouseContext ctx = getContext();

PersistentObject po = ctx.getObjectIfExists(...);

Problem: The getContext() always null.

2. Use the ObjectCache object passed into the constructor.

Problem: The ResourceName() constructor is the only one called

and the ResourceName(Resource res, ObjectCache cache)

constructor is never called so I don't have access to the ObjectCache

to issue the query.

[700 byte] By [gnufan] at [2007-11-26 11:00:36]
# 1
I figured it out...here is the solution:ObjectCache cache = _resource.getCache();try {PersistentObject po = cache.getObject(_resource.getType(), ldapName, (String)null);} catch (Exception e) {// Error handling here}
gnufan at 2007-7-7 3:14:16 > top of Java-index,Web & Directory Servers,Directory Servers...