!--a11y-->
Deployment Handler 
If the deployment hook returns a DeploymentHandler, then this handler is called for each entry in the PAR file and can decide if it wants to handle the entry or not:
Event |
Description |
ENTRY_UPLOAD |
An entry of the corresponding PAR is loaded in the Portal Content Directory (PCD) |
ENTRY_DEPLOYMENT |
An entry in the PAR is going to be deployed |

public boolean handleEvent(IDeploymentEvent event) throws DeploymentHookException { if (event instanceof IDeploymentEntryEvent) { IDeploymentEntryEvent entryEvent = (IDeploymentEntryEvent) event; String entryName = entryEvent.getEntryName(); if (entryName.indexOf("cr-plugins") != -1) { System.out.println("Deploying entry .... :" + entryName); return true; } } return false; } |
The PAR entry is retrieved from an input stream of the IdeploymentEntryEvent.

if (entryName.endsWith(".xml")) { InputStream is = entryEvent.getInputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ..... } |
The deployment handler receives the following other events:
Event |
Description |
COMMIT_UPLOAD |
All the events handlers involved in the upload process have been executed successfully |
COMMIT_DEPLOYMENT |
All the events handlers involved in the deploy process have been executed successfully |
ROLLBACK_UPLOAD |
Not supported in current version |
ROLLBACK_DEPLOYM |
Not supported in current version |

Global events are not sent to the deployment handlers, but to the deployment hooks instead (as soon as the service implements both interfaces).
