Start mule in new thread and stop it programmatically

View: New views
4 Messages — Rating Filter:   Alert me  

Start mule in new thread and stop it programmatically

by techi_amol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

Here is my requirement
1) Start mule 1.4.x in separate thread from my java application.
2) Be able to stop the the server from my java application, and re-start it with a new config file.

I read the documentation and found the following code to start it in a new thread
//create a new server and configure it with two config files
MuleServer server = new MuleServer("mule-config1.xml");
//Start the server. The boolean argument determines if the server should start
//in a new thread or use the current thread
server.start(false);

But how do i stop this server. The MuleServer class has function to stop this. Please help me out.



Re: Start mule in new thread and stop it programmatically

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can restart it via jmx. It will also pick up changes to the config file this way.

Andrew

On Fri, May 16, 2008 at 3:56 PM, techi_amol <techi_amol@...> wrote:

Hi All,

Here is my requirement
1) Start mule 1.4.x in separate thread from my java application.
2) Be able to stop the the server from my java application, and re-start it
with a new config file.

I read the documentation and found the following code to start it in a new
thread
//create a new server and configure it with two config files
MuleServer server = new MuleServer("mule-config1.xml");
//Start the server. The boolean argument determines if the server should
start
//in a new thread or use the current thread
server.start(false);

But how do i stop this server. The MuleServer class has function to stop
this. Please help me out.



--
View this message in context: http://www.nabble.com/Start-mule-in-new-thread-and-stop-it-programmatically-tp17282993p17282993.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: Start mule in new thread and stop it programmatically

by techi_amol :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there some link, documentation you can point me to where we describe how to do it via JMX.
I have very basic knowledge of JMX.

Andrew Perepelytsya wrote:
You can restart it via jmx. It will also pick up changes to the config file
this way.

Andrew

On Fri, May 16, 2008 at 3:56 PM, techi_amol <techi_amol@yahoo.com> wrote:

>
> Hi All,
>
> Here is my requirement
> 1) Start mule 1.4.x in separate thread from my java application.
> 2) Be able to stop the the server from my java application, and re-start it
> with a new config file.
>
> I read the documentation and found the following code to start it in a new
> thread
> //create a new server and configure it with two config files
> MuleServer server = new MuleServer("mule-config1.xml");
> //Start the server. The boolean argument determines if the server should
> start
> //in a new thread or use the current thread
> server.start(false);
>
> But how do i stop this server. The MuleServer class has function to stop
> this. Please help me out.
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Start-mule-in-new-thread-and-stop-it-programmatically-tp17282993p17282993.html
> Sent from the Mule - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Re: Start mule in new thread and stop it programmatically

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Check http://mule.mulesource.org/jira/browse/MULE-379

Everything else is just standard jmx communication.

Andrew

On Fri, May 16, 2008 at 5:07 PM, techi_amol <techi_amol@...> wrote:

Is there some link, documentation you can point me to where we describe how
to do it via JMX.
I have very basic knowledge of JMX.


Andrew Perepelytsya wrote:
>
> You can restart it via jmx. It will also pick up changes to the config
> file
> this way.
>
> Andrew
>
> On Fri, May 16, 2008 at 3:56 PM, techi_amol <techi_amol@...> wrote:
>
>>
>> Hi All,
>>
>> Here is my requirement
>> 1) Start mule 1.4.x in separate thread from my java application.
>> 2) Be able to stop the the server from my java application, and re-start
>> it
>> with a new config file.
>>
>> I read the documentation and found the following code to start it in a
>> new
>> thread
>> //create a new server and configure it with two config files
>> MuleServer server = new MuleServer("mule-config1.xml");
>> //Start the server. The boolean argument determines if the server should
>> start
>> //in a new thread or use the current thread
>> server.start(false);
>>
>> But how do i stop this server. The MuleServer class has function to stop
>> this. Please help me out.
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Start-mule-in-new-thread-and-stop-it-programmatically-tp17282993p17282993.html
>> Sent from the Mule - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Start-mule-in-new-thread-and-stop-it-programmatically-tp17282993p17284290.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email