URI and resources

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

URI and resources

rniamo
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
Reply | Threaded
Open this post in threaded view
|

Re: URI and resources

dblevins
Administrator

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

Reply | Threaded
Open this post in threaded view
|

Re: URI and resources

rniamo
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 <[hidden email]>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
>
>
Reply | Threaded
Open this post in threaded view
|

Re: URI and resources

dblevins
Administrator

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 <[hidden email]>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
>>
>>