You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by mast <ma...@gmail.com> on 2009/05/27 14:38:30 UTC

SU file as a resource

Hi,

Is it possible to have an file in your su artifact and then get a hold of
the file from within your su classpath? Lets say that I place an file in my
resources folder within my su, is it possible to retrieve it from a java
class that is deployed within the same su e.g do they share the same
classpath?

The reason for this is that I dont like the ideá of placing this kind of
resources in the conf dir of servicemix.

BR
Mathias 
-- 
View this message in context: http://www.nabble.com/SU-file-as-a-resource-tp23741687p23741687.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: SU file as a resource

Posted by Ryan Moquin <fr...@gmail.com>.
Is there a way to do that from a global area?  So that you could have an
imported spring xml fragment that comes from one location such as the
SERVICEMIX_BASE/etc directory?  I've been trying to do that since it looks
like it gets added to the servicemix classpath, but I can't seem to import a
spring xml file from there, or even a properties file.

Unfortunately, some of the things that I had took advantage of with 3.4 are
hard to translate into 4.1 (probably means they weren't the best mechanisms
to be using in the first place).

Thanks for any ideas on how I might be able to accomplish that, or if there
is a way to do something similar.  The reason being, is that I have some
configuration that gets duplicated among several services that are in
different service units.  I want to be able to easily configure those
service units without have to manually change each one.

On Wed, May 27, 2009 at 9:35 AM, Gert Vanthienen
<ge...@gmail.com>wrote:

> Mathias,
>
> The easiest way is to use the Spring IO Resource class.  Just provide
> a getter/setter for a property of type
> org.springframework.core.io.Resource.  You can then use a
> "classpath:..." URI for injecting your resource, e.g. like the one you
> find in the http:soap-consumer example on
> http://servicemix.apache.org/servicemix-http-new-endpoints.html.
>
> Regards,
>
> Gert Vanthienen
> ------------------------
> Open Source SOA: http://fusesource.com
> Blog: http://gertvanthienen.blogspot.com/
>
>
>
> 2009/5/27 mast <ma...@gmail.com>:
> >
> > Hi,
> >
> > Is it possible to have an file in your su artifact and then get a hold of
> > the file from within your su classpath? Lets say that I place an file in
> my
> > resources folder within my su, is it possible to retrieve it from a java
> > class that is deployed within the same su e.g do they share the same
> > classpath?
> >
> > The reason for this is that I dont like the ideá of placing this kind of
> > resources in the conf dir of servicemix.
> >
> > BR
> > Mathias
> > --
> > View this message in context:
> http://www.nabble.com/SU-file-as-a-resource-tp23741687p23741687.html
> > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >
> >
>

Re: SU file as a resource

Posted by Gert Vanthienen <ge...@gmail.com>.
Mathias,

The easiest way is to use the Spring IO Resource class.  Just provide
a getter/setter for a property of type
org.springframework.core.io.Resource.  You can then use a
"classpath:..." URI for injecting your resource, e.g. like the one you
find in the http:soap-consumer example on
http://servicemix.apache.org/servicemix-http-new-endpoints.html.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/5/27 mast <ma...@gmail.com>:
>
> Hi,
>
> Is it possible to have an file in your su artifact and then get a hold of
> the file from within your su classpath? Lets say that I place an file in my
> resources folder within my su, is it possible to retrieve it from a java
> class that is deployed within the same su e.g do they share the same
> classpath?
>
> The reason for this is that I dont like the ideá of placing this kind of
> resources in the conf dir of servicemix.
>
> BR
> Mathias
> --
> View this message in context: http://www.nabble.com/SU-file-as-a-resource-tp23741687p23741687.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>