Context
A deployer needs to act upon information stored within a deployment unit.
Problem
The deployer is unaware of the mechanism to extract such information from the deployment unit.
Solution
The deployer delegates to an informer to let the informer provide the information for the deployment to happen.
Structure
Sample Code
private JavaEEComponentInformer informer; @Override public void deploy(DeploymentUnit unit, DummyMetaData deployment) throws DeploymentException { String appName = informer.getApplicationName(unit); String moduleName = informer.getModulePath(unit); String componentName = informer.getComponentName(unit); // do your stuff } @Inject public void setJavaEEComponentInformer(JavaEEComponentInformer informer) { this.informer = informer; }
Comments