How to make my object to wait for server response

Hi ,
I need some one suggestions on thread concepts.
First Let me know my scenario is fit for thread concept.
is it possible then how I can reach to solution.
I have scenario like
I send a request to server and server is taking some time to process the request.
if I am calling the method on server it showing no results bez i know server takes some time.
for that my calling method has to be wait for some time.
Thanks
Babu H

Hi ,
Let me give more information about that between my java class and server
i have the bridge library which is also written in other than java.
for that i used the njawin tool make as java wrapper class and accessing the java wrapper class(Bridge Server).
the java wrapper class has post_request and poll_response methods so that why i 'm using only these methods in my java class to access the server.
exactly I don't which technology is resided in Brdige server and actual Server bez that has been developed some one.
poll_respnse means server has posted the response to client.
Thanks
Babu H

Similar Messages

  • Azure Service Bus client: Best way to wait for server response?

    Hi,
    I have a web service that needs to send a request on Azure Service Bus and wait for the response. The web service must operate synchronous as seen from the web service client, that is:
    public Response WebServiceMethod(Request)
    senderQueueClient.Send(Request);
    // wait for response from receiverQueueClient
    // and return to web serviuce client
    return response;
    This can be solved using mutexes that are updated in "receiverClientQueue.OnMessage". But that is hard work and if I Google the matter, I find several options to deal with this - especially when using .NET 4.5.  And there are also some built-in
    stuff in the QueueClient.
    But how to do this best? Can someone point me in the right (easy) direction?
    Werner

    Hi,
    May I know what are you use queue to achieve? can you give us further information for a better help.
    Regards

  • How to make one thread to wait for others in this situation?

    i am simulating a 2 phase locking system (shared and exclusive locks). multiple clients connects and requests for lock to a single server. at the server end, we have a class Server which implements Runnable interface. for each connection, a new Server object is created and a new thread is started. when a conflicting lock request is made by a client, the corresponding thread in the server end must wait until other threads corresponding to clients holding the lock releases it. and when all the locks in conflicting mode are released, the thread releasing the last conflicting lock must notify the waiting thread.
    but the wait() and notifyAll() methods are not working as desired. i guess this is because each thread is working on different Server objects.
    how can i implement the waiting and notifying mechanism?

    Let me recap your question: your Server is a single resource to which
    multiple Clients want access in a CREW (Concurrent Read Exclusive Write)
    fashion. You need a single object somewhere that can serve as the
    single monitor for locking. A Singleton object like this should do it:public class CREW {
       private static CREW crew= new CREW();
       public static getCREW() { return crew; }
       private boolean wite;
       private int read;
       public synchronized acquireReadLock() {
          // your read locking stuff here
       public synchronized acquireWriteLock() {
          // your write locking stuff here
    }... the important part is that there is a single object to lock on. The
    'acquire...' methods can be pooped up at will (a Command as a
    parameter mayhap?)
    kind regards,
    Jos

  • How to make the main() thread wait?

    I would like to know how to make the main() thread wait for another thread?If I use wait() method in main() method it says "non-static method wait() cannot be referenced from a static context",since main()
    is static.

    Here is an example how you may wait for a Thread in the main -
    but be careful, this is no real OO:
    public class WaitMain {
    // this is the thread class - you may also create
    // a runnable - I use a inner class to
    // keep my example simple
         public static class ThreadWait extends Thread{
              public void doSomething(){
                   synchronized(syncObject){
                        System.out.println("Do Something");
                        syncObject.notify();
              public void run(){
                   // sleep 10 seconds - this is
                   // a placeholder to do something in the thread
                   try{
                        sleep(10000);
                        doSomething();
                        sleep(10000);
                   catch(InterruptedException exc){
    // this is the object we wait for -
    // it is just a synchronizer, nothing else
         private static Object syncObject = new Object();
         public static void main(String[] args) {
              System.out.println("This will start a thread and wait for \"doSomething\"");
              ThreadWait t= new ThreadWait();
              t.start();
              synchronized(syncObject){
                   try{
    // this will wait for the notify
                        syncObject.wait();
                        System.out.println("The doSomething is now over!");
                   catch(InterruptedException exc){
              // do your stuff

  • Jakarta HTTPClient , dont wont to wait for a response.

    Hi there.
    I wonder if I can do that , I want to send a post\get request to another server but I don�t want to wait for a response from it.
    Actually, I want to continue with my program regardless to the response and don�t want to be delayed while waiting.
    How can I do it?
    Hope I made myself clear, thanks.
    Shlomi

    spawn a Thread that will send the request. When it's time to process the response, check the Thread to see if any response was returned from the server.
    example
    public class MyThread extends Thread{
        private String response = null;
        private int status = 0;
        private boolean complete = false;
        public void run(){
             // TODO: et the response from the server
             // set the response and status and complete (synchronize all variable when doing this)
        public boolean isComplete(){
            return complete;
        public String getStatus(){ return status; }
        public String getResponse(){ return response; }
    public class Demo(){
        public static void main(String args[]){
            // do some work
            MyThread thread = new MyThread();
            thread.start();
            // do some more work (don't wait for server response
            // now it's time to get the response
            while (!thread.isComplete()){
                try{   Thread.sleep(1000); } // sleep for 1 second
                catch (Exception e){ }
            String response = thread.getResponse();

  • How to make any object self-shining?

    hi,
    i guess thats an easy question, but i dont know where to look for the answer.
    so how to make any object self-shining like the infamous colorcube, so that one does not need to place any light?
    and am I right in my assumption that doing so will reduce the need of rendering power, since lights dont have to be computed?
    thanx,
    Usul

    I'm not sure what you mean here- if your object is lit then lighting will need to be calculated. If you don't want shapes to be lit, I think you can disable it by calling setLightingEnable(false) in their materials.

  • How to make an object distributed across multiple jres?

    Hi,
    We used cache data mechanism for performance tuning. It will store data in static variable (Hashtable) and get initialized when app starts . We are using IPlanet Application Server and
    Using 6 KJS engines. This object ( Hashtable) is not distributed across all JRES.It has to reinitialize data again when request goes to any other KJS.
    We avoid sharing data in session and request, as data is huge.
    Can any one help us how to make this object distributed across all KJSs?
    Thanks in advance.
    raj

    We used cache data mechanism for performance tuning.
    It will store data in static variable (Hashtable) and
    get initialized when app starts.
    We are using IPlanet Application Server and
    Using 6 KJS engines. This object ( Hashtable) is not
    distributed across all JRES. It has to reinitialize
    data again when request goes to any other KJS.
    We avoid sharing data in session and request, as data
    is huge.
    Can any one help us how to make this object
    distributed across all KJSs?When you say 'initialized when app starts' do you mean iPlanets StartUp classes, rather than the Servlets init() ? Given a 'huge' dataset, avoid the latter.
    I'd suggest that a better approach is to implement this as an Entity Bean and accessed from Session bean and using Value Objects to return the data subsets.
    Checkout the Java Pet Store
    http://java.sun.com/blueprints/code/jps13/datasheet.html

  • HOw to make an Object oriented alv respond to double click

    Hi all,
    HOw to make an Object oriented alv respond to double click.SAmple code will be helpful.
    Thanks in advance,
    Alex.

    Hi,
    1. Create a Control (for Custom and Split Containers only)
    2. Instantiate a Container Object (in case of Custom and Split Containers, specify the control which is created by us in Screen painter) CREATE OBJECT
    3. Instantiate an Object of the kind of report that has to be displayed (List, Grid or Tree). CREATE OBJECT . Here we need to specify the Parent Container as the so that it sits in that container.
    4. Call appropriate methods to display the report on the screen. CALL METHOD ->
    DATA : g_dock TYPE REF TO cl_gui_docking_container,
    g_split TYPE REF TO cl_gui_easy_splitter_container,
    g_cont1 TYPE REF TO cl_gui_container,
    g_cont2 TYPE REF TO cl_gui_container,
    g_grid1 TYPE REF TO cl_gui_alv_grid,
    g_grid2 TYPE REF TO cl_gui_alv_grid.
    i_mara is an internal table of structure MARA
    SELECT * FROM mara INTO TABLE i_mara.
    i_kna1 is an internal table of structure KNA1
    SELECT * FROM kna1 INTO TABLE i_kna1.
    To create an Object of type Docking Container
    CREATE OBJECT g_dock
    EXPORTING
    side = cl_gui_docking_container=>dock_at_top
    extension = 200 .
    To Create an Object of Type Split Container. Here we can see that the Docking *Container Created above has been used as a parent .
    CREATE OBJECT g_split
    EXPORTING
    parent = g_dock
    orientation = 1 .
    Easy Split container splits one Control into 2 manageable controls, each of them is used * to handle one GUI Container each
    g_cont1 = g_split->top_left_container.
    g_cont2 = g_split->bottom_right_container.
    To Create an Object of type Grid . Here we can see that the Left Split Container * Created above has been used as a parent .
    CREATE OBJECT g_grid1
    EXPORTING
    i_parent = g_cont1 .
    To Create an Object of type Grid . Here we can see that the Right Split Container * Created above has been used as a parent .
    CREATE OBJECT g_grid2
    EXPORTING
    i_parent = g_cont2 .
    The method of Grid Control Object is used to display the Data.
    CALL METHOD g_grid1->set_table_for_first_display
    EXPORTING
    i_structure_name = 'MARA'
    CHANGING
    it_outtab = i_mara[] .
    The method of Grid Control Object is used to display the Data.
    CALL METHOD g_grid2->set_table_for_first_display
    EXPORTING
    i_structure_name = 'KNA1'
    CHANGING
    it_outtab = i_kna1[] .
    Regards
    Hari

  • How to deal future objects and wait calls

    Hi all,
    How can I handle Future objects if the Callable object calls a wait() into the call() method? If the Callable object is waiting for something, the call Future.get() throws an IllegalMonitorStateException.
    For example:
    public class Test {
        private final ExecutorService POOL = Executors.newFixedThreadPool(1);
        private static Random r = new Random(System.nanoTime());  
        List<Callable> waiting = new ArrayList<Callable>(10);
        public Test() {
            Future[] res = new Future[10];
            for (int i = 0; i < 10; i++) {
                    res[i] = execute();  
            synchronized (res) {
                for (int i = 0; i < 10; i++) {
                    try {
                        System.err.println(res.get(10L, TimeUnit.MILLISECONDS));
    } catch (InterruptedException e) {
    e.printStackTrace();
    } catch (ExecutionException e) {
    e.printStackTrace();
    } catch (TimeoutException e) {
    POOL.shutdown();
    System.err.println("size: " + waiting.size());
    private Future<Integer> execute() {
    return POOL.submit(new Executor());
    * @param args
    public static void main(String[] args) {
    Test t = new Test();
    private class Executor implements Callable<Integer> {
    public Integer call() throws Exception {
    Integer value = -1;
    try {
    value = r.nextInt();
    waiting.add(this);
    wait(2000);
    } catch (InterruptedException e) {
    // Thread.currentThread().interrupt();
    waiting.remove(this);
    return value;
    The Object.notify() documentation says:
    "This method should only be called by a thread that is the owner of this object's monitor. A thread becomes the owner of the object's monitor in one of three ways:
    * By executing a synchronized instance method of that object.
    * By executing the body of a synchronized statement that synchronizes on the object.
    * For objects of type Class, by executing a synchronized static method of that class.",
    so how can the main thread became the owner?

    Hello,
    HR objects are not supposed to be in the SPAU list during the upgrade. It might show though because of the coding error in note 519678. The error wrote entries of HR objects in the tabel SMODILOG which is not supposed to be.
    You can try the solution in the note 519678 to remove the entries of HR objects in SMODILOG and after that they will no longer be shown in SPAU.
    Regards,
    Joe

  • How to make an object mutable?

    Can any one tell me how to make an object mutable?
    Following is Class X & Y?
    class Y
    public static void main(String arg[]) {
    X a1=new X();
    Object a=a1.get();
    System.out.println(a.toString());
    a1.set(a);
    System.out.println(a.toString());
    class X implements Serializable
    public Object get(){
    return new Object();
    public synchronized void set(Object o)
    o=null;
    In my class Y when i say
    a1.set(a);
    I want local Object a of main method should be nullified.
    Can it be possible if yes what is the way or code to be applied so that
    my next a.toString() statement will give me NullpointerException.

    Isn't it more accurate to say that object references are passed by value?
    OP -- Basically you can't to what you want to do. When you "pass an object" as a method parameter, what you're really passing is a copy of the reference that points to the object. You now have two refs pointing to the same object--one in the caller and one in the method being executed. Setting either of those refs to null does NOT affect the object itself, and does NOT affect the other ref. It just means that the ref that's been set to null no longer points to any object.
    If you want the called method to make a change that the caller can see, you need to either 1) return a value from the method, 2) encapsulate the object to be changed as a member of new class, or 3) pass the object to be changed as the single element of an array. I would STRONGLY recommend against (3) as a way to simulate pass by reference. Better to examine your design and determine whether (1) or (2) more closely matches what you're really trying to accomplish.

  • How to make Add to Favorites Option for website?

    Please Advice how to make Add to Favorites Option for the
    Website.
    Appreciated
    Thank You

    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=189&threadid =1191543&highlight_key=y&keyword1=favorites

  • How to call a ALSB Proxy Service and don't wait for his response. Publish M

    Hi,
    I have a Proxy Service called PS1 that will invoke and another Proxy service Called PS_ProcessingNode that invokes 10 differents webservices during the orchestration and takes about 2 minuts.
    I would like that if invoke PS1 that will invokes PS_ProcessingNode (asyncronously) and immediatly PS1 will return "OK" (don't wait for the response of PS_ProcessingNode) .
    For simulate this scenario I am testing with:
    - PS_Processing is a WSDL without response that has a JavaCallout with a Sleeper of 10 seconds.
    - PS invokes with "Publish action" to PS_ProcessingNode but is waiting for PS_Processsing finish. I don't want this beahivour.
    How I can do it for PS doesn't wait for the response of the PS_ProcessingNode?
    Thanks.

    - PS invokes with "Publish action" to PS_ProcessingNode but is waiting for PS_Processsing finish. I don't want this behavior.
    I'm glad you have a solution using JMS. But still Publish action should not wait for response. If you are seeing that behavior, you can contact Support with an SR to get it fixed.
    Manoj

  • How to make this object static ?

    Hi,
    I have such an InputStream :
    InputStream kombinace = getClass().getResourceAsStream("/kombinace.txt");is there anyway how to make it static ?
    thanks for help

    BigDaddyLoveHandles wrote:
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    InputStream in = loader.getResourceAsStream(path);
    I'm not sure that this is guaranteed to work since the class loader you have obtained from the current thread may not be the one that holds the resource.

  • How to make Shape3D object translucent

    Hi,
    How to make Shape3D object (like Box, Cylinder) translucent? I tried the below option but the box is not becoming translucent at all.
    final PhongMaterial redMaterial = new PhongMaterial();
              redMaterial.setSpecularColor(Color.rgb(10, 255, 15, opacity));
              redMaterial.setDiffuseColor(Color.rgb(10, 255, 15, opacity));
    final Box box = new Box(width,height,depth);
    box.setMaterial(redMaterial);
    When opacity is 1, the color of the box will be Green, when it is 0 the color becomes black.
    Is there any way the box can be made translucent?

    There is at least one unresolved issue concerning PhongMaterial's transparency: RT-28874.
    I'm neither able to get it working properly. My red Sphere also fades to black while varying the opacity value from 1.0 to 0.0.
    August

  • Can i make a method to wait for 2 mins before executing in java??

    can i make a method to wait for 2 mins before executing??
    i mean when i execute a method ....it has to wait for 2 mins before finally executing...
    can i do this in java????
    Thanks,

    Sure, put this at the beginning of the method.
    try
        Thread.sleep(120000);
    catch (Exception ex)

Maybe you are looking for

  • Archive & Install, Where did my printer settings go?

    I just upgraded to Leopard from Jaguar on my PowerPC G4, by way of Archive & Installing. On top of my printer settings being reset to defaults, my RIP software (FastRip Pro) doesn't work with Leopard yet. Did I lose all of my previous RIP/printer set

  • Problem in using 'Path Variable' in Linked resources in Eclipse

    Hi All Currently we are working on a J2EE project on which we have established the split-development environment. In this environment we have few UI web sub-projects. These projects are bundled as a one UI project at the time of deploying the applica

  • Password Protecting An entire folder in documents?

    I need to be able to password protect a folder within my Documents folder, as it contains very sensitive info. Does anyone know how to do this in pages '09? Thanks

  • Creative Vision:M Driver Softw

    Greetings, I have recently purchased the Creative Vision:M mp3 player. Unfortunetly, I am unable to install the software as my CD-ROM dri've on my computer is not working. I am wondering if there is any other way I can get the software, perhaps throu

  • Remove symbol or stop points?

    Hello! I am currently doing game design at university and Have recently started looking at action script 3. I am not struggling too much and can usually find the answer to what I am looking for but this really has me stumped. I want to add an item to