Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/src/test/java/org/jboss/weld/tests/producer/method/JmsTemplate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.jboss.weld.tests.producer.method; | ||
|
||
public class JmsTemplate | ||
{ | ||
|
||
private final int receiveTimeout; | ||
|
||
public JmsTemplate(int receiveTimeout) | ||
{ | ||
this.receiveTimeout = receiveTimeout; | ||
} | ||
|
||
public int getReceiveTimeout() | ||
{ | ||
return receiveTimeout; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
.../src/test/java/org/jboss/weld/tests/producer/method/JmsTemplateConfigurationProducer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.jboss.weld.tests.producer.method; | ||
|
||
import javax.enterprise.inject.Produces; | ||
import javax.inject.Named; | ||
|
||
public class JmsTemplateConfigurationProducer | ||
{ | ||
|
||
public static final int LONG_RECEIVE_TIMEOUT = 3 * 3600; | ||
public static final int SHORT_RECEIVE_TIMEOUT = 100; | ||
|
||
@Produces @Long | ||
private int longReceiveTimeout = LONG_RECEIVE_TIMEOUT; | ||
|
||
@Produces @Short | ||
private int shortReceiveTimeout = SHORT_RECEIVE_TIMEOUT; | ||
|
||
@Produces | ||
@Named | ||
public JmsTemplate getErrorQueueTemplate(@Long int receiveTimeout) | ||
{ | ||
return new JmsTemplate(receiveTimeout); | ||
} | ||
|
||
@Produces | ||
@Named | ||
public JmsTemplate getLogQueueTemplate(@Short int receiveTimeout) | ||
{ | ||
return new JmsTemplate(receiveTimeout); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
tests/src/test/java/org/jboss/weld/tests/producer/method/Long.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jboss.weld.tests.producer.method; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.inject.Qualifier; | ||
|
||
/** | ||
* @author Dan Allen | ||
*/ | ||
@Target( { TYPE, METHOD, PARAMETER, FIELD }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@Qualifier | ||
@Inherited | ||
public @interface Long { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/src/test/java/org/jboss/weld/tests/producer/method/Short.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jboss.weld.tests.producer.method; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.inject.Qualifier; | ||
|
||
/** | ||
* @author Dan Allen | ||
*/ | ||
@Target( { TYPE, METHOD, PARAMETER, FIELD }) | ||
@Retention(RUNTIME) | ||
@Documented | ||
@Qualifier | ||
@Inherited | ||
public @interface Short { | ||
} |