Re: Determining if code is running in EJB container

2001-03-09 Thread Thibault Cuvillier
You can try to open a file. If you get a SecurityException, your code probably run in the EJB container. === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For

Re: Determining if code is running in EJB container

2001-03-08 Thread Gene Chuang
8, 2001 5:57 PM To: [EMAIL PROTECTED] Subject: Re: Determining if code is running in EJB container On Wed, 7 Mar 2001 23:57:45 -0800, Gene Chuang <[EMAIL PROTECTED]> wrote: >I think a better question to ask first is WHY do you need to know if a class >of yours is running in a container?

Re: Determining if code is running in EJB container

2001-03-08 Thread Dave Glasser
On Thu, 8 Mar 2001 21:38:34 -0500, Tim Endres <[EMAIL PROTECTED]> wrote: > >[...snip...] > >> Some responders suggested trying a new InitialContext().lookup(), and >> if it failed, the code could assume it was running outside of an EJB >> container. This would probably work in most cases, but it

Re: Determining if code is running in EJB container

2001-03-08 Thread Tim Endres
> On Wed, 7 Mar 2001 23:57:45 -0800, Gene Chuang <[EMAIL PROTECTED]> > wrote: > >I think a better question to ask first is WHY do you need to know if a class > >of yours is running in a container? > > The way you ask that seems to imply that there's something inherently > wrong with such a require

Re: Determining if code is running in EJB container

2001-03-08 Thread Dave Glasser
On Wed, 7 Mar 2001 23:57:45 -0800, Gene Chuang <[EMAIL PROTECTED]> wrote: >I think a better question to ask first is WHY do you need to know if a class >of yours is running in a container? The way you ask that seems to imply that there's something inherently wrong with such a requirement, so I'l

Re: Determining if code is running in EJB container

2001-03-08 Thread Shane Duan
If I understand you correctly, you have a EJB container and you have a stand-alone application that are using the same classes. If that is the case, the following solution that I did might be helpful for you: Because they are different VM processes, you can have a singleton class (or a class wit

Re: Determining if code is running in EJB container

2001-03-08 Thread John Harby
I agree. Sounds like the design may need reworking. >From: Gene Chuang <[EMAIL PROTECTED]> >Reply-To: A mailing list for Enterprise JavaBeans development ><[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: Re: Determining if code is running in EJB container >

Re: Determining if code is running in EJB container

2001-03-07 Thread Gene Chuang
I think a better question to ask first is WHY do you need to know if a class of yours is running in a container? Gene -Original Message- From: A mailing list for Enterprise JavaBeans development To: [EMAIL PROTECTED] Sent: 3/7/01 9:48 PM Subject: Re: Determining if code is running in

Re: Determining if code is running in EJB container

2001-03-07 Thread Robert Nicholson
PROTECTED]]On Behalf Of Dave Glasser > Sent: Wednesday, March 07, 2001 9:48 PM > To: [EMAIL PROTECTED] > Subject: Re: Determining if code is running in EJB container > > > On Thu, 8 Mar 2001 10:45:36 +0530, Ashwani Kalra > <[EMAIL PROTECTED]> wrote: > > >I thi

Re: Determining if code is running in EJB container

2001-03-07 Thread Dave Glasser
On Thu, 8 Mar 2001 10:45:36 +0530, Ashwani Kalra <[EMAIL PROTECTED]> wrote: >I thinks you can call ejbContext fns which tells its environment. when >running in NON-EJB environment it must return some error or exception Thanks for responding. The class I'm talking about is not an EJB, so there is

Re: Determining if code is running in EJB container

2001-03-07 Thread Ashwani Kalra
I thinks you can call ejbContext fns which tells its environment. when running in NON-EJB environment it must return some error or exception ~~ Warm Regards Ashwani Kalra Sr. Member Dev. Staff Aithent Technologies(P) Ltd.(SSI) Plot 8 & 9, Sector-18 Gurgaon,Hary

Re: Determining if code is running in EJB container

2001-03-07 Thread Tim Endres
Can you determine this from your InitialContext? > I have a class which is used in both EJB and non-EJB environments, and > some of its behavior is determined by whether or not it's running > inside an EJB container. Right now, I'm using a system property, > "NO_EJB", which I set from the command