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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:14:58+00:00 2026-06-14T14:14:58+00:00

I am using Proxy Pattern in Java ( InvocationHandler ), to implement a lock

  • 0

I am using Proxy Pattern in Java (InvocationHandler), to implement a lock manager for a remote object, in the proxy class (which implements InvocationHandler). I am calling the remote object (here : flighRMConnection) :

if (method.getName().toLowerCase().contains("query")){
    lm.Lock(Thread.currentThread(), READ);
} else {
    lm.Lock(Thread.currentThread(), WRITE)
}               
method.invoke(flightRMConnection, args);

How can I check the value returned by the invocation?(there might be different types of results)

Thanks , Arian

  • 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-06-14T14:14:59+00:00Added an answer on June 14, 2026 at 2:14 pm

    Well, the static return type of invoke is naturally Object. If you want to determine the dynamic type of an instance returned by the invocation, you can call getClass() on it to get the Class object representing its type.

    If you need to inspect its contents, you can do further reflection using the Class (see getDeclaredFields(), etc.). If there’s a known class or interface the object might extend, you could also check that with instanceof and then cast it.

    Oh and don’t forget to make sure the returned object isn’t null before you call anything on it.

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

Sidebar

Related Questions

I'm creating Silverlight proxy client for WCF service using async pattern: public class ProductService
I am using the XML regex pattern to match my proxy URL. eg: Proxy
I have code to implement GoF's proxy pattern in C# . The code has
In our WCF project, we are using singleton pattern to obtain client proxy. Basically
I am communicating with a partner's webservice using proxy classes they've provided. I have
I'm writing a proxy using .NET and C#. I haven't done much Socket programming,
I'm using tornado to fetch many web pages asyncroniously using HTTP proxy . So,
I have problems with running CAS using the proxy mode. However, I don't have
I am trying to consume a WCF Webservice on Mono using the proxy but
I have an application that is working as a proxy using QTcpSocket to intercept

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.