/** * @see org.ow2.petals.extensions.transporter.nio.selector.NioClient#onClose(java.nio.channels.SocketChannel) */ public void onClose(final SocketChannel socketChannel) { this.isUsable = false; this.log.warning("Connection closed by the server side (" + socketChannel.socket().getInetAddress() + ")."); try { this.disconnect(); } catch (final IOException e) { this.log.warning(e.getMessage(), e); } }
/** * {@inheritDoc} */ @Override public void run() { try { Thread.sleep(1000); RuntimeServiceImpl.this.petalsAdminInterface.stopContainer(); } catch (Exception e) { RuntimeServiceImpl.this.log.warning("Container can not be stopped remotely", e); } } };
@SuppressWarnings("deprecation") public void undo(Context context) throws Exception { URL archiveURL = context.getArchiveUrl(); if (archiveURL != null) { final String archiveFilepath = URLDecoder.decode(archiveURL.getPath()); try { FileUtils.forceDelete(new File(archiveFilepath)); } catch (IOException e) { this.log.warning("Failed to clean the copied archive '" + archiveFilepath + "'"); } } } }
/** * {@inheritDoc} */ @Override public void run() { try { Thread.sleep(1000); RuntimeServiceImpl.this.petalsAdminInterface.shutdownContainer(); } catch (Exception e) { RuntimeServiceImpl.this.log.warning("Container can not be shutdowned remotely", e); } } };
public boolean stop(String saId) throws PetalsException { boolean result = true; try { String report = this.deploymentService.stop(saId); // really really bad... result = (report.indexOf("Successfully") > -1); } catch (Exception e) { log.warning(e.getMessage()); throw new PetalsException(e.getMessage()); } return result; }
public boolean shutdown(String saId) throws PetalsException { boolean result = true; try { String report = this.deploymentService.shutDown(saId); // really really bad... result = (report.indexOf("Successfully") > -1); } catch (Exception e) { log.warning(e.getMessage()); throw new PetalsException(e.getMessage()); } return result; }
public boolean undeploy(String saId) throws PetalsException { boolean result = true; try { String report = this.deploymentService.undeploy(saId); // really really bad... result = (report.indexOf("Successfully") > -1); } catch (Exception e) { log.warning(e.getMessage()); throw new PetalsException(e.getMessage()); } return result; }
public boolean start(String saId) throws PetalsException { boolean result = true; try { String report = this.deploymentService.start(saId); // really really bad... result = (report.indexOf("Successfully") > -1); } catch (Exception e) { log.warning(e.getMessage()); throw new PetalsException(e.getMessage()); } return result; }
public boolean deploy(URL saURL) throws PetalsException { boolean result = true; if (saURL == null) { throw new PetalsException("Service assembly URL is null"); } try { String report = this.deploymentService.deploy(saURL.toString()); // really really bad... result = (report.indexOf("Successfully") > -1); } catch (Exception e) { log.warning(e.getMessage()); throw new PetalsException(e.getMessage()); } return result; }
public ServiceEndpoint[] getEndpoints(QName interfaceName) { this.logger.start(); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getInternalEndpointsForInterface(interfaceName, LinkType.STANDARD); } catch (Exception e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public ServiceEndpoint[] getExternalEndpointsForService(QName serviceName) { this.logger.start(); ParameterCheckHelper.isNullParameter(serviceName, "serviceName"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getExternalEndpointsForService(serviceName); } catch (RegistryException e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
public ServiceEndpoint[] getEndpointsForService(QName serviceName) { this.logger.start(); ParameterCheckHelper.isNullParameter(serviceName, "serviceName"); // switch the classloader to the container one ClassLoader componentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); ServiceEndpoint[] result = null; try { result = this.componentContextCommunication.getEndpointRegistry() .getInternalEndpointsForService(serviceName, LinkType.STANDARD); } catch (RegistryException e) { this.logger.warning(e.getMessage()); } finally { Thread.currentThread().setContextClassLoader(componentClassLoader); } this.logger.end(); return result; }
/** * {@inheritDoc} */ public void removeService(String name) throws WebServiceException { Server server = this.servers.get(name); if (server != null) { try { server.stop(); } catch (Throwable e) { final String message = "Web Service " + name + " can not be removed"; if (this.log.isWarnEnabled()) { this.log.warning(message, e); } throw new WebServiceException(message, e); } this.servers.remove(name); } } }
public void deleteClassLoader(String classLoaderId) { this.log.start(); if (!this.containsClassLoader(classLoaderId)) { this.log.warning("No classloader with Id " + classLoaderId + " loaded. Can not remove it"); return; } final PetalsClassLoader classLoader = this.classLoaders.remove(classLoaderId); if (classLoader instanceof SharedLibraryClassLoader) { this.sharedLibrariesClassLoader.removeSharedLibraryClassLoader(classLoaderId); } classLoader.close(); this.log.end(); }
/** * Stop of the petals component * */ @LifeCycle(on = LifeCycleType.STOP) protected void stop() { this.log.call(); try { this.bootstrapThread.shutdownThread(); } catch (JBIException e) { this.log.warning("Failed to stop the Bootstrap thread : " + e.getMessage()); } this.logger = null; }
public ObjectName[] getSystemServices() { this.log.call(); ObjectName[] names = new ObjectName[3]; try { names[0] = MBeanHelper.retrieveServiceMBean(MBeanHelper.ADMIN_MBEAN, this.mbeanServer); names[1] = MBeanHelper.retrieveServiceMBean(MBeanHelper.DEPLOYMENT_MBEAN, this.mbeanServer); names[2] = MBeanHelper.retrieveServiceMBean(MBeanHelper.INSTALLATION_MBEAN, this.mbeanServer); } catch (MalformedObjectNameException e) { this.log.warning("A system service name can't be retrieved !", e); } return names; }
/** * {@inheritDoc} */ public boolean shutdown(String saId) throws PEtALSWebServiceException { if (this.log.isDebugEnabled()) { this.log.debug("Entering method : shutdown with params saId = " + saId); } boolean result = true; try { result = this.deploymentService.shutdown(saId); } catch (PetalsException e) { String message = "Can not shutdown the SA with ID " + saId; this.log.warning(message, e); throw new PEtALSWebServiceException(message + "(" + e.getMessage() + ")"); } return result; }
/** * {@inheritDoc} */ public boolean start(String saId) throws PEtALSWebServiceException { if (this.log.isDebugEnabled()) { this.log.debug("Entering method : start with params saId = " + saId); } boolean result = true; try { result = this.deploymentService.start(saId); } catch (PetalsException e) { String message = "Can not start the SA with ID " + saId; this.log.warning(message, e); throw new PEtALSWebServiceException(message + "(" + e.getMessage() + ")"); } return result; }
/** * {@inheritDoc} */ public boolean undeploy(String saId) throws PEtALSWebServiceException { if (this.log.isDebugEnabled()) { this.log.debug("Entering method : undeploy with params saId = " + saId); } boolean result = true; try { result = this.deploymentService.undeploy(saId); } catch (PetalsException e) { String message = "Can not undeploy the SA with ID " + saId; this.log.warning(message, e); throw new PEtALSWebServiceException(message + "(" + e.getMessage() + ")"); } return result; }
/** * {@inheritDoc} */ public boolean stop(String saId) throws PEtALSWebServiceException { if (this.log.isDebugEnabled()) { this.log.debug("Entering method : stop with params saId = " + saId); } boolean result = true; try { result = this.deploymentService.stop(saId); } catch (PetalsException e) { String message = "Can not stop the SA with ID " + saId; this.log.warning(message, e); throw new PEtALSWebServiceException(message + "(" + e.getMessage() + ")"); } return result; }