List of usage examples for java.lang InternalError InternalError
public InternalError(Throwable cause)
From source file:com.manydesigns.portofino.persistence.hibernate.HibernateConfig.java
protected void createPKComposite(Mappings mappings, com.manydesigns.portofino.model.database.Table mdTable, String pkName, RootClass clazz, Table tab, List<com.manydesigns.portofino.model.database.Column> columnPKList) { PrimaryKey primaryKey = new PrimaryKey(); primaryKey.setName(pkName);/* www . j av a 2 s .co m*/ primaryKey.setTable(tab); clazz.setEmbeddedIdentifier(true); Component component = new Component(mappings, clazz); component.setDynamic(mdTable.getActualJavaClass() == null); String name; name = mdTable.getQualifiedName(); component.setRoleName(name + ".id"); component.setEmbedded(true); //component.setNodeName("id"); component.setKey(true); component.setNullValue("undefined"); if (!component.isDynamic()) { component.setComponentClassName(mdTable.getJavaClass()); //TODO verificare se non si intende actualJavaClass } boolean hasErrors = false; for (com.manydesigns.portofino.model.database.Column column : columnPKList) { if (column == null) { throw new InternalError("Null column"); } Column col = createColumn(mappings, tab, column); hasErrors = col == null || hasErrors; if (col != null) { primaryKey.addColumn(col); Property prop = createProperty(column, col.getValue()); prop.setCascade("none"); //prop.setPropertyAccessorName("property"); interferisce con il generator pi sotto prop.setPersistentClass(clazz); component.addProperty(prop); //Generator not supported for embedded map identifier //See https://forum.hibernate.org/viewtopic.php?t=945273 //See Component.buildIdentifierGenerator() /*String columnName = column.getColumnName(); PrimaryKeyColumn pkCol = mdTable.getPrimaryKey().findPrimaryKeyColumnByName(columnName); if(pkCol == null) { logger.error("Column without corresponding PrimaryKeyColumn: {}", columnName); hasErrors = true; continue; } Generator generator = pkCol.getGenerator(); setPKColumnGenerator(mappings, clazz, tab, column, value, generator);*/ } } if (hasErrors) { // TODO PAOLO: se la PK non e' buona, tutta la tabella dovrebbe saltare logger.error("Skipping primary key"); return; } tab.setIdentifierValue(component); clazz.setIdentifier(component); clazz.setDiscriminatorValue(name); tab.setPrimaryKey(primaryKey); }
From source file:edu.ku.brc.specify.datamodel.SpUIView.java
@Transient public BusinessRulesIFace createBusinessRule() { BusinessRulesIFace businessRule = null; if (StringUtils.isNotEmpty(businessRulesClassName)) { if (StringUtils.isNotEmpty(businessRulesClassName)) { try { businessRule = (BusinessRulesIFace) Class.forName(businessRulesClassName).newInstance(); } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpUIView.class, e); InternalError error = new InternalError( "Can't instantiate BusinessRulesIFace [" + businessRulesClassName + "]"); error.initCause(e);//from w w w . j a va 2 s .c o m throw error; } } else if (useDefaultBusRule) { businessRule = DBTableIdMgr.getInstance().getBusinessRule(javaClassName); } } return businessRule; }
From source file:de.helmholtz_muenchen.ibis.utils.abstractNodes.HTExecutorNode.HTExecutorNodeModel.java
private void writeHTELog(String Log, String Type) { if (Type.equals("Info")) { LOGGER.info(Log);/*from w w w . j ava2 s. c o m*/ } else if (Type.equals("Error")) { LOGGER.error(Log); } else { throw new InternalError("Incorrect call of writeHTELog. Unknown Log Type: " + Type); } HTEOUT.append(Log + "\n"); }
From source file:net.sf.firemox.tools.MToolKit.java
/** * return the picture file chosen/* www. j a va 2s. c o m*/ * * @param oldFile * the old picture, will be returned if user cancel operation * @param parent * is parent of this dialog * @return the picture file chosen, or oldFile if canceled */ public static String getPictureFile(String oldFile, JFrame parent) { try { return showDialogFile("choose your a picture", 'o', null, pictureFilter, parent, JFileChooser.OPEN_DIALOG).getCanonicalPath(); } catch (java.io.IOException e) { throw new InternalError("choosing picture file"); } catch (Exception e) { // cancel of user; return null; } }
From source file:com.commsen.apropos.core.PropertiesManager.java
/** * Imports external properties into {@link PropertyPackage} called <code>packageName</code> . * The actual import is handled by {@link PropertyPackage#importProperties(Properties, boolean)}. * /*from w ww .ja v a 2s . co m*/ * @param packageName the name of the package. Can not be <code>null</code> or empty. * @param externalProperties the properties to import. This can not be <code>null</code> * @param overwrite boolean flag indicates whether to override existing properties * @return a new clone of the {@link PropertyPackage} made after the properties are imported * @throws PropertiesException if there is no package called <code>packageName</code> * @throws IllegalArgumentException if any of the arguments is <code>null</code> */ public static synchronized PropertyPackage importProperties(String packageName, Properties externalProperties, boolean overwrite) throws PropertiesException { if (StringUtils.isBlank(packageName)) throw new IllegalArgumentException("package name can not be null nor empty string"); if (!allPackages.containsKey(packageName)) throw new PropertiesException("No package called " + packageName + " found "); PropertyPackage propertyPackage = allPackages.get(packageName); try { propertyPackage.importProperties(externalProperties, overwrite); save(); return (PropertyPackage) propertyPackage.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
From source file:com.citrix.cpbm.portal.fragment.controllers.AbstractAuthenticationController.java
@RequestMapping(value = { "/{userParam}/loggedout", "{userParam}/j_spring_security_logout" }) public String loggedout(@PathVariable String userParam, ModelMap map, HttpSession session, HttpServletResponse response, HttpServletRequest request) { logger.debug("###Entering in loggedout(response) method"); String showSuffixControl = "false"; String suffixControlType = "textbox"; List<String> suffixList = null; if (config.getValue(Names.com_citrix_cpbm_username_duplicate_allowed).equals("true")) { showSuffixControl = "true"; if (config.getValue(Names.com_citrix_cpbm_login_screen_tenant_suffix_dropdown_enabled).equals("true")) { suffixControlType = "dropdown"; suffixList = tenantService.getSuffixList(); }/*from ww w . ja va2 s . com*/ } map.addAttribute("showSuffixControl", showSuffixControl); map.addAttribute("suffixControlType", suffixControlType); map.addAttribute("suffixList", suffixList); if (config.getBooleanValue(Configuration.Names.com_citrix_cpbm_portal_directory_service_enabled) && config.getValue(Names.com_citrix_cpbm_directory_mode).equals("pull")) { map.addAttribute("directoryServiceAuthenticationEnabled", "true"); } if (config.getValue(Names.com_citrix_cpbm_public_catalog_display).equals("true") && channelService.getDefaultServiceProviderChannel() != null) { map.addAttribute("showAnonymousCatalogBrowsing", "true"); } map.addAttribute("showLanguageSelection", "true"); map.addAttribute("supportedLocaleList", this.getLocaleDisplayName(listSupportedLocales())); map.addAttribute("logout", true); String redirect = null; Enumeration<String> en = session.getAttributeNames(); while (en.hasMoreElements()) { String attr = en.nextElement(); session.removeAttribute(attr); } Cookie cookie = new Cookie("JforumSSO", ""); cookie.setMaxAge(0); cookie.setPath("/"); response.addCookie(cookie); if (request.getRequestedSessionId() != null && request.isRequestedSessionIdValid()) { // create logout notification begins User user = userService.get(userParam); String message = "logged.out"; String messageArgs = user.getUsername(); eventService.createEvent(new Date(), user, message, messageArgs, Source.PORTAL, Scope.USER, Category.ACCOUNT, Severity.INFORMATION, true); } session.invalidate(); if (config.getAuthenticationService().compareToIgnoreCase(CAS) == 0) { try { redirect = StringUtils.isEmpty(config.getCasLogoutUrl()) ? null : config.getCasLogoutUrl() + "?service=" + URLEncoder.encode(config.getCasServiceUrl(), "UTF-8"); } catch (UnsupportedEncodingException e) { logger.error("Exception encoding: " + redirect, e); } if (redirect == null) { throw new InternalError("CAS authentication required, but login url not set"); } } SecurityContextHolder.getContext().setAuthentication(null); // ends logger.debug("###Exiting loggedout(response) method"); return redirect == null ? "redirect:/j_spring_security_logout" : "redirect:" + redirect; }
From source file:org.texai.torrent.domainEntity.MetaInfo.java
/** Calculates the info hash. * * @return the info hash/*from w w w . ja va 2 s .co m*/ */ private byte[] calculateInfoHash() { final Map<String, Object> info = createInfoMap(); final byte[] infoBytes = BEncoder.bencode(info); try { final MessageDigest digest = MessageDigest.getInstance("SHA"); return digest.digest(infoBytes); } catch (final NoSuchAlgorithmException nsa) { throw new InternalError(nsa.toString()); // NOPMD } }
From source file:com.commsen.apropos.core.PropertiesManager.java
/** * Deletes {@link Property} called <code>propertyName</code> from {@link PropertyPackage} * called <code>packageName</code>. The actual deletion is handled by * {@link PropertyPackage#removeProperty(String)}. * //from w w w. j a va 2s . c o m * @param packageName the name of the package. Can not be <code>null</code> or empty. * @param propertyName the name of the property to be updated * @return a new clone of the {@link PropertyPackage} made after the property is deleted * @throws PropertiesException if there is no package called <code>packageName</code> or no * property called <code>propertyName</code> * @throws IllegalArgumentException if any of the arguments is <code>null</code> */ public static synchronized PropertyPackage deleteProperty(String packageName, String propertyName) throws PropertiesException { if (StringUtils.isBlank(packageName)) throw new IllegalArgumentException("package name can not be null nor empty string"); if (StringUtils.isBlank(propertyName)) throw new IllegalArgumentException("property can not be null nor empty string"); if (!allPackages.containsKey(packageName)) throw new PropertiesException("No package called " + packageName + " found "); PropertyPackage propertyPackage = allPackages.get(packageName); propertyPackage.removeProperty(propertyName); save(); try { return (PropertyPackage) propertyPackage.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
From source file:com.clustercontrol.port.dialog.PortCreateDialog.java
/** * ????//w ww . j av a2 s .c o m * * @param parent * ? */ @Override protected void customizeDialog(Composite parent) { // ???? item1 = Messages.getString("response.time.milli.sec"); item2 = Messages.getString("response.time.milli.sec"); super.customizeDialog(parent); m_numericValueInfo.setInfoWarnText("0", "1000", "1000", "3000"); // shell.setText(Messages.getString("dialog.port.create.modify")); // ???? Label label = null; // ???? GridData gridData = null; /* * ???? */ Group groupCheckRule = new Group(groupRule, SWT.NONE); WidgetTestUtil.setTestId(this, "checkrule", groupCheckRule); GridLayout layout = new GridLayout(1, true); layout.marginWidth = HALF_MARGIN; layout.marginHeight = HALF_MARGIN; layout.numColumns = BASIC_UNIT; groupCheckRule.setLayout(layout); gridData = new GridData(); gridData.horizontalSpan = BASIC_UNIT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; groupCheckRule.setLayoutData(gridData); groupCheckRule.setText(Messages.getString("check.rule")); /* * */ // TCP?? this.m_radioTCP = new Button(groupCheckRule, SWT.RADIO); WidgetTestUtil.setTestId(this, "tcp", m_radioTCP); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_radioTCP.setLayoutData(gridData); this.m_radioTCP.setText(Messages.getString("tcp.connect.only")); this.m_radioTCP.setSelection(true); // this.m_radioService = new Button(groupCheckRule, SWT.RADIO); WidgetTestUtil.setTestId(this, "service", m_radioService); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_radioService.setLayoutData(gridData); this.m_radioService.setText(Messages.getString("service.protocol")); this.m_radioService.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setEnabledComboService(m_radioService.getSelection()); } }); // this.m_comboService = new Combo(groupCheckRule, SWT.DROP_DOWN | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "service", m_comboService); gridData = new GridData(); gridData.horizontalSpan = WIDTH_VALUE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_comboService.setLayoutData(gridData); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_FTP); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_SMTP); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_SMTPS); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_POP3); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_POP3S); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_IMAP); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_IMAPS); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_NTP); this.m_comboService.add(ProtocolMessage.STRING_PROTOCOL_DNS); //this.m_comboService.setEnabled(false); // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "space1", label); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TEXT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); /* * ?? */ // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "portnumber", label); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("port.number") + " : "); // this.m_textPortNo = new Text(groupCheckRule, SWT.BORDER); WidgetTestUtil.setTestId(this, "protno", m_textPortNo); gridData = new GridData(); gridData.horizontalSpan = WIDTH_VALUE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_textPortNo.setLayoutData(gridData); this.m_textPortNo.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "space2", label); gridData = new GridData(); gridData.horizontalSpan = HALF_UNIT - (WIDTH_TITLE_LONG + WIDTH_VALUE_LONG); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); /* * */ // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "space3", label); gridData = new GridData(); gridData.horizontalSpan = MIN_UNIT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "labelruncount", label); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE + MIN_UNIT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("trial.run.count") + " : "); // this.m_textRunCount = new Text(groupCheckRule, SWT.BORDER); WidgetTestUtil.setTestId(this, "textruncount", m_textRunCount); gridData = new GridData(); gridData.horizontalSpan = WIDTH_VALUE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_textRunCount.setLayoutData(gridData); this.m_textRunCount.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ?? label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "labelcount", label); gridData = new GridData(); gridData.horizontalSpan = HALF_UNIT - (WIDTH_TITLE + WIDTH_VALUE + WIDTH_VALUE_LONG); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("count")); /* * */ // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "trialruninterval", label); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("trial.run.interval") + " : "); // this.m_textRunInterval = new Text(groupCheckRule, SWT.BORDER); WidgetTestUtil.setTestId(this, "runinterval", m_textRunInterval); gridData = new GridData(); gridData.horizontalSpan = WIDTH_VALUE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_textRunInterval.setLayoutData(gridData); this.m_textRunInterval.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ?? label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "labelmillisec1", label); gridData = new GridData(); gridData.horizontalSpan = HALF_UNIT - (WIDTH_TITLE_LONG + WIDTH_VALUE_LONG); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("milli.sec")); /* * */ // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "spacetimeout", label); gridData = new GridData(); gridData.horizontalSpan = MIN_UNIT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); // label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "labeltimeout", label); gridData = new GridData(); gridData.horizontalSpan = WIDTH_TITLE + MIN_UNIT; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("time.out") + " : "); // this.m_textTimeout = new Text(groupCheckRule, SWT.BORDER); WidgetTestUtil.setTestId(this, "timeout", m_textTimeout); gridData = new GridData(); gridData.horizontalSpan = WIDTH_VALUE_LONG; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.m_textTimeout.setLayoutData(gridData); this.m_textTimeout.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ?? label = new Label(groupCheckRule, SWT.NONE); WidgetTestUtil.setTestId(this, "labelmillisec2", label); gridData = new GridData(); gridData.horizontalSpan = HALF_UNIT - (WIDTH_TITLE + WIDTH_VALUE + WIDTH_VALUE_LONG); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; label.setLayoutData(gridData); label.setText(Messages.getString("milli.sec")); // ???? this.itemName.setText(Messages.getString("response.time")); // ???? this.measure.setText(Messages.getString("time.msec")); // this.adjustDialog(); // ? MonitorInfo info = null; if (this.monitorId == null) { // ??? info = new MonitorInfo(); this.setInfoInitialValue(info); } else { // ???? try { MonitorSettingEndpointWrapper wrapper = MonitorSettingEndpointWrapper.getWrapper(managerName); info = wrapper.getMonitor(monitorId); } catch (InvalidRole_Exception e) { // ?????? MessageDialog.openInformation(null, Messages.getString("message"), Messages.getString("message.accesscontrol.16")); throw new InternalError(e.getMessage()); } catch (Exception e) { // Manager??????????? m_log.warn("customizeDialog(), " + HinemosMessage.replace(e.getMessage()), e); MessageDialog.openInformation(null, Messages.getString("message"), Messages.getString("message.hinemos.failure.unexpected") + ", " + HinemosMessage.replace(e.getMessage())); throw new InternalError(e.getMessage()); } } this.setInputData(info); }