Dear JB,
Thank you so much for your replying. I tried your code but it had a problem
that AdminCommandsServiceMBean is an interface so I cannot call the method
listServiceAssemblies. 
Well, I have a solution like this but I don't know whether it's right? I'm
quite new with servicemix so could you please confirm my understanding from
it? 
                     ClientFactory cf = new ClientFactory();
                      SerivceMixClient smc = cf.createClient();
                      ComponentContext cc = smc.getContext();
                      ServiceEndpoint se = cc.getEndpoint();
                      QName service = se.getSericeName();
                      String seriveName  = service.toString();
The code above is only the seudo code. And the problem is that
ServiceMixClient, ComponentContext, ServiceEndpoint..are also interfaces. I
don't know whether I understand it in the correct way? And what should I do
to solve it?
My purpose is that I'm trying to supervise servicemix to know what service
is invoked or stopped in servicemix. And if there's any change, it has to
notify the user.
I'm looking forward to hearing from you. Thank you very much and best
regards,


Jean-Baptiste Onofré wrote:
> 
> Hi,
> 
> You can see the ant task in org.apache.servicemix.jbi.management.task.
> 
> Basicly, you can write a JMX client like this:
> 
> public static void main(String args[]) throws Exception {
>       String[] credentials = new String[]{ "smx", "smx" };
>       Map<String,Object> environment = new Hashmap<String,Object>();
>       environment.put(JMXConnector.CREDENTIALS, credentials);
>       JMXServiceURL url = new 
> JMSServiceURL("service:jmx:rmi:///jndi/rmi://location:1099" + 
> ManagementContext.DEFAULT_CONNECTOR_PATH);
>       JMXConnector connector = JMXConnectorFactory.connect(url, environment);
>       ObjectName adminName = 
> ManagementContext.getSystemObjectName(ManagementContext.DEFAULT_DOMAIN, 
> JBIContainer.DEFAULT_NAME, AdminCommandsServiceMBean.class);
>       AdminCommandsServiceMBean adminCommandsMBean = 
> MBeanServerInvocationHandler.newProxyInstance(connector.getMBeanServerConnection(),
>  
> adminName, AdminCommandsServiceMBean.class, true);
>       String result = adminCommandsMBean.listServiceAssemblies(null, null,
> null);
> }
> 
> This client list the service assemblies deployed into ServiceMix. You 
> can list service assemblies depending of the current state (first 
> argument of listServiceAssemblies() methods), linked to a component 
> (second argument), by name (third argument).
> 
> Regards
> JB
> 
> poplar wrote:
>> Dear all,
>> 
>> I'm very new with Servicemix and I'm learning to create its client to
>> supervise the services inside servicemix but I don't know how and where
>> to
>> start. How can I create servicemix client? Could you please give me some
>> hints? Any suggestion will be highly appreciated.
>> 
>> I'm looking forward to hearing from you soon.
>> Thanks so much and best regards,
> 
> 

-- 
View this message in context: 
http://www.nabble.com/supervise-servicemix-service-tp23307893p23311295.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to