You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by poplar <du...@yahoo.com> on 2009/04/30 05:25:40 UTC
supervise servicemix service
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-tp23307893p23307893.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: supervise servicemix service
Posted by poplar <du...@yahoo.com>.
And by the way, I wonder how can I get the current status of a particular
service in servicemix? I tried to looking for from the api of servicemix but
I didn't see.
Thanks so much and best regards,
poplar wrote:
>
> Dear JB,
> I'm using apache-servicemix-3.3. And I added External Jars
> "servicemix-core-3.3.jar" already. I'm coding by using Eclipse.
>
> Regards,
> Poplar
>
>
> Jean-Baptiste Onofré wrote:
>>
>> I think that you haven't all required dependencies to compile. You need
>> the servicemix-core jar (that provide the LifeCycleMBean). Do you use
>> maven to build your client code ?
>> Warning, the sample that I have sent to you is valid for SMX3. Do you
>> use SMX4 or SMX3 ?
>>
>> Regards
>> JB
>>
>> poplar wrote:
>>> Dear JB,
>>> The error is that:
>>> "The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
>>> indirectly referenced from required .class files". I'm not sure what it
>>> is,
>>> I thought because of calling the method from interface :(
>>>
>>>
>>> Jean-Baptiste Onofré wrote:
>>>> Hi,
>>>>
>>>> I don't understand, you can call method on interface (that's the
>>>> purpose).
>>>>
>>>> Could you provide the error that you have while compiling the code ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> poplar wrote:
>>>>> 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,
>>>>
>>> The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
>>> indirectly referenced from required .class files
>>
>>
>
>
--
View this message in context: http://www.nabble.com/supervise-servicemix-service-tp23307893p23313328.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: supervise servicemix service
Posted by poplar <du...@yahoo.com>.
Dear JB,
I'm using apache-servicemix-3.3. And I added External Jars
"servicemix-core-3.3.jar" already. I'm coding by using Eclipse.
Regards,
Poplar
Jean-Baptiste Onofré wrote:
>
> I think that you haven't all required dependencies to compile. You need
> the servicemix-core jar (that provide the LifeCycleMBean). Do you use
> maven to build your client code ?
> Warning, the sample that I have sent to you is valid for SMX3. Do you
> use SMX4 or SMX3 ?
>
> Regards
> JB
>
> poplar wrote:
>> Dear JB,
>> The error is that:
>> "The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
>> indirectly referenced from required .class files". I'm not sure what it
>> is,
>> I thought because of calling the method from interface :(
>>
>>
>> Jean-Baptiste Onofré wrote:
>>> Hi,
>>>
>>> I don't understand, you can call method on interface (that's the
>>> purpose).
>>>
>>> Could you provide the error that you have while compiling the code ?
>>>
>>> Regards
>>> JB
>>>
>>> poplar wrote:
>>>> 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,
>>>
>> The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
>> indirectly referenced from required .class files
>
>
--
View this message in context: http://www.nabble.com/supervise-servicemix-service-tp23307893p23313011.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: supervise servicemix service
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I think that you haven't all required dependencies to compile. You need
the servicemix-core jar (that provide the LifeCycleMBean). Do you use
maven to build your client code ?
Warning, the sample that I have sent to you is valid for SMX3. Do you
use SMX4 or SMX3 ?
Regards
JB
poplar wrote:
> Dear JB,
> The error is that:
> "The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
> indirectly referenced from required .class files". I'm not sure what it is,
> I thought because of calling the method from interface :(
>
>
> Jean-Baptiste Onofré wrote:
>> Hi,
>>
>> I don't understand, you can call method on interface (that's the purpose).
>>
>> Could you provide the error that you have while compiling the code ?
>>
>> Regards
>> JB
>>
>> poplar wrote:
>>> 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,
>>
> The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
> indirectly referenced from required .class files
Re: supervise servicemix service
Posted by poplar <du...@yahoo.com>.
Dear JB,
The error is that:
"The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
indirectly referenced from required .class files". I'm not sure what it is,
I thought because of calling the method from interface :(
Jean-Baptiste Onofré wrote:
>
> Hi,
>
> I don't understand, you can call method on interface (that's the purpose).
>
> Could you provide the error that you have while compiling the code ?
>
> Regards
> JB
>
> poplar wrote:
>> 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,
>>>
>>
>
>
The type javax.jbi.management.LifeCycleMBean cannot be resolved. It is
indirectly referenced from required .class files
--
View this message in context: http://www.nabble.com/supervise-servicemix-service-tp23307893p23312730.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: supervise servicemix service
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
I don't understand, you can call method on interface (that's the purpose).
Could you provide the error that you have while compiling the code ?
Regards
JB
poplar wrote:
> 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,
>>
>
Re: supervise servicemix service
Posted by poplar <du...@yahoo.com>.
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.
Re: supervise servicemix service
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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,