Return-Path: X-Original-To: apmail-deltaspike-users-archive@www.apache.org Delivered-To: apmail-deltaspike-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30D5A100C2 for ; Thu, 6 Jun 2013 06:13:00 +0000 (UTC) Received: (qmail 58978 invoked by uid 500); 6 Jun 2013 06:12:59 -0000 Delivered-To: apmail-deltaspike-users-archive@deltaspike.apache.org Received: (qmail 58854 invoked by uid 500); 6 Jun 2013 06:12:53 -0000 Mailing-List: contact users-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@deltaspike.apache.org Delivered-To: mailing list users@deltaspike.apache.org Received: (qmail 58825 invoked by uid 99); 6 Jun 2013 06:12:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 06:12:51 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [77.238.189.68] (HELO nm15.bullet.mail.ird.yahoo.com) (77.238.189.68) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 06:12:44 +0000 Received: from [77.238.189.227] by nm15.bullet.mail.ird.yahoo.com with NNFMP; 06 Jun 2013 06:12:03 -0000 Received: from [212.82.108.125] by tm16.bullet.mail.ird.yahoo.com with NNFMP; 06 Jun 2013 06:12:03 -0000 Received: from [127.0.0.1] by omp1034.mail.ird.yahoo.com with NNFMP; 06 Jun 2013 06:12:03 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 349205.47367.bm@omp1034.mail.ird.yahoo.com Received: (qmail 68887 invoked by uid 60001); 6 Jun 2013 06:12:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1370499123; bh=nutqeDcStk9/TzrSgVOTIF00ci6fwXwak0j+PXxsqIw=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=rDQKEVuyPUiFWsq+ToO3CvKpD+E61Lokw88AMpTtITCibUHdj7RUfJmTWOc7rIgyjnsfzo45BFwLyWnWQdfldZxcOEUPMEyWLKl8kOQ4bQ/hDYvr/lj/l6eW73ySp+A10sOYxvpOR2roxeBhecLRFV3i1pcaIHHI0WfIYvgAscQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=DR46mdHpKTRw5cpMWrS7xi1o0fjnbs8rJMBehiGEV0J5nCWLTZaDOdL/U+TtFuePMzz6MvD54I1U2jvf8ZgTGTGm/lXYULSZ1r9p+eHKn15SYot5i/K4+CTMveFr4/aFGNMkbIqmuspGKxRjMXC34jI+2ccGafAMO8kFjGAhQRo=; X-YMail-OSG: so9k9C8VM1mS3ey_wv2H0L20SasVz9hDDTeOkle5QNWVqpV PgPTGOCeHoosCdd7lGdNYR92l1R4bsjT8TdOHItwxJiRgCvBEgKS00aE.gQ7 nKcYo10XBMyCEJ0D7q7n9Y.NCMMyeiNvVezDNczUJKyOGph9X3CdkABIV9HV K577At34s8w68prWXsYalEBPhcdI2KrFjKkkCai6zKattvOdqVtLqZo5.E3l 2FJ9Sufd0hKmYj5RtckZg0kg1.QY3Y5jS8Szy7DyPMD5AYHCRChUD6oF.TNC mQ_OjG9VdNxjAnMD8lpVUGuvcRJnxuNCP5__cL2zF8qRd_j3YUSB2SlrXwnO xIonLJKx9HKE0QOWGhKrSEYP3XDD6.sVZDEBZFRjVrdY0NhQAhEyr6WWojF5 iLbyeR8IbCKw_elXxfkwqZKcMLSTK4sZu4vPJo2_oPlDb3Ysrj5mFoGo8Us5 AzcE_bWHtNWE8MAeWGbyDUriqjOu57Y_.uWRcRIFiTHgjzn5TfC3GXqaG9nQ g3Dpv21tDe2IYbFxjlColrbqtTmp4M.IFYmCDCQwOW70n4v7BZBpcCgD95GO 29U..RqRyvclyGbMtvvoQV22lzSpMAeG4QjIfG7Idl3w8jzNPnCp7 Received: from [81.3.214.199] by web28902.mail.ir2.yahoo.com via HTTP; Thu, 06 Jun 2013 07:12:02 BST X-Rocket-MIMEInfo: 002.001,SGkgTWFyY28hCgpUaGUgZ2xvYmFsQWx0ZXJuYXRpdmVzIGlzIGEgbmVhdCBoYWNrIHRvIHdvcmsgYXJvdW5kIHBhcnRzIG9mIHRoZSBCREEgdHJvdWJsZXMgaW4gQ0RJLTEuMCBbMV0uClVuZm9ydHVuYXRlbHkgSSBmZWFyIGl0IGlzIHF1aXRlIHNvbWUgd29yayB0byBtYWtlIGl0IHdvcmtpbmcgZm9yIG11bHRpcGxlIGFyYml0cmFyeSBxdWFsaWZpZXJzIG9uIHRoZSBzYW1lIGludGVyZmFjZS4KCkEgcG9zc2libGUgYWx0ZXJuYXRpdmUgd2F5IHRvIHNvbHZlIHlvdXIgcHJvYmxlbSB3b3VsZCBiZSB0byB1c2UBMAEBAQE- X-Mailer: YahooMailWebService/0.8.144.546 References: Message-ID: <1370499122.65855.YahooMailNeo@web28902.mail.ir2.yahoo.com> Date: Thu, 6 Jun 2013 07:12:02 +0100 (BST) From: Mark Struberg Reply-To: Mark Struberg Subject: Re: Global Alternatives To: "users@deltaspike.apache.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Hi Marco! The globalAlternatives is a neat hack to work around parts of the BDA troubles in CDI-1.0 [1]. Unfortunately I fear it is quite some work to make it working for multiple arbitrary qualifiers on the same interface. A possible alternative way to solve your problem would be to use @Specializes in your case. I guess you have 2 base implementations, thus you can do @Specializes public class MyImpl1 extends BaseImpl1 { and the same for the 2nd class The downside is that you need to have the original classes in the compile classpath. But this will really work on any container. LieGrue, strub [1] https://issues.jboss.org/browse/CDI-18 ----- Original Message ----- > From: Marco Corona > To: users@deltaspike.apache.org > Cc: > Sent: Wednesday, 5 June 2013, 17:29 > Subject: Re: Global Alternatives > >T hank you for your response, I successfully got the globalAlternatives to > work, except one issue. I have an interface and two default > implementations. Both implementations are active because of a qualifier > because of an enum value. > > @MyQualifier(MyEnum.PROP1) > class MyImpl1 implements MyInterface{ > ... > } > @MyQualifier(MyEnum.PROP2) > class MyImpl2 implements MyInterface{ > ... > } > > Now I need to replace both of these implementations, but filling the > apache-deltaspike.properties with the following: > > globalAlternatives.com.example.MyInterface=com.example.OtherImpl1 > globalAlternatives.com.example.MyInterface=com.example.OtherImpl2 > > doesn't work because com.example.MyInterface is the key so it is only > activating one of the lines. > Do you think it is possible to do what I am trying to achieve? If so, can > you lend some advice? > Thank you > > > On Thu, May 30, 2013 at 2:52 PM, Cody Lerum wrote: > >> If this is in 0.4 then an example for enabling the >> BeanManagedUserTransactionStrategy >> for Transaction support would be >> >> /src/main/resources/META-INF/apache-deltaspike.properties >> >> contents are >> >> >> > globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy=org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy >> >> The prefix of "globalAlternatives." is required in 0.4 >> >> The location as built in my war it ends up @ >> >> > myApp.war\WEB-INF\classes\META-INF\apache-deltaspike.properties >> >> >> >> On Thu, May 30, 2013 at 10:11 AM, Marco Corona >> wrote: >> >> > Hello, >> > I have been trying to figure out how enable global alternatives, yet I >> > can't seem to find much documentation on the issue at all. Can > anyone >> point >> > me in the right direction or even give me an example? >> > Thank you, >> > Marco Corona >> > >> >