From user-return-1324-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Thu Dec 08 18:08:20 2005 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 695 invoked from network); 8 Dec 2005 18:08:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Dec 2005 18:08:20 -0000 Received: (qmail 40654 invoked by uid 500); 8 Dec 2005 18:08:18 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 40633 invoked by uid 500); 8 Dec 2005 18:08:17 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 40622 invoked by uid 99); 8 Dec 2005 18:08:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2005 10:08:17 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.163.169.227] (HELO smtp107.mail.sc5.yahoo.com) (66.163.169.227) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 08 Dec 2005 10:08:16 -0800 Received: (qmail 5576 invoked from network); 8 Dec 2005 18:07:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=ynsKl8EOsnbLIH/GKHUp2F4frUDCZs+HaaoPPDausOkEm7IauBvz252JLBoLCPv8XwEHi73AlZyyeqraNfnRcX20fz4bnIuAGQ0S+CelUxPsZIWFOx35CMpV9oMsvM9V9aDpwOWFXFWe8zI5STK/RwsTSMgsm6KzjC05ZIclUPk= ; Received: from unknown (HELO ?192.168.1.5?) (david?jencks@66.93.38.137 with plain) by smtp107.mail.sc5.yahoo.com with SMTP; 8 Dec 2005 18:07:55 -0000 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <71fbcc4fd39528cb0fff2b0daedb82d3@yahoo.com> Content-Transfer-Encoding: quoted-printable From: David Jencks Subject: Re: Reference to TransactionManager Date: Thu, 8 Dec 2005 10:07:53 -0800 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.622) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Dec 8, 2005, at 9:19 AM, Guglielmo.Lichtner@instinet.com wrote: > > That's good to know. > > Although, given that the substance of this method also boils to a lot > of text, it really does not change the coupling to the deployment =20 > details of the transaction, > nor does it mean that a broken dependency will be detected at =20 > compilation time. > > Therefore I think putting all the text in the gbean's plan is better =20= > because at least there it's in good company. I completely agree, but at this time there is no way to do that for a =20= j2ee component. We have not yet figured out a way to provide easy =20 access to a gbean from a j2ee component. One possibility would be a =20 new jndi namespace. > > I think gbeans achieve modularity and low coupling, but I think they =20= > do easy at the expense of ease of use. > Perhaps by using two separate apis it might be possible to do both? I'm not sure what you mean. Could you explain in more detail? thanks david jencks > > > > David Jencks > > 12/07/2005 10:10 PM > Please respond to user > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 To: =A0 =A0 =A0 =A0user@geronimo.apache.org > =A0 =A0 =A0 =A0 cc: =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 Subject: =A0 =A0 =A0 =A0Re: Reference to = TransactionManager > > > > If I understand correctly your java code is in a j2ee application =A0 > rather than a gbean? =A0If your code is in or called by a gbean you =A0= > should use the technique Guglielmo mentions. =A0If your code is in a =20= > j2ee =A0 > application you have to work harder, and you have to find or know the = =20 > =A0 > gbean name of the transaction manager. > > static final ObjectName TM_NAME =3D new =A0 > ObjectName("geronimo.server:J2EEApplication=3Dnull,J2EEModule=3Dgeronim= o/ > j2ee-server/1.0-SNAPSHOT/ > =20 > = car,J2EEServer=3Dgeronimo,j2eeType=3DTransactionManager,name=3DTransaction= Man=20 > a > ger"); > > > Kernel kernel =3D KernelRegistry.getSingleKernel(); > TransactionManager tm =3D = kernel.getProxyManager().createProxy(TM_NAME, =20 > =A0 > TransactionManager.class); > > I just wrote this code right here in this email so it is probably =20 > full =A0 > of typos and bugs but it shows the technique to use. =A0If you want = to =A0 > allow the transaction manager to be found even it it is in a =20 > different =A0 > module you can use a object name pattern, list the names satisfying =20= > it =A0 > and pick one. > > thanks > david jencks > > > > > On Dec 7, 2005, at 8:19 PM, Ranjan, Rakesh ((Cognizant)) wrote: > > > > > Thanks Guglielmo, > > But I want to get the reference to TransactionManager through java = =A0 > > code only. Isn't it possible to get it using the Transaction =20 > manager =A0 > > GBean name. > > With Regards, > > Rakess Ranjan > > =A0 > > > > From: Guglielmo.Lichtner@instinet.com =A0 > > [mailto:Guglielmo.Lichtner@instinet.com] > > Sent: Wednesday, December 07, 2005 10:41 PM > > To: user@geronimo.apache.org > > Cc: user@geronimo.apache.org > > Subject: Re: Reference to TransactionManager > > =A0 > > > > > > I had the same question. As per David Jencks: > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > =A0In your gbean info building code include something like this: > > > > =A0=A0 =A0 =A0 =A0 infoFactory.addReference("TransactionManager", > > =A0ExtendedTransactionManager.class, = NameFactory.TRANSACTION_MANAGER); > > > > > > =A0Then you won't have to specify the in the reference. > > > > =A0In the xml plan, > > > > =A0=A0 =A0 =A0 =A0 > > =A0=A0 =A0 =A0 =A0 =A0 =A0 = org/apache/geronimo/Server > > =A0=A0 =A0 =A0 =A0 =A0 =A0 TransactionManager > > =A0=A0 =A0 =A0 =A0 > > > > =A0assuming you are not using the patch I posted a few days ago = that > > =A0includes new-style configIds. > > > > > > =A0 > > "Ranjan, Rakesh =A0\(Cognizant\)" > > > > 12/07/2005 05:11 AM > > Please =A0respond to user > > =A0 =A0 =A0 =A0 > > =A0 =A0=A0 =A0 =A0 To: =A0 =A0 =A0 =A0 > > =A0 =A0=A0 =A0 =A0 cc: =A0 =A0 =A0 =A0 > > =A0 =A0=A0 =A0 =A0 Subject: =A0 =A0 =A0 =A0Reference to = =A0TransactionManager > > > > > > > > Hi, > > I need a reference to the TransactionManager in one of java class. =20= > But =A0 > > I don't know the GBean name corresponding to the =20 > TransactionManager. =A0 > > Can anybody please help me how to get a reference to =A0 > > TransactionManager in Java code. > > Regards, > > Rakesh Ranjan > > This e-mail and any files transmitted with it are =A0for the sole = use =20 > of =A0 > > the intended recipient(s) and may contain confidential and =20 > privileged =A0 > > information. > > =A0If you are not the intended recipient, please contact the sender = =20 > by =A0 > > reply =A0e-mail and destroy all copies of the original message. > > =A0Any unauthorized review, use, disclosure, dissemination, =20 > forwarding, =A0 > > printing =A0or copying of this email or any action taken in = reliance =20 > on =A0 > > this e-mail is strictly > > =A0prohibited and may be unlawful. > > > > =A0Visit us at http://www.cognizant.com > > > > > > > > > > > > > > =A0***************************************************************** > > =A0<<>> > > > > =A0In compliance with applicable rules and regulations, Instinet > > =A0reviews and archives incoming and outgoing email communications, > > =A0copies of which may be produced at the request of regulators. > > =A0This message is intended only for the personal and confidential > > =A0use of the recipients named above. If the reader of this email > > =A0is not the intended recipient, you have received this email in > > =A0error and any review, dissemination, distribution or copying is > > =A0strictly prohibited. If you have received this email in error, > > =A0please notify the sender immediately by return email and > > =A0permanently delete the copy you received. > > > > =A0Instinet accepts no liability for any content contained in the > > =A0email, or any errors or omissions arising as a result of email > > =A0transmission. Any opinions contained in this email constitute > > =A0the sender's best judgment at this time and are subject to = change > > =A0without notice. Instinet does not make recommendations of a > > =A0particular security and the information contained in this email > > =A0should not be considered as a recommendation, an offer or a > > =A0solicitation of an offer to buy and sell securities. > > > > =A0***************************************************************** > > This e-mail and any files transmitted with it are for the sole use =20= > of =A0 > > the intended recipient(s) and may contain confidential and =20 > privileged =A0 > > information. > > =A0If you are not the intended recipient, please contact the sender = =20 > by =A0 > > reply e-mail and destroy all copies of the original message. > > =A0Any unauthorized review, use, disclosure, dissemination, =20 > forwarding, =A0 > > printing or copying of this email or any action taken in reliance =20= > on =A0 > > this e-mail is strictly > > =A0prohibited and may be unlawful. > > > > =A0Visit us at http://www.cognizant.com > > >