@Override public FutureDependencyBuilder<F> complete(Object callbackInstance, String callback) { super.setCallbacks(callbackInstance, callback, null); return this; }
/** * Sets the add/remove callbacks. * @param add the callback to invoke when a dependency is added * @param remove the callback to invoke when a dependency is removed * @return this dependency instance */ public T setCallbacks(String add, String remove) { return setCallbacks(add, null, remove); }
/** * Sets a callback method invoked on the instantiated component. */ public ConfigurationDependencyImpl setCallback(String callback) { super.setCallbacks(callback, null); return this; }
/** * Sets the add/change/remove callbacks. * @param add the callback to invoke when a dependency is added * @param change the callback to invoke when a dependency has changed * @param remove the callback to invoke when a dependency is removed * @return this dependency instance */ public T setCallbacks(String add, String change, String remove) { return setCallbacks(null, add, change, remove); }
/** * Sets the callbacks for this service. These callbacks can be used as hooks whenever a * dependency is added or removed. They are called on the instance you provide. When you * specify callbacks, the auto configuration feature is automatically turned off, because * we're assuming you don't need it in this case. * * @param instance the instance to call the callbacks on * @param add the method to call when a service was added * @param remove the method to call when a service was removed * @return this service dependency */ public T setCallbacks(Object instance, String add, String remove) { return setCallbacks(instance, add, null, remove); }
/** * Sets a callback method on an external callback instance object. * If needsInstance == true, the component is instantiated at the time the callback is invoked. * We check if callback instance is null, in this case, the callback will be invoked on the instantiated component. */ public ConfigurationDependencyImpl setCallback(Object instance, String callback, boolean needsInstance) { super.setCallbacks(instance, callback, null); needsInstance(needsInstance); return this; }