public void applyPostCreate(final Method param) { final T instance = getRefs().get(getName()); try { param.invoke(instance); } catch (Throwable e) { StandardOutputStreams.printError(e, "Failed to invoke method %s%n.", param.getName()); } }
public void applyPostCreate(final ObjectProducer param) { final T instance = getRefs().get(getName()); try { setter.invoke(instance, param.getObject()); } catch (Throwable e) { StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject()); } }
public void applyPostCreate(final ObjectProducer param) { if (setter != null) { final T instance = getRefs().get(getName()); try { setter.invoke(instance, param.getObject()); } catch (Throwable e) { StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), param.getObject()); } } }
final T instance = getRefs().get(getName()); if (instance != null) { try {
public void rollback() { // We need to once again determine the property type final Class<?> propertyType = getPropertyType(actualClass, propertyName); if (propertyType == null) { // We don't want the rest of the rollback to fail so we'll just log a message StandardOutputStreams.printError("No property \"%s\" type could be determined for %s \"%s\"", propertyName, getDescription(), getName()); return; } // Get the reference instance, the old value and reset to the old value final T instance = getRefs().get(getName()); final ObjectProducer producer = getConfiguration().getValue(actualClass, propertyName, propertyType, oldValue, true); try { setter.invoke(instance, producer.getObject()); } catch (Throwable e) { StandardOutputStreams.printError(e, "Failed to invoke setter %s with value %s%n.", setter.getName(), producer.getObject()); } } });