Is #CEntryPoint supported in Quarkus? - quarkus

I'm working on a Quarkus project, and am enjoying how much quicker it is to develop, compared to normal Java.
I'm interested to know whether all GraalVm and Substrate features are available, and in particular if the #CEntryPoint annotation is available and usable?
I recently read a blog article about how to make Java code usable in c++ using Graal and this annotation.
If this is possible it would open up a lot of possibilities, such as creating python modules, that call a Quarkus or Graal shared object.

This should just work, this is a Graal VM feature so should not require any specific support in Quarkus.

Related

Is it possible to pick up any library from the Maven repository and use into Quarkus app

I am new to the Quarkus, Is it possible to pick up any library from the Maven repository and use into Quarkus app.
or i can only use these Code.
Is there any impact on performance?
If you plan on building a Java app deployed on the JVM, you should be able to use any library.
Things are a bit different if you plan to build a native executable. In this case, a library might need some additional metadata for GraalVM. That's one of the things we do in our Quarkus extensions.

How do I implement dynamic reloading in Spring (Netbeans)?

I'm used to writing Grails applications where my view or controller changes are automatically redeployed on save. I'm now stringing together a Spring Web-
MVC application and I'd like the same feature.
I'm using Netbeans as an IDE, Gradle as a build tool and the spring-boot plugin at the moment. I remember some talk of people using Jetty as it's so quick to restart that dynamic class reloading / deployment is no longer necessary. I've heard others mention JRebel which I used to use a few years back. I'm sure there is a more modern, spring-supported / spring-standard way of doing it.
I'd also like to know if you recommend deploying as a WAR or as a standalone executable JAR with a lightweight built-in web server.
Recommendations appreciated.
A yet unsolved challenge
It turns out that the Netbeans Gradle plugin does not support "compile on save" out-of-the box - and this means that a Java Agent won't be able to pick up the changes. The author kelemen suggested one or two approaches around this. It's a non-negotiable for me, so I decided to switch IDE's to Eclipse (terrible Gradle support), then IntelliJ Idea - which is looking very promising.
Netbeans Gradle Author Comment: https://github.com/kelemen/netbeans-gradle-project/issues/183
Alternatively, there is Jrebel, which is claimed to be able to support this Netbeans / Gradle combination. I wasn't able to get it working easily using a trial of JRebel. The JRebel support guys are there to help, so if you're willing to pay the price, it's likely that their support team will solve your problems.
JRebel: http://zeroturnaround.com/software/jrebel/
If anything changes, please comment below...
Spring class reloading is supported by HotswapAgent as well. It is free alternative to JRebel.
Spring has their own agent as well: https://github.com/spring-projects/spring-loaded. While developing why not just use embedded Tomcat/Jetty provided by Spring Boot.

What to choose - sbt, maven or activator - for developing standalone command-line modules for Play?

I am investigating possible frameworks for the future web-app I am tasked of building and Play framework 2.3 is pretty much sitting atop the list - however, I haven't used it until now (had used Spring and Maven in another life) and I have a particular requirement on the app itself so I wanted to hear advice/thoughts from people who have used Play so far (the language used will be Java 8).
The web-app consists of modules, some of which are stand-alone units that should be built as a jars (so that they can be accessed from command-line as a part of, say, batch script) as well as being built to function within the full-blown web-app.
Now, I've previously built apps with maven and I could imagine a way to do it with it but Play comes with its own build/dependency management tool (SBT) which I am unfamiliar with and don't know the capabilities of (is this even possible to achieve with SBT? How difficult would it be?).
That being said, I have done some cursory research on the subject and I know there is play2-maven-plugin, however the examples on the homepage deal with Scala (which I, as said above, unfortunately can't use).
What's certain is that I'd definitely like to escape from any "bridging" between SBT and maven - I wouldn't want to maintain two build systems and reconcile the differences between them together, that seems nightmarish.
Lastly, I've found in this SO thread, using maven with Play 2.3 may not even be an option (SBT apparently does somehow use Maven dependencies under the hood). After all, Play was conceived as partial departure from Java EE practices so it doesn't surprise me Maven is not natively supported. Also, Play integration with Maven proved to be troublesome.
I have no objection towards learning SBT or using just maven (if that's possible/advisable) - any of these approaches I am fine with, it's just the capabilities of SBT I am unfamiliar with (especially considering the requirement from above). Mixing SBT and maven seems frankly a bit scary and documentation on building Play with SBT seems scarce at this point.
Should I go with SBT or maven? What tutorials/docs would you recommend? Should I use Activator for getting to know SBT?
NOTE I was almost to flag the question as unclear what you're asking, but at the very end of it found the real questions I'm going to answer here.
Should I go with SBT or maven?
SBT or even better Typesafe Activator. Install it on your computer, and execute activator new myNewCoolPlayJava8App play-java to get started with Play and Java.
Apache Maven might be a viable option, but don't think it's going to be a time-saver (you'll be spending quite some time to get the configuration working).
What tutorials/docs would you recommend?
The official web site of Play Framework is enough to get started with the stack (and don't get stuck) - https://www.playframework.com/documentation. I very often use it and found it very informative. When I need a bit more in-depth information I use Google or StackOverflow (under playframework).
Should I use Activator for getting to know SBT?
No. SBT can live without Activator, but no vice versa. SBT's the foundation for Activator. See https://www.playframework.com/documentation/2.3.x/Build:
The Play build system uses sbt, a high-performance integrated build
for Scala and Java projects. Using sbt as our build tool brings
certain requirements to play which are explained on this page.
And from the Activator's docs (just at the very bottom of the page):
Activator applications use sbt under the covers. This means that
anything you can do in sbt you can do with an application in
Activator. For instance, sbt plugins can easily be added to
applications in Activator just like they would normally be added.

Adopt Spring Roo and JBoss Forge

Roo is tied to Spring framework and Maven is inherent, while Forge is closely related to Java EE/JBoss-AS and Maven becomes optional.
Can we use either of them to scaffold something independent of programming models, namely Spring framework or Java EE/CDI herewith?
Any pointers about Forge and Maven integration? Quick google leads to no useful links yet.
Since 2 years I use Telosys Tools (instead of ROO) for Java applications scaffolding
because this code generator is simple and independent of any kind of environment
(it's possible to generate anything : Java, HTML, Python, etc...)
Some predefined templates are available on GitHub, if they don't match your needs you can create your own templates for your specific targets
cf tutorials : https://sites.google.com/site/telosystutorial/
Telosys ( http://www.telosys.org/ ) is a good tool to bootstrap a project. The scaffolding is possible from a database or from a lightweight text model.
The code generation is based on Velocity templates so you can customize existing templates or create your own templates.
Everything is free and Open Source (generator and templates).
There is nothing that ties Forge to JBoss AS or really Java EE for that matter. At it's core Forge is a shell for generating resources. The available plugins tend to be Java EE focused, but they don't have to be.
Have a look at the Forge website. There is plenty of information on it there. Also JBoss Tools has nice integration with it if you use eclipse too.

How to deploy a common library in Websphere?

I'm just learning Websphere 8.5 and would like to know what is the simplest way to add a library, such as iText library so that it's available to all applications running on WAS.
I can see that both a Shared Library option is available in the Admin console and a some more advanced thing like "Business Level Application" which is made up of several assets.
What is the correct approach to achieve my goal ?
Thanks
You should not develop your applications with implicit dependencies which are in fact explicit. If the dependency is crucial for your application, it should be somehow marked as such.
With that said, there are two approaches in WebSphere - a shared library or OSGi bundle.
For the shared library concept, read Associating shared libraries with applications or modules.
If you use OSGi to develop your application(s), I'd recommend declare the dependencies in Application-Content of APPLICATION.MF and have them available in Internal or External bundle repositories.
I don't think BLA applies in your scenario, but would not be surprised to see how wrong I am.
p.s. Wonder why the question is tagged as websphere-7 since it refers to WebSphere 8.5?

Resources