public static String capitalize(String name) { // EJB2.0 proposed final draft says that CMP/CMR field names // must begin with a lower case letter. if ( Character.isUpperCase(name.charAt(0)) ) { throw new DeploymentException("CMP/CMR field "+name+" must start with a lower case character."); } else { char chars[] = name.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); } }
private void handleFailure(String appName, Class[] tasks, boolean deployment, PaaSDeploymentState state, PaaSDeploymentContext pc, Exception e) { logger.log(Level.WARNING, localStrings.getString("failure.handling",state.getClass().getSimpleName()),e); if(deployment){ DeploymentException de = null; if(isAtomicDeploymentEnabled()){ rollbackDeployment(pc, state, DEPLOYMENT_STATES); de = new DeploymentException("Failure while deploying application [ "+appName+" ], " + "rolled back all deploy operations."); }else{ de = new DeploymentException("Failure while deploying application [ "+appName+" ]. Atomic" + "deployment is disabled, manual cleanup is required"); } de.initCause(e); throw de; }else{ DeploymentException de = new DeploymentException("Failure while undeploying application [ "+appName+" ]." ); de.initCause(e); throw de; } }
public DeploymentException(Throwable t) { // we cannot just invoke the super(throwable) constructor because // the DeploymentException travels between processes and needs // to be serializable as well as all sub or chained exception. // Therefore, I use the setStackTrace to chain instead of initCause super(t.getMessage()); setStackTrace(t.getStackTrace()); } public DeploymentException(String s, Throwable t)
public static String capitalize(String name) { // EJB2.0 proposed final draft says that CMP/CMR field names // must begin with a lower case letter. if ( Character.isUpperCase(name.charAt(0)) ) { throw new DeploymentException("CMP/CMR field "+name+" must start with a lower case character."); } else { char chars[] = name.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); } }
deplLogger.log(Level.SEVERE, RESOURCE_REF_JNDI_LOOKUP_FAILED, new Object[] {resource.getName(), null, resource.getType()}); throw new DeploymentException(localStrings.getLocalString("enterprise.deployment.util.resource.validation", "JNDI lookup failed for the resource: Name: {0}, Lookup: {1}, Type: {2}", resource.getName(), null, resource.getType())); deplLogger.log(Level.SEVERE, RESOURCE_REF_JNDI_LOOKUP_FAILED, new Object[] {resource.getName(), jndiName, resource.getType()}); DeploymentException de = new DeploymentException(localStrings.getLocalString( "enterprise.deployment.util.resource.validation", "JNDI lookup failed for the resource: Name: {0}, Lookup: {1}, Type: {2}", resource.getName(), jndiName, resource.getType())); de.initCause(e); throw de;
public DeploymentException(String s, Throwable t) { // we cannot just invoke the super(throwable) constructor because // the DeploymentException travels between processes and needs // to be serializable as well as all sub or chained exception. // Therefore, I use the setStackTrace to chain instead of initCause super(s + " -- " + t.getMessage()); this.setStackTrace(t.getStackTrace()); } }
/** * Return the CMRFieldInfo object for the given CMR field */ public CMRFieldInfo getCMRFieldInfoByName(String fieldName) { CMRFieldInfo[] cmrf = this.getCMRFieldInfo(); for ( int i=0; i<cmrf.length; i++ ) { if ( cmrf[i].name.equals(fieldName) ) return cmrf[i]; } throw new DeploymentException("CMRFieldInfo not found for field "+fieldName); }
throw dde; } catch(Exception e) { DeploymentException de = new DeploymentException(e.getMessage()); de.initCause(e); throw de;
/** * Return the CMRFieldInfo object for the given CMR field */ public CMRFieldInfo getCMRFieldInfoByName(String fieldName) { CMRFieldInfo[] cmrf = this.getCMRFieldInfo(); for ( int i=0; i<cmrf.length; i++ ) { if ( cmrf[i].name.equals(fieldName) ) return cmrf[i]; } throw new DeploymentException("CMRFieldInfo not found for field "+fieldName); }
DeploymentException de = new DeploymentException(msgPrefix + t.getMessage()); de.initCause(t); throw(de); } finally {
/** * Return the PersistentFieldInfo object for the given CMP/fkey field */ public PersistentFieldInfo getPersistentFieldInfoByName(String fieldName) { if ( !fieldInfoInitialized ) initializeFieldInfo(); for ( int i=0; i<persFieldInfo.length; i++ ) { if ( persFieldInfo[i].name.equals(fieldName) ) return persFieldInfo[i]; } throw new DeploymentException("PersistentFieldInfo not found for field "+fieldName); }
/** * Return PersistentFieldInfo object for the given pkey field. */ public PersistentFieldInfo getPkeyFieldInfoByName(String fieldName) { if ( !fieldInfoInitialized ) initializeFieldInfo(); for ( int i=0; i<pkeyFieldInfo.length; i++ ) { if ( pkeyFieldInfo[i].name.equals(fieldName) ) return pkeyFieldInfo[i]; } throw new DeploymentException("PersistentFieldInfo not found for pkey field "+fieldName); }
/** * Return PersistentFieldInfo object for the given pkey field. */ public PersistentFieldInfo getPkeyFieldInfoByName(String fieldName) { if ( !fieldInfoInitialized ) initializeFieldInfo(); for ( int i=0; i<pkeyFieldInfo.length; i++ ) { if ( pkeyFieldInfo[i].name.equals(fieldName) ) return pkeyFieldInfo[i]; } throw new DeploymentException("PersistentFieldInfo not found for pkey field "+fieldName); }
/** * Return the PersistentFieldInfo object for the given CMP/fkey field */ public PersistentFieldInfo getPersistentFieldInfoByName(String fieldName) { if ( !fieldInfoInitialized ) initializeFieldInfo(); for ( int i=0; i<persFieldInfo.length; i++ ) { if ( persFieldInfo[i].name.equals(fieldName) ) return persFieldInfo[i]; } throw new DeploymentException("PersistentFieldInfo not found for field "+fieldName); }
private static void verify(File inWebDir, File outWebDir) throws DeploymentException { // inWebDir must exist, outWebDir must either exist or be creatable if (!FileUtils.safeIsDirectory(inWebDir)) { throw new DeploymentException("inWebDir is not a directory: " + inWebDir); } if (!FileUtils.safeIsDirectory(outWebDir)) { outWebDir.mkdirs(); if (!FileUtils.safeIsDirectory(outWebDir)) { throw new DeploymentException("outWebDir is not a directory, and it can't be created: " + outWebDir); } } }
private Class getClass(String className) { try { return getEjbBundleDescriptor().getClassLoader().loadClass(className); } catch ( Exception ex ) { throw new DeploymentException(ex); } }
private Class getClass(String className) { try { return getEjbBundleDescriptor().getClassLoader().loadClass(className); } catch ( Exception ex ) { throw new DeploymentException(ex); } }
/** * Return array of CMRFieldInfo objects for all CMR fields. */ public CMRFieldInfo[] getCMRFieldInfo() { if ( cmrFieldInfo == null ) { try { initCMRFieldStuff(); } catch ( Exception ex ) { DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.invalidDescriptorMappingFailure", new Object[] {ex.toString()}); throw new DeploymentException(ex); } } return cmrFieldInfo; }
/** * Return array of CMRFieldInfo objects for all CMR fields. */ public CMRFieldInfo[] getCMRFieldInfo() { if ( cmrFieldInfo == null ) { try { initCMRFieldStuff(); } catch ( Exception ex ) { DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.invalidDescriptorMappingFailure", new Object[] {ex.toString()}); throw new DeploymentException(ex); } } return cmrFieldInfo; }
public Class getStateClass() { if ( stateClass == null ) { stateClass = getPersistentClass(); if ( parentDesc.isEJB20() ) { if( !Modifier.isAbstract(stateClass.getModifiers()) ) { throw new DeploymentException("2.x CMP bean class " + stateClass.getName() + " must be decleared abstract " + "or cmp-version for the corresponding bean must be set to 1.x."); } String stateClassName = parentDesc.getStateImplClassName(); stateClass = getClass(stateClassName); } } return stateClass; }