List of usage examples for org.apache.commons.lang UnhandledException UnhandledException
public UnhandledException(String message, Throwable cause)
From source file:com.datatorrent.stram.engine.GenericNode.java
/** * Originally this method was defined in an attempt to implement the interface Runnable. * * Note that activate does not return as long as there is useful workload for the node. *//*w ww . ja v a2 s. c o m*/ @Override @SuppressWarnings({ "SleepWhileInLoop", "UseSpecificCatch", "BroadCatchBlock", "TooBroadCatch" }) public final void run() { doCheckpoint = false; final long maxSpinMillis = context.getValue(OperatorContext.SPIN_MILLIS); long spinMillis = 0; final boolean handleIdleTime = operator instanceof IdleTimeHandler; int totalQueues = inputs.size(); int regularQueues = totalQueues; // regularQueues is the number of queues that are not connected to a DelayOperator for (String portName : inputs.keySet()) { if (isInputPortConnectedToDelayOperator(portName)) { regularQueues--; } } ArrayList<Map.Entry<String, SweepableReservoir>> activeQueues = new ArrayList<>(); activeQueues.addAll(inputs.entrySet()); int expectingBeginWindow = activeQueues.size(); int receivedEndWindow = 0; long firstWindowId = -1; calculateNextCheckpointWindow(); TupleTracker tracker; LinkedList<TupleTracker> resetTupleTracker = new LinkedList<TupleTracker>(); try { do { Iterator<Map.Entry<String, SweepableReservoir>> buffers = activeQueues.iterator(); activequeue: while (buffers.hasNext()) { Map.Entry<String, SweepableReservoir> activePortEntry = buffers.next(); SweepableReservoir activePort = activePortEntry.getValue(); Tuple t = activePort.sweep(); if (t != null) { spinMillis = 0; boolean delay = (operator instanceof Operator.DelayOperator); long windowAhead = 0; if (delay) { windowAhead = WindowGenerator.getAheadWindowId(t.getWindowId(), firstWindowMillis, windowWidthMillis, 1); } switch (t.getType()) { case BEGIN_WINDOW: if (expectingBeginWindow == totalQueues) { // This is the first begin window tuple among all ports if (isInputPortConnectedToDelayOperator(activePortEntry.getKey())) { // We need to wait for the first BEGIN_WINDOW from a port not connected to DelayOperator before // we can do anything with it, because otherwise if a CHECKPOINT tuple arrives from // upstream after the BEGIN_WINDOW tuple for the next window from the delay operator, it would end // up checkpointing in the middle of the window. This code is assuming we have at least one // input port that is not connected to a DelayOperator, and we might have to change this later. // In the future, this condition will not be needed if we get rid of the CHECKPOINT tuple. continue; } activePort.remove(); expectingBeginWindow--; receivedEndWindow = 0; currentWindowId = t.getWindowId(); if (delay) { if (WindowGenerator.getBaseSecondsFromWindowId(windowAhead) > t .getBaseSeconds()) { // Buffer server code strips out the base seconds from BEGIN_WINDOW and END_WINDOW tuples for // serialization optimization. That's why we need a reset window here to tell the buffer // server we are having a new baseSeconds now. Tuple resetWindowTuple = new ResetWindowTuple(windowAhead); for (int s = sinks.length; s-- > 0;) { sinks[s].put(resetWindowTuple); } controlTupleCount++; } t.setWindowId(windowAhead); } for (int s = sinks.length; s-- > 0;) { sinks[s].put(t); } controlTupleCount++; context.setWindowsFromCheckpoint(nextCheckpointWindowCount--); if (applicationWindowCount == 0) { insideWindow = true; operator.beginWindow(currentWindowId); } } else if (t.getWindowId() == currentWindowId) { activePort.remove(); expectingBeginWindow--; } else { buffers.remove(); String port = activePortEntry.getKey(); if (PROCESSING_MODE == ProcessingMode.AT_MOST_ONCE) { if (t.getWindowId() < currentWindowId) { /* * we need to fast forward this stream till we find the current * window or the window which is bigger than the current window. */ /* lets move the current reservoir in the background */ Sink<Object> sink = activePort.setSink(Sink.BLACKHOLE); deferredInputConnections.add(0, new DeferredInputConnection(port, activePort)); /* replace it with the reservoir which blocks the tuples in the past */ WindowIdActivatedReservoir wiar = new WindowIdActivatedReservoir(port, activePort, currentWindowId); wiar.setSink(sink); inputs.put(port, wiar); activeQueues.add(new AbstractMap.SimpleEntry<String, SweepableReservoir>( port, wiar)); break activequeue; } else { expectingBeginWindow--; if (++receivedEndWindow == totalQueues) { processEndWindow(null); activeQueues.addAll(inputs.entrySet()); expectingBeginWindow = activeQueues.size(); break activequeue; } } } else { logger.error( "Catastrophic Error: Out of sequence {} tuple {} on port {} while expecting {}", t.getType(), Codec.getStringWindowId(t.getWindowId()), port, Codec.getStringWindowId(currentWindowId)); System.exit(2); } } break; case END_WINDOW: buffers.remove(); if (t.getWindowId() == currentWindowId) { activePort.remove(); endWindowDequeueTimes.put(activePort, System.currentTimeMillis()); if (++receivedEndWindow == totalQueues) { assert (activeQueues.isEmpty()); if (delay) { t.setWindowId(windowAhead); } processEndWindow(t); activeQueues.addAll(inputs.entrySet()); expectingBeginWindow = activeQueues.size(); break activequeue; } } break; case CHECKPOINT: activePort.remove(); long checkpointWindow = t.getWindowId(); if (lastCheckpointWindowId < checkpointWindow) { dagCheckpointOffsetCount = 0; if (PROCESSING_MODE == ProcessingMode.EXACTLY_ONCE) { lastCheckpointWindowId = checkpointWindow; } else if (!doCheckpoint) { if (checkpointWindowCount == 0) { checkpoint(checkpointWindow); lastCheckpointWindowId = checkpointWindow; } else { doCheckpoint = true; } } if (!delay) { for (int s = sinks.length; s-- > 0;) { sinks[s].put(t); } controlTupleCount++; } } break; case RESET_WINDOW: /** * we will receive tuples which are equal to the number of input streams. */ activePort.remove(); if (isInputPortConnectedToDelayOperator(activePortEntry.getKey())) { break; // breaking out of the switch/case } buffers.remove(); int baseSeconds = t.getBaseSeconds(); tracker = null; for (Iterator<TupleTracker> trackerIterator = resetTupleTracker .iterator(); trackerIterator.hasNext();) { tracker = trackerIterator.next(); if (tracker.tuple.getBaseSeconds() == baseSeconds) { break; } } if (tracker == null) { tracker = new TupleTracker(t, regularQueues); resetTupleTracker.add(tracker); } int trackerIndex = 0; while (trackerIndex < tracker.ports.length) { if (tracker.ports[trackerIndex] == null) { tracker.ports[trackerIndex++] = activePort; break; } else if (tracker.ports[trackerIndex] == activePort) { break; } trackerIndex++; } if (trackerIndex == regularQueues) { Iterator<TupleTracker> trackerIterator = resetTupleTracker.iterator(); while (trackerIterator.hasNext()) { if (trackerIterator.next().tuple.getBaseSeconds() <= baseSeconds) { trackerIterator.remove(); } } if (!delay) { for (int s = sinks.length; s-- > 0;) { sinks[s].put(t); } controlTupleCount++; } if (!activeQueues.isEmpty()) { // make sure they are all queues from DelayOperator for (Map.Entry<String, SweepableReservoir> entry : activeQueues) { if (!isInputPortConnectedToDelayOperator(entry.getKey())) { assert (false); } } activeQueues.clear(); } activeQueues.addAll(inputs.entrySet()); expectingBeginWindow = activeQueues.size(); if (firstWindowId == -1) { if (delay) { for (int s = sinks.length; s-- > 0;) { sinks[s].put(t); } controlTupleCount++; // if it's a DelayOperator and this is the first RESET_WINDOW (start) or END_STREAM // (recovery), fabricate the first window fabricateFirstWindow((Operator.DelayOperator) operator, windowAhead); } firstWindowId = t.getWindowId(); } break activequeue; } break; case END_STREAM: activePort.remove(); buffers.remove(); if (firstWindowId == -1) { // this is for recovery from a checkpoint for DelayOperator if (delay) { // if it's a DelayOperator and this is the first RESET_WINDOW (start) or END_STREAM (recovery), // fabricate the first window fabricateFirstWindow((Operator.DelayOperator) operator, windowAhead); } firstWindowId = t.getWindowId(); } for (Iterator<Entry<String, SweepableReservoir>> it = inputs.entrySet().iterator(); it .hasNext();) { Entry<String, SweepableReservoir> e = it.next(); if (e.getValue() == activePort) { if (!descriptor.inputPorts.isEmpty()) { descriptor.inputPorts.get(e.getKey()).component.setConnected(false); } it.remove(); /* check the deferred connection list for any new port that should be connected here */ Iterator<DeferredInputConnection> dici = deferredInputConnections.iterator(); while (dici.hasNext()) { DeferredInputConnection dic = dici.next(); if (e.getKey().equals(dic.portname)) { connectInputPort(dic.portname, dic.reservoir); dici.remove(); activeQueues.add( new AbstractMap.SimpleEntry<>(dic.portname, dic.reservoir)); break activequeue; } } break; } } /** * We are not going to receive begin window on this ever! */ expectingBeginWindow--; /** * Since one of the operators we care about it gone, we should relook at our ports. * We need to make sure that the END_STREAM comes outside of the window. */ regularQueues--; totalQueues--; boolean break_activequeue = false; if (regularQueues == 0) { alive = false; break_activequeue = true; } else if (activeQueues.isEmpty()) { assert (!inputs.isEmpty()); processEndWindow(null); activeQueues.addAll(inputs.entrySet()); expectingBeginWindow = activeQueues.size(); break_activequeue = true; } /** * also make sure that we update the reset tuple tracker if this stream had delivered any reset tuples. * Check all the reset buffers to see if current input port has already delivered reset tuple. If it has * then we are waiting for something else to deliver the reset tuple, so just clear current reservoir * from the list of tracked reservoirs. If the current input port has not delivered the reset tuple, and * it's the only one which has not, then we consider it delivered and release the reset tuple downstream. */ Tuple tuple = null; for (Iterator<TupleTracker> trackerIterator = resetTupleTracker .iterator(); trackerIterator.hasNext();) { tracker = trackerIterator.next(); trackerIndex = 0; while (trackerIndex < tracker.ports.length) { if (tracker.ports[trackerIndex] == activePort) { SweepableReservoir[] ports = new SweepableReservoir[regularQueues]; System.arraycopy(tracker.ports, 0, ports, 0, trackerIndex); if (trackerIndex < regularQueues) { System.arraycopy(tracker.ports, trackerIndex + 1, ports, trackerIndex, tracker.ports.length - trackerIndex - 1); } tracker.ports = ports; break; } else if (tracker.ports[trackerIndex] == null) { if (trackerIndex == regularQueues) { /* regularQueues is already adjusted above */ if (tuple == null || tuple.getBaseSeconds() < tracker.tuple.getBaseSeconds()) { tuple = tracker.tuple; } trackerIterator.remove(); } break; } else { tracker.ports = Arrays.copyOf(tracker.ports, regularQueues); } trackerIndex++; } } /* * Since we were waiting for a reset tuple on this stream, we should not any longer. */ if (tuple != null && !delay) { for (int s = sinks.length; s-- > 0;) { sinks[s].put(tuple); } controlTupleCount++; } if (break_activequeue) { break activequeue; } break; default: throw new UnhandledException("Unrecognized Control Tuple", new IllegalArgumentException(t.toString())); } } } if (activeQueues.isEmpty() && alive) { logger.error("Catastrophic Error: Invalid State - the operator blocked forever!"); System.exit(2); } else { boolean need2sleep = true; for (Map.Entry<String, SweepableReservoir> cb : activeQueues) { need2sleep = cb.getValue().isEmpty(); if (!need2sleep) { spinMillis = 0; break; } } if (need2sleep) { if (handleIdleTime && insideWindow) { ((IdleTimeHandler) operator).handleIdleTime(); } else { Thread.sleep(spinMillis); spinMillis = Math.min(maxSpinMillis, spinMillis + 1); } } } } while (alive); } catch (ShutdownException se) { logger.debug("Shutdown requested by the operator when alive = {}.", alive); alive = false; } catch (Throwable cause) { synchronized (this) { if (alive) { DTThrowable.rethrow(cause); } } Throwable rootCause = cause; while (rootCause != null) { if (rootCause instanceof InterruptedException) { break; } rootCause = rootCause.getCause(); } if (rootCause == null) { DTThrowable.rethrow(cause); } else { logger.debug("Ignoring InterruptedException after shutdown", cause); } } /** * TODO: If shutdown and inside window provide alternate way of notifying the operator in such ways * TODO: as using a listener callback */ if (insideWindow && !shutdown) { operator.endWindow(); endWindowEmitTime = System.currentTimeMillis(); if (++applicationWindowCount == APPLICATION_WINDOW_COUNT) { applicationWindowCount = 0; } if (++checkpointWindowCount == CHECKPOINT_WINDOW_COUNT) { checkpointWindowCount = 0; if (doCheckpoint || PROCESSING_MODE == ProcessingMode.EXACTLY_ONCE) { checkpoint(currentWindowId); } } ContainerStats.OperatorStats stats = new ContainerStats.OperatorStats(); fixEndWindowDequeueTimesBeforeDeactivate(); reportStats(stats, currentWindowId); stats.metrics = collectMetrics(); handleRequests(currentWindowId); } }
From source file:org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.LazyPersistTestCase.java
protected void waitForMetric(final String metricName, final int expectedValue) throws TimeoutException, InterruptedException { GenericTestUtils.waitFor(new Supplier<Boolean>() { @Override//from w ww . j av a 2 s . c om public Boolean get() { try { final int currentValue = Integer.parseInt(jmx.getValue(metricName)); LOG.info("Waiting for " + metricName + " to reach value " + expectedValue + ", current value = " + currentValue); return currentValue == expectedValue; } catch (Exception e) { throw new UnhandledException("Test failed due to unexpected exception", e); } } }, 1000, Integer.MAX_VALUE); }
From source file:org.devproof.portal.core.app.PortalResourceStreamLocator.java
@Override public IResourceStream locate(Class<?> clazz, String path) { // try to load the resource from the web context if (themeUuid != null) { try {//from w w w . j a va 2 s. co m StringBuilder b = new StringBuilder(); b.append("/WEB-INF/themes/").append(themeUuid).append("/").append(path); URL url = servletContext.getResource(b.toString()); if (url != null) { return new UrlResourceStream(url); } } catch (MalformedURLException e) { throw new UnhandledException("Must not occur!", e); } } return super.locate(clazz, path); }
From source file:org.devproof.portal.core.module.common.util.PortalUtil.java
/** * Generates a MD5 key/*from w ww .ja v a 2 s . co m*/ * * @param value some text, for example a password */ public static String generateMd5(String value) { try { MessageDigest digest = MessageDigest.getInstance("MD5"); digest.update(value.getBytes(), 0, value.length()); return new BigInteger(1, digest.digest()).toString(16); } catch (NoSuchAlgorithmException e) { throw new UnhandledException("MD5 ist not available: ", e); } }
From source file:org.devproof.portal.core.module.configuration.entity.Configuration.java
@Transient public Date getDateValue() { try {/* w w w.j a va 2 s . co m*/ return ConfigurationConstants.DATE_FORMAT.parse(value); } catch (ParseException e) { throw new UnhandledException("The configuration date format is wrong!", e); } }
From source file:org.devproof.portal.core.module.feed.page.BaseFeedPage.java
@Override protected final void onRender(MarkupStream markupStream) { getResponse().setContentType(getContentType()); PrintWriter writer = new PrintWriter(getResponse().getOutputStream()); SyndFeedOutput output = new SyndFeedOutput(); try {//from www .j av a 2 s. c o m SyndFeed feed = createAppropriateFeedProvider(); output.output(feed, writer); writer.close(); } catch (IOException e) { throw new UnhandledException("Error streaming feed.", e); } catch (FeedException e) { throw new UnhandledException("Error streaming feed.", e); } }
From source file:org.displaytag.tags.CaptionTagBeanInfo.java
/** * @see java.beans.BeanInfo#getPropertyDescriptors() *//*ww w. jav a2 s . c o m*/ public PropertyDescriptor[] getPropertyDescriptors() { List proplist = new ArrayList(); try { proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$ CaptionTag.class, null, "setClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("dir", //$NON-NLS-1$ CaptionTag.class, null, "setDir")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("id", //$NON-NLS-1$ CaptionTag.class, null, "setId")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("lang", //$NON-NLS-1$ CaptionTag.class, null, "setLang")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("media", //$NON-NLS-1$ CaptionTag.class, null, "setMedia")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$ CaptionTag.class, null, "setStyle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("title", //$NON-NLS-1$ CaptionTag.class, null, "setTitle")); //$NON-NLS-1$ // make ATG Dynamo happy: // Attribute "className" of tag "caption" in taglib descriptor file displaytag-11.tld" must have a // corresponding property in class "org.displaytag.tags.CaptionTag" with a public setter method proplist.add(new PropertyDescriptor("className", //$NON-NLS-1$ CaptionTag.class, null, "setClass")); //$NON-NLS-1$ } catch (IntrospectionException ex) { throw new UnhandledException( "You got an introspection exception - maybe defining a property that is not" + " defined in the CaptionTag?: " + ex.getMessage(), ex); } PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()]; return ((PropertyDescriptor[]) proplist.toArray(result)); }
From source file:org.displaytag.tags.ColumnTagBeanInfo.java
/** * @see java.beans.BeanInfo#getPropertyDescriptors() *//*from www . j a va 2 s .c o m*/ public PropertyDescriptor[] getPropertyDescriptors() { List proplist = new ArrayList(); try { proplist.add(new PropertyDescriptor("autolink", //$NON-NLS-1$ ColumnTag.class, null, "setAutolink")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("escapeXml", //$NON-NLS-1$ ColumnTag.class, null, "setEscapeXml")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$ ColumnTag.class, null, "setClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$ ColumnTag.class, null, "setDecorator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("group", //$NON-NLS-1$ ColumnTag.class, null, "setGroup")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("headerClass", //$NON-NLS-1$ ColumnTag.class, null, "setHeaderClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("href", //$NON-NLS-1$ ColumnTag.class, null, "setHref")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("maxLength", //$NON-NLS-1$ ColumnTag.class, null, "setMaxLength")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("maxWords", //$NON-NLS-1$ ColumnTag.class, null, "setMaxWords")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("media", //$NON-NLS-1$ ColumnTag.class, null, "setMedia")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("nulls", //$NON-NLS-1$ ColumnTag.class, null, "setNulls")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramId", //$NON-NLS-1$ ColumnTag.class, null, "setParamId")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramName", //$NON-NLS-1$ ColumnTag.class, null, "setParamName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramProperty", //$NON-NLS-1$ ColumnTag.class, null, "setParamProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramScope", //$NON-NLS-1$ ColumnTag.class, null, "setParamScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("property", //$NON-NLS-1$ ColumnTag.class, null, "setProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortable", //$NON-NLS-1$ ColumnTag.class, null, "setSortable")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortName", //$NON-NLS-1$ ColumnTag.class, null, "setSortName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$ ColumnTag.class, null, "setStyle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("title", //$NON-NLS-1$ ColumnTag.class, null, "setTitle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("titleKey", //$NON-NLS-1$ ColumnTag.class, null, "setTitleKey")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("url", //$NON-NLS-1$ ColumnTag.class, null, "setUrl")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortProperty", //$NON-NLS-1$ ColumnTag.class, null, "setSortProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("total", //$NON-NLS-1$ ColumnTag.class, null, "setTotal")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("comparator", //$NON-NLS-1$ ColumnTag.class, null, "setComparator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$ ColumnTag.class, null, "setDefaultorder")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("headerScope", //$NON-NLS-1$ ColumnTag.class, null, "setHeaderScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("scope", //$NON-NLS-1$ ColumnTag.class, null, "setScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("format", //$NON-NLS-1$ ColumnTag.class, null, "setFormat")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("value", //$NON-NLS-1$ ColumnTag.class, null, "setValue")); //$NON-NLS-1$ // make ATG Dynamo happy: proplist.add(new PropertyDescriptor("className", //$NON-NLS-1$ ColumnTag.class, null, "setClass")); // map //$NON-NLS-1$ // DISPL-242: handle new grouped title attribute proplist.add(new PropertyDescriptor("groupTitle", //$NON-NLS-1$ ColumnTag.class, null, "setGroupTitle")); // map //$NON-NLS-1$ proplist.add(new PropertyDescriptor("groupTitleKey", //$NON-NLS-1$ ColumnTag.class, null, "setGroupTitleKey")); // map //$NON-NLS-1$ } catch (IntrospectionException ex) { throw new UnhandledException( "You got an introspection exception - maybe defining a property that is not" + " defined in the ColumnTag?: " + ex.getMessage(), ex); } PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()]; return ((PropertyDescriptor[]) proplist.toArray(result)); }
From source file:org.displaytag.tags.el.ELColumnTagBeanInfo.java
/** * @see java.beans.BeanInfo#getPropertyDescriptors() *///from w w w . j av a 2 s . co m public PropertyDescriptor[] getPropertyDescriptors() { List proplist = new ArrayList(); try { proplist.add(new PropertyDescriptor("autolink", //$NON-NLS-1$ ELColumnTag.class, null, "setAutolink")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("escapeXml", //$NON-NLS-1$ ELColumnTag.class, null, "setEscapeXml")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$ ELColumnTag.class, null, "setClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$ ELColumnTag.class, null, "setDecorator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("group", //$NON-NLS-1$ ELColumnTag.class, null, "setGroup")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("headerClass", //$NON-NLS-1$ ELColumnTag.class, null, "setHeaderClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("href", //$NON-NLS-1$ ELColumnTag.class, null, "setHref")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("maxLength", //$NON-NLS-1$ ELColumnTag.class, null, "setMaxLength")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("maxWords", //$NON-NLS-1$ ELColumnTag.class, null, "setMaxWords")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("media", //$NON-NLS-1$ ELColumnTag.class, null, "setMedia")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("nulls", //$NON-NLS-1$ ELColumnTag.class, null, "setNulls")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramId", //$NON-NLS-1$ ELColumnTag.class, null, "setParamId")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramName", //$NON-NLS-1$ ELColumnTag.class, null, "setParamName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramProperty", //$NON-NLS-1$ ELColumnTag.class, null, "setParamProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("paramScope", //$NON-NLS-1$ ELColumnTag.class, null, "setParamScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("property", //$NON-NLS-1$ ELColumnTag.class, null, "setProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortable", //$NON-NLS-1$ ELColumnTag.class, null, "setSortable")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortName", //$NON-NLS-1$ ELColumnTag.class, null, "setSortName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$ ELColumnTag.class, null, "setStyle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("total", //$NON-NLS-1$ ELColumnTag.class, null, "setTotal")); // map //$NON-NLS-1$ proplist.add(new PropertyDescriptor("title", //$NON-NLS-1$ ELColumnTag.class, null, "setTitle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("titleKey", //$NON-NLS-1$ ELColumnTag.class, null, "setTitleKey")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("url", //$NON-NLS-1$ ELColumnTag.class, null, "setUrl")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sortProperty", //$NON-NLS-1$ ELColumnTag.class, null, "setSortProperty")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("comparator", //$NON-NLS-1$ ELColumnTag.class, null, "setComparator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$ ELColumnTag.class, null, "setDefaultorder")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("headerScope", //$NON-NLS-1$ ELColumnTag.class, null, "setHeaderScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("scope", //$NON-NLS-1$ ELColumnTag.class, null, "setScope")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("format", //$NON-NLS-1$ ELColumnTag.class, null, "setFormat")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("value", //$NON-NLS-1$ ELColumnTag.class, null, "setValue")); //$NON-NLS-1$ } catch (IntrospectionException ex) { throw new UnhandledException( "You got an introspection exception - maybe defining a property that is not" + " defined in the bean?: " + ex.getMessage(), ex); } PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()]; return ((PropertyDescriptor[]) proplist.toArray(result)); }
From source file:org.displaytag.tags.el.ELTableTagBeanInfo.java
/** * @see java.beans.BeanInfo#getPropertyDescriptors() */// w w w .j av a2 s.c o m public PropertyDescriptor[] getPropertyDescriptors() { List proplist = new ArrayList(); try { proplist.add(new PropertyDescriptor("cellpadding", //$NON-NLS-1$ ELTableTag.class, null, "setCellpadding")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("cellspacing", //$NON-NLS-1$ ELTableTag.class, null, "setCellspacing")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$ ELTableTag.class, null, "setClass")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$ ELTableTag.class, null, "setDecorator")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$ ELTableTag.class, null, "setDefaultorder")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("defaultsort", //$NON-NLS-1$ ELTableTag.class, null, "setDefaultsort")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("export", //$NON-NLS-1$ ELTableTag.class, null, "setExport")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("frame", //$NON-NLS-1$ ELTableTag.class, null, "setFrame")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("length", //$NON-NLS-1$ ELTableTag.class, null, "setLength")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("name", //$NON-NLS-1$ ELTableTag.class, null, "setName")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("offset", //$NON-NLS-1$ ELTableTag.class, null, "setOffset")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("pagesize", //$NON-NLS-1$ ELTableTag.class, null, "setPagesize")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("partialList", //$NON-NLS-1$ ELTableTag.class, null, "setPartialList")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("requestURI", //$NON-NLS-1$ ELTableTag.class, null, "setRequestURI")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("requestURIcontext", //$NON-NLS-1$ ELTableTag.class, null, "setRequestURIcontext")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("rules", //$NON-NLS-1$ ELTableTag.class, null, "setRules")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("size", //$NON-NLS-1$ ELTableTag.class, null, "setSize")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("sort", //$NON-NLS-1$ ELTableTag.class, null, "setSort")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$ ELTableTag.class, null, "setStyle")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("summary", //$NON-NLS-1$ ELTableTag.class, null, "setSummary")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("excludedParams", //$NON-NLS-1$ ELTableTag.class, null, "setExcludedParams")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("id", //$NON-NLS-1$ ELTableTag.class, null, "setUid")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("keepStatus", //$NON-NLS-1$ ELTableTag.class, null, "setKeepStatus")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("clearStatus", //$NON-NLS-1$ ELTableTag.class, null, "setClearStatus")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("form", //$NON-NLS-1$ ELTableTag.class, null, "setForm")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("uid", //$NON-NLS-1$ ELTableTag.class, null, "setUid")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("htmlId", //$NON-NLS-1$ ELTableTag.class, null, "setHtmlId")); //$NON-NLS-1$ proplist.add(new PropertyDescriptor("varTotals", //$NON-NLS-1$ TableTag.class, null, "setVarTotals")); //$NON-NLS-1$ } catch (IntrospectionException ex) { throw new UnhandledException( "You got an introspection exception - maybe defining a property that is not" + " defined in the ElTableTag?: " + ex.getMessage(), ex); } PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()]; return ((PropertyDescriptor[]) proplist.toArray(result)); }