Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:53:41+00:00 2026-05-31T17:53:41+00:00

public Class GUi(){ // More Code public void onClick(ClickEvent event) { LoginServer loginServer =new

  • 0
public Class GUi(){
 // More Code

public void onClick(ClickEvent event) {

LoginServer loginServer =new  LoginServer(getTextBoxUsername().getText(),getTextBoxPassword().getText());     
loginServer.setConnection(connection);
connection=loginServer.getConnection();
System.out.println(" connected "+connection);
// More code
}

public class LoginServer {
// more code
public void setConnection(Boolean connection) {

    String[] authentication = {username,password};
    //RPC call
    connectionService.connectionServer(authentication, callbackConnection); 
    System.out.println("setConnection" + connection);
}

public Boolean getConnection() {
    return connection;
}
AsyncCallback callbackConnection = new AsyncCallback() {

    public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
        connection=false;
    }

    public void onSuccess(Object result) {
        connection=true;
        System.out.println("onSuccess + connection);

    }
};

}

Output

setConnectionnull
connected null
onSuccesstrue

According to Me the Output should be.

 onSuccesstrue
 setConnectiontrue
 connected null

Because I made object of LoginServer ; Then I call method setConnection where there is RPC call written which is working perfectly fine.
OnSucces will change the value of connection.
Then I called method getConnection .

I also don’t understand why connected null

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:53:43+00:00Added an answer on May 31, 2026 at 5:53 pm

    When/if you ask your wife/girlfriend to bring you a beer, you don’t have that beer in your hand the second after you asked her, and you can continue watching the match and reacting, you’re not blocked waiting for your beer: that’s called asynchronous processing.

    Similarly, connection is still null the second after you send your RPC call.

    See https://groups.google.com/d/msg/Google-Web-Toolkit/-soVdfMGug8/vRmqIcAZ5zsJ

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class like this class GUI : public QWidget, public QThread When
public class MyClass { public int Age; public int ID; } public void MyMethod()
public class Test { public static void main(String[] args) { } } class Outer
public class doublePrecision { public static void main(String[] args) { double total = 0;
public class CovariantTest { public A getObj() { return new A(); } public static
public class WrapperTest { static { print(10); } static void print(int x) { System.out.println(x);
public class WrapperTest { public static void main(String[] args) { Integer i = 100;
public class Main3 { public static void main(String[] args) { Integer min = Integer.MIN_VALUE;
public class Item { ... } public class Order { public List<Item> Items ...
public class Address { public string ZipCode {get; set;} } public class Customer {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.