コード例 #1
0
ファイル: ActivationData.cs プロジェクト: supwar/orleans
        public ActivationData(ActivationAddress addr, string genericArguments, PlacementStrategy placedUsing, IActivationCollector collector, TimeSpan ageLimit)
        {
            if (null == addr)
            {
                throw new ArgumentNullException("addr");
            }
            if (null == placedUsing)
            {
                throw new ArgumentNullException("placedUsing");
            }
            if (null == collector)
            {
                throw new ArgumentNullException("collector");
            }

            logger = TraceLogger.GetLogger("ActivationData", TraceLogger.LoggerType.Runtime);
            ResetKeepAliveRequest();
            Address     = addr;
            State       = ActivationState.Create;
            PlacedUsing = placedUsing;

            if (!Grain.IsSystemTarget && !Constants.IsSystemGrain(Grain))
            {
                this.collector = collector;
            }
            CollectionAgeLimit = ageLimit;

            GrainReference = GrainReference.FromGrainId(addr.Grain, genericArguments,
                                                        Grain.IsSystemTarget ? addr.Silo : null);
        }
コード例 #2
0
ファイル: ActivationData.cs プロジェクト: nirvana2/orleans
        public ActivationData(
            ActivationAddress addr,
            string genericArguments,
            PlacementStrategy placedUsing,
            IMultiClusterRegistrationStrategy registrationStrategy,
            IActivationCollector collector,
            TimeSpan ageLimit,
            IOptions <SiloMessagingOptions> messagingOptions,
            TimeSpan maxWarningRequestProcessingTime,
            TimeSpan maxRequestProcessingTime,
            IRuntimeClient runtimeClient,
            ILoggerFactory loggerFactory)
        {
            if (null == addr)
            {
                throw new ArgumentNullException(nameof(addr));
            }
            if (null == placedUsing)
            {
                throw new ArgumentNullException(nameof(placedUsing));
            }
            if (null == collector)
            {
                throw new ArgumentNullException(nameof(collector));
            }

            logger         = loggerFactory.CreateLogger <ActivationData>();
            this.lifecycle = new GrainLifecycle(loggerFactory.CreateLogger <LifecycleSubject>());
            this.maxRequestProcessingTime        = maxRequestProcessingTime;
            this.maxWarningRequestProcessingTime = maxWarningRequestProcessingTime;
            this.messagingOptions = messagingOptions.Value;
            ResetKeepAliveRequest();
            Address              = addr;
            State                = ActivationState.Create;
            PlacedUsing          = placedUsing;
            RegistrationStrategy = registrationStrategy;
            if (!Grain.IsSystemTarget)
            {
                this.collector = collector;
            }

            CollectionAgeLimit = ageLimit;

            GrainReference         = GrainReference.FromGrainId(addr.Grain, runtimeClient.GrainReferenceRuntime, genericArguments, Grain.IsSystemTarget ? addr.Silo : null);
            this.SchedulingContext = new SchedulingContext(this);
        }
コード例 #3
0
ファイル: ActivationData.cs プロジェクト: vansha/orleans
        public ActivationData(
            ActivationAddress addr,
            string genericArguments,
            PlacementStrategy placedUsing,
            IMultiClusterRegistrationStrategy registrationStrategy,
            IActivationCollector collector,
            TimeSpan ageLimit,
            NodeConfiguration nodeConfiguration,
            TimeSpan maxWarningRequestProcessingTime,
            TimeSpan maxRequestProcessingTime,
            IRuntimeClient runtimeClient)
        {
            if (null == addr)
            {
                throw new ArgumentNullException(nameof(addr));
            }
            if (null == placedUsing)
            {
                throw new ArgumentNullException(nameof(placedUsing));
            }
            if (null == collector)
            {
                throw new ArgumentNullException(nameof(collector));
            }

            logger         = LogManager.GetLogger("ActivationData", LoggerType.Runtime);
            this.lifecycle = new GrainLifecycle(logger);
            this.maxRequestProcessingTime        = maxRequestProcessingTime;
            this.maxWarningRequestProcessingTime = maxWarningRequestProcessingTime;
            this.nodeConfiguration = nodeConfiguration;
            ResetKeepAliveRequest();
            Address              = addr;
            State                = ActivationState.Create;
            PlacedUsing          = placedUsing;
            RegistrationStrategy = registrationStrategy;
            if (!Grain.IsSystemTarget && !Constants.IsSystemGrain(Grain))
            {
                this.collector = collector;
            }
            CollectionAgeLimit = ageLimit;

            GrainReference         = GrainReference.FromGrainId(addr.Grain, runtimeClient.GrainReferenceRuntime, genericArguments, Grain.IsSystemTarget ? addr.Silo : null);
            this.SchedulingContext = new SchedulingContext(this);
        }
コード例 #4
0
        public ActivationData(
            ActivationAddress addr,
            string genericArguments,
            PlacementStrategy placedUsing,
            MultiClusterRegistrationStrategy registrationStrategy,
            IActivationCollector collector,
            TimeSpan ageLimit,
            NodeConfiguration nodeConfiguration,
            TimeSpan maxRequestProcessingTime)
        {
            if (null == addr)
            {
                throw new ArgumentNullException("addr");
            }
            if (null == placedUsing)
            {
                throw new ArgumentNullException("placedUsing");
            }
            if (null == collector)
            {
                throw new ArgumentNullException("collector");
            }

            logger = LogManager.GetLogger("ActivationData", LoggerType.Runtime);
            this.maxRequestProcessingTime = maxRequestProcessingTime;
            this.nodeConfiguration        = nodeConfiguration;
            ResetKeepAliveRequest();
            Address              = addr;
            State                = ActivationState.Create;
            PlacedUsing          = placedUsing;
            RegistrationStrategy = registrationStrategy;
            if (!Grain.IsSystemTarget && !Constants.IsSystemGrain(Grain))
            {
                this.collector = collector;
            }
            CollectionAgeLimit = ageLimit;


            GrainReference = GrainReference.FromGrainId(addr.Grain, genericArguments, Grain.IsSystemTarget ? addr.Silo : null);
        }
コード例 #5
0
 public GrainReference GetGrainReference() => GrainReference.FromGrainId(((ISystemTargetBase)this).GrainId, ((ISystemTargetBase)this).GrainReferenceRuntime, null, this.Silo);
コード例 #6
0
 public GrainReference MakeGrainServiceGrainReference(int typeData, string systemGrainId, SiloAddress siloAddress)
 => GrainReference.FromGrainId(GrainId.GetGrainServiceGrainId(typeData, systemGrainId), this.runtimeClient.GrainReferenceRuntime, systemTargetSilo: siloAddress);
コード例 #7
0
 private GrainReference MakeGrainReference(GrainId grainId, SiloAddress siloAddress)
 => GrainReference.FromGrainId(grainId, this.runtimeClient.GrainReferenceRuntime, systemTargetSilo: siloAddress);