public ShelfServiceController(Inbox inbox, string name, IServiceChannel coordinatorChannel, ShelfType shelfType, Type bootstrapperType, AssemblyName[] assemblyNames) { _inbox = inbox; _name = name; _publish = new PublishChannel(coordinatorChannel, inbox); _shelfType = shelfType; _bootstrapperType = bootstrapperType; _assemblyNames = assemblyNames; _inbox.Loop(loop => { loop.Receive <ShelfCreated>(x => { ShelfCreated(x); loop.Continue(); }); loop.Receive <ServiceUnloaded>(x => { ShelfUnloaded(x); loop.Continue(); }); }); }
// Henrik: I removed the finalizer, no unmanaged objects. See // http://blogs.msdn.com/b/tom/archive/2008/04/25/understanding-when-to-use-a-finalizer-in-your-net-class.aspx void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_scheduler != null) { _scheduler.Stop(30.Seconds()); } _fiber.Shutdown(30.Seconds()); if (_producer != null) { _producer.Dispose(); } _serviceChannel = null; } _disposed = true; }
public DirectoryMonitor(string directory, IServiceChannel serviceChannel) { _pendingNotifications = new Dictionary<string, ScheduledOperation>(); _baseDirectory = directory; _serviceChannel = serviceChannel; _fiber = new PoolFiber(); }
public DirectoryMonitor(string directory, IServiceChannel serviceChannel) { _pendingNotifications = new Dictionary <string, ScheduledOperation>(); _baseDirectory = directory; _serviceChannel = serviceChannel; _fiber = new PoolFiber(); }
public FilterContext(Type retType, Parameters parameters, IServiceChannel serviceChannel, LinkedListNode <T> filterNode) { RetType = retType; Parameters = parameters; ServiceChannel = serviceChannel; filter_node = filterNode; NextContext = CreateNextContext(); }
public IServiceController Build(Inbox inbox, IServiceChannel coordinatorChannel) { var serviceController = new LocalServiceController <T>(Name, inbox, coordinatorChannel, StartService, StopService, PauseService, ContinueService, CreateService); return(serviceController); }
static void Main(string[] args) { ChannelFactory <IServiceChannel> channelFactory; channelFactory = new ChannelFactory <IServiceChannel>(new BasicHttpRelayBinding(), "https://azurerelaytest.servicebus.windows.net/azurerelayservice"); channelFactory.Endpoint.Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("SharedAccessKey", "5YEwr1YFY3V7AThi2k/Mldaezr+m6lg5PP5cumlkYUo=") }); // Create the Communication to the WCF IServiceChannel channel = channelFactory.CreateChannel(); // Call the Service Method using Channel Console.WriteLine("Approval for 50? ->" + channel.GetApproval(50)); Console.WriteLine("Approval for 500? ->" + channel.GetApproval(500)); Console.ReadLine(); }
public object CallExceptionFilter <Excp>(Excp value, Type retType, Parameters parameters, IServiceChannel serviceChannel) where Excp : Exception { if (ExceptionFilters.Count == 0) { return(null); } var context = new ExceptionFilterContext(retType, parameters, serviceChannel, ExceptionFilters.First); var obj = context.Invoke(null, value); if (!context.ExceptionHandled) { throw new ProviderException(value.GetBaseException().Message); } return(obj); }
public LocalServiceController(string name, Inbox inbox, IServiceChannel coordinatorChannel, Action <TService> startAction, Action <TService> stopAction, Action <TService> pauseAction, Action <TService> continueAction, InternalServiceFactory <TService> serviceFactory) { _name = name; _inbox = inbox; _coordinatorChannel = coordinatorChannel; _startAction = startAction; _continueAction = continueAction; _serviceFactory = serviceFactory; _pauseAction = pauseAction; _stopAction = stopAction; _log = LogManager.GetLogger("Topshelf.Host.Service." + name); }
public string MakeServiceCall() { // Validate the specified Email address IServiceChannel proxy = proxyFactory.CreateChannel();; var response = ""; try { proxy.Open(); response = proxy.GetData(); // Do some processing on the results proxy.Close(); return(response); } catch (Exception e) { proxy.Abort(); } return(response); }
public PublishChannel(IServiceChannel channel, UntypedChannel inbox) { _channel = channel; _inbox = inbox; }
public ChannelController(IHttpContextAccessor httpContextAccessor, IUnitOfWork unityOfWork, IServiceChannel serviceChannel) : base(unityOfWork) { _serviceChannel = serviceChannel; _httpContextAccessor = httpContextAccessor; }
public TopshelfDashboard(ServiceDescription description, IServiceChannel serviceCoordinator) { _description = description; _serviceCoordinator = serviceCoordinator; _port = 8483; }
public MessageFilterContext(Type retType, Parameters parameters, IServiceChannel serviceChannel, LinkedListNode <IMessageFilter> filterNode) : base(retType, parameters, serviceChannel, filterNode) { }
public MistyService(IServiceChannel channel) { _channel = channel; }
public Host(IServiceChannel serviceChannel) { _serviceChannel = serviceChannel; }
public StatusChannel(IServiceChannel serviceCoordinator) { _serviceCoordinator = serviceCoordinator; }
void Dispose(bool disposing) { if (_disposed) return; if (disposing) { if (_scheduler != null) _scheduler.Stop(30.Seconds()); _fiber.Shutdown(30.Seconds()); if (_producer != null) _producer.Dispose(); _serviceChannel = null; } _disposed = true; }
T CreateService(string name, IServiceChannel coordinatorChannel) { return(_factory(_description, name, coordinatorChannel)); }
public ShelfHost(IServiceChannel serviceChannel) { _serviceChannel = serviceChannel; }
public CommandProcessor(IServiceChannel coordinatorChannel) { _coordinatorChannel = coordinatorChannel; }
public DirectoryMonitor(string directory, IServiceChannel serviceChannel) { _baseDirectory = directory; _serviceChannel = serviceChannel; _fiber = new PoolFiber(); }
public ApplicationHost(IServiceChannel serviceChannel) { _serviceChannel = serviceChannel; }
public DashboardConnectionHandler(IServiceChannel serviceCoordinator) : base("^/$", "GET") { _serviceCoordinator = serviceCoordinator; }
//: this() //private NancyHost _host; /* public DeploymentService() { */ /* _timer = new Timer(3000) { AutoReset = true }; _timer.Elapsed += (sender, eventArgs) => TimedMessageProcessor(); */ /* } */ public DeploymentService(ServiceDescription description, IServiceChannel coordinatorChannel) { _description = description; _coordinatorChannel = coordinatorChannel; }
public static IServiceChannel <T, T> RegisterNotify <T>(this IServiceChannel <T> channel, IService <object> decorator) => new ServiceChannel <T, T>(channel, channel, decorator);
public TopshelfDashboard(ServiceDescription description, IServiceChannel serviceCoordinator) { _serviceCoordinator = serviceCoordinator; TinyIoC.TinyIoCContainer.Current.Register<IServiceChannel>(_serviceCoordinator); }
public object CallMessageFilter(object value, Type retType, Parameters parameters, IServiceChannel serviceChannel) { if (MessageFilters.Count == 0) { return(value); } var message = new MessageFilterContext(retType, parameters, serviceChannel, MessageFilters.First); return(message.Invoke(null, value)); }
private static IEnumerable<dynamic> GetServices(IServiceChannel serviceCoordinator) { var result = new Future<IEnumerable<dynamic>>(); AnonymousActor.New(inbox => { serviceCoordinator.Send<Request<ServiceStatus>>(new RequestImpl<ServiceStatus>(inbox, new ServiceStatus())); inbox.Receive<Response<ServiceStatus>>(response => { var report = from service in response.Body.Services select new { Name = Uri.EscapeUriString(service.Name), service.ServiceType, service.CurrentState, Action = (service.CurrentState == "Running") ? "stop" : "start" }; result.Complete(report); }, 10.Seconds(), () => { var report = new[] { new { Name = "Failed to get Services list" } }; result.Complete(report); }); }); result.WaitUntilCompleted(20.Seconds()); return result.Value; }