[JBoss JIRA] (FORGE-2225) Being able to add a new CDI producer method to an existing class
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2225?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2225:
-------------------------------------
Description:
It would be good to have a command to add a CDI producer method to an existing class. A simple command such as :
{code}
cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
The method is by default private, but we could change this :
{code}
cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer --accessType private
{code}
We can also have a parameter to add the injection point
{code}
cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer --injectionPoint
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
Then, we can have more attributes :
{code}
cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger --accessType private --injectionPoint --qualifier Production --alternative=true --scoped Request --atNamed=true
{code}
{code}
public class LoggingProducer
{
@Produces
@Production
@Alternative
@RequestScoped
@Named
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
was:
It would be good to have a command to add a CDI producer method to an existing class. A simple command such as :
{code}
cdi-new-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --accessType private
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
We can also have a parameter to add the injection point
{code}
cdi-new-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --accessType private --injectionPoint
{code}
Would generate :
{code}
public class LoggingProducer
{
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
Then, we can have more attributes :
{code}
cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger --accessType private --injectionPoint --qualifier Production --alternative=true --scoped Request --atNamed=true
{code}
{code}
public class LoggingProducer
{
@Produces
@Production
@Alternative
@RequestScoped
@Named
public Logger produceLogger() {
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
> Being able to add a new CDI producer method to an existing class
> ----------------------------------------------------------------
>
> Key: FORGE-2225
> URL: https://issues.jboss.org/browse/FORGE-2225
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.14.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to add a CDI producer method to an existing class. A simple command such as :
> {code}
> cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer
> {code}
> Would generate :
> {code}
> public class LoggingProducer
> {
> @Produces
> public Logger produceLogger() {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
> The method is by default private, but we could change this :
> {code}
> cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer --accessType private
> {code}
> We can also have a parameter to add the injection point
> {code}
> cdi-add-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --targetClass LoggingProducer --injectionPoint
> {code}
> Would generate :
> {code}
> public class LoggingProducer
> {
> @Produces
> public Logger produceLogger(InjectionPoint injectionPoint) {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
> Then, we can have more attributes :
> {code}
> cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger --accessType private --injectionPoint --qualifier Production --alternative=true --scoped Request --atNamed=true
> {code}
> {code}
> public class LoggingProducer
> {
> @Produces
> @Production
> @Alternative
> @RequestScoped
> @Named
> public Logger produceLogger() {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 7 months
[JBoss JIRA] (FORGE-2225) Being able to add a new CDI producer method to an existing class
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2225?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2225:
-------------------------------------
Summary: Being able to add a new CDI producer method to an existing class (was: Being able to create a new CDI producer method)
> Being able to add a new CDI producer method to an existing class
> ----------------------------------------------------------------
>
> Key: FORGE-2225
> URL: https://issues.jboss.org/browse/FORGE-2225
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.14.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> It would be good to have a command to add a CDI producer method to an existing class. A simple command such as :
> {code}
> cdi-new-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --accessType private
> {code}
> Would generate :
> {code}
> public class LoggingProducer
> {
> @Produces
> public Logger produceLogger() {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
> We can also have a parameter to add the injection point
> {code}
> cdi-new-producer-method --named produceLogger --type org.apache.logging.log4j.Logger --accessType private --injectionPoint
> {code}
> Would generate :
> {code}
> public class LoggingProducer
> {
> @Produces
> public Logger produceLogger(InjectionPoint injectionPoint) {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
> Then, we can have more attributes :
> {code}
> cdi-new-producer-method --named produceLogger --returnType org.apache.logging.log4j.Logger --accessType private --injectionPoint --qualifier Production --alternative=true --scoped Request --atNamed=true
> {code}
> {code}
> public class LoggingProducer
> {
> @Produces
> @Production
> @Alternative
> @RequestScoped
> @Named
> public Logger produceLogger() {
> throw new UnsupportedOperationException("Not supported yet.");
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 7 months
[JBoss JIRA] (FURNACE-76) AddonRegistry.getServices(Furnace.class) and AddonRegistry.getServices(AddonRegistry.class) throws Ambiguous exception
by George Gastaldi (JIRA)
George Gastaldi created FURNACE-76:
--------------------------------------
Summary: AddonRegistry.getServices(Furnace.class) and AddonRegistry.getServices(AddonRegistry.class) throws Ambiguous exception
Key: FURNACE-76
URL: https://issues.jboss.org/browse/FURNACE-76
Project: Forge: Furnace
Issue Type: Bug
Components: Runtime
Affects Versions: 2.21.0.Final
Reporter: George Gastaldi
Priority: Minor
Fix For: 2.x Future
{code}
java.lang.IllegalStateException: Cannot resolve Ambiguous dependencies: [org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:ui-test-harness,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:projects,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:configuration,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:convert,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:ui,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:parser-java,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:shell,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.addons.AddonRegistry from addon org.jboss.forge.addon:shell-test-harness,2.18.1-SNAPSHOT]
at org.jboss.forge.furnace.impl.addons.ImportedImpl.get(ImportedImpl.java:69)
at org.jboss.forge.addon.manager.AddonManagerTest.setUp(AddonManagerTest.java:86)
{code}
{code}
java.lang.IllegalStateException: Cannot resolve Ambiguous dependencies: [org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:convert,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:configuration,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:shell-test-harness,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:ui-test-harness,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:parser-java,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:shell,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:projects,2.18.1-SNAPSHOT,
org.jboss.forge.furnace.Furnace from addon org.jboss.forge.addon:ui,2.18.1-SNAPSHOT]
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 7 months