You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Ruwan Linton <ru...@gmail.com> on 2007/09/14 07:32:23 UTC

Hot deployment and hot update support of mediators

Hi all,

I have done a MediatorDeployer to support hot deployment of mediators
(r575533) which basically is an Axis2 Deployer which is keeping an eye on a
specified folder and gives the control to the deploy method on any file
change of specified extensions.

I have put the folder as repository/mediators for mediator lookup and the
extension as .jar, which is configurable through the axis2.xml in the
repository/conf.

This implementation does not use the service providers concept because it is
only supported by the sun jdk. Instead I read the same file
(META-INF/services/org.apache.synapse.config.xml.MediatorFactory) in the
deployer to find the factory implementation and Class.forName that factory,
so that all the required classes will be loaded. Then the deployer will
register the factory implementation with the MediatorFactoryFinder. Did the
same for serializer as well.

If a particular jar contains several mediators then you have to specify the
factory implementations separated by line breaks in the
org.apache.synapse.config.xml.MediatorFactory file. As usual it is required
to present this file and at least one entry should be there and Serializer
is optional.

Any comments .....

Thanks,
Ruwan

-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: Hot deployment and hot update support of mediators

Posted by Ruwan Linton <ru...@gmail.com>.
On 9/17/07, Deepal jayasinghe <de...@gmail.com> wrote:
>
>
> > Asankha,
> >
> > We can do this by removing the deployer entry from the axis2 xml (may
> > be we can keep it commented so that users has to just uncomment the
> > config line in the axis2 xml to enable it). Or do we have to provide a
> > configuration to start or stop the deployer in the Synapse
> > configuration???
> >
> > BTW: I saw the POJO deployer configuration was there already in the
> > axis2.xml. Are we using that???? Any how that POJO deployer will start
> > a new thread. If this is not necessary we can remove that too.
> Nope, none of the deployers in Axis2 start threads . In Axis2 there is a
> main thread who listen to a particular directory (or directories )
> depending on the changes in those directories Axis2 will call the right
> deloyer. Then it is up to the deloyer to make something  (service ,
> module etc...) out from the file given by Axis2 . Just having deployer
> entry in axis2.xml will not do anything.


Cool. Anyway I have removed the pojo deployer (it is not necessary for
Synapse) and commented the MediatorDeployer so that any one interested on
hot deployment can uncomment that entry before starting synapse and enable
the hot deployment of mediators

Thanks,
Ruwan


Thanks
> Deepal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: Hot deployment and hot update support of mediators

Posted by Deepal jayasinghe <de...@gmail.com>.
> Asankha,
>
> We can do this by removing the deployer entry from the axis2 xml (may
> be we can keep it commented so that users has to just uncomment the
> config line in the axis2 xml to enable it). Or do we have to provide a
> configuration to start or stop the deployer in the Synapse
> configuration???
>
> BTW: I saw the POJO deployer configuration was there already in the
> axis2.xml. Are we using that???? Any how that POJO deployer will start
> a new thread. If this is not necessary we can remove that too.
Nope, none of the deployers in Axis2 start threads . In Axis2 there is a
main thread who listen to a particular directory (or directories )
depending on the changes in those directories Axis2 will call the right
deloyer. Then it is up to the deloyer to make something  (service ,
module etc...) out from the file given by Axis2 . Just having deployer
entry in axis2.xml will not do anything.

Thanks
Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: Hot deployment and hot update support of mediators

Posted by Ruwan Linton <ru...@gmail.com>.
Asankha,

We can do this by removing the deployer entry from the axis2 xml (may be we
can keep it commented so that users has to just uncomment the config line in
the axis2 xml to enable it). Or do we have to provide a configuration to
start or stop the deployer in the Synapse configuration???

BTW: I saw the POJO deployer configuration was there already in the
axis2.xml. Are we using that???? Any how that POJO deployer will start a new
thread. If this is not necessary we can remove that too.

Thanks,
Ruwan.

On 9/16/07, Asankha C. Perera <as...@wso2.com> wrote:
>
> Ruwan
>
> Though this is something really good.. I am a bit concerned as it seems
> to be a JDK provider independent implementation of the Service Provider
> model. The problem I see is in polling a directory for files to appear
> (I am ok doing this one time during startup).. thus I think it should be
> turned off by default at Synapse and we should provide the instructions
> to turn it on. While off it should not poll the directory or have any
> new thread started.
>
> thanks
> asankha
>
> Ruwan Linton wrote:
> > Hi all,
> >
> > I have done a MediatorDeployer to support hot deployment of mediators
> > (r575533) which basically is an Axis2 Deployer which is keeping an eye
> > on a specified folder and gives the control to the deploy method on
> > any file change of specified extensions.
> >
> > I have put the folder as repository/mediators for mediator lookup and
> > the extension as .jar, which is configurable through the axis2.xml in
> > the repository/conf.
> >
> > This implementation does not use the service providers concept because
> > it is only supported by the sun jdk. Instead I read the same file
> > (META-INF/services/org.apache.synapse.config.xml.MediatorFactory) in
> > the deployer to find the factory implementation and Class.forName that
> > factory, so that all the required classes will be loaded. Then the
> > deployer will register the factory implementation with the
> > MediatorFactoryFinder. Did the same for serializer as well.
> >
> > If a particular jar contains several mediators then you have to
> > specify the factory implementations separated by line breaks in the
> > org.apache.synapse.config.xml.MediatorFactory file. As usual it is
> > required to present this file and at least one entry should be there
> > and Serializer is optional.
> >
> > Any comments .....
> >
> > Thanks,
> > Ruwan
> >
> > --
> > Ruwan Linton
> > http://www.wso2.org - "Oxygenating the Web Services Platform"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"

Re: Hot deployment and hot update support of mediators

Posted by "Asankha C. Perera" <as...@wso2.com>.
Ruwan

Though this is something really good.. I am a bit concerned as it seems 
to be a JDK provider independent implementation of the Service Provider 
model. The problem I see is in polling a directory for files to appear 
(I am ok doing this one time during startup).. thus I think it should be 
turned off by default at Synapse and we should provide the instructions 
to turn it on. While off it should not poll the directory or have any 
new thread started.

thanks
asankha

Ruwan Linton wrote:
> Hi all,
>
> I have done a MediatorDeployer to support hot deployment of mediators 
> (r575533) which basically is an Axis2 Deployer which is keeping an eye 
> on a specified folder and gives the control to the deploy method on 
> any file change of specified extensions.
>
> I have put the folder as repository/mediators for mediator lookup and 
> the extension as .jar, which is configurable through the axis2.xml in 
> the repository/conf.
>
> This implementation does not use the service providers concept because 
> it is only supported by the sun jdk. Instead I read the same file 
> (META-INF/services/org.apache.synapse.config.xml.MediatorFactory) in 
> the deployer to find the factory implementation and Class.forName that 
> factory, so that all the required classes will be loaded. Then the 
> deployer will register the factory implementation with the 
> MediatorFactoryFinder. Did the same for serializer as well.
>
> If a particular jar contains several mediators then you have to 
> specify the factory implementations separated by line breaks in the 
> org.apache.synapse.config.xml.MediatorFactory file. As usual it is 
> required to present this file and at least one entry should be there 
> and Serializer is optional.
>
> Any comments .....
>
> Thanks,
> Ruwan
>
> -- 
> Ruwan Linton
> http://www.wso2.org - "Oxygenating the Web Services Platform" 

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org