protected override StateContainer Hydrating(IHydrationObject obj)
 {
     ResourceLimitingStateContainer container = obj.State.Deserialize<ResourceLimitingStateContainer>();
     container.Prototype = BundlePrototype;
     Limiter.Hydrate(container.LimiterState);
     return container;
 }
Exemple #2
0
        protected override StateContainer Hydrating(IHydrationObject obj)
        {
            InMemoryStateContainer container = obj.State.Deserialize <InMemoryStateContainer>();

            Pending = container.Pending;
            return(container);
        }
 public IRequestResult Hydrate(IHydrationObject obj) {
     if (obj.IsNotNull() && obj.State.IsNotNull()) {
         var container = obj.State.Deserialize<StateContainer>();
         Target = container.Target;
         MimeType = container.MimeType;
     }
     return RequestResult.Create();
 }
Exemple #4
0
        // TODO:

        public IRequestResult Hydrate(IHydrationObject obj)
        {
            if (obj.IsNotNull() && obj.State.IsNotNull())
            {
                Messages = obj.State.Deserialize <StateContainer>().Messages;
            }
            return(RequestResult.Create());
        }
        protected override StateContainer Hydrating(IHydrationObject obj)
        {
            ResourceLimitingStateContainer container = obj.State.Deserialize <ResourceLimitingStateContainer>();

            container.Prototype = BundlePrototype;
            Limiter.Hydrate(container.LimiterState);
            return(container);
        }
Exemple #6
0
 public override IRequestResult Hydrate(IHydrationObject memento)
 {
     if (memento.IsNotNull() && memento.State.IsNotNull())
     {
         Units = memento.State.Deserialize <List <IProcessableUnit> >();
     }
     return(RequestResult.Create());
 }
Exemple #7
0
 public IRequestResult Hydrate(IHydrationObject obj)
 {
     if (obj.IsNotNull() && obj.State.IsNotNull())
     {
         var container = obj.State.Deserialize <StateContainer>();
         Target   = container.Target;
         MimeType = container.MimeType;
     }
     return(RequestResult.Create());
 }
Exemple #8
0
 public virtual IRequestResult Hydrate(IHydrationObject obj)
 {
     if (obj.IsNotNull() && obj.State.IsNotNull())
     {
         StateContainer container = Hydrating(obj);
         BundlePrototype   = container.BundlePrototype;
         FailureHandlerSet = container.FailureHandlers.Select(def => HydrationService.Restore <IFailureHandler>(def)).ToArray();
     }
     // In case was blocked, ensure available again
     Blocked = false;
     return(RequestResult.Create());
 }
        public TType Restore <TType>(IHydrationObject obj) where TType : IHydratableDependent
        {
            TType result = default(TType);

            if (obj.ConcreteType != null)
            {
                var interim = DependencyFacilitator
                              .Delegate <IHydratableDependent>(f => {
                    var matches = f.InstantiateAll <IHydratableDependent>(obj.ServiceInterface);
                    return(matches.FirstOrDefault(o => o.GetType() == obj.ConcreteType));
                });
                Assert.True(interim.IsNotNull(), () => "Cannot instantiate hydration object: " + obj.ToString() + ", are you trying to restore a state incompatible with your services?");
                interim.Hydrate(obj);
                result = (TType)interim;
            }
            return(result);
        }
 public virtual IRequestResult Hydrate(IHydrationObject memento)
 {
     return(RequestResult.Create());
 }
Exemple #11
0
 protected abstract StateContainer Hydrating(IHydrationObject obj);
 public override IRequestResult Hydrate(IHydrationObject memento)
 {
     if (memento.IsNotNull() && memento.State.IsNotNull())
         Units = memento.State.Deserialize<List<IProcessableUnit>>();
     return RequestResult.Create();
 }
 public IRequestResult Hydrate(IHydrationObject memento)
 {
     MessagesPending = memento.IsNull() || memento.State.IsNull() ? 0 : int.Parse(memento.State);
     return RequestResult.Create();
 }
 protected override StateContainer Hydrating(IHydrationObject obj)
 {
     InMemoryStateContainer container = obj.State.Deserialize<InMemoryStateContainer>();
     Pending = container.Pending;
     return container;
 }
 public virtual IRequestResult Hydrate(IHydrationObject memento)
 {
     return RequestResult.Create();
 }
 // TODO:
 public IRequestResult Hydrate(IHydrationObject obj)
 {
     if (obj.IsNotNull() && obj.State.IsNotNull())
         Messages = obj.State.Deserialize<StateContainer>().Messages;
     return RequestResult.Create();
 }
 protected abstract StateContainer Hydrating(IHydrationObject obj);
 public virtual IRequestResult Hydrate(IHydrationObject obj) {
     if (obj.IsNotNull() && obj.State.IsNotNull()) {
         StateContainer container = Hydrating(obj);
         BundlePrototype = container.BundlePrototype;
         FailureHandlerSet = container.FailureHandlers.Select(def => HydrationService.Restore<IFailureHandler>(def)).ToArray();
     }
     // In case was blocked, ensure available again
     Blocked = false;
     return RequestResult.Create();
 }
Exemple #19
0
 public IRequestResult Hydrate(IHydrationObject memento)
 {
     MessagesPending = memento.IsNull() || memento.State.IsNull() ? 0 : int.Parse(memento.State);
     return(RequestResult.Create());
 }