public void setProvideCapability(ViewCapability viewCapability, ViewResourceCallback resourceCallback) { if (!canProvideCapability(viewCapability)) { throw new UnsupportedOperationException("View capability " + viewCapability.getClass().getSimpleName() + " not supported"); } // Get the index requested, such as the 8th prior event ViewCapPriorEventAccess requested = (ViewCapPriorEventAccess) viewCapability; int reqIndex = requested.getIndexConstant(); // Store in a list per index such that we can consolidate this into a single buffer List<ViewResourceCallback> callbackList = callbacksPerIndex.get(reqIndex); if (callbackList == null) { callbackList = new LinkedList<ViewResourceCallback>(); callbacksPerIndex.put(reqIndex, callbackList); } callbackList.add(resourceCallback); }
if (!viewResourceDelegate.requestCapability(streamNumber, new ViewCapPriorEventAccess(constantIndexNumber), this))