Hi,

I have a Clojure project which strongly uses some external java framework
(if you want to know it is Eclipse RDF4j). I need to override some method
within a java class. The issue is I am not able to inject my own
implementation of that class because it is in the middle of some complex
hierarchy.

In another Java (+ Spring Framework) project I had similar problem and I
had fixed that using AspectJ proxy which had had a breakpoint in calling a
particular java method. I read in many places that Clojure does not need it
and some explanation based on pure clojure examples. I would like to know
if Clojure is able to manage java code.

Quite often examples built a proxy with combination Java Class + protocol
and than injected the instance into somewhere. I thing that it does not
cover following example. The problems I found difficult are:

1. Distance between my code and Foo class is like 3 or 4 classes
2. Programmers quite strongly uses creation de novo rather than injection
already prepared instance

Thanks a lot for your help,
Jacek Grzebyta



++++++ java code+++++

class Baz {

// I need to proxy this method
protected List doAction(String arg 1, String arg2)

// weird work which I need to change

}


//////////////////////// Foo class

class Foo {

// cut


// elswhere

Baz jobber = new Baz(); // it creates de novo injection not supported


public String mySuperMethod(List args4) {

jobber.doAction(someList)

}


// cut
}


++++++ end ++++++++++

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to