public static def void setDelegate(RpcService proxy, RpcService delegate) {
val field = proxy.class.getField(DELEGATE_FIELD)
if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy");
public static def void setDelegate(RpcService proxy, RpcService delegate) {
val field = proxy.class.getField(DELEGATE_FIELD)
if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy");
field.set(proxy, delegate)
} else
throw new IllegalArgumentException("delegate class is not assignable to proxy");
field.set(proxy, delegate)
} else
throw new IllegalArgumentException("delegate class is not assignable to proxy");
public static def void setDelegate(Object proxy, Object delegate) {
val field = proxy.class.getField(DELEGATE_FIELD)
if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy");
public static def void setDelegate(Object proxy, Object delegate) {
val field = proxy.class.getField(DELEGATE_FIELD)
if (field == null) throw new UnsupportedOperationException("Unable to set delegate to proxy");
field.set(proxy, delegate)
} else
throw new IllegalArgumentException("delegate class is not assignable to proxy");
field.set(proxy, delegate)
} else
throw new IllegalArgumentException("delegate class is not assignable to proxy");