Пример #1
0
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject)scheduler, bindName);
            }
            catch (RemotingException)
            {

            }
            catch (SecurityException)
            {

            }
            catch (Exception)
            {

            }
        }
Пример #2
0
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            try
            {
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);
            }
            catch (ArgumentException)
            {
            }
            catch (SecurityException)
            {
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            try
            {
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);
                Log.Info("Successfully disconnected remotable scheduler");
            }
            catch (ArgumentException ex)
            {
                Log.Error("ArgumentException during Unbind", ex);
            }
            catch (SecurityException ex)
            {
                Log.Error("SecurityException during Unbind", ex);
            }
            catch (Exception ex)
            {
                Log.Error("Exception during Unbind", ex);
            }
        }
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject) scheduler, bindName);
                Log.Info(string.Format(CultureInfo.InvariantCulture, "Successfully marhalled remotable scheduler under name '{0}'", bindName));
            }
            catch (RemotingException ex)
            {
                Log.Error("RemotingException during Bind", ex);
            }
            catch (SecurityException ex)
            {
                Log.Error("SecurityException during Bind", ex);
            }
            catch (Exception ex)
            {
                Log.Error("Exception during Bind", ex);
            } 
        }
Пример #5
0
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject)scheduler, bindName);
                Log.Info(string.Format(CultureInfo.InvariantCulture, "Successfully marhalled remotable scheduler under name '{0}'", bindName));
            }
            catch (RemotingException ex)
            {
                Log.Error("RemotingException during Bind", ex);
            }
            catch (SecurityException ex)
            {
                Log.Error("SecurityException during Bind", ex);
            }
            catch (Exception ex)
            {
                Log.Error("Exception during Bind", ex);
            }
        }
Пример #6
0
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }
#if REMOTING
            if (!(scheduler is MarshalByRefObject))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", nameof(scheduler));
            }
#endif // REMOTING

            try
            {
#if REMOTING
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);
                Log.Info("Successfully disconnected remotable scheduler");
#else // REMOTING
                // TODO (NetCore Port): Replace with HTTP communication
#endif // REMOTING
            }
            catch (ArgumentException ex)
            {
                Log.ErrorException("ArgumentException during Unbind", ex);
            }
            catch (SecurityException ex)
            {
                Log.ErrorException("SecurityException during Unbind", ex);
            }
            catch (Exception ex)
            {
                Log.ErrorException("Exception during Unbind", ex);
            }
        }
Пример #7
0
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject)scheduler, bindName);
            }
            catch (RemotingException ex)
            {
            }
            catch (SecurityException ex)
            {
            }
            catch (Exception ex)
            {
            }
        }
        protected virtual SchedulerException InvalidateHandleCreateException(string msg, Exception cause)
        {
            rsched = null;
            SchedulerException ex = new SchedulerException(msg, cause);

            return(ex);
        }
Пример #9
0
        protected virtual SchedulerException InvalidateHandleCreateException(string msg, Exception cause)
        {
            rsched = null;
            SchedulerException ex = new SchedulerException(msg, cause);

            ex.ErrorCode = SchedulerException.ErrorCommunicationFailure;
            return(ex);
        }
Пример #10
0
        /// <summary>
        /// Get a <see cref="SchedulerMetaData"/> object describiing the settings
        /// and capabilities of the scheduler instance.
        /// <p>
        /// Note that the data returned is an 'instantaneous' snap-shot, and that as
        /// soon as it's returned, the meta data values may be different.
        /// </p>
        /// </summary>
        /// <returns></returns>
        public virtual SchedulerMetaData GetMetaData()
        {
            try
            {
                IRemotableQuartzScheduler sched = GetRemoteScheduler();

                return
                    (new SchedulerMetaData(SchedulerName, SchedulerInstanceId, GetType(), true, IsStarted, InStandbyMode,
                                           IsShutdown, sched.RunningSince, sched.NumJobsExecuted, sched.JobStoreClass,
                                           sched.SupportsPersistence, sched.ThreadPoolClass, sched.ThreadPoolSize, sched.Version));
            }
            catch (RemotingException re)
            {
                throw InvalidateHandleCreateException("Error communicating with remote scheduler.", re);
            }
        }
Пример #11
0
        protected virtual IRemotableQuartzScheduler GetRemoteScheduler()
        {
            if (rsched != null)
            {
                return(rsched);
            }

            try
            {
                rsched = proxyFactory.GetProxy();
            }
            catch (Exception e)
            {
                string             errorMessage  = $"Could not get handle to remote scheduler: {e.Message}";
                SchedulerException initException = new SchedulerException(errorMessage, e);
                throw initException;
            }

            return(rsched);
        }
        protected virtual IRemotableQuartzScheduler GetRemoteScheduler()
        {
            if (rsched != null)
            {
                return(rsched);
            }

            try
            {
                rsched = proxyFactory.GetProxy();
            }
            catch (Exception e)
            {
                string             errorMessage  = string.Format(CultureInfo.InvariantCulture, "Could not get handle to remote scheduler: {0}", e.Message);
                SchedulerException initException = new SchedulerException(errorMessage, e);
                throw initException;
            }

            return(rsched);
        }
Пример #13
0
        protected virtual IRemotableQuartzScheduler GetRemoteScheduler()
        {
            if (rsched != null)
            {
                return(rsched);
            }

            try
            {
                rsched =
                    (IRemotableQuartzScheduler)
                    Activator.GetObject(typeof(IRemotableQuartzScheduler), RemoteSchedulerAddress);
            }
            catch (Exception e)
            {
                SchedulerException initException =
                    new SchedulerException(string.Format(CultureInfo.InvariantCulture, "Could not get handle to remote scheduler: {0}", e.Message), e);
                throw initException;
            }

            return(rsched);
        }
Пример #14
0
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException(nameof(scheduler));
            }

#if REMOTING
            if (!(scheduler is MarshalByRefObject))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", nameof(scheduler));
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject)scheduler, BindName);
                Log.Info($"Successfully marshalled remotable scheduler under name '{BindName}'");
            }
            catch (RemotingException ex)
            {
                Log.ErrorException("RemotingException during Bind", ex);
            }
            catch (SecurityException ex)
            {
                Log.ErrorException("SecurityException during Bind", ex);
            }
            catch (Exception ex)
            {
                Log.ErrorException("Exception during Bind", ex);
            }
#else // REMOTING
            // TODO (NetCore Port): Replace with HTTP communication
#endif // REMOTING
        }
        public virtual void Bind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }

#if REMOTING
            if (!(scheduler is MarshalByRefObject))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            RegisterRemotingChannelIfNeeded();

            try
            {
                RemotingServices.Marshal((MarshalByRefObject)scheduler, BindName);
                Log.Info($"Successfully marshalled remotable scheduler under name '{BindName}'");
            }
            catch (RemotingException ex)
            {
                Log.ErrorException("RemotingException during Bind", ex);
            }
            catch (SecurityException ex)
            {
                Log.ErrorException("SecurityException during Bind", ex);
            }
            catch (Exception ex)
            {
                Log.ErrorException("Exception during Bind", ex);
            }
#else // REMOTING
            // TODO (NetCore Port): Replace with HTTP communication
#endif // REMOTING
        }
Пример #16
0
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            try
            {
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);

            }
            catch (ArgumentException)
            {

            }
            catch (SecurityException)
            {

            }
            catch (Exception)
            {

            }
        }
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
#if REMOTING
            if (!(scheduler is MarshalByRefObject))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }
#endif // REMOTING

            try
            {
#if REMOTING
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);
                Log.Info("Successfully disconnected remotable scheduler");
#else // REMOTING
                // TODO (NetCore Port): Replace with HTTP communication
#endif // REMOTING
            }
            catch (ArgumentException ex)
            {
                Log.ErrorException("ArgumentException during Unbind", ex);
            }
            catch (SecurityException ex)
            {
                Log.ErrorException("SecurityException during Unbind", ex);
            }
            catch (Exception ex)
            {
                Log.ErrorException("Exception during Unbind", ex);
            }
        }
Пример #18
0
 protected virtual SchedulerException InvalidateHandleCreateException(string msg, Exception cause)
 {
     rsched = null;
     SchedulerException ex = new SchedulerException(msg, cause);
     return ex;
 }
Пример #19
0
        protected virtual IRemotableQuartzScheduler GetRemoteScheduler()
        {
            if (rsched != null)
            {
                return rsched;
            }

            try
            {
                rsched =
                    (IRemotableQuartzScheduler)
                    Activator.GetObject(typeof (IRemotableQuartzScheduler), RemoteSchedulerAddress);
            }
            catch (Exception e)
            {
                SchedulerException initException =
                    new SchedulerException(string.Format(CultureInfo.InvariantCulture, "Could not get handle to remote scheduler: {0}", e.Message), e);
                throw initException;
            }

            return rsched;
        }
		protected virtual SchedulerException InvalidateHandleCreateException(string msg, Exception cause)
		{
			rsched = null;
			SchedulerException ex = new SchedulerException(msg, cause);
			ex.ErrorCode = SchedulerException.ErrorCommunicationFailure;
			return ex;
		}
        public virtual void UnBind(IRemotableQuartzScheduler scheduler)
        {
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }
            if (!typeof(MarshalByRefObject).IsAssignableFrom(scheduler.GetType()))
            {
                throw new ArgumentException("Exported scheduler must be of type MarshallByRefObject", "scheduler");
            }

            try
            {
                RemotingServices.Disconnect((MarshalByRefObject)scheduler);
                Log.Info("Successfully disconnected remotable scheduler");
            }
            catch (ArgumentException ex)
            {
                Log.Error("ArgumentException during Unbind", ex);
            }
            catch (SecurityException ex)
            {
                Log.Error("SecurityException during Unbind", ex);
            }
            catch (Exception ex)
            {
                Log.Error("Exception during Unbind", ex);
            }
        }