Hi Adriano, I have posted the sample at http://svn.apache.org/repos/asf/tuscany/sandbox/dougsleite/conversationTest
There are two ways to execute the program: (1) executing the main.Main.java, and (2) executing the test case ConversationTestCase.java. As mentioned by Simon, the presence of the annotation @Conversational is not essential to keep the program running. I have noticed it while executing the test case, the program finishes even though the thread at someServiceMethod is running. However, I cannot get the same result when executing the program by the first way. I am using maven 2.0.9, java 1.5.0_15, and tuscany libs 1.4 Thanks, On Tue, Jan 27, 2009 at 4:52 AM, Adriano Crestani <[email protected] > wrote: > Hi Douglas, > > Could you provide to us a sample that reproduces this behavior? > > Thanks, > Adriano Crestani > > > On Mon, Jan 26, 2009 at 7:42 AM, Simon Laws <[email protected]>wrote: > >> >> >> On Mon, Jan 26, 2009 at 12:07 AM, Douglas Leite <[email protected]>wrote: >> >>> Supposing I have the following scenario: >>> >>> #A client: >>> >>> *public ClientImpl implements Client { >>> >>> public void someClientMethod() { >>> service.someServiceMethod(); >>> Thread.sleep(1000); >>> } >>> }* >>> >>> #A server: >>> >>> *...@conversational >>> public interface ServiceProvider { >>> >>> @OneWay >>> public void someServiceMethod(); >>> >>> @EndsConversation >>> public void close(); >>> }* >>> >>> #The main program: >>> >>> * public static void main(String... args) { >>> SCADomain scaDomain = >>> SCADomain.newInstance("conversational.composite"); >>> >>> Client client = scaDomain.getService(Client.class, "Consumer"); >>> client.someClientMethod(); * >>> *}* >>> >>> The main program just call the *someClientMethod* method. Suppose that >>> the *someServiceMethod* has an execution time greater than 1000 >>> milliseconds (time taken by the *someClientMethod* execution). Due to >>> the @Conversational annotation, the program will not finish even though the >>> client method finishes firstly. However, should the program finish when the >>> *close* method is invoked? I have tried this in some tests, but even >>> when the *close* is invoked, and no more computation are done, the >>> program still running. >>> >>> >>> -- >>> Douglas Siqueira Leite >>> Computer Science Master's degree student of University of Campinas >>> (Unicamp), Brazil >>> >>> >> Hi Douglas >> >> I'm surprised that the program continues to run. @Conversation ensures >> that an service instance is available across a sequence of calls. I wouldn't >> expect the presence of @Conversation to keep the program running. >> >> I don't see that you call "close()" anywhere in this example but you say >> you have tried it. I wouldn't expect this to make a difference to whether >> the program stops or not but it would tidy away the conversational instance >> when you are done with it. >> >> Simon >> > > -- Douglas Siqueira Leite Computer Science Master's degree student of University of Campinas (Unicamp), Brazil
