/** * {@inheritDoc} */ public void preUndeploy(IDeployable<?> deployable) { Dictionary<String, Object> dictionary = new Hashtable<String, Object>(); dictionary.put(EVENT_DEPLOYABLE_NAME_KEY, deployable.getShortName()); dictionary.put(EVENT_DEPLOYABLE_CURRENT_TIME, Long.valueOf(Calendar.getInstance().getTimeInMillis())); publisher.send(dictionary); }
/** * Unpack the given archive in the given folder, then build a local * deployable (and fill it with submodules for EAR) and then return it. * @param deployable the archive to unpack. * @param pattern the path in the pattern to use in the temp folder * @param keepExistingFiles if 'true', do not override existing files * @param earUnpackOpts options to unpack an ear * @param <T> an object implementing IDeployable * @return a new deployable (which is unpacked) * @throws DeployerException if the Deployable can't be unpacked */ public static <T extends IDeployable<T>> T unpack(final T deployable, final String pattern, final boolean keepExistingFiles, final EarUnpackOpts earUnpackOpts) throws DeployerException { File unpackedFolder = new File(createTmpFolder(pattern, deployable), deployable.getShortName()); unpackedFolder.mkdir(); return unpack(deployable, unpackedFolder, keepExistingFiles, earUnpackOpts); }
/** * {@inheritDoc} */ public void preDeploy(IDeployable<?> deployable) { if (deployable != null) { String name = deployable.getShortName(); DeployableState state = DeployableState.NOT_DEPLOYED; deployables.put(name, state); String path = null; try { path = deployable.getArchive().getURL().getPath(); } catch (ArchiveException e) { logger.error("Cannot get the path of the deployable " + name, e); } Dictionary<String, Object> dictionary = new Hashtable<String, Object>(); dictionary.put(EVENT_DEPLOYABLE_NAME_KEY, name); dictionary.put(EVENT_DEPLOYABLE_STATE_KEY, state); dictionary.put(EVENT_DEPLOYABLE_PATH_KEY, path); dictionary.put(EVENT_DEPLOYABLE_SOURCE_KEY, getDeployableSource(name)); dictionary.put(EVENT_DEPLOYABLE_CURRENT_TIME, Long.valueOf(Calendar.getInstance().getTimeInMillis())); publisher.send(dictionary); } }
String name = deployable.getShortName(); DeployableState state; Exception exception = null;
String name = deployable.getShortName(); DeployableState state; Exception exception = null;