Hi David, No problems. The Proxy class is standard in JDK 1.3.x and up, check out the standard javadocs for the java.lang.reflect.Proxy and java.lang.reflect.InvocationHandler classes at Sun, etc.
Proxies don't actually implement interfaces per se, they intercept calls to the object they wrap, and decide what to do with them programatically inside of their InvocationHandler. In ECM, have a look at DefaultComponentFactory and ComponentProxyGenerator at http://cvs.apache.org/viewcvs.cgi/avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/. In these classes Serviceable components (which don't implement o.a.a.f.Component) are wrapped dynamically so they can be safely casted to Component by user code, without needing to implement Component themselves. Hope that helps. Cheers, Marcus On Fri, Aug 01, 2003 at 12:45:09PM -0400, David Kavanagh wrote: > Marcus, > Thanks. I guess I was just surprised and didn't find any documentation > to explain what was going on. I tried finding the code that created the > proxy and put it into the ServiceManager. What interface does the Proxy > implement? Could you give me a pointer to some docs or classes to look > at? Thanks! > > David > > Marcus Crafter wrote: > > >Hi David, > > > >IIRC ECM returns proxies to components, rather than the actual component > >instances themselves. This lets it do things like automatically handle > >deprecated or missing methods (like the Serviceable/Composable situation). > > > >Is there actually a problem that you're noticing, or were you just > >surprised > >to notice this ? :) > > > >The proxy should wrap the instantiated component and its invocation handler > >should orward all calls to the original instance implicitly. Is this > >happening? > > > >Cheers, > > > >Marcus > > > >On Fri, Aug 01, 2003 at 12:10:17PM -0400, David Kavanagh wrote: > > > > > >>I tried the dev list already... any ideas? > >> > >>I'm getting my GenericTaskManager stuff running under 2.1rc1 and ran > >>across a snag. I thought 2.1 was switching over to the whole Serviceable > >>interface. So, I make this action I wrote implement Serviceable and ask > >>the ServiceManager for a component that is defined in the cocoon.xconf > >>file (the GenericTaskManager) and I get some class back called > >>"$Proxy2"! So, that is an inner class with no package! > >>I look around the code and it looks like the ExcaliburComponentManger is > >>still being used which deals just with Components. Should I even try > >>asking the ServiceManager for components defined in the cocoon.xconf file? > >> > >>David > >> > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > > -- ..... ,,$$$$$$$$$, Marcus Crafter ;$' '$$$$: Computer Systems Engineer $: $$$$: ManageSoft GmbH $ o_)$$$: 82-84 Mainzer Landstrasse ;$, _/\ &&:' 60327 Frankfurt Germany ' /( &&& \_&&&&' &&&&. &&&&&&&: --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
