public Object getValue(ServiceValueContext valueContext) throws Throwable { KernelController controller = valueContext.getController(); ControllerState state = dependentState; if (state == null) state = ControllerState.INSTALLED; ControllerContext context = controller.getContext(dependency, state); if (context == null) throw new Error("Should not be here - dependency failed! " + this); if (property != null && property.length() > 0) { if (context instanceof AttributeDispatchContext) { AttributeDispatchContext adc = (AttributeDispatchContext)context; return adc.get(property); } else throw new IllegalArgumentException( "Cannot use property attribute, context is not AttributeDispatchContext: " + context + ", metadata: " + this); } else { return getTarget(underlyingContext, context); } }
@Override public Object ungetValue(ServiceValueContext valueContext) throws Throwable { if (property == null || property.length() == 0) { KernelController controller = valueContext.getController(); ControllerState state = dependentState; if (state == null) state = ControllerState.INSTALLED; ControllerContext context = controller.getContext(dependency, state); if (context != null) { ungetTarget(underlyingContext, context); return null; } } return super.ungetValue(valueContext); }
public Object getValue(ServiceValueContext valueContext) throws Throwable { KernelController controller = valueContext.getController(); ControllerState state = dependentState; if (state == null) state = ControllerState.INSTALLED; ControllerContext context = controller.getContext(dependency, state); if (context == null) throw new Error("Should not be here - dependency failed! " + this); Object result = context.getTarget(); if (property != null) { if (context instanceof AttributeDispatchContext) { AttributeDispatchContext adc = (AttributeDispatchContext)context; result = adc.get(property); } else throw new IllegalArgumentException( "Cannot use property attribute, context is not AttributeDispatchContext: " + context + ", metadata: " + this); } return result; }
public Object getValue(ServiceValueContext valueContext) throws Throwable KernelController controller = valueContext.getController();
public Object getValue(ServiceValueContext valueContext) throws Throwable KernelController controller = valueContext.getController();