[jboss-user] [Microcontainer] - Re: StructureDeployer that supports subdeployments
alesj
do-not-reply at jboss.com
Mon Aug 3 07:51:38 EDT 2009
"beve" wrote :
| Regarding the solution with a StructureProcessor and the example you gave , SeamTempModificationTypeMatcher. Could you explain a little more how this could be used to solve the issue with subdirectory deployments?
|
You would write your own EsbModificationTypeMatcher.
Where ModificationTypeStructureProcessor picks up this EMTM by MC's incallback.
e.g.
| public class EsbModificationTypeMatcher implements ModificationTypeMatcher
| {
| private StructureDeployer warStructureDeployer = null; // get it injected
| private VFSStructuralDeployers deployers = null; // get it injected
|
| public boolean determineModification(VirtualFile root, StructureMetaData structureMetaData)
| {
| try
| {
| if (root.getName().endsWith(".esb"))
| {
| VirtualFile wars = root.getChild("wars");
| if (wars != null)
| {
| List<VirtualFile> children = wars.getChildren();
| for (VirtualFile war : children)
| {
| StructureContext context = new StructureContext(root, root, war, structureMetaData, deployers, null);
| warStructureDeployer.determineStructure(context);
| }
| }
| return true;
| }
| }
| catch (Exception ignored)
| {
| }
| return false;
| }
|
| public boolean determineModification(VirtualFile root, ContextInfo contextInfo)
| {
| // cannot change sub-deployment
| return false;
| }
| }
|
Perhaps try something like this.
If this doesn't work, I would fallback to writing my own StructureDeployer.
Where you can extend JARStructure (to only understand .esb) + change its candidateStructureVisitorFactory.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247569#4247569
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247569
More information about the jboss-user
mailing list