Mapped Name for ejbs

View: New views
10 Messages — Rating Filter:   Alert me  

Mapped Name for ejbs

by manucet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
     I was looking for a way to get the ejb3 beans registered in jndi
under the name a user provides in the mappedName attribute of the
@Stateless ,@Stateful annotations . One way that David told me to give
custom jndi names was to set the jndi-name as deployment-id via the
jndi name configuration property and then give custom deployment ids.
However suppose the user wants a way to set a custom mappedName in the
annotation and that should be the jndi name. On looking at the code I
find that we are not processing for the mappedName. If this is so then
I think that we should be processing the mapped name so that a user
can also specify that as a part of auto created deployment ids like
shown below.

eg:
openejb.jndiname.format={deploymentId}

openejb.deploymentId.format={mappedName}

regards
Manu

Re: Mapped Name for ejbs

by David Blevins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 3, 2008, at 1:32 AM, Manu George wrote:

> Hi,
>     I was looking for a way to get the ejb3 beans registered in jndi
> under the name a user provides in the mappedName attribute of the
> @Stateless ,@Stateful annotations . One way that David told me to give
> custom jndi names was to set the jndi-name as deployment-id via the
> jndi name configuration property and then give custom deployment ids.
> However suppose the user wants a way to set a custom mappedName in the
> annotation and that should be the jndi name. On looking at the code I
> find that we are not processing for the mappedName. If this is so then
> I think that we should be processing the mapped name so that a user
> can also specify that as a part of auto created deployment ids like
> shown below.
>
> eg:
> openejb.jndiname.format={deploymentId}
>
> openejb.deploymentId.format={mappedName}

I wonder if we shouldn't just cut out the middle man and let the  
mappedName be used as a jndiname format.

-David


Re: Mapped Name for ejbs

by manucet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes makes perfect sense.

On Thu, Jul 10, 2008 at 11:34 AM, David Blevins <david.blevins@...> wrote:

>
> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>
>> Hi,
>>    I was looking for a way to get the ejb3 beans registered in jndi
>> under the name a user provides in the mappedName attribute of the
>> @Stateless ,@Stateful annotations . One way that David told me to give
>> custom jndi names was to set the jndi-name as deployment-id via the
>> jndi name configuration property and then give custom deployment ids.
>> However suppose the user wants a way to set a custom mappedName in the
>> annotation and that should be the jndi name. On looking at the code I
>> find that we are not processing for the mappedName. If this is so then
>> I think that we should be processing the mapped name so that a user
>> can also specify that as a part of auto created deployment ids like
>> shown below.
>>
>> eg:
>> openejb.jndiname.format={deploymentId}
>>
>> openejb.deploymentId.format={mappedName}
>
> I wonder if we shouldn't just cut out the middle man and let the mappedName
> be used as a jndiname format.
>
> -David
>
>

Re: Mapped Name for ejbs

by Dain Sundstrom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 9, 2008, at 11:04 PM, David Blevins wrote:

>
> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>
>> Hi,
>>    I was looking for a way to get the ejb3 beans registered in jndi
>> under the name a user provides in the mappedName attribute of the
>> @Stateless ,@Stateful annotations . One way that David told me to  
>> give
>> custom jndi names was to set the jndi-name as deployment-id via the
>> jndi name configuration property and then give custom deployment ids.
>> However suppose the user wants a way to set a custom mappedName in  
>> the
>> annotation and that should be the jndi name. On looking at the code I
>> find that we are not processing for the mappedName. If this is so  
>> then
>> I think that we should be processing the mapped name so that a user
>> can also specify that as a part of auto created deployment ids like
>> shown below.
>>
>> eg:
>> openejb.jndiname.format={deploymentId}
>>
>> openejb.deploymentId.format={mappedName}
>
> I wonder if we shouldn't just cut out the middle man and let the  
> mappedName be used as a jndiname format.

So I could have an annotation like  
@Stateless(mappedName="{deploymenId}/Whatever")?

Not sure what you are suggesting,

-dain


Re: Mapped Name for ejbs

by David Blevins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:

> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>
>>
>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>
>>> Hi,
>>>   I was looking for a way to get the ejb3 beans registered in jndi
>>> under the name a user provides in the mappedName attribute of the
>>> @Stateless ,@Stateful annotations . One way that David told me to  
>>> give
>>> custom jndi names was to set the jndi-name as deployment-id via the
>>> jndi name configuration property and then give custom deployment  
>>> ids.
>>> However suppose the user wants a way to set a custom mappedName in  
>>> the
>>> annotation and that should be the jndi name. On looking at the  
>>> code I
>>> find that we are not processing for the mappedName. If this is so  
>>> then
>>> I think that we should be processing the mapped name so that a user
>>> can also specify that as a part of auto created deployment ids like
>>> shown below.
>>>
>>> eg:
>>> openejb.jndiname.format={deploymentId}
>>>
>>> openejb.deploymentId.format={mappedName}
>>
>> I wonder if we shouldn't just cut out the middle man and let the  
>> mappedName be used as a jndiname format.
>
> So I could have an annotation like  
> @Stateless(mappedName="{deploymenId}/Whatever")?

Right, something like that.

Also possible:

@Stateless(mappedName="{interfaceClass}")
@Stateless(mappedName="{ejbName}/{interfaceClass}")

etc.

-David


Re: Mapped Name for ejbs

by Dain Sundstrom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 10, 2008, at 2:26 PM, David Blevins wrote:

> On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:
>
>> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>>
>>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>>
>>>> Hi,
>>>>  I was looking for a way to get the ejb3 beans registered in jndi
>>>> under the name a user provides in the mappedName attribute of the
>>>> @Stateless ,@Stateful annotations . One way that David told me to  
>>>> give
>>>> custom jndi names was to set the jndi-name as deployment-id via the
>>>> jndi name configuration property and then give custom deployment  
>>>> ids.
>>>> However suppose the user wants a way to set a custom mappedName  
>>>> in the
>>>> annotation and that should be the jndi name. On looking at the  
>>>> code I
>>>> find that we are not processing for the mappedName. If this is so  
>>>> then
>>>> I think that we should be processing the mapped name so that a user
>>>> can also specify that as a part of auto created deployment ids like
>>>> shown below.
>>>>
>>>> eg:
>>>> openejb.jndiname.format={deploymentId}
>>>>
>>>> openejb.deploymentId.format={mappedName}
>>>
>>> I wonder if we shouldn't just cut out the middle man and let the  
>>> mappedName be used as a jndiname format.
>>
>> So I could have an annotation like  
>> @Stateless(mappedName="{deploymenId}/Whatever")?
>
> Right, something like that.
>
> Also possible:
>
> @Stateless(mappedName="{interfaceClass}")
> @Stateless(mappedName="{ejbName}/{interfaceClass}")

That's cool.  Is this an override for the current settings or in  
addition to the current settings?

-dain

Re: Mapped Name for ejbs

by David Blevins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 10, 2008, at 10:35 PM, Dain Sundstrom wrote:

> On Jul 10, 2008, at 2:26 PM, David Blevins wrote:
>
>> On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:
>>
>>> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>>>
>>>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>>>
>>>>> Hi,
>>>>> I was looking for a way to get the ejb3 beans registered in jndi
>>>>> under the name a user provides in the mappedName attribute of the
>>>>> @Stateless ,@Stateful annotations . One way that David told me  
>>>>> to give
>>>>> custom jndi names was to set the jndi-name as deployment-id via  
>>>>> the
>>>>> jndi name configuration property and then give custom deployment  
>>>>> ids.
>>>>> However suppose the user wants a way to set a custom mappedName  
>>>>> in the
>>>>> annotation and that should be the jndi name. On looking at the  
>>>>> code I
>>>>> find that we are not processing for the mappedName. If this is  
>>>>> so then
>>>>> I think that we should be processing the mapped name so that a  
>>>>> user
>>>>> can also specify that as a part of auto created deployment ids  
>>>>> like
>>>>> shown below.
>>>>>
>>>>> eg:
>>>>> openejb.jndiname.format={deploymentId}
>>>>>
>>>>> openejb.deploymentId.format={mappedName}
>>>>
>>>> I wonder if we shouldn't just cut out the middle man and let the  
>>>> mappedName be used as a jndiname format.
>>>
>>> So I could have an annotation like  
>>> @Stateless(mappedName="{deploymenId}/Whatever")?
>>
>> Right, something like that.
>>
>> Also possible:
>>
>> @Stateless(mappedName="{interfaceClass}")
>> @Stateless(mappedName="{ejbName}/{interfaceClass}")
>
> That's cool.  Is this an override for the current settings or in  
> addition to the current settings?

I'd say any xml declaration would override it, though it'd still trump  
any server or module level setting (i.e. less specific settings).

-David



Re: Mapped Name for ejbs

by manucet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah Sorry I guess I was not clear. What I was proposing was that the
user can specify openejb.jndiname.format={mappedName}
and then whatever the user gives say
@Stateless(mappedName="David/Dain") will be the jndi name :) of the
bean. i.e. whatever users specify as mappedName will be the name under
which the ejb will be bound in the JNDI Context.

Regards
Manu

On Fri, Jul 11, 2008 at 1:41 PM, David Blevins <david.blevins@...> wrote:

>
> On Jul 10, 2008, at 10:35 PM, Dain Sundstrom wrote:
>
>> On Jul 10, 2008, at 2:26 PM, David Blevins wrote:
>>
>>> On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:
>>>
>>>> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>>>>
>>>>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>>>>
>>>>>> Hi,
>>>>>> I was looking for a way to get the ejb3 beans registered in jndi
>>>>>> under the name a user provides in the mappedName attribute of the
>>>>>> @Stateless ,@Stateful annotations . One way that David told me to give
>>>>>> custom jndi names was to set the jndi-name as deployment-id via the
>>>>>> jndi name configuration property and then give custom deployment ids.
>>>>>> However suppose the user wants a way to set a custom mappedName in the
>>>>>> annotation and that should be the jndi name. On looking at the code I
>>>>>> find that we are not processing for the mappedName. If this is so then
>>>>>> I think that we should be processing the mapped name so that a user
>>>>>> can also specify that as a part of auto created deployment ids like
>>>>>> shown below.
>>>>>>
>>>>>> eg:
>>>>>> openejb.jndiname.format={deploymentId}
>>>>>>
>>>>>> openejb.deploymentId.format={mappedName}
>>>>>
>>>>> I wonder if we shouldn't just cut out the middle man and let the
>>>>> mappedName be used as a jndiname format.
>>>>
>>>> So I could have an annotation like
>>>> @Stateless(mappedName="{deploymenId}/Whatever")?
>>>
>>> Right, something like that.
>>>
>>> Also possible:
>>>
>>> @Stateless(mappedName="{interfaceClass}")
>>> @Stateless(mappedName="{ejbName}/{interfaceClass}")
>>
>> That's cool.  Is this an override for the current settings or in addition
>> to the current settings?
>
> I'd say any xml declaration would override it, though it'd still trump any
> server or module level setting (i.e. less specific settings).
>
> -David
>
>
>

Re: Mapped Name for ejbs

by David Blevins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 13, 2008, at 6:53 AM, Manu George wrote:

> Ah Sorry I guess I was not clear. What I was proposing was that the
> user can specify openejb.jndiname.format={mappedName}
> and then whatever the user gives say
> @Stateless(mappedName="David/Dain") will be the jndi name :) of the
> bean. i.e. whatever users specify as mappedName will be the name under
> which the ejb will be bound in the JNDI Context.

Right, I understood.  When I said "cut out the middle man" I meant  
that we could eliminate the steps where they have to set the two  
variables.  We could just treat the mappedName as the  
openejb.jndiname.format for that bean.

Using a mappedName of "David/Dain" would still be possible:

   @Stateless(mappedName="David/Dain")

... but with the added bonus that this is possible too:

   @Stateless(mappedName="David/Dain/{interfaceClass}")


-David


>
>
> Regards
> Manu
>
> On Fri, Jul 11, 2008 at 1:41 PM, David Blevins  
> <david.blevins@...> wrote:
>>
>> On Jul 10, 2008, at 10:35 PM, Dain Sundstrom wrote:
>>
>>> On Jul 10, 2008, at 2:26 PM, David Blevins wrote:
>>>
>>>> On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:
>>>>
>>>>> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>>>>>
>>>>>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> I was looking for a way to get the ejb3 beans registered in jndi
>>>>>>> under the name a user provides in the mappedName attribute of  
>>>>>>> the
>>>>>>> @Stateless ,@Stateful annotations . One way that David told me  
>>>>>>> to give
>>>>>>> custom jndi names was to set the jndi-name as deployment-id  
>>>>>>> via the
>>>>>>> jndi name configuration property and then give custom  
>>>>>>> deployment ids.
>>>>>>> However suppose the user wants a way to set a custom  
>>>>>>> mappedName in the
>>>>>>> annotation and that should be the jndi name. On looking at the  
>>>>>>> code I
>>>>>>> find that we are not processing for the mappedName. If this is  
>>>>>>> so then
>>>>>>> I think that we should be processing the mapped name so that a  
>>>>>>> user
>>>>>>> can also specify that as a part of auto created deployment ids  
>>>>>>> like
>>>>>>> shown below.
>>>>>>>
>>>>>>> eg:
>>>>>>> openejb.jndiname.format={deploymentId}
>>>>>>>
>>>>>>> openejb.deploymentId.format={mappedName}
>>>>>>
>>>>>> I wonder if we shouldn't just cut out the middle man and let the
>>>>>> mappedName be used as a jndiname format.
>>>>>
>>>>> So I could have an annotation like
>>>>> @Stateless(mappedName="{deploymenId}/Whatever")?
>>>>
>>>> Right, something like that.
>>>>
>>>> Also possible:
>>>>
>>>> @Stateless(mappedName="{interfaceClass}")
>>>> @Stateless(mappedName="{ejbName}/{interfaceClass}")
>>>
>>> That's cool.  Is this an override for the current settings or in  
>>> addition
>>> to the current settings?
>>
>> I'd say any xml declaration would override it, though it'd still  
>> trump any
>> server or module level setting (i.e. less specific settings).
>>
>> -David
>>
>>
>>
>


Re: Mapped Name for ejbs

by manucet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yep got it now.  Will open a JIRA for tracking

Thanks
Manu

On Mon, Jul 14, 2008 at 12:18 AM, David Blevins <david.blevins@...> wrote:

>
> On Jul 13, 2008, at 6:53 AM, Manu George wrote:
>
>> Ah Sorry I guess I was not clear. What I was proposing was that the
>> user can specify openejb.jndiname.format={mappedName}
>> and then whatever the user gives say
>> @Stateless(mappedName="David/Dain") will be the jndi name :) of the
>> bean. i.e. whatever users specify as mappedName will be the name under
>> which the ejb will be bound in the JNDI Context.
>
> Right, I understood.  When I said "cut out the middle man" I meant that we
> could eliminate the steps where they have to set the two variables.  We
> could just treat the mappedName as the openejb.jndiname.format for that
> bean.
>
> Using a mappedName of "David/Dain" would still be possible:
>
>  @Stateless(mappedName="David/Dain")
>
> ... but with the added bonus that this is possible too:
>
>  @Stateless(mappedName="David/Dain/{interfaceClass}")
>
>
> -David
>
>
>>
>>
>> Regards
>> Manu
>>
>> On Fri, Jul 11, 2008 at 1:41 PM, David Blevins <david.blevins@...>
>> wrote:
>>>
>>> On Jul 10, 2008, at 10:35 PM, Dain Sundstrom wrote:
>>>
>>>> On Jul 10, 2008, at 2:26 PM, David Blevins wrote:
>>>>
>>>>> On Jul 10, 2008, at 2:04 PM, Dain Sundstrom wrote:
>>>>>
>>>>>> On Jul 9, 2008, at 11:04 PM, David Blevins wrote:
>>>>>>
>>>>>>> On Jul 3, 2008, at 1:32 AM, Manu George wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I was looking for a way to get the ejb3 beans registered in jndi
>>>>>>>> under the name a user provides in the mappedName attribute of the
>>>>>>>> @Stateless ,@Stateful annotations . One way that David told me to
>>>>>>>> give
>>>>>>>> custom jndi names was to set the jndi-name as deployment-id via the
>>>>>>>> jndi name configuration property and then give custom deployment
>>>>>>>> ids.
>>>>>>>> However suppose the user wants a way to set a custom mappedName in
>>>>>>>> the
>>>>>>>> annotation and that should be the jndi name. On looking at the code
>>>>>>>> I
>>>>>>>> find that we are not processing for the mappedName. If this is so
>>>>>>>> then
>>>>>>>> I think that we should be processing the mapped name so that a user
>>>>>>>> can also specify that as a part of auto created deployment ids like
>>>>>>>> shown below.
>>>>>>>>
>>>>>>>> eg:
>>>>>>>> openejb.jndiname.format={deploymentId}
>>>>>>>>
>>>>>>>> openejb.deploymentId.format={mappedName}
>>>>>>>
>>>>>>> I wonder if we shouldn't just cut out the middle man and let the
>>>>>>> mappedName be used as a jndiname format.
>>>>>>
>>>>>> So I could have an annotation like
>>>>>> @Stateless(mappedName="{deploymenId}/Whatever")?
>>>>>
>>>>> Right, something like that.
>>>>>
>>>>> Also possible:
>>>>>
>>>>> @Stateless(mappedName="{interfaceClass}")
>>>>> @Stateless(mappedName="{ejbName}/{interfaceClass}")
>>>>
>>>> That's cool.  Is this an override for the current settings or in
>>>> addition
>>>> to the current settings?
>>>
>>> I'd say any xml declaration would override it, though it'd still trump
>>> any
>>> server or module level setting (i.e. less specific settings).
>>>
>>> -David
>>>
>>>
>>>
>>
>
>
LightInTheBox - Buy quality products at wholesale price!