I've added this
| public interface GraphController
| {
| /**
| * Get the context.
| *
| * @param name the context name
| * @param state the required state
| * @param info the seatch info
| * @return found context or null if not available
| * @throws Throwable for any error
| */
| ControllerContext getContext(Object name, ControllerState state, SearchInfo info)
throws Throwable;
|
where normally Controller(Impl) would implement this interface.
And then decide on passed SearchInfo param what to do.
e.g. implement the SearchInfo::type itself - due to some private/protected modifiers,
internal info
or let SearchInfo's strategy handle the lookup.
In my current impl, I let strategy handle all different lookups.
| DEFAULT(new DefaultSearchInfoWrapper()),
| LOCAL(new LocalLookupStrategy()),
| TOP(new TopLevelLookupStrategy()),
| PARENT(new ParentOnlyLookupStrategy()),
| DEPTH(new DepthLookupStrategy()),
| LEAVES(new LeavesFirstLookupStrategy()),
| WIDTH(new WidthLookupStrategy()),
| CHILD_ONLY_DEPTH(new ChildrenOnlyDepthLookupStrategy()),
| CHILD_ONLY_LEAVES(new ChildrenOnlyLeavesFirstLookupStrategy()),
| CHILD_ONLY_WIDTH(new ChildrenOnlyWidthLookupStrategy());
|
But I still don't see where to pass-in this search type info?
I could add new annotation (@SearchType(Search)), which I would only handle in my
annotation plugins, but not in XML (too much hassle to get ValueMetaData owner for this
simple use case).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162794#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...