Hi Peter,
> Peter Donald wrote:
>
> I would like to see it as soon as you are ready. A couple have
> been created
> before (Neeme you still got one?). But as of yet no one has added
> in support
> for jdk1.2 in fortress/ecm which is what I want to see it for ;) If you
> simultaeously add support for that then I would very much appreciate it ;)
well, I am by no means an expert in this field, so I am not sure what issues
might be involved in adapting what I have to the jdk1.2, if any. What I did
was pretty much straightforward: for a given work interface
public interface WorkIf
{
public static final String ROLE = WorkIf.class.getName();
public Object doMethod(Object arg)
throws Exception;
}
and a component
public class Foo
implements WorkIf, LogEnabled, Configurable, Disposable
{
...
public Object doMethod(Object arg)
throws Exception
{
...
}
}
my BCELWrapperGenerator will simply create a
public final class Foo$BCELWrapper
implements WorkIf
{
private final Foo m_wrapped;
public Foo$BCELWrapper(Foo classToWrap)
{
m_wrapped = classToWrap;
}
public Object doMethod()
throws Exception
{
return m_wrapped.doMethod();
}
}
wrapping the given component and delegating all method calls to the wrapped
component. I then wrote a WrapperObjectFactory as a replacement for the
ProxyObjectFactory in the org.apache.avalon.fortress.impl.handler package
that for a given component instance foo creates a Class instance
fooWrapperClass of Foo$BCELWrapper and calls
fooWrapperClass.getConstructor( new Class[] {
foo.getClass() } ).newInstance( new Object[] { foo } )
to create an instance of the component wrapper. A preliminary inspection of
the javadocs seems to indicate that this might work even in jdk1.2.
Anyways, if you want to see it, you can have it. Just give me a note.
Regards,
Olaf
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]