It seems that remoting a jmx client is not so easy. All classes involved must be serializable or mbeans i think. And this is not the case at all (the client has a pointer to the container, the DefaultDestination has a pointer to the client, etc..) So if we want to go that way, we have to provide wrapper for all non serializable classes involved in the client api.
So i will let the remote stuff aside for the moment. It makes me thing that the first draft of the client api James put in svn was simpler and easier use in a remote mode. http://incubator.apache.org/servicemix/maven/servicemix-core/apidocs/org/apache/servicemix/client/Client.html http://incubator.apache.org/servicemix/maven/servicemix-core/apidocs/org/apache/servicemix/client/Destination.html Should we revert back to it ? Cheers, Guillaume Nodet On 7/25/06, James Strachan <[EMAIL PROTECTED]> wrote:
On 7/25/06, Guillaume Nodet <[EMAIL PROTECTED]> wrote: > I do not really see the point of having several different mechanism to > access the same objects. > If JMX is easier to use, let's use it. > This will also allow us to have a remote client easily, without relying on a > clustered flow. > > We could define a simple helper beans (and/or a factory bean) > that would return the ClientFactory given a MBeanServerConnection (which can > be local or remote). > > public class ClientFactoryHelper { > public ClientFactory getClientFactory(MBeanServerConnection server) { > ... > } > // in case the container does not have the default name > public ClientFactory getClientFactory(MBeanServerConnection server, String > containerName) { > ... > } > public ClientFactory getClientFactory(String host, String port) { > ... > } > // in case the container does not have the default name > public ClientFactory getClientFactory(String host, String port, String > container) { > ... > } > } > > /** > * We may need a way to authenticate the user using login/password > * so keep a level of indirection using a factory > */ > public interface ClientFactory { > public ServiceMixClient createClient(); > // public ServiceMixClient createClient(String user, String password); > } > > We just need to expose the implementation of the ClientFactory in the mbean > server. > Any comments ? Yeah that'll work (and do the remoting piece too). Another approach is just to configure the ClientFactory as a POJO in the JNDI provider thats used by the server - such as in Tomcat or Jetty or some of the other J2EE servers. Either sound good to me; using a container-specific JNDI provider or JMX -- James ------- http://radio.weblogs.com/0112098/