public Set<ControllerContext> getContextsByState(ControllerState state) { return controller.getContextsByState(state); }
@Override public boolean resolve(Controller controller) { for(ControllerContext context : controller.getContextsByState(ControllerState.INSTALLED)) { String name = context.getName().toString(); if(!name.startsWith(domain)) continue; if(!name.contains(serviceProperty)) continue; try { ObjectName otherName = new ObjectName(name); if(demand.apply(otherName)) { setIDependOn(context.getName()); addDependsOnMe(controller, context); setResolved(true); return isResolved(); } } catch (MalformedObjectNameException e) { // ignore this context } } setResolved(false); return isResolved(); }
Set<ControllerContext> notInstalled = fromController.getContextsByState(initialState); notInstalled.add(context); context.setState(initialState); fromContexts = fromController.getContextsByState(fromState); if (fromContexts.contains(context) == false) throw new IllegalStateException("Context not found in previous state (" + fromState + "): " + context.toShortString()); Set<ControllerContext> toContexts = toController.getContextsByState(toState); toContexts.add(context); context.setState(toState);
Set<ControllerContext> fromContexts = other.getController().getContextsByState(other.getState()); if (fromContexts.contains(other) == false)
Set<ControllerContext> fromContexts = fromController.getContextsByState(fromState); if (fromContexts == null || fromContexts.remove(context) == false) throw new Error("INTERNAL ERROR: context not found in previous state " + fromState.getStateString() + " context=" + context.toShortString(), new Exception("STACKTRACE")); Set<ControllerContext> toContexts = toController.getContextsByState(toState); toContexts.add(context); context.setState(toState);