You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Vikas <vi...@infravio.com> on 2005/12/28 06:28:37 UTC
Changes to directory-structure
Hi,
Currently we have the sampleMediators folder under 'src'.
The problem is that while creating the Synapse-Incubating-M1-RC1-SNAPSHOT.jar the sampleMediator folder ends up inside it.
When we make a servicemediator [mediator implemented as an AXIS2 service], it is supposed to be put into the services folder under synapse-repository.
I tried working with the DeprecationMediator, I took the aar and placed it in the services folder.
But because of the same classes were already present in the Synapse-Incubating-M1-RC1-SNAPSHOT.jar they get picked from there.
Incidentally the META-INF, present under deprecation was not picked up when the jar was packed and I ended up with an NPE when trying to access a resource placed in it.
This is not supposed to happen [or is it ??]
*** I propose that we ***
1) Move the sampleMediators folder from under 'src' to the main-level itself
or
2) Make a provision for excluding the sampleMediators from ending up in the Synapse-Incubating-M1-RC1-SNAPSHOT.jar
Any thoughts??
~Vikas
Re: Changes to directory-structure
Posted by Saminda Abeyruwan <sa...@gmail.com>.
On 12/28/05, Vikas <vi...@infravio.com> wrote:
>
> Hi,
>
> Currently we have the sampleMediators folder under 'src'.
>
> The problem is that while creating the
> Synapse-Incubating-M1-RC1-SNAPSHOT.jar the sampleMediator folder ends up
> inside it.
> When we make a servicemediator [mediator implemented as an AXIS2 service],
> it is supposed to be put into the services folder under synapse-repository.
>
> I tried working with the DeprecationMediator, I took the aar and placed it
> in the services folder.
> But because of the same classes were already present in the
> Synapse-Incubating-M1-RC1-SNAPSHOT.jar they get picked from there.
> Incidentally the META-INF, present under deprecation was not picked up
> when the jar was packed and I ended up with an NPE when trying to access
> a resource placed in it.
>
This is exactly why we have introduced EnvironmentAware.getClassLoader().
When you write a mediator as an axis2 service, you need to implement it with
Mediator interface.
If that mediator wants any resources {ex: properties.file }, make available
it in the .aar, then implement EnvironmentAware interface. Then the
mediator will get hold of the correct classloader and current instance of
the SynapseEnvironment.
The above approach will work, even it the resources do not present in main
jar. But, what we include in main Synapse jar is the core of Synapse. So we
should remove samples classes from it. But, this will lead considering
what we should include in Synapse jar.
> This is not supposed to happen [or is it ??]
>
> *** I propose that we ***
>
> 1) Move the sampleMediators folder from under 'src' to the main-level
> itself
>
So sample will become standalone. Are we thinking of modularizing Synapse.
If so pls wait till post M1.
or
>
> 2) Make a provision for excluding the sampleMediators from ending up in
> the Synapse-Incubating-M1-RC1-SNAPSHOT.jar
>
We should have a clear picture of what we include in main jar btw.
Saminda
Any thoughts??
>
> ~Vikas
>