List of usage examples for java.lang InternalError InternalError
public InternalError(Throwable cause)
From source file:org.apache.jackrabbit.core.query.lucene.IndexMerger.java
/** * Creates an <code>IndexMerger</code>. * * @param multiIndex the <code>MultiIndex</code>. */// w w w . ja va 2 s . c o m IndexMerger(MultiIndex multiIndex) { this.multiIndex = multiIndex; setName("IndexMerger"); setDaemon(true); try { mergerIdle.acquire(); } catch (InterruptedException e) { // will never happen, lock is free upon construction throw new InternalError("Unable to acquire mutex after construction"); } }
From source file:com.clustercontrol.notify.view.action.NotifyCopyAction.java
public int openDialog(Shell shell, String managerName, String notifyId, int notifyType) { NotifyBasicCreateDialog dialog = null; if (NotifyTypeConstant.TYPE_STATUS == notifyType) { dialog = new NotifyStatusCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_EVENT == notifyType) { dialog = new NotifyEventCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_MAIL == notifyType) { dialog = new NotifyMailCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_JOB == notifyType) { dialog = new NotifyJobCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_LOG_ESCALATE == notifyType) { dialog = new NotifyLogEscalateCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_COMMAND == notifyType) { dialog = new NotifyCommandCreateDialog(shell, managerName, notifyId, false); } else if (NotifyTypeConstant.TYPE_INFRA == notifyType) { dialog = new NotifyInfraCreateDialog(shell, managerName, notifyId, false); } else {//from w ww .j a v a 2s .co m throw new InternalError("unknown notify type select"); } return dialog.open(); }
From source file:org.exoplatform.services.jcr.impl.core.query.lucene.IndexMerger.java
/** * Creates an <code>IndexMerger</code>. * * @param multiIndex the <code>MultiIndex</code>. *//*from w ww. ja v a 2 s. com*/ IndexMerger(MultiIndex multiIndex) { this.multiIndex = multiIndex; setName("Index Merger" + (multiIndex.workspaceId == null ? "" : " " + multiIndex.workspaceId)); setDaemon(true); try { mergerIdle.acquire(); } catch (InterruptedException e) { // will never happen, lock is free upon construction throw new InternalError("Unable to acquire mutex after construction"); } }
From source file:technology.tikal.customers.dao.objectify.paginator.StringPaginator.java
private List<T> consultarTodosConFiltro(PaginationContext<K> context, int duplicated, int retry) { List<T> result;//from w w w . ja v a 2 s . c om Query<T> query = buildQuery(context); if (context.getPagination().hasSince()) { String since = StringNormalizer.normalize(context.getPagination().getSince()); query = query.filter(context.getIndexOfy() + " >=", since).filter(context.getIndexOfy() + " < ", getStringFilter(context) + "\uFFFD"); result = resolvePaginationSince(query, context, duplicated); if (result == null) { if (retry > this.maxRetry) { throw new InternalError("No se logro paginar"); } //se incrementa el numero de duplicados y se busca de nuevo result = this.consultarTodosConFiltro(context, duplicated + stepDuplicated, retry + 1); } } else { query = query.filter(context.getIndexOfy() + " >=", getStringFilter(context)) .filter(context.getIndexOfy() + " < ", getStringFilter(context) + "\uFFFD"); result = resolvePagination(query, context); } return result; }
From source file:com.clustercontrol.notify.view.action.NotifyModifyAction.java
public int openDialog(Shell shell, String managerName, String notifyId, int notifyType) { NotifyBasicCreateDialog dialog = null; boolean updateFlg = true; if (notifyId == null) { updateFlg = false;/*from w ww.java 2 s.co m*/ } if (NotifyTypeConstant.TYPE_STATUS == notifyType) { dialog = new NotifyStatusCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_EVENT == notifyType) { dialog = new NotifyEventCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_MAIL == notifyType) { dialog = new NotifyMailCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_JOB == notifyType) { dialog = new NotifyJobCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_LOG_ESCALATE == notifyType) { dialog = new NotifyLogEscalateCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_COMMAND == notifyType) { dialog = new NotifyCommandCreateDialog(shell, managerName, notifyId, updateFlg); } else if (NotifyTypeConstant.TYPE_INFRA == notifyType) { dialog = new NotifyInfraCreateDialog(shell, managerName, notifyId, updateFlg); } else { throw new InternalError("unknown notify type select"); } return dialog.open(); }
From source file:org.tsho.dmc2.managers.LyapunovManager.java
public boolean doRendering() { plot.setDrawGridLines(gridlines);/*from w ww . jav a2 s .co m*/ plot.setNoData(false); switch (type) { case LyapunovControlForm2.TYPE_VS_TIME: return renderVsTime(); case LyapunovControlForm2.TYPE_VS_PAR: return renderVsParameter(); case LyapunovControlForm2.TYPE_PAR_SPACE: return renderArea(); default: throw new InternalError("invalid type"); } }
From source file:fll.web.playoff.Playoff.java
/** * Build the list of teams ordered from top to bottom (visually) of a single * elimination bracket.//from w w w. jav a2s. co m * * @param connection connection to the database * @param teams the teams in the playoffs * @return a List of teams * @throws SQLException on a database error */ public static List<Team> buildInitialBracketOrder(final Connection connection, final BracketSortType bracketSort, final WinnerType winnerCriteria, final List<? extends Team> teams) throws SQLException { if (null == connection) { throw new NullPointerException("Connection cannot be null"); } final List<? extends Team> seedingOrder; if (BracketSortType.ALPHA_TEAM == bracketSort) { seedingOrder = teams; // sort by team name Collections.sort(seedingOrder, Team.TEAM_NAME_COMPARATOR); } else if (BracketSortType.RANDOM == bracketSort) { seedingOrder = teams; // assign a random number to each team final double[] randoms = new double[seedingOrder.size()]; final Random generator = new Random(); for (int i = 0; i < randoms.length; ++i) { randoms[i] = generator.nextDouble(); } Collections.sort(seedingOrder, new Comparator<Team>() { public int compare(final Team one, final Team two) { final int oneIdx = seedingOrder.indexOf(one); final int twoIdx = seedingOrder.indexOf(two); return Double.compare(randoms[oneIdx], randoms[twoIdx]); } }); } else { // standard seeding final int tournament = Queries.getCurrentTournament(connection); final int numSeedingRounds = TournamentParameters.getNumSeedingRounds(connection, tournament); if (numSeedingRounds < 1) { throw new FLLRuntimeException( "Cannot initialize playoff brackets using scores from seeding rounds when the number of seeing rounds is less than 1"); } seedingOrder = Queries.getPlayoffSeedingOrder(connection, winnerCriteria, teams); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("seedingOrder: " + seedingOrder); } final int[] seeding = computeInitialBrackets(seedingOrder.size()); // give byes to the last byesNeeded teams. final List<Team> list = new LinkedList<Team>(); for (final int element : seeding) { if (element > seedingOrder.size()) { list.add(Team.BYE); } else { final Team team = seedingOrder.get(element - 1); list.add(team); } } if (list.size() != seeding.length) { throw new InternalError("Programming error, list size should be the same as seeding length"); } return list; }
From source file:org.apache.hadoop.mapred.SampleTaskStatus.java
@Override public Object clone() { try {/* w w w . j a v a2 s . com*/ return super.clone(); } catch (CloneNotSupportedException cnse) { // Shouldn't happen since we do implement Clonable throw new InternalError(cnse.toString()); } }
From source file:edu.ku.brc.dbsupport.SchemaUpdateService.java
/** * Returns the instance of the AppContextMgr. * @return the instance of the AppContextMgr. */// w ww . ja v a 2s .c o m public static SchemaUpdateService getInstance() { if (instance != null) { return instance; } // else String factoryNameStr = AccessController.doPrivileged(new PrivilegedAction<String>() { public String run() { return System.getProperty(factoryName); } }); if (factoryNameStr != null) { try { instance = (SchemaUpdateService) Class.forName(factoryNameStr).newInstance(); return instance; } catch (Exception e) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SchemaUpdateService.class, e); InternalError error = new InternalError( "Can't instantiate AppContextMgr factory " + factoryNameStr); //$NON-NLS-1$ error.initCause(e); throw error; } } return null; }
From source file:com.clustercontrol.monitor.view.action.StatusModifyMonitorSettingAction.java
/** * []????????// w w w . j a v a 2 s. co m * <p> * <ol> * <li>[]??????????</li> * <li>????????? </li> * </ol> * * @see org.eclipse.core.commands.IHandler#execute * @see com.clustercontrol.monitor.view.StatusView * @see com.clustercontrol.monitor.view.StatusView#update() */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { this.window = HandlerUtil.getActiveWorkbenchWindow(event); // In case this action has been disposed if (null == this.window || !isEnabled()) { return null; } // ??? this.viewPart = HandlerUtil.getActivePart(event); ScopeListBaseView view = null; try { view = (StatusView) this.viewPart.getAdapter(StatusView.class); } catch (Exception e) { m_log.info("execute " + e.getMessage()); return null; } if (view == null) { m_log.info("execute: view is null"); return null; } StatusListComposite composite = (StatusListComposite) view.getListComposite(); WidgetTestUtil.setTestId(this, null, composite); StructuredSelection selection = (StructuredSelection) composite.getTableViewer().getSelection(); List<?> list = (ArrayList<?>) selection.getFirstElement(); if (list == null) { return null; } String managerName = ""; String pluginId = ""; String monitorId = ""; managerName = (String) list.get(GetStatusListTableDefine.MANAGER_NAME); pluginId = (String) list.get(GetStatusListTableDefine.PLUGIN_ID); if (pluginId == null) throw new InternalError("pluginId is null."); monitorId = (String) list.get(GetStatusListTableDefine.MONITOR_ID); if (monitorId != null) { // ??? MonitorModifyAction mmAction = new MonitorModifyAction(); // ??????????? if (mmAction.dialogOpen(composite.getShell(), managerName, pluginId, monitorId) == IDialogConstants.OK_ID) { composite.update(); } } return null; }