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 6538349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:43:32+00:00 2026-05-25T10:43:32+00:00

I have a scenario wherein I need to specify a return type to the

  • 0

I have a scenario wherein I need to specify a return type to the Synchrnous function, the code is as follows :

@RemoteServiceRelativePath("show_box")
public interface ShowBoxCommandService extends RemoteService{

 public ArrayList<String> showBox();

}

The implementation of the method on the server is :

public ArrayList<String> showBox() {

  ArrayList<String> box = new ArrayList<String>();
  Iterator<Box> boxes = BoxRegistry.getInstance().getBoxes();
  while (boxes.hasNext()) {
     box.add(boxes.next().toString());
  }
  return box;
}

I am trying to define the callback variable in the following format at the client side in order to call the method

 AsyncCallback<Void> callback = new AsyncCallback<Void>() {
           public void onFailure(Throwable caught) {
              // TODO: Do something with errors.
              // console was not started properly
           }

           @Override
           public void onSuccess(Void result) {
              // TODO Auto-generated method stub
              // dialog saying that the console is started succesfully

           }
        };

update with the aync interface code :

    public interface ShowBoxCommandServiceAsync {

   void showBox(AsyncCallback<ArrayList<String>> callback);

  }

But this is causing the definition of the method in the Async method to change.

Any ideas or clues will be helpful.

Thanks,
Bhavya

P.S. Apologies if this is a repetition

  • 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-25T10:43:32+00:00Added an answer on May 25, 2026 at 10:43 am

    The callback should be:

    AsyncCallback<ArrayList<String>> callback = new AsyncCallback<ArrayList<String>>() {
           public void onFailure(Throwable caught) {
              // TODO: Do something with errors.
              // console was not started properly
           }
    
           @Override
           public void onSuccess(ArrayList<String> result) {
              // TODO Auto-generated method stub
              // dialog saying that the console is started succesfully
    
           }
        };
    

    If you don’t need to utilize the result then you can ignore it, but if that is the case, you should probably question your design and why you would need the method to return an ArrayList<String> in the first place.

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

Sidebar

Related Questions

i have a scenario where in i need to send an xml as a
I am using SVNKit in my application. I have a scenario wherein certain files
I have a scenario where I need to upload a file from one web
I have a scenario wherein the user uploads a file to the system. The
I have a scenario where-in I need to create an uber jar of a
I have this scenario wherein I get a linear equation in the Prolog query
I have scenario like Here is the abstract class abstract class A { public
I am working on a scenario in Prolog (eclipse) wherein I need a list
I have scenario to use the Temporary user defined type variable in transaction, but
So here's my scenario, I need to have an inputs name and ID equal

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.