public void onRead(final PipedDeserializer deserializer) { try { this.threadPoolTaskExecutor.execute(deserializer); } catch (final RejectedExecutionException e) { this.log.error("A message deserialization task has been rejected (" + e.getMessage() + ")"); } }
public void undo(Context context) throws Exception { URL downloadUrl = context.getArchiveUrl(); if (downloadUrl != null) { try { FileUtils.forceDelete(new File(downloadUrl.getPath())); } catch (IOException e) { this.log.error("Failed to clean downloaded artefact " + downloadUrl); } } }
public void undo(Context context) throws Exception { File tempDir = context.getUnzipRoot(); if (tempDir != null) { try { if (tempDir.exists()) { FileUtils.forceDelete(tempDir); } } catch (IOException e) { this.log.error("Failed to delete the temporary directory '" + tempDir.getAbsolutePath() + "'", e); } } }
private void write(final SelectionKey key) { this.log.start(); final Object attach = key.attachment(); if (attach instanceof OutputSocketChannelContext) { ((OutputSocketChannelContext) attach).write(key); } else { // This problem should not occur because it's a bug this.log.error("Unexpected key attachment on OP_WRITE: " + attach.getClass().getName()); } this.log.end(); }
@SuppressWarnings("deprecation") public void undo(Context context) throws Exception { URL archiveUrl = context.getArchiveUrl(); if (archiveUrl != null) { File archiveFile = new File(URLDecoder.decode(archiveUrl.getPath())); File installedArchive = this.getInstalledArchive(archiveFile.getName()); if (installedArchive.exists()) { try { FileUtils.forceDelete(installedArchive); } catch (IOException e) { this.log.error("Component archive can not be deleted", e); } } } } }
/** * Install the specified shared library in the JBI container Any exception * will cause the abortion of the process. A file "fileName.success" will be * created if success A file "fileName.failed" will be created otherwise, * containing the related exception * * @param slFile * The shared library */ private void performInstallSL(File slFile) { this.log.call(); try { this.installationService.installSharedLibrary(slFile.toURI().toString()); } catch (final Throwable e) { this.log.error("Failed to auto-install a shared library"); } }
public void execute(Context context) throws Exception { String name = context.getEntityName(); try { this.repositoryService.removeServiceAssembly(name); } catch (IOException e) { this.log.error( "The service assembly '" + name + "' can not be removed from repository", e); } }
public void undo(Context context) throws Exception { String entityName = context.getEntityName(); String entityVersion = context.getEntityVersion(); if (entityName != null) { try { this.deleteEntityStateHolder(entityName, entityVersion); } catch (Exception e) { this.log.error("Failed to revert a CreateStateHolderTask", e); } } }
public void undo(Context context) throws Exception { String entityName = context.getEntityName(); String entityVersion = context.getEntityVersion(); if (entityName != null) { try { this.removeEntityPackage(entityName, entityVersion); } catch (IOException e) { this.log.error("Unable to remove the entity package", e); } } }
@Override protected void setState(String state) throws JBIException { super.setState(state); try { this.systemStateService.updateComponentLifeCycleState(this.name, state); } catch (Exception e) { String msg = "Component state can't be persisted"; this.log.error(msg, e); throw new JBIException(msg, e); } }
public void execute(Context context) { String slName = context.getEntityName(); String version = context.getEntityVersion(); try { this.repositoryService.removeSharedLibrary(slName, version); } catch (IOException e) { this.log.error("The shared library '" + slName + "' can not be removed from repository", e); } }
public void execute(Context context) throws Exception { String name = context.getEntityName(); ServiceAssembly serviceAssemblyStateHolder = null; try { serviceAssemblyStateHolder = this.recoveryService .deleteServiceAssemblyStateHolder(name); } catch (Exception e) { this.log .error("The service assembly '" + name + "' state holder can not be removed", e); } context.setServiceAssemblyStateHolder(serviceAssemblyStateHolder); }
public void execute(Context context) throws Exception { String componentName = context.getEntityName(); Component componentStateHolder = null; try { componentStateHolder = this.systemStateService .deleteComponentStateHolder(componentName); } catch (SystemStateException e) { this.log.error("The component '" + componentName + "' state holder can not be removed", e); } context.setComponentStateHolder(componentStateHolder); }
public String[] getServiceUnitForServiceAssembly(String saName) throws Exception { this.log.start(); ParameterCheckHelper.isNullOrEmptyParameterWithLog(saName, "saName", this.log); List<String> result = new ArrayList<String>(); ServiceAssemblyLifeCycle saLifeCycle = this.adminService.getServiceAssemblyByName(saName); if (saLifeCycle != null) { List<ServiceUnit> serviceUnits = saLifeCycle.getServiceAssembly().getServiceUnit(); for (ServiceUnit serviceUnit : serviceUnits) { result.add(serviceUnit.getIdentification().getName()); } } else { String msg = "Cannot retrieve service assembly with the name '" + saName + '"'; this.log.error(msg); throw new Exception(msg); } this.log.end(); return result.toArray(new String[result.size()]); }
public void undo(Context context) throws Exception { final Jbi descriptor = context.getDescriptor(); final String componentName = descriptor.getComponent().getIdentification().getName(); try { // Unregister the InstallerMBean this.adminService.unregisterInstaller(componentName); } catch (final ManagementException e) { this.log.error("Component installer can't be unregistered or doesn't exist", e); } try { this.containerService.removeInstaller(componentName); } catch (PetalsException e) { this.log.error("Fractal installer can't be removed or doesn't exist", e); } } }
@LifeCycle(on = LifeCycleType.STOP) protected void stop() { this.log.start(); if (this.initialContextDecorator != null) { try { this.initialContextDecorator.closeInitialContextDecorator(); } catch (final NamingException e) { this.log.error(e); } finally { this.initialContextDecorator = null; } } this.log.end(); }
public void execute(Context context) { String slName = context.getEntityName(); String version = context.getEntityVersion(); SharedLibrary sharedLibraryStateHolder = null; if (slName != null) { try { sharedLibraryStateHolder = this.recoveryService.deleteSharedLibraryStateHolder( slName, version); context.setSharedLibraryStateHolder(sharedLibraryStateHolder); } catch (SystemStateException e) { this.log.error("The shared library '" + slName + "' with version '" + version + "' state holder can not be removed", e); } } }
/** * Stop the RMI Server */ @LifeCycle(on = LifeCycleType.STOP) protected void stop() { this.log.start(); if (this.cs != null) { try { this.cs.stop(); } catch (Exception e) { this.log.error("Failed to stop JMX RMI connector service", e); } } this.log.end(); }
public void undo(Context context) throws Exception { Jbi descriptor = context.getDescriptor(); if (descriptor != null) { Connections connections = descriptor.getServiceAssembly().getConnections(); if (connections != null) { for (Connection connection : connections.getConnection()) { try { this.removeConnection(connection); } catch (Exception e) { this.log.error("Failed to revert a RegisterAllConnectionTask", e); } } } } }
public void undo(Context context) throws Exception { this.log.debug("Revert DeploySUToComponent"); if ((context.getSuInstallUrl() != null) && (context.getSuDescriptorInSa() != null)) { try { this.undeploySUFromComponent(context.getSuInstallUrl(), context .getSuDescriptorInSa()); } catch (ManagementException e) { this.log.error("Failed to revert a DeploySUToComponentask", e); } } }