stuartdouglas: Yes [07:44am] alesj: would that work? [07:44am] stuartdouglas: maybe, I'm just waiting for my computer to unswap IDEA so that I can open weld and have a look [07:45am] stuartdouglas: It always seems to swap everything out overnight [07:45am] alesj: auch [07:47am] stuartdouglas: alesj: It is not that simple [07:47am] stuartdouglas: EnterpriseBeanProxyMethodHandler is used in create [07:48am] stuartdouglas: but that bean that is created can be injected into multiple injection points [07:49am] stuartdouglas: Also it may be used in EL, where there is not really a defined business interface [07:49am] stuartdouglas: So I think we just relax the contract on SessionObjectReference [07:50am] stuartdouglas: It is much easier for the EJB integration code to deal with this than it is for us to deal with it in weld [07:50am] stuartdouglas: If you were going to deal with it in weld you would need one proxy per injection [07:50am] stuartdouglas: and the proxy would need to know which business interface it represents [07:51am] stuartdouglas: But that would require some fairly major changes I think [07:52am] alesj: yes [07:52am] alesj: so you're saying we need to change SOR API? [07:53am] stuartdouglas: Not the api [07:53am] stuartdouglas: just the javadoc [07:54am] alesj: but where will the SOR get the right biz interface? [07:54am] OndrejZizka joined the chat room. [07:54am] alesj: or we'll try all possible biz interfaces? [07:54am] stuartdouglas: That is up to SOR, but basically it has to figure out which business interface has the method that is being invoked, and then call [07:55am] stuartdouglas: but that sort of thing can be cached [07:55am] stuartdouglas: actually that may not work [07:55am] stuartdouglas: because if they have two views with the same method, but different view interceptors [07:55am] alesj: multi biz interfaces can have that [07:55am] alesj: yes, exactly [07:55am] stuartdouglas: then there will be a probiem [07:55am] alesj: [07:55am] alesj: it's a problem now as well [07:56am] nickarls: time to head over to the OpenWebBeans repo and check out how they do it [07:57am] alesj: nickarls: are they able to handle this? [07:57am] stuartdouglas: alesj: how about this then [07:57am] nickarls: don't know, haven't checked [07:57am] alesj: nickarls: as I see you're the culpit behind this code [07:57am] stuartdouglas: we add a new method to the EnterpriseProxy [07:57am] stuartdouglas: resulveProxyForInterface(Class clazz) [07:58am] nickarls: no, I'm not. Pete probably changed everything and left my name behind to hide his trail [07:58am] stuartdouglas: when this is invoked it returns a new proxy for the same bean but one that knows which bean interface it needs to invoke [07:58am] alesj: stuartdouglas: EnterpriseProxy? [07:59am] stuartdouglas: It's not a real thing [07:59am] stuartdouglas: but enterpries beans have a speciial proxy EnterpriseProxyFactory [07:59am] stuartdouglas: we could create that interface and add it to the beans through EnterpriseProxyFactory [08:00am] alesj: which interface? [08:00am] stuartdouglas: and then you can go ((EnterpriseProxy)beanInstance).resolveProxyForInjectionType(injectionTargetType) [08:00am] stuartdouglas: we would need to create one [08:00am] alesj: ah, ic [08:00am] stuartdouglas: and add it to the proxies [08:00am] alesj: yeah, got it now … me = slow [08:00am] alesj: [08:01am] stuartdouglas: actually there is one [08:01am] stuartdouglas: EnterpriseBeanInstance [08:01am] alesj: what would this give us? [08:01am] alesj: woundn;t this be the problem of 2 biz beans having the same iface [08:01am] alesj: but diff actual biz ifaces [08:01am] stuartdouglas: There is nothing you can do there [08:02am] stuartdouglas: the EJB integration has to sort it out, that is ambiguous by nature [08:02am] stuartdouglas: but this would allow you to create a proxy that knows the type of it's injection point [08:02am] stuartdouglas: so if you have interfaces B and C that extend A [08:03am] stuartdouglas: and you call A.someMethod() [08:03am] alesj: kaboom? [08:03am] stuartdouglas: you can figure out wether to call the B or C interface [08:03am] stuartdouglas: as the proxy knows the type of the injection point [08:03am] alesj: how? [08:03am] alesj: ah, ok [08:03am] alesj: if the IP would be either B or C [08:03am] stuartdouglas: as long as the injection point was actually type B or C [08:03am] stuartdouglas: yea [08:04am] stuartdouglas: otherwise it's ambigous, so the user can't really complain if we pick a different one that what they wanted [08:04am] alesj: we need to then also bring in the ip type [08:04am] stuartdouglas: but 90% of the time it won't matter anyway, as the view interceptors are the same [08:04am] alesj: which is not there now [08:04am] stuartdouglas: yea, that is the point of resolveProxyForInjectionType [08:04am] alesj: which would kick in where? [08:04am] stuartdouglas: you call it just before you inject [08:05am] stuartdouglas: where you know the injection point type [08:05am] stuartdouglas: and it would return a proxy that has stored the injectionTargetType [08:05am] stuartdouglas: (or rather, a proxy with a handler that has stored the injection target type) [08:07am] alesj: we could just store/cache the handler? [08:08am] alesj: where in the code do we know that actual ip type, for this e-proxy? [08:09am] alesj: as i would suspect that code is bean-type agnostic [08:10am] stuartdouglas: alesj: that is in the actual injection code, and it is bean type agnosic, but you can just check if the bean is an instance of EnterpriseBeanInstance [08:10am] stuartdouglas: also we still have to relax the contract for SOR [08:11am] stuartdouglas: becuase even then they might not be injecting into an injection point that is a business interface [08:11am] rruss left the chat room. (Quit: Leaving.) [08:12am] alesj: stuartdouglas: adding EBI check to actual ip injection is ugly ... [08:12am] stuartdouglas: it should probably be in the bit where the BM actually creates a bean instance [08:13am] stuartdouglas: creates / gets a proxy for [08:16am] alesj: yup, sounds better [08:16am] stuartdouglas: actually this isn't going to work [08:16am] stuartdouglas: because at the moment we only have one client proxy per bean [08:17am] stuartdouglas: you would also need to change that to be one client proxy per bean / injection point type pair [08:17am] alesj: yeah, caching would probably screw this … right? [08:17am] alesj: yea [08:17am] stuartdouglas: all in all I would say that it would be best to just relax the contract on SOR for now [08:17am] stuartdouglas: because this requires pretty major changes [08:18am] stuartdouglas: to handle a really unusual corner case [08:18am] alesj: for SOR to do what? [08:18am] alesj: go out and try and guess the right stuff? [08:18am] stuartdouglas: yup [08:18am] stuartdouglas: because 99.9% of the time it will be fine [08:18am] stuartdouglas: and the 0.1% of the time it isn't it is easy for the user to work around [08:19am] stuartdouglas: for it to be a problem you need to have two difference views that inherit from the same base interface [08:19am] stuartdouglas: and one of the views has to have had it's view interceptor chain modified by the deployment descriptor [08:20am] stuartdouglas: I don't think anyone is really going to notice, and even if someone does it is to big a change for a point release anyway [08:20am] stuartdouglas: we can bump this to 1.1 and have another look at it then [08:21am] alesj1 joined the chat room. [08:21am] alesj left the chat room. (Read error: Connection reset by peer) [08:21am] alesj1: 1.2 or 2.0 [08:22am] stuartdouglas: oops 2.0 [08:22am] alesj1: [08:24am] alesj1: stuartdouglas: how does pmuir see this, reading his email just now [08:27am] stuartdouglas: I don't think he though it through to be honest [08:27am] alesj1: [08:27am] stuartdouglas: you can use current injection point to get the type, but not at the point that you actually need it [08:28am] alesj1: why not? [08:29am] alesj1: ah, the diff proxy per ip_type pair? [08:29am] stuartdouglas: the thing is the point where you need it is when you are actually injecting, so there is no point getting it from CurrentInjectionPoint [08:30am] alesj1: what would CIP return? [08:30am] alesj1: or where is CIP used? [08:32am] stuartdouglas: CIP just gets you the current injection point, so you could use it in the create() method to figure out the type of injection point [08:33am] stuartdouglas: but the would be wrong, as normal scoped beans can be injected into different injection points [08:33am] stuartdouglas: CIP is really just a think for @Dependent scoped beans [08:34am] mbg left the chat room. (Ping timeout: 260 seconds) [08:36am] alesj1: well, if CIP::type could be somehow pushed to code that invokes SOR::getBizIface [08:37am] alesj1: that could work [08:37am] alesj1: but that means we would need to change a bunch of things [08:39am] stuartdouglas: no it would not [08:39am] stuartdouglas: because that code is invoked at invocation time [08:39am] stuartdouglas: not at injection time [08:39am] stuartdouglas: CIP is only an injection time thing [08:40am] stuartdouglas: you need to create a new proxy that stores the CIP, which is basically what we were talking about above