I have this situation in Java:
On internal modules called I. A big module Z that receives messages by DBus from I. This big module Z communicate with a external server E (for every message received by Dbus).
By DBus architecture, every time it is done a request, in Z module it is created a new Thread to handle it.
What is the best approach to communicate with 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 ?
Thanks in advance João