Exemple #1
0
        public SpringContainer(GenericApplicationContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            _context = context;
            _componentDefinitions = new Dictionary<Type, ComponentConfig>();
            _callModels = new Dictionary<Type, ComponentCallModelEnum>();
            _factory = new DefaultObjectDefinitionFactory();
        }
Exemple #2
0
 public void Init()
 {
     ctx = new XmlApplicationContext("./conf/rpc-server.xml");
     NmsRpcInvoker rpcInvoker = ctx.GetObject("rpcInvoker") as NmsRpcInvoker;
     Preconditions.NotNull(rpcInvoker,"No rpcInvoker object defined in spring ctx.");
     object[] oo = GetAllObjectsInContext();
     log.Info("Begin Init of RpcInvoker");
     rpcInvoker.Init(oo);
     log.Info("Finished Init of RpcInvoker");
 }
 private static bool ModularApplicationContextAlreadyInitialized(AbstractApplicationContext applicationContext)
 {
     return applicationContext.GetObjectNamesForType(typeof (ModularApplicationContext)).Any();
 }
Exemple #4
0
        public void Initialize()
        {
            if (!_isInitialized)
            {
                foreach (KeyValuePair<Type, ComponentConfig> componentDefinition in _componentDefinitions)
                {
                    RegisterObjectDefinitionInContext(componentDefinition.Key, componentDefinition.Value,
                                                      _callModels[componentDefinition.Key]);
                }

                var newContext = new EasyNetQApplicationContext(_context);
                newContext.Refresh();

                _context = newContext;

                _isInitialized = true;
            }
        }