Javaでこの状況があります:
I と呼ばれる内部モジュール。I から DBus によってメッセージを受信する大きなモジュール Z。この大きなモジュール Z は、(Dbus によって受信されたすべてのメッセージに対して) 外部サーバー E と通信します。
DBus アーキテクチャにより、リクエストが行われるたびに、Z モジュールではそれを処理するための新しい Thread が作成されます。
Eと通信するための最良のアプローチは何ですか?
a) Make a class with a method SendToExternalServer(). this method will be called every time that have a new DBus message.
i) The method has only one HttpUrlConnection.
ii) The method create a differente HttpUrlConnection instance every time is called.
b) Same situation on a) but now the method SendToExternalServer() is static
i) (same situations)
ii) (same situations)
c) Same situation on a) but the class extends the interface Runnable
i) (same situation)
ii) (same situation)
d) OTHER ?
前もってありがとうジョアン