[JBoss JIRA] (FORGE-2228) Cannot create a method on a Java Interface
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2228:
----------------------------------------
Summary: Cannot create a method on a Java Interface
Key: FORGE-2228
URL: https://issues.jboss.org/browse/FORGE-2228
Project: Forge
Issue Type: Enhancement
Components: Java EE
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
With [FORGE-1842] we can now create methods on Java classes. But it doesn't work on Java interface.
{code}
[util]$ java-new-interface --named MyInterface
[MyInterface.java]$ java-new-method --methodName generateNumber --returnType String --accessType public
***INFO*** Required inputs not satisfied, entering interactive mode
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2227) Being able to create a new Entity Listener
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2227:
----------------------------------------
Summary: Being able to create a new Entity Listener
Key: FORGE-2227
URL: https://issues.jboss.org/browse/FORGE-2227
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 create an Entity Listener. A command like this :
{code}
cdi-new-entity-listener --named MyListener ;
{code}
Would generate by default in the {{model}} package :
{code}
public class MyListener
{
}
{code}
Nothing too fancy, but the command could propose a list of events and generate a method per event :
{code}
cdi-new-entity-listener --named MyListener --events PRE_PERSIST POST_PERSIST PRE_UPDATE ;
{code}
{code}
public class MyListener
{
@PrePersist
private void prePersist(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@PostPersist
private void postPersist(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@PreUpdate
private void preUpdate(Object object)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2226) Being able to add a CDI injection point
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2226?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2226:
-------------------------------------
Description:
It would be useful to have a command to add a new CDI injection point to an existing bean. A command such as :
{code}
cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --accessType private
{code}
Would add to an existing class the following code :
{code}
@Inject
private Logger logger;
{code}
Private is the default access type and can be omited. A qualifier could be added with:
{code}
cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --qualifier Debug
{code}
Would add to an existing class the following code :
{code}
@Inject @Debug
private Logger logger;
{code}
was:
It would be useful to have a command to add a new CDI injection point to an existing bean. A command such as :
{code}
cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --accessType private
{code}
Would add to an existing class the following code :
{code}
@Inject
private Logger logger;
{code}
> Being able to add a CDI injection point
> ---------------------------------------
>
> Key: FORGE-2226
> URL: https://issues.jboss.org/browse/FORGE-2226
> 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 useful to have a command to add a new CDI injection point to an existing bean. A command such as :
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --accessType private
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject
> private Logger logger;
> {code}
> Private is the default access type and can be omited. A qualifier could be added with:
> {code}
> cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --qualifier Debug
> {code}
> Would add to an existing class the following code :
> {code}
> @Inject @Debug
> private Logger logger;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-1617) Command to add a new field to an existing constraint
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1617?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1617:
-------------------------------------
Description:
Some constraints need to have fields (attributes). For example, the {{URL}} constraint needs three fields : a protocol, a host, and a port :
{code}
constraint-add-field --named protocol --type String --targetConstraint URL
constraint-add-field --named host --type String --targetConstraint URL
constraint-add-field --named port --type String --targetConstraint URL
{code}
This will add the three attributes to the existing constraint {{URL}} :
{code}
@Documented
@Constraint(validatedBy = URLValidator.class)
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface URL {
String message() default "{org.mycompany.myproject.constraints.URL.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
String protocol() default "";
String host() default "";
int port() default -1;
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
public @interface List {
URL[] value();
}
}
{code}
But it will also add the three attributes to the implementation : attributes and {{initialize}} method :
{code}
public class URLValidator implements ConstraintValidator<URL, String> {
private String protocol;
private String host;
private int port;
@Override
public void initialize(URL url) {
this.protocol = url.protocol();
this.host = url.host();
this.port = url.port();
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
return false;
}
}
{code}
was:
Some constraints need to have fields (attributes). For example, the {{URL}} constraint needs three fields : a protocol, a host, and a port :
{code}
constraint-new-field --named protocol --type String --targetConstraint URL
constraint-new-field --named host --type String --targetConstraint URL
constraint-new-field --named port --type String --targetConstraint URL
{code}
This will add the three attributes to the existing constraint {{URL}} :
{code}
@Documented
@Constraint(validatedBy = URLValidator.class)
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface URL {
String message() default "{org.mycompany.myproject.constraints.URL.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
String protocol() default "";
String host() default "";
int port() default -1;
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
public @interface List {
URL[] value();
}
}
{code}
But it will also add the three attributes to the implementation : attributes and {{initialize}} method :
{code}
public class URLValidator implements ConstraintValidator<URL, String> {
private String protocol;
private String host;
private int port;
@Override
public void initialize(URL url) {
this.protocol = url.protocol();
this.host = url.host();
this.port = url.port();
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
return false;
}
}
{code}
> Command to add a new field to an existing constraint
> ----------------------------------------------------
>
> Key: FORGE-1617
> URL: https://issues.jboss.org/browse/FORGE-1617
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.1.1.Final
> Reporter: Antonio Goncalves
> Labels: Starter
> Fix For: 2.x Future
>
>
> Some constraints need to have fields (attributes). For example, the {{URL}} constraint needs three fields : a protocol, a host, and a port :
> {code}
> constraint-add-field --named protocol --type String --targetConstraint URL
> constraint-add-field --named host --type String --targetConstraint URL
> constraint-add-field --named port --type String --targetConstraint URL
> {code}
> This will add the three attributes to the existing constraint {{URL}} :
> {code}
> @Documented
> @Constraint(validatedBy = URLValidator.class)
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "{org.mycompany.myproject.constraints.URL.message}";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> String protocol() default "";
> String host() default "";
> int port() default -1;
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @Documented
> public @interface List {
> URL[] value();
> }
> }
> {code}
> But it will also add the three attributes to the implementation : attributes and {{initialize}} method :
> {code}
> public class URLValidator implements ConstraintValidator<URL, String> {
> private String protocol;
> private String host;
> private int port;
> @Override
> public void initialize(URL url) {
> this.protocol = url.protocol();
> this.host = url.host();
> this.port = url.port();
> }
> @Override
> public boolean isValid(String value, ConstraintValidatorContext context) {
> return false;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-1801) Being able to add a custom constraint annotation to a property
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1801?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1801:
-------------------------------------
Summary: Being able to add a custom constraint annotation to a property (was: Being able to add a custom annotation to a property)
> Being able to add a custom constraint annotation to a property
> --------------------------------------------------------------
>
> Key: FORGE-1801
> URL: https://issues.jboss.org/browse/FORGE-1801
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.5.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> With [FORGE-1616] I can now create my own constraint. For example, this is the way I create an ISBN constraint :
> {code}
> constraint-new-annotation --named ISBN
> {code}
> The constraint is created, by default, under the {{constraint}} package. Now the problem, is that I can't apply it to a property because the constraint is not known. If I add a constraint, and press TAB for completion, ISBN does not appear :
> {code}
> [Book.java]$ constraint-add --onProperty isbn --constraint TAB
> Valid Null NotNull AssertTrue AssertFalse Min Max DecimalMin DecimalMax Size Digits Past Future Pattern
> {code}
> Even if I try to add the location of the constraint, it does not work :
> {code}
> [Book.java]$ constraint-add --onProperty isbn --constraint ../constraints/ISBN
> [0] - Valid
> [1] - Null
> [2] - NotNull
> [3] - AssertTrue
> [4] - AssertFalse
> [5] - Min
> [6] - Max
> [7] - DecimalMin
> [8] - DecimalMax
> [9] - Size
> [10] - Digits
> [11] - Past
> [12] - Future
> [13] - Pattern
> ***ERROR*** Constraint must be specified.
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-1617) Command to add a new field to an existing constraint
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1617?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1617:
-------------------------------------
Summary: Command to add a new field to an existing constraint (was: Command constraint-new-field to add a new field to an existing constraint)
> Command to add a new field to an existing constraint
> ----------------------------------------------------
>
> Key: FORGE-1617
> URL: https://issues.jboss.org/browse/FORGE-1617
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.1.1.Final
> Reporter: Antonio Goncalves
> Labels: Starter
> Fix For: 2.x Future
>
>
> Some constraints need to have fields (attributes). For example, the {{URL}} constraint needs three fields : a protocol, a host, and a port :
> {code}
> constraint-new-field --named protocol --type String --targetConstraint URL
> constraint-new-field --named host --type String --targetConstraint URL
> constraint-new-field --named port --type String --targetConstraint URL
> {code}
> This will add the three attributes to the existing constraint {{URL}} :
> {code}
> @Documented
> @Constraint(validatedBy = URLValidator.class)
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "{org.mycompany.myproject.constraints.URL.message}";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> String protocol() default "";
> String host() default "";
> int port() default -1;
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @Documented
> public @interface List {
> URL[] value();
> }
> }
> {code}
> But it will also add the three attributes to the implementation : attributes and {{initialize}} method :
> {code}
> public class URLValidator implements ConstraintValidator<URL, String> {
> private String protocol;
> private String host;
> private int port;
> @Override
> public void initialize(URL url) {
> this.protocol = url.protocol();
> this.host = url.host();
> this.port = url.port();
> }
> @Override
> public boolean isValid(String value, ConstraintValidatorContext context) {
> return false;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2226) Being able to add a CDI injection point
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2226:
----------------------------------------
Summary: Being able to add a CDI injection point
Key: FORGE-2226
URL: https://issues.jboss.org/browse/FORGE-2226
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
It would be useful to have a command to add a new CDI injection point to an existing bean. A command such as :
{code}
cdi-add-injection-point --named logger --type org.apache.logging.log4j.Logger --accessType private
{code}
Would add to an existing class the following code :
{code}
@Inject
private Logger logger;
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2225) Being able to create a new CDI producer method
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2225:
----------------------------------------
Summary: Being able to create a new CDI producer method
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
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 --returnType 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 --returnType 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.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGE-2224) Rename attribute methodName in command java-new-method
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-2224:
----------------------------------------
Summary: Rename attribute methodName in command java-new-method
Key: FORGE-2224
URL: https://issues.jboss.org/browse/FORGE-2224
Project: Forge
Issue Type: Enhancement
Components: Java EE
Affects Versions: 2.14.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
The {{java-new-method}} has the following attributes :
{code}
$ java-new-method
--targetClass --returnType --parameters --accessType --methodName
{code}
The attribute {{methodName}} should be renamed to {{named}} to follow the Forge naming convention.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months
[JBoss JIRA] (FORGEPLUGINS-162) JBoss AS Addon gets NPE
by Jérémie Lagarde (JIRA)
[ https://issues.jboss.org/browse/FORGEPLUGINS-162?page=com.atlassian.jira.... ]
Jérémie Lagarde resolved FORGEPLUGINS-162.
------------------------------------------
Resolution: Done
See https://github.com/jerr/as-addon/commit/befc8e5428be7e8f52c9135adb66d9a17...
> JBoss AS Addon gets NPE
> -----------------------
>
> Key: FORGEPLUGINS-162
> URL: https://issues.jboss.org/browse/FORGEPLUGINS-162
> Project: Forge Plugins/Addons
> Issue Type: Bug
> Components: JBoss AS Plugin
> Reporter: Antonio Goncalves
> Assignee: Jérémie Lagarde
> Priority: Critical
>
> I've installed the latest version of Forge (2.4.2-SNAPSHOT) and JBoss AS Addon :
> {code}
> [demo]$ addon-list
> Currently installed addons:
> ...
> org.jboss.forge.addon:as,2.0.0-SNAPSHOT
> org.jboss.forge.addon:as-jboss-as7,2.0.0-SNAPSHOT
> org.jboss.forge.addon:as-jboss-wf8,2.0.0-SNAPSHOT
> org.jboss.forge.addon:as-spi,2.0.0-SNAPSHOT
> {code}
> Things work kind of ok, I manage to start JBoss, deploy app, but once in a while (I don't know how to reproduce it) I get a NPE on the logs, and then, all the {{as}} commands disappear (not TAB completion), and that's the end of the add-on. Even restarting Forge doesn't help. I need to remove and re-install the addon.
> {code}
> 19:24:01,527 SEVERE [org.jboss.forge.addon.ui.impl.command.CommandFactoryImpl] (Aesh Process Loop 2020314661) Error while checking if command org.jboss.forge.addon.as.ui.ASUndeployWizardImpl@4d75c021 isEnabled: java.lang.NullPointerException
> at org.jboss.forge.addon.as.ui.AbstractASWizardImpl.getSelectedProvider(AbstractASWizardImpl.java:83)
> at org.jboss.forge.addon.as.ui.AbstractASWizardImpl.isEnabled(AbstractASWizardImpl.java:61)
> at sun.reflect.GeneratedMethodAccessor238.invoke(Unknown Source) [:1.7.0_45]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
> at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:59) [furnace-proxy-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34) [furnace-api-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:75) [furnace-proxy-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.addon.as.ui.ASUndeployWizardImpl_$$_javassist_edd91fc8-6604-4157-bd0e-1803e7ea98d4.isEnabled(ASUndeployWizardImpl_$$_javassist_edd91fc8-6604-4157-bd0e-1803e7ea98d4.java)
> at org.jboss.forge.addon.ui.util.Commands.isEnabled(Commands.java:54) [ui-api-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.addon.ui.impl.command.CommandFactoryImpl.getEnabledCommandNames(CommandFactoryImpl.java:77) [ui-impl-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
> at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:59) [furnace-proxy-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34) [furnace-api-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:75) [furnace-proxy-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.addon.ui.impl.command.CommandFactoryImpl_$$_javassist_2cbdd21c-7325-462b-9a45-1a35fe865a17.getEnabledCommandNames(CommandFactoryImpl_$$_javassist_2cbdd21c-7325-462b-9a45-1a35fe865a17.java) [ui-impl-2.4.2-SNAPSHOT.jar:2.4.2-SNAPSHOT]
> at org.jboss.forge.addon.shell.aesh.ForgeCommandRegistry.getForgeCommandNames(ForgeCommandRegistry.java:171)
> at org.jboss.forge.addon.shell.aesh.ForgeCommandRegistry.getAllCommandNames(ForgeCommandRegistry.java:162)
> at org.jboss.aesh.console.AeshConsoleImpl.completeCommandName(AeshConsoleImpl.java:180)
> at org.jboss.aesh.console.AeshConsoleImpl.access$000(AeshConsoleImpl.java:48)
> at org.jboss.aesh.console.AeshConsoleImpl$AeshCompletion.complete(AeshConsoleImpl.java:227)
> at org.jboss.aesh.console.AeshCompletionHandler.complete(AeshCompletionHandler.java:125)
> at org.jboss.aesh.console.AeshInputProcessor.complete(AeshInputProcessor.java:363)
> at org.jboss.aesh.console.AeshInputProcessor.parseOperation(AeshInputProcessor.java:148)
> at org.jboss.aesh.console.Console.processInternalOperation(Console.java:592)
> at org.jboss.aesh.console.Console.execute(Console.java:582)
> at org.jboss.aesh.console.Console.access$700(Console.java:60)
> at org.jboss.aesh.console.Console$6.run(Console.java:499)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
9 years, 4 months