calling a method of a Object inside Session without typecasing

Vivek

I have a jar (xyz.jar) which is pluggable to 5 projects , all project creates a object in session when anyone login to any of those 5 application named "loginObject" , I have to use this object from session in "xyz.jar" but LoginObject class is in main project , because of which i am unable to typecast it to "loginObject" class.

EGlobalLoginBean loginObject=(EGlobalLoginBean ) httpSession.getAttribute("loginObject");

Now that class "EGlobalLoginBean " is in main project not "xyz" , so i am unable to typecast it , and as i can't typecast i am unable to call it's method. I can't add main project as dependent project into "xyz" because it's suppose to happen the other way around.

All suggestion are highly appreciated.

ramp

You will have to work around it IMHO

  1. Copy the .class file to the web-inf/classes of xyz.jar (if its a web application) or else add it to the server's classpath (bad, but it will work). Either way you have to extract the .class file (and its dependencies) out.

  2. Load the .class file using a URL class loader, have it implement a common interface and invoke it's methods using the interface.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

(javascript) Calling a method on an object inside an array

From Dev

objects - calling object instance inside a static method

From Dev

calling virtual method without pointing to an object?

From Dev

Calling a method inside a method

From Dev

Swift - Is there a way run a method on an object without calling the object? (Self?)

From Dev

Modifying state object without calling setState, but object method instead

From Dev

How to combine results with fold without calling unsafe method inside

From Dev

Calling a method inside model

From Java

Calling method after Optional.filter() without passing in object

From Dev

PHP Calling method inside method

From Dev

Calling a method without an instance

From Dev

Calling non static method without class instance inside a non static method

From Dev

Calling a method on object in typescript

From Dev

Get object of calling method

From Java

Java: Why a method called inside another method is called automatically with the current calling object in Java?

From Dev

Calling object of a method in another method

From Dev

Does calling the new_csrf_token() method on a Pyramid session object invalidate previously issued tokens?

From Android

Calling a function inside onRespons method

From Dev

Calling a controller inside a factory method

From

Calling a method inside getDerivedStateFromProps in React

From Dev

Calling self inside a method in smalltalk

From Dev

Calling PDO inside a method PHP

From Dev

Android Crash when calling a method inside a class, without trigger exceptions or errors

From Dev

Calling method on subslice without reference

From Dev

Calling method without typeless argument

From Java

Calling a method inside another method in same class

From Dev

Calling a method inside another method JavaScript

From Dev

Calling method inside a method in Interface c#

From Dev

C# Calling a Method Inside another Method

Related Related

  1. 1

    (javascript) Calling a method on an object inside an array

  2. 2

    objects - calling object instance inside a static method

  3. 3

    calling virtual method without pointing to an object?

  4. 4

    Calling a method inside a method

  5. 5

    Swift - Is there a way run a method on an object without calling the object? (Self?)

  6. 6

    Modifying state object without calling setState, but object method instead

  7. 7

    How to combine results with fold without calling unsafe method inside

  8. 8

    Calling a method inside model

  9. 9

    Calling method after Optional.filter() without passing in object

  10. 10

    PHP Calling method inside method

  11. 11

    Calling a method without an instance

  12. 12

    Calling non static method without class instance inside a non static method

  13. 13

    Calling a method on object in typescript

  14. 14

    Get object of calling method

  15. 15

    Java: Why a method called inside another method is called automatically with the current calling object in Java?

  16. 16

    Calling object of a method in another method

  17. 17

    Does calling the new_csrf_token() method on a Pyramid session object invalidate previously issued tokens?

  18. 18

    Calling a function inside onRespons method

  19. 19

    Calling a controller inside a factory method

  20. 20

    Calling a method inside getDerivedStateFromProps in React

  21. 21

    Calling self inside a method in smalltalk

  22. 22

    Calling PDO inside a method PHP

  23. 23

    Android Crash when calling a method inside a class, without trigger exceptions or errors

  24. 24

    Calling method on subslice without reference

  25. 25

    Calling method without typeless argument

  26. 26

    Calling a method inside another method in same class

  27. 27

    Calling a method inside another method JavaScript

  28. 28

    Calling method inside a method in Interface c#

  29. 29

    C# Calling a Method Inside another Method

HotTag

Archive