Java SDK 100.7 How to Put a LocalGP Service on a Timer

565
2
04-02-2020 06:14 AM
thomasbales
Occasional Contributor

I was able to run a local gpk and it runs once returning a railroad milepost location. What I need to do is to put the gpk on a thread and return the milepost location once every second or two. I am not sure how to do this or where the loop (timer) should go. Could somebody point me in the right direction? The method is in an attachment below.

Thanks,

Tom

Tags (3)
0 Kudos
2 Replies
GayleYoung
Esri Contributor

Hi Tom,

I would use a TimerTask (Java SE 10 & JDK 10 )  and Timer (Java SE 10 & JDK 10 ) for this,

Regards,

Gayle.

0 Kudos
thomasbales
Occasional Contributor

Thank you for your comment and I apologize for not getting back sooner. I was able to use a thread coinciding with a GPTask. I initialized the local server in the initialize() method and then created a thread to run the GPSTask and everything is working.

Thanks

0 Kudos