[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBMICROCONT-309; aliases and scoping
alesj
do-not-reply at jboss.com
Mon Jul 7 06:47:05 EDT 2008
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#4162794
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162794
More information about the jboss-dev-forums
mailing list