Ctirad Kr�l�k

Greenhorn
+ Follow
since Nov 17, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ctirad Kr�l�k

Hey guys,

actually I have something very similar to the code above. The only nasty thing is that I want to execute the react() method after the "return randomValue". And this is the problem in Java...
I think that I'll solve it as follows:
The Reactor.react() method will run a new thread which will implement the wanted operation, but after some delay. I'll rely that the result of the getNumber() is already returned to the client.

Nevertheless - thank you very much for your answers!

have a nice time
C.
15 years ago
Yes - actually I have considered the separate thread with some delay, but I also wanted to know if there is anything else...

AspectJ could (maybe) help like this:
1) I would define a new aspect with a pointcut that catches the calling of the remote method
2) In the same aspect I would define an advice "after()" and I would put the "reacting" method's call here.
I guess it would work...

Thank you for the answer
15 years ago
Hey guys,

I have an interesting problem with programming my RMI application in Java.
I'll just put it in a simple way:
- I've a method with return value. This method is invoked from the remote VM.
- What I need is to invoke another method _after_ the method in the previous point returns the value.

Note: If you know Aspect Oriented Programming (e.g. AspectJ), you can see that the solution to my problem could be something like pointcut and advice constructs in AOP. But I'm limited to using the pure Java, so I cannot use AspectJ.
Perhaps some _lightweight_ framework enabling the usage of cross-cutting could also help me. So if you know any one, post it here, please.

I hope you aren't confused too much - I really cannot explain things

C.
15 years ago
;(

Thank you for your answer
C.
15 years ago
Ok, guys - thank you for the answers - they really helped me and I'll try to make the best of them

Have a nice time
Ok, I've had a look at the CyclicBarrier, but I don't know if it's the right thing I'm looking for.

If I understood it correctly, the only way to synchronize the threads is the using of method await(). But the thing is that this causes the "faster" threads to wait until all threads call the await() method - it means that the first thread can wait for the second one or vice versa. I want only the SequenceOne thread waiting for the other... The SequenceTwo shouldn't wait for the calling await() by SequenceOne. In other words - Continuance of the SequenceOne is conditioned on actions in SequenceTwo. Not vice versa.

Nevertheless, thank you for the answer
So the only way to determine whether the reference is "alive" is to call some remote method and catch exceptions?
15 years ago
Hello

I've got one question. I'm using Java RMI for programming my distributed application. I have one server which is registered in the registry and sometimes I shut down my application incorrectly (I don't unbind this server from the registry)
After it, I run the client, which finds the server's reference in the registry, but when it wants to call some server's method, the exception is thrown because there isn't any server object on the remote machine.

My question is: Is there any possibility how to check the liveness of objects in the registry?
15 years ago
Greetings

I'm working on a project which deals with converting one particullar BPEL process to Java code (it communicates with similar "BPEL services" written in Java - communication is done by Java RMI) and in the process I have 2 parallel sequences which are handled by 2 threads.

Now my task is to deal with this: to make the execution of some parts of the first thread to be conditional on an execution of some parts in the second thread. If you are familiar with BPEL, there are constructs "link", "sources" and "targets" devoted to this tasks.

I've proposed an easy way how to deal with:


I've ommited all the exception handling.

My question is really stupid: Do you think that this is a good solution? My heart told me that nothing can go wrong, but my brain refuses this thought

Thank you for each constructive answers.
[ November 17, 2008: Message edited by: Ctirad Kr�l�k ]