That seems…odd. I cannot imagine anything in such Java code that would be sensitive nor risky. You can mask out anything that reveals company/private info. But in order to effectively help, seeing exactly what you’re trying to do is a key bit of info.
The Java object is presumably being created in A. If you want to pass it to B, you need to put it in the pipeline. And B should explicitly declare in its inputs that it expects that object as an input. Referencing variables from other services that are not defined on the input tab is a poor practice from a few perspectives.
Why? Creating a separate thread is useful in a couple of scenarios – can you share what your scenario is? Hopefully it is not based on the assumption that doing so will somehow make the overall process faster.
#Service-Designer#Integration-Server-and-ESB#webMethods