Beispiel #1
0
        public Type GetInteractionBeanType(MessageTypeKey key)
        {
            Type value;

            registry.TryGetValue(key, out value);

            return(value);
        }
Beispiel #2
0
        private void RegisterClass(Type type, String[] versions)
        {
            string domainType = type.Name;

            foreach (var version in versions)
            {
                var key = new MessageTypeKey(version, domainType);
                //Workaround for the fact that we do not have a separate DLL for test classes
                if (!codeTypeRegistry.ContainsKey(key))
                {
                    codeTypeRegistry.Add(key, type);
                }
            }
        }
Beispiel #3
0
        public Type GetMessagePartClass(VersionNumber version, String type)
        {
            MessageTypeKey key = new MessageTypeKey(version, type);

            var result = GetMessagePartType(key);

            if (result == null && type.Contains("."))
            {
                String unqualifiedTypeName = StringUtils.SubstringAfter(type, ".");
                key    = new MessageTypeKey(version, unqualifiedTypeName);
                result = GetMessagePartType(key);

                if (result == null && unqualifiedTypeName.Contains("_"))
                {
                    String typeWithoutVersionCode = StringUtils.SubstringBefore(type, ".")
                                                    + "." + StringUtils.SubstringBefore(unqualifiedTypeName, "_");
                    result = GetMessagePartClass(version, typeWithoutVersionCode);
                }
            }
            return(result);
        }
Beispiel #4
0
        private void RegisterClass(Type type, String[] versions)
        {
            var mapping = GetClassAttributes(type, typeof(Hl7PartTypeMappingAttribute));

            foreach (var partId in mapping.Value)
            {
                foreach (var version in versions)
                {
                    var key = new MessageTypeKey(version, partId);

                    if (partTypeRegistry.ContainsKey(key))
                    {
                        continue; // or shall will let it fail ?
                    }

                    partTypeRegistry.Add(key, type);

                    if (typeof(IInteraction).IsAssignableFrom(type))
                    {
                        registry.Add(key, type);
                    }
                }
            }
        }
Beispiel #5
0
 private Type GetMessagePartType(MessageTypeKey key)
 {
     return(partTypeRegistry.ContainsKey(key) ? partTypeRegistry[key] : null);
 }
Beispiel #6
0
        public virtual Interaction GetInteraction(IInteraction tealBean)
        {
            MessageTypeKey type = MessageBeanRegistry.GetInstance().GetMessageTypeKey(this.version, tealBean);

            return(this.service.GetInteraction(this.version, type.GetMessageId()));
        }
Beispiel #7
0
        public Type GetCodeType(string domainType, string version)
        {
            var key = new MessageTypeKey(version, domainType);

            return(codeTypeRegistry.ContainsKey(key) ? codeTypeRegistry[key] : null);
        }