in core/src/main/java/flex/messaging/endpoints/AbstractEndpoint.java [200:293]
public void initialize(String id, ConfigMap properties) {
super.initialize(id, properties);
if (properties == null || properties.size() == 0)
return;
// Client-targeted <client-load-balancing>
initializeClientLoadBalancing(id, properties);
// Client-targeted <connect-timeout-seconds/>
connectTimeoutSeconds = properties.getPropertyAsInt(CONNECT_TIMEOUT_SECONDS_ELEMENT, 0);
// Client-targeted <request-timeout-seconds/>
requestTimeoutSeconds = properties.getPropertyAsInt(REQUEST_TIMEOUT_SECONDS_ELEMENT, 0);
// Check for a custom FlexClient outbound queue processor.
ConfigMap outboundQueueConfig = properties.getPropertyAsMap(FLEX_CLIENT_OUTBOUND_QUEUE_PROCESSOR, null);
if (outboundQueueConfig != null) {
// Get nested props for the processor.
flexClientOutboundQueueProcessorConfig = outboundQueueConfig.getPropertyAsMap(PROPERTIES_ELEMENT, null);
String pClassName = outboundQueueConfig.getPropertyAsString(CLASS_ATTR, null);
if (pClassName != null) {
try {
flexClientOutboundQueueProcessClass = createClass(pClassName);
// And now create an instance and initialize to make sure the properties are valid.
setFlexClientOutboundQueueProcessorConfig(flexClientOutboundQueueProcessorConfig);
} catch (Throwable t) {
if (Log.isWarn())
log.warn("Cannot register custom FlexClient outbound queue processor class {0}", new Object[]{pClassName}, t);
}
}
}
ConfigMap serialization = properties.getPropertyAsMap(SERIALIZATION, null);
if (serialization != null) {
// Custom deserializers
List<?> deserializers = serialization.getPropertyAsList(CUSTOM_DESERIALIZER, null);
if (deserializers != null && Log.isWarn())
log.warn("Endpoint <custom-deserializer> functionality is no longer available. Please remove this entry from your configuration.");
// Custom serializers
List<?> serializers = serialization.getPropertyAsList(CUSTOM_SERIALIZER, null);
if (serializers != null && Log.isWarn())
log.warn("Endpoint <custom-serializer> functionality is no longer available. Please remove this entry from your configuration.");
// Type Marshaller implementation
String typeMarshallerClassName = serialization.getPropertyAsString(TYPE_MARSHALLER, null);
if (typeMarshallerClassName != null && typeMarshallerClassName.length() > 0) {
try {
Class<?> tmc = createClass(typeMarshallerClassName);
typeMarshaller = (TypeMarshaller) ClassUtil.createDefaultInstance(tmc, TypeMarshaller.class);
} catch (Throwable t) {
if (Log.isWarn())
log.warn("Cannot register custom type marshaller for type {0}", new Object[]{typeMarshallerClassName}, t);
}
}
// Boolean Serialization Flags
serializationContext.createASObjectForMissingType = serialization.getPropertyAsBoolean(CREATE_ASOBJECT_FOR_MISSING_TYPE, false);
serializationContext.enableSmallMessages = serialization.getPropertyAsBoolean(ENABLE_SMALL_MESSAGES, true);
serializationContext.instantiateTypes = serialization.getPropertyAsBoolean(INSTANTIATE_TYPES, true);
serializationContext.supportRemoteClass = serialization.getPropertyAsBoolean(SUPPORT_REMOTE_CLASS, false);
serializationContext.legacyCollection = serialization.getPropertyAsBoolean(LEGACY_COLLECTION, false);
serializationContext.legacyDictionary = serialization.getPropertyAsBoolean(LEGACY_DICTIONARY, false);
serializationContext.legacyMap = serialization.getPropertyAsBoolean(LEGACY_MAP, false);
serializationContext.legacyXMLDocument = serialization.getPropertyAsBoolean(LEGACY_XML, false);
serializationContext.legacyXMLNamespaces = serialization.getPropertyAsBoolean(LEGACY_XML_NAMESPACES, false);
serializationContext.legacyThrowable = serialization.getPropertyAsBoolean(LEGACY_THROWABLE, false);
serializationContext.legacyBigNumbers = serialization.getPropertyAsBoolean(LEGACY_BIG_NUMBERS, false);
serializationContext.legacyExternalizable = serialization.getPropertyAsBoolean(LEGACY_EXTERNALIZABLE, false);
serializationContext.allowXml = serialization.getPropertyAsBoolean(ALLOW_XML, false);
serializationContext.allowXmlDoctypeDeclaration = serialization.getPropertyAsBoolean(ALLOW_XML_DOCTYPE_DECLARATION, false);
serializationContext.allowXmlExternalEntityExpansion = serialization.getPropertyAsBoolean(ALLOW_XML_EXTERNAL_ENTITY_EXPANSION, false);
serializationContext.maxObjectNestLevel = (int) serialization.getPropertyAsLong(MAX_OBJECT_NEST_LEVEL, 512);
serializationContext.maxCollectionNestLevel = (int) serialization.getPropertyAsLong(MAX_COLLECTION_NEST_LEVEL, 15);
serializationContext.preferVectors = serialization.getPropertyAsBoolean(PREFER_VECTORS, false);
boolean showStacktraces = serialization.getPropertyAsBoolean(SHOW_STACKTRACES, false);
if (showStacktraces && Log.isWarn())
log.warn("The " + SHOW_STACKTRACES + " configuration option is deprecated and non-functional. Please remove this from your configuration file.");
serializationContext.restoreReferences = serialization.getPropertyAsBoolean(RESTORE_REFERENCES, false);
serializationContext.logPropertyErrors = serialization.getPropertyAsBoolean(LOG_PROPERTY_ERRORS, false);
serializationContext.ignorePropertyErrors = serialization.getPropertyAsBoolean(IGNORE_PROPERTY_ERRORS, true);
serializationContext.includeReadOnly = serialization.getPropertyAsBoolean(INCLUDE_READ_ONLY, false);
}
recordMessageSizes = properties.getPropertyAsBoolean(ConfigurationConstants.RECORD_MESSAGE_SIZES_ELEMENT, false);
if (recordMessageSizes && Log.isWarn())
log.warn("Setting <record-message-sizes> to true affects application performance and should only be used for debugging");
recordMessageTimes = properties.getPropertyAsBoolean(ConfigurationConstants.RECORD_MESSAGE_TIMES_ELEMENT, false);
}