public Channel(String id, String className, EndPoint endPoint, XMap properties) { this.id = id; this.className = className; this.endPoint = endPoint; this.properties = properties; this.legacyCollection = Boolean.TRUE.toString().equals(properties.get(LEGACY_COLLECTION)); this.legacyXml = Boolean.TRUE.toString().equals(properties.get(LEGACY_XML)); }
public static Channel forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap endPointElt = element.getOne("endpoint"); if (endPointElt == null) throw new RuntimeException("Excepting a 'endpoint' element in 'channel-definition': " + id); EndPoint endPoint = EndPoint.forElement(endPointElt); XMap properties = new XMap(element.getOne("properties")); return new Channel(id, className, endPoint, properties); } }
public void configure(XMap properties) { if (properties != null) { String dynamicclass = properties.get("dynamic-class"); if (Boolean.TRUE.toString().equalsIgnoreCase(dynamicclass)) dynamicClass = true; } }
public static Channel forElement(XMap element) { String id = element.get("@id"); String className = element.get("@class"); XMap endPointElt = element.getOne("endpoint"); if (endPointElt == null) throw new RuntimeException("Excepting a 'endpoint' element in 'channel-definition': " + id); EndPoint endPoint = EndPoint.forElement(endPointElt); XMap properties = new XMap(element.getOne("properties")); return new Channel(id, className, endPoint, properties); } }
public void configure(XMap properties) { if (properties != null) { String dynamicclass = properties.get("dynamic-class"); if (Boolean.TRUE.toString().equalsIgnoreCase(dynamicclass)) dynamicClass = true; } }
private void loadCustomMethodMatcher(XMap element, boolean custom) { XMap methodMatcher = element.getOne("method-matcher"); if (methodMatcher != null) { String type = methodMatcher.get("@type"); try { this.methodMatcher = (MethodMatcher)TypeUtil.newInstance(type); } catch (Exception e) { throw new GraniteConfigException("Could not construct method matcher: " + type, e); } } }
@Override public void configure(XMap adapterProperties, XMap destinationProperties) throws ServiceException { _topicIdCache = new ConcurrentHashMap<String, GAETopicId>(); if (Boolean.TRUE.toString().equals(destinationProperties.get("no-local"))) noLocal = true; }
private void loadCustomClassGetter(XMap element, boolean custom) { XMap classGetter = element.getOne("class-getter"); if (classGetter != null) { String type = classGetter.get("@type"); try { this.classGetter = (ClassGetter)TypeUtil.newInstance(type); classGetterSet = true; } catch (Exception e) { throw new GraniteConfigException("Could not instantiate ClassGetter: " + type, e); } } }
@Override public void configure(XMap adapterProperties, XMap destinationProperties) throws ServiceException { super.configure(adapterProperties, destinationProperties); _topicIdCache = new ConcurrentHashMap<String, TopicId>(); if (Boolean.TRUE.toString().equals(destinationProperties.get("no-local"))) noLocal = true; }
private void loadCustomClassGetter(XMap element, boolean custom) { XMap classGetter = element.getOne("class-getter"); if (classGetter != null) { String type = classGetter.get("@type"); try { this.classGetter = (ClassGetter)TypeUtil.newInstance(type); classGetterSet = true; } catch (Exception e) { throw new GraniteConfigException("Could not instantiate ClassGetter: " + type, e); } } }
@Override public String toString() { return "Destination{" + "id='" + id + '\'' + ", service='" + service.getId() + '\'' + ", factory='" + factory.getId() + '\'' + ", scope='" + properties.get("scope") + '\'' + '}'; } }
private void loadCustomClassGetter(XMap element, boolean custom) { XMap classGetter = element.getOne("class-getter"); if (classGetter != null) { String type = classGetter.get("@type"); try { this.classGetter = (ClassGetter)TypeUtil.newInstance(type); classGetterSet = true; } catch (Exception e) { throw new GraniteConfigException("Could not instantiate ClassGetter: " + type, e); } } }
public void configure(XMap adapterProperties, XMap destinationProperties) throws ServiceException { String securityPolicy = adapterProperties.get("security-policy"); if (securityPolicy != null) { try { this.securityPolicy = TypeUtil.newInstance(securityPolicy, SecurityPolicy.class); } catch (Exception e) { log.error(e, "Could not create instance of %s (using default security policy)", securityPolicy); } } }
private void loadCustomInvocationListener(XMap element, boolean custom) { XMap invocationListener = element.getOne("invocation-listener"); if (invocationListener != null) { String type = invocationListener.get("@type"); try { this.invocationListener = (ServiceInvocationListener)TypeUtil.newInstance(type); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate ServiceInvocationListener: " + type, e); } } }
private void loadCustomAMF3MessageInterceptor(XMap element, boolean custom) { XMap interceptor = element.getOne("amf3-message-interceptor"); if (interceptor != null) { String type = interceptor.get("@type"); try { amf3MessageInterceptor = (AMF3MessageInterceptor)TypeUtil.newInstance(type); } catch (Exception e) { throw new GraniteConfigException("Could not construct amf3 message interceptor: " + type, e); } } }
private void loadCustomInvocationListener(XMap element, boolean custom) { XMap invocationListener = element.getOne("invocation-listener"); if (invocationListener != null) { String type = invocationListener.get("@type"); try { this.invocationListener = (ServiceInvocationListener)TypeUtil.newInstance(type); } catch (Exception e) { throw new GraniteConfigException("Could not instantiate ServiceInvocationListener: " + type, e); } } }