Ejemplo n.º 1
0
        internal static ORBConfig GetInitializedConfig()
        {
            ORBConfig      config         = null;
            AutoResetEvent autoResetEvent = new AutoResetEvent(false);

            ThreadPool.QueueUserWorkItem(state =>
            {
                config = GetInstance();
                autoResetEvent.Set();
            });
            WaitHandle.WaitAll(new WaitHandle[] { autoResetEvent });
            return(config);
        }
Ejemplo n.º 2
0
        public static ORBConfig GetInstance()
        {
            if (instance == null)
            {
                lock ( _lock )
                {
                    if (instance == null)
                    {
                        instance = new ORBConfig();
                    }
                }
            }

            if (instance.GetConfigInstanceListener != null)
            {
                instance.GetConfigInstanceListener(instance);
            }

            return(instance);
        }
Ejemplo n.º 3
0
        private ORBConfig()
        {
            instance = this;
#if ( FULL_BUILD)
            Initialize(null);
#endif
#if (PURE_CLIENT_LIB || WINDOWS_PHONE8)
            getTypeMapper()._AddClientClassMapping("flex.messaging.messages.AsyncMessage", typeof(Weborb.V3Types.AsyncMessage));
            getTypeMapper()._AddClientClassMapping("flex.messaging.messages.CommandMessage", typeof(Weborb.V3Types.CommandMessage));
            getTypeMapper()._AddClientClassMapping("flex.messaging.messages.RemotingMessage", typeof(Weborb.V3Types.ReqMessage));
            getTypeMapper()._AddClientClassMapping("flex.messaging.messages.AcknowledgeMessage", typeof(Weborb.V3Types.AckMessage));
            getTypeMapper()._AddClientClassMapping("flex.messaging.messages.ErrorMessage", typeof(Weborb.V3Types.ErrMessage));
            getTypeMapper()._AddClientClassMapping("flex.messaging.io.ObjectProxy", typeof(Weborb.Util.ObjectProxy));
            getTypeMapper()._AddClientClassMapping("weborb.v3types.V3Message", typeof(Weborb.V3Types.V3Message));

            IArgumentObjectFactory factory = (IArgumentObjectFactory)getObjectFactories()._CreateServiceObject("Weborb.V3Types.BodyHolderFactory");
            getObjectFactories().AddArgumentObjectFactory("Weborb.V3Types.BodyHolder", factory);

            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.Generic.IList <>), typeof(System.Collections.Generic.List <>));

            ITypeWriter writerObject = (ITypeWriter)getObjectFactories()._CreateServiceObject("Weborb.V3Types.BodyHolderWriter");
            Type        mappedType   = typeof(Weborb.V3Types.BodyHolder);
            MessageWriter.AddAdditionalTypeWriter(mappedType, writerObject);
#endif

#if ( PURE_CLIENT_LIB )
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.ICollection), typeof(System.Collections.ArrayList));
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.IList), typeof(System.Collections.ArrayList));
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.IDictionary), typeof(System.Collections.Hashtable));
#endif

#if ( WINDOWS_PHONE8 )
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.ICollection), typeof(System.Collections.Generic.List <>));
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.IList), typeof(System.Collections.Generic.List <>));
            getTypeMapper()._AddAbstractTypeMapping(typeof(System.Collections.IDictionary), typeof(System.Collections.Generic.Dictionary <,>));
#endif
        }