All Questions
812
questions
0
votes
2
answers
64
views
I can not stop a Runnable using Handler in JAVA
I am trying to build a stopwatch and i have a button named start which starts the counting, after it starts the name of the button changes to stop and when i press stop i want to pause the counting, ...
0
votes
1
answer
395
views
Handle Callback Exceptions In Another Method
I am connecting to a database and I want to make queries using callbacks, so I wrote this:
public void query(String query, Consumer<ResultSet> callback, String database) throws SQLException {
...
0
votes
0
answers
87
views
JNA callback method wont be called until futureTask.get() timeout
If I run like this, the callback block will not run so future.get() will block forever:
FutureTask<Long> futureTask = new FutureTask<>(System::currentTimeMillis);
boolean login = ...
0
votes
1
answer
352
views
Java callback (in another class) to populate private member
Please forgive my Java syntax as I am a Java beginner.
I have 3 classes Main, Tool, ToolResultCallback.
class Main {
private DataList dl;
public doSomething() {
Tool t = new Tool();
...
0
votes
1
answer
206
views
Weak Reference Callback not working android
I am trying to pass my data(accountNumber) from LoyaltyCardReader.java to HCEPayment.java but somehow the call is not being received at HCEPayment.java. Can someone help me what i am doing wrong. I am ...
0
votes
1
answer
2k
views
How to properly do a thread callback in Java?
I am working on a project in Java (no Android). I have a thread that does some long work and I want a function in the main thread to be called when the work is done. I’ve seen many questions already ...
0
votes
1
answer
112
views
How to accept parameters in a new Callable instance passed as a function parameter
I am new to Java and trying to pass a function as an argument that gets called when a certain event occurs. I came across Callable and found a few answers for similar problems but not this exactly.
...
0
votes
2
answers
554
views
java callback function in case of an exception
I've to implement a callback mechanism in case of an exception.
suppose i hv a code to call like , which takes 3 parameters
inside a class called ServiceA
serviceA.functionA(String str1, String str2, ...
0
votes
2
answers
3k
views
How to unit test a callback in parameter - Kotlin
I have a Client class (written in Kotlin in an Android app) that implements an interface ReadyCallback (written in Java in a library of the app, the app is dependent on this library). In Client I have ...
1
vote
1
answer
118
views
Is apache ignite call back function blocking or non blocking?
I am using apache ignite,
there is a code block that looks like this:
query.setLocalListener(cacheEntryEvents -> {
Set<String> taskIds = new HashSet<>();
for (CacheEntryEvent<? ...
2
votes
0
answers
72
views
Is the WindowProcedure always called in the JavaFX Application Thread?
In a JavaFX app, if I use the JNA to implement a custom window procedure, will the callback always be on the JavaFX Application Thread?
public class MyWindowProc implements WinUser.WindowProc
...
...
0
votes
1
answer
241
views
How to test a function that uses a callback?
Suppose we have an interface for a callback function as such:
public interface Model {
interface UserListener {
void callback(User user);
}
void getUser(String username, ...
-1
votes
2
answers
639
views
How to make REST call asynchronous in Java
I have REST calls between two microservices, one of the call is taking more than 15 mins of time to complete. We have company's own private cloud implementation which is terminating any open ...
0
votes
0
answers
124
views
Why can't Java see the interface method?
I need to connect two Functions and a Consumer.
To do this, I created a new interface FunctionToConsumer in which I implemented the atLast method.
But the atLast method is just not visible.
error: ...
1
vote
0
answers
228
views
@PostRemove doesn't get called
I added some callback functions annotated witch @PostUpdate, @PostPersist, @PostRemove in a Listener class added to the entity class with @EntityListeners annotation. When I'm testing the ...