Esempio n. 1
0
        internal static bool IsInitialized()
        {
            DomainSpecificRemotingData remotingData = Thread.GetDomain().RemotingData;
            LeaseManager leaseManager = remotingData.LeaseManager;

            return(leaseManager != null);
        }
Esempio n. 2
0
        internal static LeaseManager GetLeaseManager()
        {
            DomainSpecificRemotingData remotingData = Thread.GetDomain().RemotingData;
            LeaseManager leaseManager = remotingData.LeaseManager;

            BCLDebug.Assert(leaseManager != null, "[LeaseManager.GetLeaseManager()]leaseManager !=null");
            return(leaseManager);
        }
        internal static ILease GetLease(MarshalByRefObject obj)

        {
            ILease       lease        = null;
            LeaseManager leaseManager = LeaseManager.GetLeaseManager(LeaseManagerPollTime);

            lease = (ILease)leaseManager.GetLease(obj);
            return(lease);
        }
 internal Lease(TimeSpan initialLeaseTime, TimeSpan renewOnCallTime, TimeSpan sponsorshipTimeout, MarshalByRefObject managedObject)
 {
     this.renewOnCallTime    = renewOnCallTime;
     this.sponsorshipTimeout = sponsorshipTimeout;
     this.initialLeaseTime   = initialLeaseTime;
     this.managedObject      = managedObject;
     this.leaseManager       = LeaseManager.GetLeaseManager();
     this.sponsorTable       = new Hashtable(10);
     this.state = LeaseState.Initial;
 }
 internal Lease(TimeSpan initialLeaseTime, TimeSpan renewOnCallTime, TimeSpan sponsorshipTimeout, MarshalByRefObject managedObject)
 {
     this.renewOnCallTime = renewOnCallTime;
     this.sponsorshipTimeout = sponsorshipTimeout;
     this.initialLeaseTime = initialLeaseTime;
     this.managedObject = managedObject;
     this.leaseManager = LeaseManager.GetLeaseManager();
     this.sponsorTable = new Hashtable(10);
     this.state = LeaseState.Initial;
 }
        internal static ILease GetLeaseInitial(MarshalByRefObject obj)
        {
            LeaseManager leaseManager = LeaseManager.GetLeaseManager(LifetimeServices.LeaseManagerPollTime);
            ILease       lease        = leaseManager.GetLease(obj);

            if (lease == null)
            {
                lease = LifetimeServices.CreateLease(obj);
            }
            return(lease);
        }
        internal static ILease CreateLease(TimeSpan leaseTime,
                                           TimeSpan renewOnCallTime,
                                           TimeSpan sponsorshipTimeout,
                                           MarshalByRefObject obj
                                           )

        {
            // Will create leaseManager if not already created.
            LeaseManager.GetLeaseManager(LeaseManagerPollTime);
            return((ILease)(new Lease(leaseTime, renewOnCallTime, sponsorshipTimeout, obj)));
        }
        internal static ILease GetLeaseInitial(MarshalByRefObject obj)
        {
            ILease lease = null;

            lease = LeaseManager.GetLeaseManager(LeaseManagerPollTime).GetLease(obj);
            if (lease == null)
            {
                lease = CreateLease(obj);
            }
            return(lease);
        }
Esempio n. 9
0
        internal static LeaseManager GetLeaseManager(TimeSpan pollTime)
        {
            DomainSpecificRemotingData remotingData = Thread.GetDomain().RemotingData;
            LeaseManager leaseManager = remotingData.LeaseManager;
            if (leaseManager == null)
            {
                leaseManager = new LeaseManager(pollTime);
                remotingData.LeaseManager = leaseManager;
            }

            return leaseManager;
        }
Esempio n. 10
0
        internal static LeaseManager GetLeaseManager(TimeSpan pollTime)
        {
            DomainSpecificRemotingData remotingData = Thread.GetDomain().RemotingData;
            LeaseManager leaseManager = remotingData.LeaseManager;

            if (leaseManager == null)
            {
                leaseManager = new LeaseManager(pollTime);
                remotingData.LeaseManager = leaseManager;
            }

            return(leaseManager);
        }
Esempio n. 11
0
        internal Lease(TimeSpan initialLeaseTime,
                       TimeSpan renewOnCallTime,
                       TimeSpan sponsorshipTimeout,
                       MarshalByRefObject managedObject
                       )
        {
            id = nextId++;
            BCLDebug.Trace("REMOTE", "Lease Constructor ", managedObject, " initialLeaseTime " + initialLeaseTime + " renewOnCall " + renewOnCallTime + " sponsorshipTimeout ", sponsorshipTimeout);

            // Set Policy
            this.renewOnCallTime    = renewOnCallTime;
            this.sponsorshipTimeout = sponsorshipTimeout;
            this.initialLeaseTime   = initialLeaseTime;
            this.managedObject      = managedObject;

            //Add lease to leaseManager
            leaseManager = LeaseManager.GetLeaseManager();

            // Initialize tables
            sponsorTable = new Hashtable(10);
            state        = LeaseState.Initial;
        }
Esempio n. 12
0
        internal Lease(TimeSpan initialLeaseTime,
                       TimeSpan renewOnCallTime,                       
                       TimeSpan sponsorshipTimeout,
                       MarshalByRefObject managedObject
                      )
        {
            id = nextId++;
            BCLDebug.Trace("REMOTE", "Lease Constructor ",managedObject," initialLeaseTime "+initialLeaseTime+" renewOnCall "+renewOnCallTime+" sponsorshipTimeout ",sponsorshipTimeout);

            // Set Policy            
            this.renewOnCallTime = renewOnCallTime;
            this.sponsorshipTimeout = sponsorshipTimeout;
            this.initialLeaseTime = initialLeaseTime;
            this.managedObject = managedObject;

            //Add lease to leaseManager
            leaseManager = LeaseManager.GetLeaseManager();

            // Initialize tables
            sponsorTable = new Hashtable(10);
            state = LeaseState.Initial;
        }
 internal static ILease CreateLease(TimeSpan leaseTime, TimeSpan renewOnCallTime, TimeSpan sponsorshipTimeout, MarshalByRefObject obj)
 {
     LeaseManager.GetLeaseManager(LifetimeServices.LeaseManagerPollTime);
     return(new Lease(leaseTime, renewOnCallTime, sponsorshipTimeout, obj));
 }
        internal static ILease GetLease(MarshalByRefObject obj)
        {
            LeaseManager leaseManager = LeaseManager.GetLeaseManager(LifetimeServices.LeaseManagerPollTime);

            return(leaseManager.GetLease(obj));
        }
Esempio n. 15
0
 internal static ILease GetLeaseInitial(MarshalByRefObject obj)
 {
     return(LeaseManager.GetLeaseManager(LifetimeServices.LeaseManagerPollTime).GetLease(obj) ?? LifetimeServices.CreateLease(obj));
 }
 internal static ILease GetLease(MarshalByRefObject obj)
 {
     return(LeaseManager.GetLeaseManager(LeaseManagerPollTime).GetLease(obj));
 }