|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompassCallback<T>
Callback interface for Compass code. To be used with CompassTemplate's execute methods, assumably often as anonymous classes within a method implementation. The typical implementation will call CompassSession.load/find/save to perform some operations on searchable objects.
Method Summary | |
---|---|
T |
doInCompass(CompassSession session)
Gets called by CompassTemplate.execute with an active
Compass Session. |
Method Detail |
---|
T doInCompass(CompassSession session) throws CompassException
CompassTemplate.execute
with an active
Compass Session. Does not need to care about activating or closing the
Session, or handling transactions.
If called within a thread-bound Compass transaction (initiated by an outer compass transaction abstraction), the code will simply get executed on the outer compass transaction with its transactional semantics.
Allows for returning a result object created within the callback, i.e. a domain object or a hits of domain objects. Note that there's special support for single step actions: see CompassTemplate.find etc. A thrown RuntimeException is treated as application exception, it gets propagated to the caller of the template.
CompassException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |