Hey,
Jason made a good point. If you want to use a different invoker for your
container you currently have to provide a new container configuration and
also specify the new invoker in jboss.xml. This is too much configuration.
A better design might be as follows.
1. The ProxyFactory becomes an mbean.
2. EJB Containers deal with ProxyFactories, not invokers, so no more
<home-invoker> or <bean-invoker> configurations.
So, the code for the container on deployment would look as follows:
1. container looks up <home-proxy-factory> mbean in the registry. This xml
attribute can be overriden in jboss.xml and defaults to the RmiProxyFactory.
2. Casts the mbean to a ProxyFactory
3. calls: proxyFactory.bindProxies(jndiName, ...)
The MBEAN configuration of the ProxyFactory would look as follows. The
ProxyFactory contains information about what invoker to use. Also notice
that client interceptors are defined here as well. Really, only the proxy
factory cares about client interceptors. The IIOP Proxy Factory for
instance, will probably not deal with client interceptors because it will
probably be passing back a CORBA Object reference to the client rather than
a serialized Java Proxy class.
<mbean code="org.jboss.invocation.jrmp.server.RmiProxyFactory"
name="jboss:service=invoker,type=jrmp">
<attribute name="RMIObjectPort">4444</attribute>
<!--
<attribute name="invoker">jboss:service=invoker,type=jrmp</attribute>
<attribute name="clientInterceptors">
<home>
<interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</home>
<bean>
<interceptor>org.jboss.proxy.ejb.EntityInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</bean>
<list-entity>
<interceptor>org.jboss.proxy.ejb.ListEntityInterceptor</interceptor>
<interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
<interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
<interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
</list-entity>
</attribute>
</mbean>
The good thing about this is that everything is separated.
1. JRMPInvoker knows how to invoke on MBeans from an RMI request.
2. RmiProxyFactory knows how to create EJB proxies for RMI clients
3. standardjboss.xml knows how to configure the EJB container and does not
worry about how the container is invoked upon.
4. The EJB Container knows how to serve up MBean EJB requests. It doesn't
worry about proxy creation nor does it manage how requests are routed from
the client.
Let me know what you think and I'll implement it. (Well, eventually
implement it :)
Bill
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development