How to deploy and parse files with custom extensions in wildfly?

39 views
Skip to first unread message

Sayantan Ganguly

unread,
Jan 30, 2023, 12:10:33 PM1/30/23
to WildFly
Hello All,

I have a requirement to deploy files in wildfly with custom extensions (*.XYZ), this is required to deliver content. The files will have similar structure like a regular deployment (WAR/EAR) but will have other descriptor files which needs to be parsed and classes to be run.

Additionally, I have a requirement of listeners to take action on the specific file deployment notification and classpath resolvers to resolve the associated dependencies.

In Jboss 6x this was achieved by extending org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer & org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer classes. The file extension was set using setJarExtension from AbstractParsingDeployerWithOutput class.

Any kind of pointers are much appreciated!

Thanks,
Sayantan

Sayantan Ganguly

unread,
Jan 31, 2023, 3:22:36 AM1/31/23
to WildFly
Looking for recommendations

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/2e16db4f-c466-4cc2-b11d-5c0f0b150777n%40googlegroups.com.

Paul Ferraro

unread,
Jan 31, 2023, 8:15:55 AM1/31/23
to WildFly
To do this, you will need to create a WildFly extension that registers a subsystem which registers custom DeploymentUnitProcessors.

Sayantan Ganguly

unread,
Feb 1, 2023, 10:56:42 AM2/1/23
to Paul Ferraro, WildFly
Hi Paul,

Thanks for the prompt reply! 

Could you also help me understand the below behavior from the example:

processorTarget.addDeploymentProcessor("server", Phase.DEPENDENCIES, 0x4000, new SubsystemDeploymentProcessor());

In my case I was able to register the tracker subsystem and register tracker.xyz service, but the deploy() method was not called on a deployment. I changed the line to the one below and the deploy() method was called on deployment of an artifact: 

processorTarget.addDeploymentProcessor("server", Phase.STRUCTURE, Phase.STRUCTURE_MOUNT, new SubsystemDeploymentProcessor());

although, the phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT); is returning null.

Am I missing something? Could you please suggest.

Thanks!


--
You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/VY0asOTSQb4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/db24577a-194f-42c6-8457-17cf2e17677dn%40googlegroups.com.

Paul Ferraro

unread,
Feb 10, 2023, 10:09:12 AM2/10/23
to WildFly
On Wednesday, February 1, 2023 at 10:56:42 AM UTC-5 Sayantan Ganguly wrote:
Hi Paul,

Thanks for the prompt reply! 

Could you also help me understand the below behavior from the example:

processorTarget.addDeploymentProcessor("server", Phase.DEPENDENCIES, 0x4000, new SubsystemDeploymentProcessor());

In my case I was able to register the tracker subsystem and register tracker.xyz service, but the deploy() method was not called on a deployment. I changed the line to the one below and the deploy() method was called on deployment of an artifact: 

processorTarget.addDeploymentProcessor("server", Phase.STRUCTURE, Phase.STRUCTURE_MOUNT, new SubsystemDeploymentProcessor());

You most certainly do not want to override an existing deployment unit processor.  See below.
 
although, the phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT); is returning null.

This is because your SubsystemDeploymentProcessor was installed using the same priority as the existing DeploymentRootMountProcessor whose responsibility it is to attach this.  If you want to make sure this processor runs before yours, you should use a priority with a larger value.
Additionally, make sure to register your deployment unit processor using the name of your subsystem, which I assume is "tracker" (and not "server").
Reply all
Reply to author
Forward
0 new messages