service

How and when to dispose my objects?

走远了吗. 提交于 2020-12-27 03:14:45
问题 In my backend service I use unit of work pattern. I was wondering if I'm missing something related to disposing objects. First, this is the code I have so far, which works. The service just calls a request handler: [GlobalExceptionHandlerBehaviour(typeof(GlobalExceptionHandler))] public class CustomerService : ICustomerService { public void AddCustomer(AddCustomerRequest request) { ObjectFactory.GetInstance<AddCustomerRequestHandler>().Execute(request); } } The request handler looks like:

How and when to dispose my objects?

a 夏天 提交于 2020-12-27 03:13:07
问题 In my backend service I use unit of work pattern. I was wondering if I'm missing something related to disposing objects. First, this is the code I have so far, which works. The service just calls a request handler: [GlobalExceptionHandlerBehaviour(typeof(GlobalExceptionHandler))] public class CustomerService : ICustomerService { public void AddCustomer(AddCustomerRequest request) { ObjectFactory.GetInstance<AddCustomerRequestHandler>().Execute(request); } } The request handler looks like:

dotnet core 3.1 windows service fails to load configuration settings

给你一囗甜甜゛ 提交于 2020-12-16 03:42:20
问题 I've run into a problem with a dotnet core 3.1 application that's designed to run as a windows service. The project originates from the Worker Service template in VS2019. Below is the call stack logged into the system event log. I can't find anything on SO or via web search. If I execute the application directly (double-click) or from a command line it runs fine. The exception is only thrown when executed as a windows service. Description: The process was terminated due to an unhandled

dotnet core 3.1 windows service fails to load configuration settings

风流意气都作罢 提交于 2020-12-16 03:41:09
问题 I've run into a problem with a dotnet core 3.1 application that's designed to run as a windows service. The project originates from the Worker Service template in VS2019. Below is the call stack logged into the system event log. I can't find anything on SO or via web search. If I execute the application directly (double-click) or from a command line it runs fine. The exception is only thrown when executed as a windows service. Description: The process was terminated due to an unhandled

weird behaviour of service and media player

微笑、不失礼 提交于 2020-12-15 06:51:57
问题 I have an activity that starts and binds to a music playing service, hence I have implemented both the onStartCommand and onBind methods. I have a MediaPlayer object in the service used to play media files. These are the steps I perform: I start the service and bind to it from the activity. the service invokes the MediaPlayer Object with a valid mediaLocation and the media starts playing I destroy the activity, while being destroyed, I use the unbindService(mServiceConn) method to unbind to

notification being dismissed after app destroyed after updates are triggered

半城伤御伤魂 提交于 2020-12-13 07:46:07
问题 The android docs state that for a service to be started, the onStartCommand has to be implemented. When I made the service , and start the service using ContextCompat.startForegroundService(...) , then it's onStartCommand method gets executed, and at this point even when I quit the app , the service doesn't stop ( as expected ). But, later when I make updates to the notification by changing the text displayed, I use the notificationManager.notify() method, and now when I quit the app , the

[控件]NotificationManager提示通知

ⅰ亾dé卋堺 提交于 2020-12-13 00:29:25
在main2中直接finish不做操作 package a.b; import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class main extends Activity implements OnClickListener { Button btn1, btn2, btn3; NotificationManager myManager; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main

LocalBroadcastManager has been deprecated. What I should use instead in its place?

丶灬走出姿态 提交于 2020-12-04 19:25:03
问题 I'm working on this project in Android in which an aspect requires a CountdownTimer with a foreground service. A few other answers on Stack Overflow mentioned that LocalBroadcastManager would be suitable for my needs. The documentation in Android Developers, however, mentions that it has been deprecated. Any suggestions on what I should use in its place? The documentation mentioned about using LiveData, but I was wondering if there are any easier alternatives. 回答1: LocalBroadcastManager is

LocalBroadcastManager has been deprecated. What I should use instead in its place?

♀尐吖头ヾ 提交于 2020-12-04 19:07:35
问题 I'm working on this project in Android in which an aspect requires a CountdownTimer with a foreground service. A few other answers on Stack Overflow mentioned that LocalBroadcastManager would be suitable for my needs. The documentation in Android Developers, however, mentions that it has been deprecated. Any suggestions on what I should use in its place? The documentation mentioned about using LiveData, but I was wondering if there are any easier alternatives. 回答1: LocalBroadcastManager is

LocalBroadcastManager has been deprecated. What I should use instead in its place?

最后都变了- 提交于 2020-12-04 19:06:36
问题 I'm working on this project in Android in which an aspect requires a CountdownTimer with a foreground service. A few other answers on Stack Overflow mentioned that LocalBroadcastManager would be suitable for my needs. The documentation in Android Developers, however, mentions that it has been deprecated. Any suggestions on what I should use in its place? The documentation mentioned about using LiveData, but I was wondering if there are any easier alternatives. 回答1: LocalBroadcastManager is