protected void setProcessDefinitionProperty(T entity, ProcessDefinition processDefinition) throws Exception { IntrospectionSupport.setProperty(entity, "processDefinition", processDefinition); }
private void peekMessage(Message mail) { // this only applies to IMAP messages which has a setPeek method if (mail.getClass().getSimpleName().startsWith("IMAP")) { try { LOG.trace("Calling setPeek(true) on mail message {}", mail); IntrospectionSupport.setProperty(mail, "peek", true); } catch (Throwable e) { // ignore LOG.trace("Error setting peak property to true on: " + mail + ". This exception is ignored.", e); } } }
/** * Sets the key property on the new entity */ protected void setKeyProperty(T entity, Object key) throws Exception { IntrospectionSupport.setProperty(entity, getKeyPropertyName(), key); }
public static void setProperties(final CamelContext context, final Object target, final Map<String, Object> properties) { final Iterator<Map.Entry<String, Object>> iterator = properties.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, Object> entry = iterator.next(); final String key = entry.getKey(); Object val = entry.getValue(); try { if (val instanceof String) { val = context.resolvePropertyPlaceholders((String) val); } // Bind properties to the customizer if (IntrospectionSupport.setProperty(context, target, key, val)) { // Remove property if bound to the customizer. iterator.remove(); } } catch (final Exception e) { throw new IllegalStateException("Unable to set property `" + key + "` = `" + val + "`", e); } } }
if (IntrospectionSupport.setProperty(context, component, key, val)) { options.remove(key);
public static ManagedGroupFactory create(CuratorFramework curator, ClassLoader loader, ClassResolver resolver, Callable<CuratorFramework> factory) throws Exception { if (curator != null) { return new StaticManagedGroupFactory(curator, false); } try { Class<?> clazz = resolver.resolveClass("org.apache.camel.component.zookeepermaster.group.internal.osgi.OsgiManagedGroupFactory"); if (clazz != null) { Object instance = clazz.newInstance(); IntrospectionSupport.setProperty(instance, "classLoader", loader); return (ManagedGroupFactory) instance; } } catch (Throwable e) { // Ignore if we'e not in OSGi } return new StaticManagedGroupFactory(factory.call(), true); }
@Override protected Object doInvokeMethod(ApiMethod method, Map<String, Object> properties) throws RuntimeCamelException { AbstractGoogleClientRequest request = (AbstractGoogleClientRequest) super.doInvokeMethod(method, properties); try { TypeConverter typeConverter = getEndpoint().getCamelContext().getTypeConverter(); for (Entry<String, Object> p : properties.entrySet()) { IntrospectionSupport.setProperty(typeConverter, request, p.getKey(), p.getValue()); } return request.execute(); } catch (Exception e) { throw new RuntimeCamelException(e); } }
@Override protected Object doInvokeMethod(Map<String, Object> properties) throws RuntimeCamelException { AbstractGoogleClientRequest request = (AbstractGoogleClientRequest) super.doInvokeMethod(properties); try { TypeConverter typeConverter = getEndpoint().getCamelContext().getTypeConverter(); for (Entry<String, Object> p : properties.entrySet()) { IntrospectionSupport.setProperty(typeConverter, request, p.getKey(), p.getValue()); } return request.execute(); } catch (Exception e) { throw new RuntimeCamelException(e); } }
@Override protected Object doInvokeMethod(Map<String, Object> properties) throws RuntimeCamelException { AbstractGoogleClientRequest<?> request = (AbstractGoogleClientRequest) super.doInvokeMethod(properties); try { TypeConverter typeConverter = getEndpoint().getCamelContext().getTypeConverter(); for (Entry<String, Object> p : properties.entrySet()) { IntrospectionSupport.setProperty(typeConverter, request, p.getKey(), p.getValue()); } return request.execute(); } catch (Exception e) { throw new RuntimeCamelException(e); } } }
@Override protected Object doInvokeMethod(ApiMethod method, Map<String, Object> properties) throws RuntimeCamelException { AbstractGoogleClientRequest<?> request = (AbstractGoogleClientRequest)super.doInvokeMethod(method, properties); try { TypeConverter typeConverter = getEndpoint().getCamelContext().getTypeConverter(); for (Entry<String, Object> p : properties.entrySet()) { IntrospectionSupport.setProperty(typeConverter, request, p.getKey(), p.getValue()); } return request.execute(); } catch (Exception e) { throw new RuntimeCamelException(e); } }
if (stringValue != null && isReferenceParameter(stringValue)) { hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), target, name, null, stringValue, true); } else if (value != null) { hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), target, name, value); } catch (IllegalArgumentException e) { hit = IntrospectionSupport.setProperty(context, context.getTypeConverter(), target, name, null, stringValue, true);
IntrospectionSupport.setProperty(context, component, key, val);
if (IntrospectionSupport.setProperty(context, customizer, key, val)) {