RE: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Jeremy Boynes
OK. 
3.2 is fine for me.

Thanks
Jeremy

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of David
> Jencks
> Sent: Thursday, January 30, 2003 4:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] Accessing Container from an EJB?
> 
> 
> Someone left the "get" method out of the ModelMBeanInfo for the  
> registry.  I'm checking for problems, then I'll add it to 3.2.  I'm  
> less enthusiastic about 3.0.
> 
> david jencks
> 



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread David Jencks
Someone left the "get" method out of the ModelMBeanInfo for the  
registry.  I'm checking for problems, then I'll add it to 3.2.  I'm  
less enthusiastic about 3.0.

david jencks

On Thursday, January 30, 2003, at 06:27 PM, Jeremy Boynes wrote:

OK, it worked like a charm in the HEAD branch.
In 3.2 I get a NoSuchMethodException when calling get(name) on the  
registry:

Caused by: java.lang.NoSuchMethodException: Unable to locate method  
for:
get(,javax.management.ObjectName)
	at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanD 
ispat
cher.java:288)
	at
org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectRefere 
nceIn
terceptor.java:64)
	at
org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttribut 
eInte
rceptor.java:50)
	at
org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInter 
cepto
r.java:91)
	at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:79)
	at
javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBea 
n.jav
a:141)
	at  
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
	at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

Any ideas?
Thanks
Jeremy

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Jeremy Boynes
Sent: Thursday, January 30, 2003 9:43 AM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-dev] Accessing Container from an EJB?


Thanks - I copied the code to get the registry into the test setup  
and it
worked like a charm.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of  
David
Jencks
Sent: Thursday, January 30, 2003 9:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] Accessing Container from an EJB?


Well, one solution in jboss 4 that doesnt add any more code is:

I figure you know the object name for the ejbModule mbean you are
writing the test.

I just added a jmx method in ServiceMBeanSupport to return the actual
object behind an mbean.  You can use this (or pre-jboss 4 similar  
code)
to get the actual ejbModule object and call whatever method you want  
on
it.  I don't know if this will work with the Container mbean since it
is dynamic.

david




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development





---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Jeremy Boynes
OK, it worked like a charm in the HEAD branch.
In 3.2 I get a NoSuchMethodException when calling get(name) on the registry:

Caused by: java.lang.NoSuchMethodException: Unable to locate method for:
get(,javax.management.ObjectName)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
cher.java:288)
at
org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceIn
terceptor.java:64)
at
org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInte
rceptor.java:50)
at
org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceIntercepto
r.java:91)
at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:79)
at
javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.jav
a:141)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)

Any ideas?
Thanks
Jeremy

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Jeremy Boynes
> Sent: Thursday, January 30, 2003 9:43 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] Accessing Container from an EJB?
>
>
> Thanks - I copied the code to get the registry into the test setup and it
> worked like a charm.
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of David
> > Jencks
> > Sent: Thursday, January 30, 2003 9:13 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [JBoss-dev] Accessing Container from an EJB?
> >
> >
> > Well, one solution in jboss 4 that doesnt add any more code is:
> >
> > I figure you know the object name for the ejbModule mbean you are
> > writing the test.
> >
> > I just added a jmx method in ServiceMBeanSupport to return the actual
> > object behind an mbean.  You can use this (or pre-jboss 4 similar code)
> > to get the actual ejbModule object and call whatever method you want on
> > it.  I don't know if this will work with the Container mbean since it
> > is dynamic.
> >
> > david
> >
>
>
>
> ---
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> ___
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Jeremy Boynes
Thanks - I copied the code to get the registry into the test setup and it
worked like a charm.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of David
> Jencks
> Sent: Thursday, January 30, 2003 9:13 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] Accessing Container from an EJB?
>
>
> Well, one solution in jboss 4 that doesnt add any more code is:
>
> I figure you know the object name for the ejbModule mbean you are
> writing the test.
>
> I just added a jmx method in ServiceMBeanSupport to return the actual
> object behind an mbean.  You can use this (or pre-jboss 4 similar code)
> to get the actual ejbModule object and call whatever method you want on
> it.  I don't know if this will work with the Container mbean since it
> is dynamic.
>
> david
>



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread David Jencks
Well, one solution in jboss 4 that doesnt add any more code is:

I figure you know the object name for the ejbModule mbean you are 
writing the test.

I just added a jmx method in ServiceMBeanSupport to return the actual 
object behind an mbean.  You can use this (or pre-jboss 4 similar code) 
to get the actual ejbModule object and call whatever method you want on 
it.  I don't know if this will work with the Container mbean since it 
is dynamic.

david

On Thursday, January 30, 2003, at 11:41 AM, Jeremy Boynes wrote:

David Jencks wrote


I'm pretty confused about what exactly you are trying to do, since
there is already an instance variable ejbModule and and accessors
get/setEjbModule in the Container class.



I am trying to unit test changes to JDBCEJBQLCompiler by comparing the 
SQL
generated to known values. Its constructor takes a Catalog, which is 
the
metadata about the abstract schema in this deployment and is stored in 
the
EjbModule moduleData. Trying to construct one from scratch is a 
nightmare,
so my intention was to deploy the ejb-jar and get the Catalog created 
during
deployment.

The problem I had was getting access to the EjbModule from the test 
case
EJB. I know the ObjectName of the Container but the MBeanServer 
isolates me
from the get/setEjbModule as it is not a declared JMX attribute. I was 
able
to solve this by adding
  if("EjbModule".equals(attribute))
  {
 return getEjbModule();
  }
to Container.getAttribute(String attribute) to declare it but was 
wondering
if

a) there was a better way of getting the EjbModule, or
b) another way of getting a direct reference to the Container
   so I can call getEjbModule().

And also, whether it was OK to declare this attribute.

Thanks
Jeremy



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Dain Sundstrom
Why not?  I see no reason why a client can't look up the EJB container 
directly using an MBean and get some information.  I can see why this 
would be a bad idea, but we shouldn't restrict the access.  Anyway this 
is for some test code.

-dain

On Thursday, January 30, 2003, at 04:23 AM, julien viet wrote:

I don't think EJB can access its container directly.
However maybe you could add an interceptor in stack that does nothing
but provides you information you need, because they have access
to container. Then your EJB could contact interceptor (with static
call for instance)

Maybe is it possible via JMX also ?

julien

JB> I am trying to write an EJBTestCase that needs access to 
information held in
JB> the Container (Container.getEjbModule().getModuleData("CATALOG")). 
I can do
JB> this if I add EjbModule as a attribute of Container but was 
wondering if I
JB> should do this or if there was another way?

JB> Thanks
JB> Jeremy



JB> ---
JB> This SF.NET email is sponsored by:
JB> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 
See!
JB> http://www.vasoftware.com
JB> ___
JB> Jboss-development mailing list
JB> [EMAIL PROTECTED]
JB> https://lists.sourceforge.net/lists/listinfo/jboss-development



--
Best regards,
 julienmailto:[EMAIL PROTECTED]

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



RE: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Jeremy Boynes
David Jencks wrote
>
> I'm pretty confused about what exactly you are trying to do, since
> there is already an instance variable ejbModule and and accessors
> get/setEjbModule in the Container class.
>

I am trying to unit test changes to JDBCEJBQLCompiler by comparing the SQL
generated to known values. Its constructor takes a Catalog, which is the
metadata about the abstract schema in this deployment and is stored in the
EjbModule moduleData. Trying to construct one from scratch is a nightmare,
so my intention was to deploy the ejb-jar and get the Catalog created during
deployment.

The problem I had was getting access to the EjbModule from the test case
EJB. I know the ObjectName of the Container but the MBeanServer isolates me
from the get/setEjbModule as it is not a declared JMX attribute. I was able
to solve this by adding
  if("EjbModule".equals(attribute))
  {
 return getEjbModule();
  }
to Container.getAttribute(String attribute) to declare it but was wondering
if

a) there was a better way of getting the EjbModule, or
b) another way of getting a direct reference to the Container
   so I can call getEjbModule().

And also, whether it was OK to declare this attribute.

Thanks
Jeremy



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread Dain Sundstrom
Yes but it is not exposed on the MBean interface, so how do you get a 
reference to the module unless you already have a real reference to the 
container?

-dain

On Thursday, January 30, 2003, at 06:50 AM, David Jencks wrote:

I'm pretty confused about what exactly you are trying to do, since 
there is already an instance variable ejbModule and and accessors 
get/setEjbModule in the Container class.

??

david jencks

On Thursday, January 30, 2003, at 01:36 AM, Jeremy Boynes wrote:

I am trying to write an EJBTestCase that needs access to information 
held in
the Container (Container.getEjbModule().getModuleData("CATALOG")). I 
can do
this if I add EjbModule as a attribute of Container but was wondering 
if I
should do this or if there was another way?

Thanks
Jeremy



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread David Jencks
I'm pretty confused about what exactly you are trying to do, since 
there is already an instance variable ejbModule and and accessors 
get/setEjbModule in the Container class.

??

david jencks

On Thursday, January 30, 2003, at 01:36 AM, Jeremy Boynes wrote:

I am trying to write an EJBTestCase that needs access to information 
held in
the Container (Container.getEjbModule().getModuleData("CATALOG")). I 
can do
this if I add EjbModule as a attribute of Container but was wondering 
if I
should do this or if there was another way?

Thanks
Jeremy



---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development




---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



Re: [JBoss-dev] Accessing Container from an EJB?

2003-01-30 Thread julien viet
I don't think EJB can access its container directly.
However maybe you could add an interceptor in stack that does nothing
but provides you information you need, because they have access
to container. Then your EJB could contact interceptor (with static
call for instance)

Maybe is it possible via JMX also ?

julien

JB> I am trying to write an EJBTestCase that needs access to information held in
JB> the Container (Container.getEjbModule().getModuleData("CATALOG")). I can do
JB> this if I add EjbModule as a attribute of Container but was wondering if I
JB> should do this or if there was another way?

JB> Thanks
JB> Jeremy



JB> ---
JB> This SF.NET email is sponsored by:
JB> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
JB> http://www.vasoftware.com
JB> ___
JB> Jboss-development mailing list
JB> [EMAIL PROTECTED]
JB> https://lists.sourceforge.net/lists/listinfo/jboss-development



-- 
Best regards,
 julienmailto:[EMAIL PROTECTED]

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development