Ok that is what I was afraid about.

And, Romain, it is not normal - it is due to still missing alignment between cdi and ejb :D

For those of you reading this question some times later: the "hack" I will make is to have only one EJB (facade) and in that EJB inject @Default or @Alternative implementation based on beans.xml config.

br
reinis

On 22.07.2013 10:07, Romain Manni-Bucau wrote:
Hi,

@Schedule is an EJB feature not a CDI one so @Alternative is not used here
(so it sounds normal for me).

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/7/22 Reinis Vicups <[email protected]>

Hi,

I have two implementations of some SchedulerWorkerManager:

//ALTERNATIVE!
@Startup @Singleton @TransactionAttribute(**TransactionAttributeType.NOT_*
*SUPPORTED) @Lock(LockType.READ) @Alternative
public class AzureSchedulerWorkerManager implements SchedulerWorkerManager
{
     @Override
     @Schedule(second = "*/20", minute = "*", hour = "*", info = "Every 20
seconds")
     @Lock(LockType.WRITE)
     public void manageSchedulerWorkers() {}
}

AND

//DEFAULT!
@Startup @Singleton @TransactionAttribute(**TransactionAttributeType.NOT_*
*SUPPORTED) @Lock(LockType.READ) @Default
public class BasicSchedulerWorkerManager implements SchedulerWorkerManager
{
     @Override
     @Schedule(second = "*/5", minute = "*", hour = "*", info = "Every 5
seconds")
     @Lock(LockType.WRITE)
     public void manageSchedulerWorkers() {}
}

I just noticed that despite AzureSchedulerWorkerManager is annotated as
being @Alternative it is still "ticking".

Thank you, guys, for hints on how to configure them both properly.

br
reinis


Reply via email to