You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Rniamo <rn...@gmail.com> on 2010/09/26 12:13:18 UTC
URI and resources
Hi,
Why a URI is used to parse resources properties (new://Resource,
new://Connector...)?
I use a connector with a personnal provider "my.package#MyConnector" and the
URISupport.parseParameters() uses only URI query and removes the fragment.
I know it can work using "my.package:MyConnector" but is it normal?
Rniamo
Re: URI and resources
Posted by David Blevins <da...@visi.com>.
On Oct 13, 2010, at 11:24 PM, Rniamo wrote:
> Replacing '#' by ':' before calling URISupport.parseParameters() is not
> enough? Well if it is not as easy as this i think it is not important.
This worked:
https://issues.apache.org/jira/browse/OPENEJB-1389
Automatically encode # in provider attribute of "new://Resource?provider=org.acme#FooResource" URIs
Slipped in a little regex to munge the string before turning it into a URI.
value = value.replaceFirst("(provider=[^#=&]+)#", "$1%23");
-David
>
>
> On Thu, Oct 14, 2010 at 8:10 AM, David Blevins <da...@visi.com>wrote:
>
>>
>> On Sep 26, 2010, at 3:13 AM, Rniamo wrote:
>>
>>>
>>> Why a URI is used to parse resources properties (new://Resource,
>>> new://Connector...)?
>>>
>>> I use a connector with a personnal provider "my.package#MyConnector" and
>> the
>>> URISupport.parseParameters() uses only URI query and removes the
>> fragment.
>>>
>>> I know it can work using "my.package:MyConnector" but is it normal?
>>
>> The URI idea came from ActiveMQ who uses it pretty successfully for jamming
>> lots of info on one line. The unfortunate clash is that the
>> 'my.package#MyConnector' syntax was done years before we added the
>> properties support and corresponding "new://Resource" URI. I agree, it's a
>> pain to have to encode the #.
>>
>> Ideally, we wouldn't need the path part of the could be omitted and only
>> required if there was another service-jar.xml service with the same name.
>> There are a couple related changes that would have to happen to make that
>> work.
>>
>> If you feel like hacking, hop on the dev list. Happy to walk you through
>> the code!
>>
>>
>> -David
>>
>>
Re: URI and resources
Posted by Rniamo <rn...@gmail.com>.
Replacing '#' by ':' before calling URISupport.parseParameters() is not
enough? Well if it is not as easy as this i think it is not important.
Thanks for your answer.
- Rniamo
On Thu, Oct 14, 2010 at 8:10 AM, David Blevins <da...@visi.com>wrote:
>
> On Sep 26, 2010, at 3:13 AM, Rniamo wrote:
>
> >
> > Why a URI is used to parse resources properties (new://Resource,
> > new://Connector...)?
> >
> > I use a connector with a personnal provider "my.package#MyConnector" and
> the
> > URISupport.parseParameters() uses only URI query and removes the
> fragment.
> >
> > I know it can work using "my.package:MyConnector" but is it normal?
>
> The URI idea came from ActiveMQ who uses it pretty successfully for jamming
> lots of info on one line. The unfortunate clash is that the
> 'my.package#MyConnector' syntax was done years before we added the
> properties support and corresponding "new://Resource" URI. I agree, it's a
> pain to have to encode the #.
>
> Ideally, we wouldn't need the path part of the could be omitted and only
> required if there was another service-jar.xml service with the same name.
> There are a couple related changes that would have to happen to make that
> work.
>
> If you feel like hacking, hop on the dev list. Happy to walk you through
> the code!
>
>
> -David
>
>
Re: URI and resources
Posted by David Blevins <da...@visi.com>.
On Sep 26, 2010, at 3:13 AM, Rniamo wrote:
>
> Why a URI is used to parse resources properties (new://Resource,
> new://Connector...)?
>
> I use a connector with a personnal provider "my.package#MyConnector" and the
> URISupport.parseParameters() uses only URI query and removes the fragment.
>
> I know it can work using "my.package:MyConnector" but is it normal?
The URI idea came from ActiveMQ who uses it pretty successfully for jamming lots of info on one line. The unfortunate clash is that the 'my.package#MyConnector' syntax was done years before we added the properties support and corresponding "new://Resource" URI. I agree, it's a pain to have to encode the #.
Ideally, we wouldn't need the path part of the could be omitted and only required if there was another service-jar.xml service with the same name. There are a couple related changes that would have to happen to make that work.
If you feel like hacking, hop on the dev list. Happy to walk you through the code!
-David