public void validate() throws DeploymentException { super.validate(); if (resourceAdapter == null) { throw new DeploymentException("resourceAdapter must be set"); } if (activationSpec == null) { throw new DeploymentException("activationSpec must be set"); } }
de.printStackTrace(); throw new Exception(de.getMessage());
if (resultObject == null) throw new DeploymentException("LIFECYCLE_OBJECTNAME_IS_NULL"); String exMessage = de.getMessage(); Document doc = db.parse(new InputSource(new StringReader(exMessage))); elem = DOMUtil.UTIL.getElement(doc, "component-task-result");
/** * Install a shared library jar. * * @param location URI locating a jar file containing a shared library. * @return the name of the shared library loaded from aSharedLibURI. */ public String installSharedLibrary(String location) { try { return doInstallSharedLibrary(location); } catch (DeploymentException e) { throw new RuntimeException(e.getMessage()); } catch (Exception e) { throw ManagementSupport.failure("installSharedibrary", location, e); } }
throw new Exception(de.getMessage());
@Override public void validate() throws DeploymentException { super.validate(); // check listen address not null if (this.address == null) { throw new DeploymentException("The listen address attribute has to be specified!"); } // check if address is valid try { if (GenericAddress.parse(this.address) == null) { throw new DeploymentException("The specified address " + address + " is not valid!"); } } catch (IllegalArgumentException ex) { throw new DeploymentException("The specified address " + address + " is not valid!"); } }
de.printStackTrace(); throw new Exception(de.getMessage());
throw new Exception(de.getMessage());
protected void cleanUpBootstrap() throws DeploymentException { try { bootstrap.cleanUp(); } catch (JBIException e) { LOGGER.error("Could not initialize bootstrap", e); throw new DeploymentException(e); } finally { initialized = false; } }
de.printStackTrace(); throw new Exception(de.getMessage());
public static DeploymentException componentFailure(String task, String component, String info) { try { Element e = createComponentFailure(task, component, info, null); return new DeploymentException(DOMUtil.asXML(e)); } catch (Exception e) { LOGGER.debug("Error creating management message", e); return new DeploymentException(info); } }
public void undeploy(ServiceUnit su) throws DeploymentException { // Force a shutdown of the SU // There is no initialized state, so after deployment, the SU // is shutdown but may need a cleanup. try { su.shutDown(); } catch (Exception e) { throw new DeploymentException("Unable to shutDown service unit", e); } }
public void validate() throws DeploymentException { super.validate(); if (targetInterface == null && targetService == null && targetUri == null) { throw new DeploymentException("targetInterface, targetService or targetUri should be specified"); } } }
protected void validate(Endpoint endpoint) throws DeploymentException { for (int i = 0; i < endpointClasses.length; i++) { if (endpointClasses[i].isInstance(endpoint)) { super.validate(endpoint); return; } } throw new DeploymentException("Endpoint is not of type: " + Arrays.asList(endpointClasses) + " but is of type: " + endpoint.getClass()); }
public static DeploymentException componentFailure(String task, String component, String info) { try { Element e = createComponentFailure(task, component, info, null); return new DeploymentException(DOMUtil.asXML(e)); } catch (Exception e) { logger.debug("Error creating management message", e); return new DeploymentException(info); } }
protected void cleanUpBootstrap() throws DeploymentException { if (bootstrap != null) { ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader()); bootstrap.cleanUp(); } catch (JBIException e) { logger.error("Could not initialize bootstrap", e); throw new DeploymentException(e); } finally { initialized = false; Thread.currentThread().setContextClassLoader(oldCl); } } }
@Override public void validate() throws DeploymentException { super.validate(); // check address not null if (this.address == null) { throw new DeploymentException("The address attribute has to be specified!"); } // check if address is valid try { if (GenericAddress.parse(this.address) == null) { throw new DeploymentException("The specified address " + address + " is not valid!"); } } catch (IllegalArgumentException ex) { throw new DeploymentException("The specified address " + address + " is not valid!"); } // finally check if the oid vector contains values if (this.oids == null || this.oids.size()<=0) { // the poller would be unemployed throw new DeploymentException("There are no OIDs defined to be polled. Check your oids attribute."); } }
protected URL[] getDefaultLocations() throws DeploymentException { try { File[] jars = new File(_serviceUnitRootPath, LIB_DIR).listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { name = name.toLowerCase(); return name.endsWith(".jar") || name.endsWith(".zip"); } }); URL[] urls = new URL[jars != null ? jars.length + 1 : 1]; urls[0] = _serviceUnitRootPath.toURI().toURL(); if (jars != null) { for (int i = 0; i < jars.length; i++) { urls[i + 1] = jars[i].toURI().toURL(); } } if (__log.isDebugEnabled()) { for (URL u : urls) { __log.debug("in classpath for "+_serviceUnitID+" using url: "+u); } } return urls; } catch (MalformedURLException e) { throw new DeploymentException("Unable to get default classpath locations", e); } }
public void validate() throws DeploymentException { super.validate(); if (directory == null) { throw new DeploymentException("You must specify the directory property"); } if (isAutoCreateDirectory()) { directory.mkdirs(); } if (!directory.isDirectory()) { throw new DeploymentException("The directory property must be a directory but was: " + directory); } if (isOverwrite() && isAppend()) { throw new DeploymentException("You can't have 'append' and 'overwrite' active at the same time."); } }
public synchronized void shutDown(String serviceUnitID) throws DeploymentException { __log.trace("shutDown called for " + serviceUnitID); OdeServiceUnit su = _serviceUnits.remove(serviceUnitID); if (su == null) return; try { su.shutdown(); } catch (Exception ex) { String errmsg = __msgs.msgServiceUnitShutdownFailed(serviceUnitID); __log.error(errmsg, ex); throw new DeploymentException(errmsg, ex); } }