DNA SVN: r611 - in trunk: dna-common/src/main/java/org/jboss/dna/common/monitor and 7 other directories.
by dna-commits@lists.jboss.org
Author: jverhaeg(a)redhat.com
Date: 2008-10-31 17:38:00 -0400 (Fri, 31 Oct 2008)
New Revision: 611
Added:
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/CapturedActivityInfo.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/UnlocalizedActivityInfo.java
trunk/dna-common/src/main/java/org/jboss/dna/common/util/EmptyIterator.java
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/CapturedActivityInfoTest.java
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitor.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitorWrapper.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityStatus.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleActivityMonitor.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SubActivityMonitor.java
trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/ActivityStatusTest.java
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleActivityMonitorTest.java
trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/StreamSequencerAdapterTest.java
trunk/extensions/dna-sequencer-xml/src/main/java/org/jboss/dna/sequencer/xml/XmlSequencer.java
Log:
DNA-244: Changed ActivityMonitor to now support capturing of information, including markers, errors, and warnings, that can be later retrieved via the ActivityStatus.
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -42,58 +42,51 @@
public static I18n i18nFieldNotStatic;
public static I18n i18nLocalizationFileNotFound;
public static I18n i18nLocalizationProblems;
- public static I18n i18nRequiredToSuppliedParameterMismatch;
-
- /**
- * Parameters:
- * <ol>
- * <li>{@link I18n#id() Property}</li>
- * <li>Localization file URL</li>
- * </ol>
- */
public static I18n i18nPropertyDuplicate;
public static I18n i18nPropertyMissing;
public static I18n i18nPropertyUnused;
+ public static I18n i18nRequiredToSuppliedParameterMismatch;
// Core-related fields
- public static I18n argumentMayNotBeLessThan;
+ public static I18n activityMonitorBeginTask;
+ public static I18n activityMonitorStatus;
+ public static I18n argumentDidNotContainKey;
+ public static I18n argumentDidNotContainObject;
+ public static I18n argumentMayNotBeEmpty;
public static I18n argumentMayNotBeGreaterThan;
+ public static I18n argumentMayNotBeLessThan;
+ public static I18n argumentMayNotBeNegative;
+ public static I18n argumentMayNotBeNull;
+ public static I18n argumentMayNotBeNullOrZeroLength;
+ public static I18n argumentMayNotBeNullOrZeroLengthOrEmpty;
+ public static I18n argumentMayNotBePositive;
+ public static I18n argumentMayNotContainNullValue;
+ public static I18n argumentMustBeEmpty;
+ public static I18n argumentMustBeEquals;
public static I18n argumentMustBeGreaterThan;
- public static I18n argumentMustBeLessThan;
public static I18n argumentMustBeGreaterThanOrEqualTo;
+ public static I18n argumentMustBeInstanceOf;
+ public static I18n argumentMustBeLessThan;
public static I18n argumentMustBeLessThanOrEqualTo;
- public static I18n argumentMayNotBeNegative;
- public static I18n argumentMayNotBePositive;
public static I18n argumentMustBeNegative;
- public static I18n argumentMustBePositive;
- public static I18n argumentMustBeNumber;
- public static I18n argumentMayNotBeNullOrZeroLength;
- public static I18n argumentMayNotBeNullOrZeroLengthOrEmpty;
- public static I18n argumentMayNotBeNull;
public static I18n argumentMustBeNull;
- public static I18n argumentMustBeInstanceOf;
+ public static I18n argumentMustBeNumber;
+ public static I18n argumentMustBeOfMaximumSize;
+ public static I18n argumentMustBeOfMinimumSize;
+ public static I18n argumentMustBePositive;
public static I18n argumentMustBeSameAs;
- public static I18n argumentMustNotBeSameAs;
- public static I18n argumentMustBeEquals;
public static I18n argumentMustNotBeEquals;
- public static I18n argumentMayNotBeEmpty;
- public static I18n argumentDidNotContainObject;
- public static I18n argumentDidNotContainKey;
- public static I18n argumentMayNotContainNullValue;
- public static I18n argumentMustBeOfMinimumSize;
- public static I18n argumentMustBeOfMaximumSize;
+ public static I18n argumentMustNotBeSameAs;
public static I18n componentClassnameNotValid;
public static I18n componentNotConfigured;
public static I18n dateParsingFailure;
public static I18n initialActivityMonitorTaskName;
public static I18n nullActivityMonitorTaskName;
public static I18n pathAncestorDegreeIsInvalid;
+ public static I18n pathCannotBeNormalized;
public static I18n pathIsAlreadyAbsolute;
public static I18n pathIsNotAbsolute;
public static I18n pathIsNotRelative;
- public static I18n pathCannotBeNormalized;
- public static I18n activityMonitorBeginTask;
- public static I18n activityMonitorStatus;
public static I18n requiredToSuppliedParameterMismatch;
static {
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitor.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitor.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitor.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -23,8 +23,9 @@
package org.jboss.dna.common.monitor;
import java.util.Locale;
-import org.jboss.dna.common.collection.Problems;
import org.jboss.dna.common.i18n.I18n;
+import org.jboss.dna.common.util.Logger;
+import org.slf4j.Marker;
/**
* A basic activity monitor that facilitates the updating and monitoring of progress towards the completion of an activity.
@@ -41,6 +42,15 @@
* cancelled before its normal completion, the <strong>Updater</strong> must deny any previous cancellation request by calling
* {@link #setCancelled(boolean) setCancelled(false)}.
* </p>
+ * <h2>Events</h2>
+ * <p>
+ * The <strong>Updater</strong> may {@link #capture(Marker, I18n, Object...) capture} information related to an activity,
+ * including errors encountered, similar to using a {@link Logger}. However, instead of being written to a log, this information
+ * are merely collected so that it can be later {@link ActivityStatus#getCapturedInformation() retrieved}. This is especially
+ * useful when the activity involves using an API that doesn't provide the ability to collect or return one or more errors or
+ * warnings that may have occurred during the activity. Implementations of the API can get around this deficiency using this
+ * activity monitor to store these issues so that they can be dealt with after the API call has completed.
+ * </p>
*
* @author Randall Hauch
* @author John Verhaeg
@@ -53,13 +63,135 @@
*
* @param totalWork the total number of work units for the task
* @param name the name of the task
- * @param params the parameters for localization
+ * @param messageParameters the parameters for localization
*/
void beginTask( double totalWork,
I18n name,
- Object... params );
+ Object... messageParameters );
/**
+ * Captures an event that occurred during this activity.
+ *
+ * @param message a message representing the event.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void capture( I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures an event that occurred during this activity.
+ *
+ * @param marker an identifying marker
+ * @param message a message representing the event
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void capture( Marker marker,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures an error that occurred during this activity.
+ *
+ * @param throwable the error.
+ */
+ public void captureError( Throwable throwable );
+
+ /**
+ * Captures an error that occurred during this activity.
+ *
+ * @param message a message describing the error.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureError( I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures an error that occurred during this activity.
+ *
+ * @param marker an identifying marker
+ * @param message a message describing the error.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureError( Marker marker,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures an error that occurred during this activity.
+ *
+ * @param throwable the error.
+ * @param message a message describing the error.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureError( Throwable throwable,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures an error that occurred during this activity.
+ *
+ * @param marker an identifying marker
+ * @param throwable the error.
+ * @param message a message describing the error.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureError( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures a warning that occurred during this activity.
+ *
+ * @param throwable the warning.
+ */
+ public void captureWarning( Throwable throwable );
+
+ /**
+ * Captures a warning that occurred during this activity.
+ *
+ * @param message a message describing the warning.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureWarning( I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures a warning that occurred during this activity.
+ *
+ * @param marker an identifying marker
+ * @param message a message describing the warning.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureWarning( Marker marker,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures a warning that occurred during this activity.
+ *
+ * @param throwable the warning.
+ * @param message a message describing the warning.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureWarning( Throwable throwable,
+ I18n message,
+ Object... messageParameters );
+
+ /**
+ * Captures a warning that occurred during this activity.
+ *
+ * @param marker an identifying marker
+ * @param throwable the warning.
+ * @param message a message describing the warning.
+ * @param messageParameters parameter values that are to replace the placeholders in the message
+ */
+ public void captureWarning( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... messageParameters );
+
+ /**
* Called by the <strong>Updater</strong> to create a subtask with the given about of work. The resulting activity monitor
* must be started ({@link #beginTask(double, I18n, Object...)}) and finished ({@link #done()}).
*
@@ -75,8 +207,8 @@
void done();
/**
- * Get the name of the activity using the default locale. This should never change for a activity monitor, and all
- * {@link #createSubtask(double) subtasks} should have the same name.
+ * Get the name of the activity using the {@link Locale#getDefault() default locale}. This should never change for a activity
+ * monitor, and all {@link #createSubtask(double) subtasks} should have the same name.
*
* @return the activity's name; never <code>null</code>
* @see #getActivityName(Locale)
@@ -87,28 +219,29 @@
* Returns the name of the activity using the supplied locale. This should never change for a activity monitor, and all
* {@link #createSubtask(double) subtasks} should have the same name.
*
- * @param locale the locale in which the name is to be represented; if null, the {@link Locale#getDefault() default locale}
- * will be used
+ * @param locale the locale in which the name is to be represented; if <code>null</code>, the {@link Locale#getDefault()
+ * default locale} will be used
* @return the activity's name; never <code>null</code>
- * @see #getActivityName()
*/
String getActivityName( Locale locale );
/**
- * Return the problems encountered during the {@link #getStatus(Locale) progress} made towards completing the associated
- * {@link #getActivityName() activity}.
+ * Return the current status of this activity, localized to the {@link Locale#getDefault() default locale}. This method
+ * returns an immutable but consistent snapshot of the status for this activity. Note that if this instance is a
+ * {@link #createSubtask(double) subtask} , this method returns the status of the subtask.
*
- * @return the list of problems
+ * @return the status of this activity
+ * @see #getStatus(Locale)
*/
- Problems getProblems();
+ ActivityStatus getStatus();
/**
- * Return the current status of this activity, localized to the specified locale. This method returns an immutable but
+ * Return the current status of this activity, localized to the supplied locale. This method returns an immutable but
* consistent snapshot of the status for this activity. Note that if this instance is a {@link #createSubtask(double) subtask}
* , this method returns the status of the subtask.
*
- * @param locale the locale in which the status is to be represented; if null, the {@link Locale#getDefault() default locale}
- * will be used
+ * @param locale the locale in which the status is to be represented; if <code>null</code>, the {@link Locale#getDefault()
+ * default locale} will be used
* @return the status of this activity
*/
ActivityStatus getStatus( Locale locale );
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitorWrapper.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitorWrapper.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityMonitorWrapper.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -23,8 +23,8 @@
package org.jboss.dna.common.monitor;
import java.util.Locale;
-import org.jboss.dna.common.collection.Problems;
import org.jboss.dna.common.i18n.I18n;
+import org.slf4j.Marker;
/**
* The thread safety of this class is determined by the delegate.
@@ -54,6 +54,140 @@
/**
* {@inheritDoc}
*
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void capture( I18n message,
+ Object... parameters ) {
+ delegate.capture(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void capture( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ delegate.capture(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable)
+ */
+ public void captureError( Throwable throwable ) {
+ delegate.captureError(throwable);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( I18n message,
+ Object... parameters ) {
+ delegate.captureError(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureError(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureError(throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureError(marker, throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable)
+ */
+ public void captureWarning( Throwable throwable ) {
+ delegate.captureWarning(throwable);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( I18n message,
+ Object... parameters ) {
+ delegate.captureWarning(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureWarning(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureWarning(throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ delegate.captureWarning(marker, throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.jboss.dna.common.monitor.ActivityMonitor#createSubtask(double)
*/
public ActivityMonitor createSubtask( double subtaskWork ) {
@@ -90,10 +224,10 @@
/**
* {@inheritDoc}
*
- * @see org.jboss.dna.common.monitor.ActivityMonitor#getProblems()
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#getStatus()
*/
- public Problems getProblems() {
- return delegate.getProblems();
+ public ActivityStatus getStatus() {
+ return delegate.getStatus();
}
/**
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityStatus.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityStatus.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/ActivityStatus.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -24,7 +24,11 @@
import java.io.Serializable;
import java.text.DecimalFormat;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.i18n.I18n;
import org.jboss.dna.common.util.StringUtil;
/**
@@ -67,45 +71,76 @@
private final double percentWorked;
private final boolean done;
private final boolean cancelled;
- private final String message;
+ private final String taskName;
+ private final CapturedActivityInfo[] capturedInformation;
/**
* Create the activity status.
*
- * @param activityName the name of the activity, which may not be <code>null</code>
- * @param message the message for the status, which may not be <code>null</code>
+ * @param activityName the name of the activity; must not be <code>null</code>
+ * @param activityNameParameters the parameters for <code>activityName</code>
+ * @param taskName the i18n template for the name of the task being performed within the activity; must not be
+ * <code>null</code>
+ * @param taskNameParameters the parameters for <code>taskName</code>
* @param percentWorked the percentage worked, ranging from 0.0 for not started to 100.0 for complete; a negative value are
* treated as 0.0, while a value greater than 100.0 is treated as 100.0
* @param cancelled <code>true</code> if the activity has been requested to be cancelled, or <code>false</code> otherwise
+ * @param capturedInformation the captured activity information; must not be <code>null</code>
+ * @param locale the locale in which the status is to be represented; if <code>null</code>, the {@link Locale#getDefault()
+ * default locale} will be used
*/
- public ActivityStatus( String activityName,
- String message,
- double percentWorked,
- boolean cancelled ) {
+ ActivityStatus( I18n activityName,
+ Object[] activityNameParameters,
+ I18n taskName,
+ Object[] taskNameParameters,
+ double percentWorked,
+ boolean cancelled,
+ List<UnlocalizedActivityInfo> capturedInformation,
+ Locale locale ) {
assert activityName != null;
- assert message != null;
- this.activityName = activityName;
+ assert capturedInformation != null;
+ assert taskName != null || taskNameParameters == null || taskNameParameters.length == 0;
+ this.activityName = activityName.text(locale, activityNameParameters);
this.done = percentWorked >= 100.0d;
this.percentWorked = this.done ? 100.0d : (percentWorked <= 0.0d ? 0.0d : percentWorked);
- this.message = message;
+ this.taskName = taskName == null ? "" : taskName.text(locale, taskNameParameters);
this.cancelled = cancelled;
+ this.capturedInformation = new CapturedActivityInfo[capturedInformation.size()];
+ Iterator<UnlocalizedActivityInfo> iter = capturedInformation.iterator();
+ for (int ndx = 0; iter.hasNext(); ndx++) {
+ UnlocalizedActivityInfo info = iter.next();
+ this.capturedInformation[ndx] = new CapturedActivityInfo(info.type, info.taskName, info.taskNameParameters,
+ info.marker, info.throwable, info.message,
+ info.messageParameters, locale);
+ }
}
/**
* Create the activity status and compute the percentage worked.
*
- * @param activityName the name of the activity, which may not be null
- * @param message the message for the status, which may not be null
+ * @param activityName the name of the activity; must not be <code>null</code>
+ * @param activityNameParameters the parameters for <code>activityName</code>
+ * @param taskName the i18n template for the name of the task being performed within the activity; must not be
+ * <code>null</code>
+ * @param taskNameParameters the parameters for <code>taskName</code>
* @param workedSoFar the amount of work so far percentage worked
* @param totalWork the total amount of work for this activity
* @param cancelled true if the activity has been requested to be cancelled, or false otherwise
+ * @param capturedInformation the captured activity information; must not be <code>null</code>
+ * @param locale the locale in which the status is to be represented; if <code>null</code>, the {@link Locale#getDefault()
+ * default locale} will be used
*/
- public ActivityStatus( String activityName,
- String message,
- double workedSoFar,
- double totalWork,
- boolean cancelled ) {
- this(activityName, message, computePercentage(workedSoFar, totalWork), cancelled);
+ ActivityStatus( I18n activityName,
+ Object[] activityNameParameters,
+ I18n taskName,
+ Object[] taskNameParameters,
+ double workedSoFar,
+ double totalWork,
+ boolean cancelled,
+ List<UnlocalizedActivityInfo> capturedInformation,
+ Locale locale ) {
+ this(activityName, activityNameParameters, taskName, taskNameParameters, computePercentage(workedSoFar, totalWork),
+ cancelled, capturedInformation, locale);
}
/**
@@ -117,6 +152,10 @@
return this.activityName;
}
+ public CapturedActivityInfo[] getCapturedInformation() {
+ return capturedInformation;
+ }
+
/**
* Get the progress as a percentage of the total work that's been completed.
*
@@ -127,12 +166,12 @@
}
/**
- * Get the activity monitor's text message.
+ * Get the activity monitor's task name.
*
- * @return the text message
+ * @return the task name
*/
- public String getMessage() {
- return this.message;
+ public String getTaskName() {
+ return taskName;
}
/**
@@ -163,7 +202,7 @@
String percentage = new DecimalFormat(PERCENTAGE_PATTERN).format(getPercentWorked());
percentage = StringUtil.justifyRight(percentage, PERCENTAGE_PATTERN.length(), ' ');
String cancelled = this.isCancelled() ? " (cancelled)" : "";
- return this.activityName + " (" + this.message + ") " + percentage + " %" + cancelled;
+ return activityName + " (" + taskName + ") " + percentage + " %" + cancelled;
}
/**
Added: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/CapturedActivityInfo.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/CapturedActivityInfo.java (rev 0)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/CapturedActivityInfo.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.monitor;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.i18n.I18n;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
+import org.slf4j.Marker;
+
+/**
+ * @author jverhaeg
+ */
+@Immutable
+public final class CapturedActivityInfo {
+
+ private final Logger.Level type;
+ private final String taskName;
+ private final Marker marker;
+ private final Throwable throwable;
+ private final String message;
+
+ CapturedActivityInfo( Logger.Level type,
+ I18n taskName,
+ Object[] taskNameParameters,
+ final Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object[] messageParameters,
+ Locale locale ) {
+ assert type != null;
+ assert taskName != null || taskNameParameters == null || taskNameParameters.length == 0;
+ assert message != null || messageParameters == null || messageParameters.length == 0;
+ this.type = type;
+ this.taskName = taskName == null ? "" : taskName.text(locale, taskNameParameters);
+ this.marker = marker == null ? null : new ImmutableMarker(marker);
+ this.throwable = throwable;
+ this.message = message == null ? "" : message.text(locale, messageParameters);
+ }
+
+ /**
+ * Returns the identifying marker associated with this information.
+ *
+ * @return the marker
+ */
+ public Marker getMarker() {
+ return marker;
+ }
+
+ /**
+ * Returns the message associated with this information localized to the {@link ActivityMonitor#getStatus(Locale) supplied
+ * locale}.
+ *
+ * @return the message
+ */
+ public String getMessage() {
+ if (message == null) {
+ if (throwable == null) return null;
+ return throwable.getMessage();
+ }
+ return message;
+ }
+
+ /**
+ * Returns the name of the task, localized to the {@link ActivityMonitor#getStatus(Locale) supplied locale}, that was being
+ * performed when this information was captured.
+ *
+ * @return the task name
+ */
+ public String getTaskName() {
+ return taskName;
+ }
+
+ /**
+ * Returns the throwable associated with this information.
+ *
+ * @return the throwable
+ */
+ public Throwable getThrowable() {
+ return throwable;
+ }
+
+ /**
+ * @return <code>true</code> if this information represents an error.
+ */
+ public boolean isError() {
+ return (type == Logger.Level.ERROR);
+ }
+
+ /**
+ * @return <code>true</code> if this information represents a warning.
+ */
+ public boolean isWarning() {
+ return (type == Logger.Level.WARNING);
+ }
+
+ @Immutable
+ private final class ImmutableMarker implements Marker {
+
+ private static final long serialVersionUID = 1L;
+
+ private final String name;
+ private final List<ImmutableMarker> children = new ArrayList<ImmutableMarker>();
+
+ ImmutableMarker( Marker marker ) {
+ name = marker.getName();
+ for (Iterator<?> iter = marker.iterator(); iter.hasNext();) {
+ children.add(new ImmutableMarker((Marker)iter.next()));
+ }
+ }
+
+ public void add( Marker child ) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean contains( Marker that ) {
+ CheckArg.isNotNull(that, "that");
+ if (this == that) return true;
+ for (ImmutableMarker marker : children) {
+ if (marker.contains(that)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean contains( String name ) {
+ CheckArg.isNotNull(name, "name");
+ if (this.name.equals(name)) return true;
+ for (ImmutableMarker marker : children) {
+ if (marker.contains(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean hasChildren() {
+ return !children.isEmpty();
+ }
+
+ public Iterator<?> iterator() {
+ return children.iterator();
+ }
+
+ public boolean remove( Marker child ) {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Property changes on: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/CapturedActivityInfo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleActivityMonitor.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleActivityMonitor.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleActivityMonitor.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -22,16 +22,19 @@
package org.jboss.dna.common.monitor;
+import java.util.List;
import java.util.Locale;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
-import org.jboss.dna.common.collection.Problems;
-import org.jboss.dna.common.collection.ThreadSafeProblems;
import org.jboss.dna.common.i18n.I18n;
import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.common.util.Logger.Level;
+import org.slf4j.Marker;
/**
* A basic activity monitor.
@@ -40,30 +43,30 @@
* @author John Verhaeg
*/
@ThreadSafe
-public class SimpleActivityMonitor implements ActivityMonitor {
+public final class SimpleActivityMonitor implements ActivityMonitor {
@GuardedBy( "lock" )
private I18n taskName;
@GuardedBy( "lock" )
- private Object[] taskNameParams;
+ private Object[] taskNameParameters;
@GuardedBy( "lock" )
private double totalWork;
@GuardedBy( "lock" )
private double worked;
private final I18n activityName;
- private final Object[] activityNameParams;
+ private final Object[] activityNameParameters;
private final ReadWriteLock lock = new ReentrantReadWriteLock();
private final AtomicBoolean cancelled = new AtomicBoolean(false);
- private final Problems problems = new ThreadSafeProblems();
+ private final List<UnlocalizedActivityInfo> capturedInformation = new CopyOnWriteArrayList<UnlocalizedActivityInfo>();
public SimpleActivityMonitor( I18n activityName,
Object... params ) {
CheckArg.isNotNull(activityName, "activityName");
this.activityName = activityName;
- this.activityNameParams = params;
+ this.activityNameParameters = params;
this.taskName = null;
- this.taskNameParams = null;
+ this.taskNameParameters = null;
}
/**
@@ -72,13 +75,16 @@
* @see org.jboss.dna.common.monitor.ActivityMonitor#beginTask(double, org.jboss.dna.common.i18n.I18n, java.lang.Object[])
*/
public void beginTask( double totalWork,
- I18n name,
- Object... params ) {
+ I18n taskName,
+ Object... taskNameParameters ) {
CheckArg.isGreaterThan(totalWork, 0.0, "totalWork");
+ if (taskName == null && taskNameParameters != null) {
+ CheckArg.isEmpty(taskNameParameters, "taskNameParameters");
+ }
try {
this.lock.writeLock().lock();
- this.taskName = name;
- this.taskNameParams = params;
+ this.taskName = taskName;
+ this.taskNameParameters = taskNameParameters;
this.totalWork = totalWork;
this.worked = 0.0d;
} finally {
@@ -89,10 +95,157 @@
/**
* {@inheritDoc}
*
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void capture( I18n message,
+ Object... messageParameters ) {
+ capture(null, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void capture( Marker marker,
+ I18n message,
+ Object... messageParameters ) {
+ capture(Level.INFO, marker, null, message, messageParameters);
+ }
+
+ private void capture( Logger.Level type,
+ Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... messageParameters ) {
+ assert type != null;
+ if (message == null && messageParameters != null) {
+ CheckArg.isEmpty(messageParameters, "messageParameters");
+ }
+ capturedInformation.add(new UnlocalizedActivityInfo(type, taskName, taskNameParameters, marker, null, message,
+ messageParameters));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable)
+ */
+ public void captureError( Throwable throwable ) {
+ captureError(throwable, null);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( I18n message,
+ Object... messageParameters ) {
+ captureError(null, null, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ I18n message,
+ Object... messageParameters ) {
+ captureError(marker, null, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Throwable throwable,
+ I18n message,
+ Object... messageParameters ) {
+ captureError(null, throwable, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... messageParameters ) {
+ capture(Level.ERROR, marker, throwable, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable)
+ */
+ public void captureWarning( Throwable throwable ) {
+ captureWarning(throwable, null);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( I18n message,
+ Object... messageParameters ) {
+ captureWarning(null, null, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ I18n message,
+ Object... messageParameters ) {
+ captureWarning(marker, null, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Throwable throwable,
+ I18n message,
+ Object... messageParameters ) {
+ captureWarning(null, throwable, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... messageParameters ) {
+ capture(Level.WARNING, marker, throwable, message, messageParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.jboss.dna.common.monitor.ActivityMonitor#createSubtask(double)
*/
public ActivityMonitor createSubtask( double subtaskWork ) {
- return new SubActivityMonitor(this, subtaskWork);
+ return new SubActivityMonitor(this, activityName, activityNameParameters, subtaskWork, capturedInformation);
}
/**
@@ -130,20 +283,16 @@
* @see org.jboss.dna.common.monitor.ActivityMonitor#getActivityName(java.util.Locale)
*/
public String getActivityName( Locale locale ) {
- return activityName.text(locale == null ? Locale.getDefault() : locale, activityNameParams);
+ return activityName.text(locale, activityNameParameters);
}
/**
* {@inheritDoc}
- * <p>
- * Problems must only be added by the {@link ActivityMonitor <strong>Updater</strong>}, and accessed by
- * {@link ActivityMonitor Observers} only after the activity has been {@link #done() completed}.
- * </p>
*
- * @see org.jboss.dna.common.monitor.ActivityMonitor#getProblems()
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#getStatus()
*/
- public Problems getProblems() {
- return problems;
+ public ActivityStatus getStatus() {
+ return getStatus(null);
}
/**
@@ -153,12 +302,11 @@
*/
public ActivityStatus getStatus( Locale locale ) {
try {
- this.lock.readLock().lock();
- String localizedTaskName = this.taskName == null ? "" : this.taskName.text(locale, this.taskNameParams);
- return new ActivityStatus(this.getActivityName(locale), localizedTaskName, this.worked, this.totalWork,
- this.isCancelled());
+ lock.readLock().lock();
+ return new ActivityStatus(activityName, activityNameParameters, taskName, taskNameParameters, worked, totalWork,
+ isCancelled(), capturedInformation, locale);
} finally {
- this.lock.readLock().unlock();
+ lock.readLock().unlock();
}
}
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SubActivityMonitor.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SubActivityMonitor.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SubActivityMonitor.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -22,27 +22,26 @@
package org.jboss.dna.common.monitor;
+import java.util.List;
import java.util.Locale;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import net.jcip.annotations.GuardedBy;
-import org.jboss.dna.common.collection.Problems;
+import net.jcip.annotations.ThreadSafe;
import org.jboss.dna.common.i18n.I18n;
+import org.slf4j.Marker;
/**
- * This class is thread-safe except when accessing or adding {@link #getProblems() problems}. Problems must only be added by the
- * {@link ActivityMonitor <strong>Updater</strong>}, and accessed by {@link ActivityMonitor Observers} only after the activity has
- * been {@link #done() completed}.
- *
* @author Randall Hauch
* @author John Verhaeg
*/
-public class SubActivityMonitor implements ActivityMonitor {
+@ThreadSafe
+class SubActivityMonitor implements ActivityMonitor {
@GuardedBy( "lock" )
private I18n taskName;
@GuardedBy( "lock" )
- private Object[] params;
+ private Object[] taskNameParameters;
@GuardedBy( "lock" )
private double totalWork;
@GuardedBy( "lock" )
@@ -52,14 +51,25 @@
private final double subtaskTotalInParent;
private final ActivityMonitor parent;
+ private final I18n activityName;
+ private final Object[] activityNameParameters;
private final ReadWriteLock lock = new ReentrantReadWriteLock();
+ private final List<UnlocalizedActivityInfo> capturedInformation;
- public SubActivityMonitor( final ActivityMonitor parent,
- final double subtaskTotalInParent ) {
+ SubActivityMonitor( final ActivityMonitor parent,
+ final I18n activityName,
+ final Object[] activityNameParameters,
+ final double subtaskTotalInParent,
+ List<UnlocalizedActivityInfo> capturedInformation ) {
assert subtaskTotalInParent > 0;
assert parent != null;
+ assert activityName != null;
+ this.activityName = activityName;
+ this.activityNameParameters = activityNameParameters;
+ assert capturedInformation != null;
this.parent = parent;
this.subtaskTotalInParent = subtaskTotalInParent;
+ this.capturedInformation = capturedInformation;
}
/**
@@ -74,7 +84,7 @@
try {
this.lock.writeLock().lock();
this.taskName = name;
- this.params = params;
+ this.taskNameParameters = params;
this.totalWork = totalWork;
this.parentWorkScaleFactor = ((float)subtaskTotalInParent) / ((float)totalWork);
} finally {
@@ -85,10 +95,144 @@
/**
* {@inheritDoc}
*
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void capture( I18n message,
+ Object... parameters ) {
+ parent.capture(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#capture(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void capture( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ parent.capture(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable)
+ */
+ public void captureError( Throwable throwable ) {
+ parent.captureError(throwable);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( I18n message,
+ Object... parameters ) {
+ parent.captureError(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ parent.captureError(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureError( Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ parent.captureError(throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureError(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureError( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ parent.captureError(marker, throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable)
+ */
+ public void captureWarning( Throwable throwable ) {
+ parent.captureWarning(throwable);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( I18n message,
+ Object... parameters ) {
+ parent.captureWarning(message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ I18n message,
+ Object... parameters ) {
+ parent.captureWarning(marker, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(java.lang.Throwable, org.jboss.dna.common.i18n.I18n,
+ * java.lang.Object[])
+ */
+ public void captureWarning( Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ parent.captureWarning(throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#captureWarning(org.slf4j.Marker, java.lang.Throwable,
+ * org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public void captureWarning( Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object... parameters ) {
+ parent.captureWarning(marker, throwable, message, parameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.jboss.dna.common.monitor.ActivityMonitor#createSubtask(double)
*/
public ActivityMonitor createSubtask( double subtaskWork ) {
- return new SubActivityMonitor(this, subtaskWork);
+ return new SubActivityMonitor(this, activityName, activityNameParameters, subtaskWork, capturedInformation);
}
/**
@@ -138,10 +282,10 @@
/**
* {@inheritDoc}
*
- * @see org.jboss.dna.common.monitor.ActivityMonitor#getProblems()
+ * @see org.jboss.dna.common.monitor.ActivityMonitor#getStatus()
*/
- public Problems getProblems() {
- return parent.getProblems();
+ public ActivityStatus getStatus() {
+ return getStatus(null);
}
/**
@@ -151,11 +295,11 @@
*/
public ActivityStatus getStatus( Locale locale ) {
try {
- this.lock.readLock().lock();
- return new ActivityStatus(getActivityName(), this.taskName.text(locale, this.params), this.submittedToParent,
- this.subtaskTotalInParent, this.isCancelled());
+ lock.readLock().lock();
+ return new ActivityStatus(activityName, activityNameParameters, taskName, taskNameParameters, submittedToParent,
+ subtaskTotalInParent, isCancelled(), capturedInformation, locale);
} finally {
- this.lock.readLock().unlock();
+ lock.readLock().unlock();
}
}
Added: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/UnlocalizedActivityInfo.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/UnlocalizedActivityInfo.java (rev 0)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/UnlocalizedActivityInfo.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.monitor;
+
+import net.jcip.annotations.Immutable;
+import org.jboss.dna.common.i18n.I18n;
+import org.jboss.dna.common.util.Logger;
+import org.slf4j.Marker;
+
+/**
+ * @author jverhaeg
+ */
+@Immutable
+class UnlocalizedActivityInfo {
+
+ final Logger.Level type;
+ final I18n taskName;
+ final Object[] taskNameParameters;
+ final Marker marker;
+ final Throwable throwable;
+ final I18n message;
+ final Object[] messageParameters;
+
+ UnlocalizedActivityInfo( Logger.Level type,
+ I18n taskName,
+ Object[] taskNameParameters,
+ Marker marker,
+ Throwable throwable,
+ I18n message,
+ Object[] messageParameters ) {
+ assert type != null;
+ this.type = type;
+ this.taskName = taskName;
+ this.taskNameParameters = taskNameParameters;
+ this.marker = marker;
+ this.throwable = throwable;
+ this.message = message;
+ this.messageParameters = messageParameters;
+ }
+}
Property changes on: trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/UnlocalizedActivityInfo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/util/CheckArg.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -588,6 +588,21 @@
}
/**
+ * Check that the array is empty
+ *
+ * @param argument Array
+ * @param name The name of the argument
+ * @throws IllegalArgumentException If array is not empty
+ */
+ public static void isEmpty( Object[] argument,
+ String name ) {
+ isNotNull(argument, name);
+ if (argument.length > 0) {
+ throw new IllegalArgumentException(CommonI18n.argumentMustBeEmpty.text(name));
+ }
+ }
+
+ /**
* Check that the array is not empty
*
* @param argument Array
Added: trunk/dna-common/src/main/java/org/jboss/dna/common/util/EmptyIterator.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/util/EmptyIterator.java (rev 0)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/util/EmptyIterator.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.util;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * @author jverhaeg
+ * @param <T> some type
+ */
+public final class EmptyIterator<T> implements Iterator<T> {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#hasNext()
+ */
+ public boolean hasNext() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#next()
+ */
+ public T next() {
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.util.Iterator#remove()
+ */
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on: trunk/dna-common/src/main/java/org/jboss/dna/common/util/EmptyIterator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
===================================================================
--- trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-10-31 21:38:00 UTC (rev 611)
@@ -37,42 +37,43 @@
i18nRequiredToSuppliedParameterMismatch = Internationalization field "{0}" in {1}: {2}
# Core-related fields
+activityMonitorBeginTask = Beginning {0} ({1})
+activityMonitorStatus = {0}
+argumentDidNotContainKey = "The {0} argument did not contain the expected key {1}
+argumentDidNotContainObject = "The {0} argument did not contain the expected object {1}
+argumentMayNotBeEmpty = The {0} argument may not be empty
argumentMayNotBeGreaterThan = The {0} argument value, {1}, may not be greater than {2}
argumentMayNotBeLessThan = The {0} argument value, {1}, may not be less than {2}
+argumentMayNotBeNegative = The {0} argument value, {1}, may not be negative
+argumentMayNotBeNull = The {0} argument may not be null
+argumentMayNotBeNullOrZeroLength = The {0} argument may not be null or zero-length
+argumentMayNotBeNullOrZeroLengthOrEmpty = The {0} argument may not be empty or contain only whitespace
+argumentMayNotBePositive = The {0} argument value, {1}, may not be positive
+argumentMayNotContainNullValue = The {0} argument may not contain a null value (first null found at position {1})
+argumentMustBeEmpty = The {0} argument must be empty.
+argumentMustBeEquals = The {0} argument is not equal to {1}
argumentMustBeGreaterThan = The {0} argument value, {1}, must be greater than {2}
+argumentMustBeGreaterThanOrEqualTo = The {0} argument value, {1}, must be greater than or equal to {2}
+argumentMustBeInstanceOf = The {0} argument was an instance of {1} but was expected to be an instance of {2}
argumentMustBeLessThan = The {0} argument value, {1}, must be less than {2}
-argumentMustBeGreaterThanOrEqualTo = The {0} argument value, {1}, must be greater than or equal to {2}
argumentMustBeLessThanOrEqualTo = The {0} argument value, {1}, must be less than or equal to {2}
-argumentMayNotBeNegative = The {0} argument value, {1}, may not be negative
-argumentMayNotBePositive = The {0} argument value, {1}, may not be positive
argumentMustBeNegative = The {0} argument value, {1}, must be negative
+argumentMustBeNull = The {0} argument must be null
+argumentMustBeNumber = The {0} argument value must be a number
+argumentMustBeOfMaximumSize = The {0} argument is a {1} with {2} elements but must have no more than {3}
+argumentMustBeOfMinimumSize = The {0} argument is a {1} with {2} elements but must have at least {3}
argumentMustBePositive = The {0} argument value, {1}, must be positive
-argumentMustBeNumber = The {0} argument value must be a number
-argumentMayNotBeNullOrZeroLength = The {0} argument may not be null or zero-length
-argumentMayNotBeNullOrZeroLengthOrEmpty = The {0} argument may not be empty or contain only whitespace
-argumentMayNotBeNull = The {0} argument may not be null
-argumentMustBeNull = The {0} argument must be null
-argumentMustBeInstanceOf = The {0} argument was an instance of {1} but was expected to be an instance of {2}
argumentMustBeSameAs = The {0} argument is not the same as "{1}"
+argumentMustNotBeEquals = The {0} argument is equal to {1}
argumentMustNotBeSameAs = The {0} argument is the same as "{1}"
-argumentMustBeEquals = The {0} argument is not equal to {1}
-argumentMustNotBeEquals = The {0} argument is equal to {1}
-argumentMayNotBeEmpty = The {0} argument may not be empty
-argumentDidNotContainObject = "The {0} argument did not contain the expected object {1}
-argumentDidNotContainKey = "The {0} argument did not contain the expected key {1}
-argumentMayNotContainNullValue = The {0} argument may not contain a null value (first null found at position {1})
-argumentMustBeOfMinimumSize = The {0} argument is a {1} with {2} elements but must have at least {3}
-argumentMustBeOfMaximumSize = The {0} argument is a {1} with {2} elements but must have no more than {3}
componentClassnameNotValid = The class name {0} specified for {1} is not a valid Java class name
componentNotConfigured = The component {0} was not configured and will not be used
dateParsingFailure = Unable to parse the date "{0}" using the standard ISO 8601 format
initialActivityMonitorTaskName =
nullActivityMonitorTaskName = Not available
pathAncestorDegreeIsInvalid = Unable to obtain the {1} ancestor for {0}
+pathCannotBeNormalized = The path {0} is invalid and cannot be normalized
pathIsAlreadyAbsolute = The path {0} is already an absolute path
pathIsNotAbsolute = The path {0} is not an absolute path
pathIsNotRelative = The path {0} is not a relative path
-pathCannotBeNormalized = The path {0} is invalid and cannot be normalized
-activityMonitorBeginTask = Beginning {0} ({1})
-activityMonitorStatus = {0}
requiredToSuppliedParameterMismatch = {0} parameter{1} supplied, but {2} parameter{3} required: "{4}" => "{5}"
Modified: trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -34,5 +34,6 @@
}
}
+ public static I18n noPlaceholders;
public static I18n passthrough;
}
Modified: trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/ActivityStatusTest.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/ActivityStatusTest.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/ActivityStatusTest.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -25,6 +25,11 @@
import static org.hamcrest.core.Is.is;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertThat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import org.jboss.dna.common.i18n.MockI18n;
+import org.jboss.dna.common.util.Logger;
import org.junit.Before;
import org.junit.Test;
@@ -34,18 +39,56 @@
*/
public class ActivityStatusTest {
+ private static final String VALID_ACTIVITY_NAME = "Reading from file X";
+ private static final String VALID_TASK_NAME = "Checking for file";
+
private ActivityStatus status;
- private String validActivityName;
- private String validTaskName;
+ private List<UnlocalizedActivityInfo> infos;
@Before
public void beforeEach() {
- this.validActivityName = "Reading from file X";
- this.validTaskName = "Checking for file";
- this.status = new ActivityStatus(this.validActivityName, this.validTaskName, 10.0d, false);
+ infos = new ArrayList<UnlocalizedActivityInfo>();
+ infos.add(new UnlocalizedActivityInfo(Logger.Level.INFO, null, null, null, null, null, null));
+ this.status = new ActivityStatus(MockI18n.passthrough, new Object[] {VALID_ACTIVITY_NAME}, MockI18n.passthrough,
+ new Object[] {VALID_TASK_NAME}, 10.0d, false, infos, Locale.US);
}
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowNoActivityName() {
+ new ActivityStatus(null, new Object[] {VALID_ACTIVITY_NAME}, MockI18n.passthrough, new Object[] {VALID_TASK_NAME}, 10.0d,
+ false, infos, Locale.US);
+ }
+
@Test
+ public void shouldAllowNoActivityNameParameters() {
+ new ActivityStatus(MockI18n.noPlaceholders, null, MockI18n.passthrough, new Object[] {VALID_TASK_NAME}, 10.0d, false,
+ infos, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoTaskName() {
+ new ActivityStatus(MockI18n.passthrough, new Object[] {VALID_ACTIVITY_NAME}, null, null, 10.0d, false, infos, Locale.US);
+ }
+
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowTaskNameParametersWithNoTaskName() {
+ new ActivityStatus(MockI18n.passthrough, new Object[] {VALID_ACTIVITY_NAME}, null, new Object[] {VALID_TASK_NAME}, 10.0d,
+ false, infos, Locale.US);
+ }
+
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowNoCapturedActivityInformation() {
+ new ActivityStatus(MockI18n.passthrough, new Object[] {VALID_ACTIVITY_NAME}, MockI18n.passthrough,
+ new Object[] {VALID_TASK_NAME}, 10.0d, false, null, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoLocale() {
+ new ActivityStatus(MockI18n.passthrough, new Object[] {VALID_ACTIVITY_NAME}, MockI18n.passthrough,
+ new Object[] {VALID_TASK_NAME}, 10.0d, false, infos, null);
+ }
+
+ @Test
public void shouldComputePercentageAs100PercentIfWithinPrecision() {
assertThat(ActivityStatus.computePercentage(100.0d - (ActivityStatus.PERCENT_PRECISION / 2.0d), 100.0d),
is(closeTo(100.0d, ActivityStatus.PERCENT_PRECISION)));
@@ -60,7 +103,21 @@
@Test
public void shouldHaveToStringThatIncludesPercentage() {
- // System.out.println(this.status);
assertThat(this.status.toString().indexOf("10.0 %") > 0, is(true));
}
+
+ @Test
+ public void shouldProvideCapturedActivityInforation() {
+ assertThat(status.getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldProvideActivityName() {
+ assertThat(status.getActivityName(), is(VALID_ACTIVITY_NAME));
+ }
+
+ @Test
+ public void shouldProvideTaskName() {
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
+ }
}
Added: trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/CapturedActivityInfoTest.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/CapturedActivityInfoTest.java (rev 0)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/CapturedActivityInfoTest.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.monitor;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.stub;
+import java.util.Locale;
+import org.jboss.dna.common.i18n.MockI18n;
+import org.jboss.dna.common.util.EmptyIterator;
+import org.jboss.dna.common.util.Logger.Level;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.MockitoAnnotations;
+import org.mockito.MockitoAnnotations.Mock;
+import org.slf4j.Marker;
+
+/**
+ * @author jverhaeg
+ */
+public final class CapturedActivityInfoTest {
+
+ private CapturedActivityInfo info;
+ @Mock
+ Marker marker;
+
+ @Before
+ public void before() {
+ MockitoAnnotations.initMocks(this);
+ stub(marker.iterator()).toReturn(new EmptyIterator<Marker>());
+ info = new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(),
+ MockI18n.passthrough, new Object[] {"message"}, Locale.US);
+ }
+
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowNoType() {
+ new CapturedActivityInfo(null, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(),
+ MockI18n.passthrough, new Object[] {"message"}, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoTaskName() {
+ new CapturedActivityInfo(Level.INFO, null, null, marker, new Throwable(), MockI18n.passthrough, new Object[] {"message"},
+ Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoTaskNameParameters() {
+ new CapturedActivityInfo(Level.INFO, null, null, marker, new Throwable(), MockI18n.noPlaceholders, null, Locale.US);
+ }
+
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowTaskNameParametersWithNoTaskName() {
+ new CapturedActivityInfo(Level.INFO, null, new Object[] {"task"}, marker, new Throwable(), MockI18n.passthrough,
+ new Object[] {"message"}, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoMarker() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, null, new Throwable(),
+ MockI18n.passthrough, new Object[] {"message"}, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoThrowable() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, null, MockI18n.passthrough,
+ new Object[] {"message"}, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoMessage() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(), null, null,
+ Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoMessageParameters() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(),
+ MockI18n.noPlaceholders, null, Locale.US);
+ }
+
+ @Test( expected = AssertionError.class )
+ public void shouldNotAllowMessageParametersWithNoMessage() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(), null,
+ new Object[] {"message"}, Locale.US);
+ }
+
+ @Test
+ public void shouldAllowNoLocale() {
+ new CapturedActivityInfo(Level.INFO, MockI18n.passthrough, new Object[] {"task"}, marker, new Throwable(),
+ MockI18n.passthrough, new Object[] {"message"}, null);
+ }
+
+ @Test
+ public void shouldProvideMarker() {
+ assertThat(info.getMarker(), notNullValue());
+ }
+
+ @Test
+ public void shouldProvideMessage() {
+ assertThat(info.getMessage(), is("message"));
+ }
+
+ @Test
+ public void shouldProvideTaskName() {
+ assertThat(info.getTaskName(), is("task"));
+ }
+
+ @Test
+ public void shouldProvideThrowable() {
+ assertThat(info.getThrowable(), notNullValue());
+ }
+
+ @Test
+ public void shouldIndicateType() {
+ assertThat(info.isError(), is(false));
+ assertThat(info.isWarning(), is(false));
+ CapturedActivityInfo info = new CapturedActivityInfo(Level.ERROR, null, null, null, null, null, null, null);
+ assertThat(info.isError(), is(true));
+ assertThat(info.isWarning(), is(false));
+ info = new CapturedActivityInfo(Level.WARNING, null, null, null, null, null, null, null);
+ assertThat(info.isError(), is(false));
+ assertThat(info.isWarning(), is(true));
+ info = new CapturedActivityInfo(Level.DEBUG, null, null, null, null, null, null, null);
+ assertThat(info.isError(), is(false));
+ assertThat(info.isWarning(), is(false));
+ }
+}
Property changes on: trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/CapturedActivityInfoTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleActivityMonitorTest.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleActivityMonitorTest.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleActivityMonitorTest.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -28,13 +28,18 @@
import static org.hamcrest.core.IsSame.sameInstance;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.stub;
import java.util.Locale;
import java.util.Set;
import org.jboss.dna.common.CommonI18n;
import org.jboss.dna.common.i18n.I18n;
import org.jboss.dna.common.i18n.MockI18n;
+import org.jboss.dna.common.util.EmptyIterator;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.MockitoAnnotations;
+import org.mockito.MockitoAnnotations.Mock;
+import org.slf4j.Marker;
/**
* @author Randall Hauch
@@ -45,9 +50,13 @@
private static final String VALID_TASK_NAME = "Checking for file";
private ActivityMonitor monitor;
+ @Mock
+ Marker marker;
@Before
public void beforeEach() {
+ MockitoAnnotations.initMocks(this);
+ stub(marker.iterator()).toReturn(new EmptyIterator<Marker>());
this.monitor = new SimpleActivityMonitor(MockI18n.passthrough, "Reading from file X");
}
@@ -60,12 +69,12 @@
public void shouldReturnActivityStatusWithEmptyMessageBeforeTaskIsBegun() {
ActivityStatus status = monitor.getStatus(Locale.FRANCE);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is(""));
+ assertThat(status.getTaskName(), is(""));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is(""));
+ assertThat(status.getTaskName(), is(""));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
}
@@ -75,22 +84,22 @@
monitor.worked(10.0d);
ActivityStatus status = monitor.getStatus(Locale.FRANCE);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("examinez le message"));
+ assertThat(status.getTaskName(), is("examinez le message"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(Locale.ENGLISH);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("test task"));
+ assertThat(status.getTaskName(), is("test task"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(Locale.getDefault());
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("test task"));
+ assertThat(status.getTaskName(), is("test task"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("test task"));
+ assertThat(status.getTaskName(), is("test task"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
}
@@ -100,22 +109,22 @@
monitor.worked(10.0d);
ActivityStatus status = monitor.getStatus(Locale.FRANCE);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("examinez le message 2"));
+ assertThat(status.getTaskName(), is("examinez le message 2"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(Locale.ENGLISH);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("second test task 2"));
+ assertThat(status.getTaskName(), is("second test task 2"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(Locale.getDefault());
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("second test task 2"));
+ assertThat(status.getTaskName(), is("second test task 2"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
- assertThat(status.getMessage(), is("second test task 2"));
+ assertThat(status.getTaskName(), is("second test task 2"));
assertThat(status.getPercentWorked(), is(closeTo(10.0d, 0.001d)));
}
@@ -124,7 +133,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(""));
+ assertThat(status.getTaskName(), is(""));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
}
@@ -134,7 +143,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
}
@@ -144,7 +153,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
for (int i = 1; i <= 9; ++i) {
this.monitor.worked(100);
@@ -152,7 +161,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(10 * i, 0.001d)));
assertThat(status.isDone(), is(false));
}
@@ -161,7 +170,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(100, 0.001d)));
assertThat(status.isDone(), is(true));
}
@@ -172,7 +181,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
// Create subtasks ...
@@ -192,7 +201,7 @@
status = subtask.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(subtaskName));
+ assertThat(status.getTaskName(), is(subtaskName));
assertThat(status.getPercentWorked(), is(closeTo(10 * j, 0.001d)));
assertThat(status.isDone(), is(j == 10));
@@ -204,7 +213,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(10 * i, 0.001d)));
assertThat(status.isDone(), is(false));
}
@@ -214,7 +223,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(100, 0.001d)));
assertThat(status.isDone(), is(true));
}
@@ -225,7 +234,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
assertThat(status.isDone(), is(false));
@@ -237,7 +246,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(100, 0.001d)));
assertThat(status.isDone(), is(true));
}
@@ -257,7 +266,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
for (int i = 1; i <= 9; ++i) {
monitor.worked(100);
@@ -266,7 +275,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(10 * i, 0.001d)));
assertThat(status.isDone(), is(false));
@@ -279,7 +288,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(100, 0.001d)));
assertThat(status.isDone(), is(true));
@@ -291,7 +300,7 @@
ActivityStatus status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(0.0d, 0.001d)));
for (int i = 1; i <= 9; ++i) {
monitor.worked(100);
@@ -300,7 +309,7 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(10 * i, 0.001d)));
assertThat(status.isDone(), is(false));
@@ -313,20 +322,96 @@
status = monitor.getStatus(null);
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(), is(monitor.getActivityName()));
- assertThat(status.getMessage(), is(VALID_TASK_NAME));
+ assertThat(status.getTaskName(), is(VALID_TASK_NAME));
assertThat(status.getPercentWorked(), is(closeTo(100, 0.001d)));
assertThat(status.isDone(), is(true));
assertThat(monitor.isCancelled(), is(true));
}
@Test
- public void shouldRecordProblems() {
- monitor.beginTask(1000, MockI18n.passthrough, VALID_TASK_NAME);
- monitor.getProblems().addWarning(MockI18n.passthrough);
- monitor.done();
- assertThat(monitor.getProblems().hasWarnings(), is(true));
+ public void shouldAllowCaptureInformation() {
+ monitor.capture(MockI18n.passthrough, "Message");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
}
+ @Test
+ public void shouldAllowCaptureInformationWithNoMessage() {
+ monitor.capture(null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test( expected = IllegalArgumentException.class )
+ public void shouldNotAllowCaptureInformationWithNoMessageAndMessageParameters() {
+ monitor.capture(null, "message");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureInformationWithMarker() {
+ monitor.capture(marker, null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureError() {
+ monitor.captureError(MockI18n.passthrough, "Error");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureErrorWithNoMessage() {
+ monitor.captureError(null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test( expected = IllegalArgumentException.class )
+ public void shouldNotAllowCaptureErrorWithNoMessageAndMessageParameters() {
+ monitor.captureError(null, "Error");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureErrorWithMarker() {
+ monitor.captureError(marker, null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureErrorWithThrowable() {
+ monitor.captureError(new Throwable());
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureWarning() {
+ monitor.captureWarning(MockI18n.passthrough, "Warning");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureWarningWithNoMessage() {
+ monitor.captureWarning(null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test( expected = IllegalArgumentException.class )
+ public void shouldNotAllowCaptureWarningWithNoMessageAndMessageParameters() {
+ monitor.captureWarning(null, "Warning");
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureWarningWithMarker() {
+ monitor.captureWarning(marker, null);
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
+ @Test
+ public void shouldAllowCaptureWarningWithThrowable() {
+ monitor.captureWarning(new Throwable());
+ assertThat(monitor.getStatus(Locale.getDefault()).getCapturedInformation().length > 0, is(true));
+ }
+
public static class I18nMessages {
public static I18n testTaskName;
Modified: trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
===================================================================
--- trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties 2008-10-31 21:38:00 UTC (rev 611)
@@ -1 +1,2 @@
+noPlaceholders = empty
passthrough = {0}
Modified: trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/StreamSequencerAdapterTest.java
===================================================================
--- trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/StreamSequencerAdapterTest.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/StreamSequencerAdapterTest.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -35,9 +35,9 @@
import javax.jcr.Node;
import javax.jcr.Session;
import javax.jcr.observation.Event;
-import org.jboss.dna.common.collection.Problem;
import org.jboss.dna.common.jcr.AbstractJcrRepositoryTest;
import org.jboss.dna.common.monitor.ActivityMonitor;
+import org.jboss.dna.common.monitor.CapturedActivityInfo;
import org.jboss.dna.common.monitor.RecordingActivityMonitor;
import org.jboss.dna.graph.properties.NamespaceRegistry;
import org.jboss.dna.graph.properties.Path;
@@ -129,7 +129,7 @@
}
}
- protected void testSequencer( final StreamSequencer sequencer ) throws Exception {
+ protected void testSequencer( final StreamSequencer sequencer ) throws Throwable {
StreamSequencer streamSequencer = new StreamSequencer() {
public void sequence( InputStream stream,
@@ -139,7 +139,7 @@
try {
sequencer.sequence(stream, output, context, activityMonitor);
} catch (AssertionError err) {
- activityMonitor.getProblems().addError(err, null);
+ activityMonitor.captureError(err);
}
}
};
@@ -155,8 +155,8 @@
outputPaths.add(new RepositoryNodePath(repositoryWorkspaceName, outputNode.getPath()));
sequencerOutput.setProperty("alpha/beta", "isSomething", true);
adapter.execute(inputNode, "sequencedProperty", nodeChange, outputPaths, context, activityMonitor);
- for (Problem problem : activityMonitor.getProblems()) {
- throw (AssertionError)problem.getThrowable();
+ for (CapturedActivityInfo info : activityMonitor.getStatus().getCapturedInformation()) {
+ if (info.isError()) throw info.getThrowable();
}
}
@@ -375,7 +375,7 @@
}
@Test
- public void shouldPassNonNullInputStreamToSequencer() throws Exception {
+ public void shouldPassNonNullInputStreamToSequencer() throws Throwable {
testSequencer(new StreamSequencer() {
public void sequence( InputStream stream,
@@ -388,7 +388,7 @@
}
@Test
- public void shouldPassNonNullSequencerOutputToSequencer() throws Exception {
+ public void shouldPassNonNullSequencerOutputToSequencer() throws Throwable {
testSequencer(new StreamSequencer() {
public void sequence( InputStream stream,
@@ -401,7 +401,7 @@
}
@Test
- public void shouldPassNonNullSequencerContextToSequencer() throws Exception {
+ public void shouldPassNonNullSequencerContextToSequencer() throws Throwable {
testSequencer(new StreamSequencer() {
public void sequence( InputStream stream,
@@ -414,7 +414,7 @@
}
@Test
- public void shouldPassNonNullActivityMonitorToSequencer() throws Exception {
+ public void shouldPassNonNullActivityMonitorToSequencer() throws Throwable {
testSequencer(new StreamSequencer() {
public void sequence( InputStream stream,
Modified: trunk/extensions/dna-sequencer-xml/src/main/java/org/jboss/dna/sequencer/xml/XmlSequencer.java
===================================================================
--- trunk/extensions/dna-sequencer-xml/src/main/java/org/jboss/dna/sequencer/xml/XmlSequencer.java 2008-10-31 20:09:32 UTC (rev 610)
+++ trunk/extensions/dna-sequencer-xml/src/main/java/org/jboss/dna/sequencer/xml/XmlSequencer.java 2008-10-31 21:38:00 UTC (rev 611)
@@ -90,7 +90,7 @@
reader.parse(new InputSource(stream));
} catch (Exception error) {
context.getLogger(getClass()).error(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
- monitor.getProblems().addError(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
+ monitor.captureError(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
} finally {
monitor.done();
}
@@ -361,7 +361,7 @@
@Override
public void error( SAXParseException error ) {
context.getLogger(XmlSequencer.class).error(error, XmlSequencerI18n.errorSequencingXmlDocument, error);
- monitor.getProblems().addError(error, XmlSequencerI18n.errorSequencingXmlDocument, error);
+ monitor.captureError(error, XmlSequencerI18n.errorSequencingXmlDocument, error);
}
/**
@@ -397,7 +397,7 @@
@Override
public void fatalError( SAXParseException error ) {
context.getLogger(XmlSequencer.class).error(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
- monitor.getProblems().addError(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
+ monitor.captureError(error, XmlSequencerI18n.fatalErrorSequencingXmlDocument, error);
}
private Name getDefaultPrimaryType() {
@@ -688,7 +688,7 @@
@Override
public void warning( SAXParseException warning ) {
context.getLogger(XmlSequencer.class).warn(warning, XmlSequencerI18n.warningSequencingXmlDocument);
- monitor.getProblems().addWarning(warning, XmlSequencerI18n.warningSequencingXmlDocument, warning);
+ monitor.captureWarning(warning, XmlSequencerI18n.warningSequencingXmlDocument, warning);
}
}
15 years, 6 months
DNA SVN: r610 - trunk/docs/presentations.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 16:09:32 -0400 (Fri, 31 Oct 2008)
New Revision: 610
Modified:
trunk/docs/presentations/
Log:
Changed to not add keynote folders
Property changes on: trunk/docs/presentations
___________________________________________________________________
Name: svn:ignore
+ *.key
15 years, 6 months
DNA SVN: r609 - trunk/docs/presentations.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 16:08:16 -0400 (Fri, 31 Oct 2008)
New Revision: 609
Added:
trunk/docs/presentations/JBoss DNA 2008-10.keynote.zip
Removed:
trunk/docs/presentations/JBoss DNA 2008-10.zip
Log:
Changed to store the presentation via ZIP file.
Copied: trunk/docs/presentations/JBoss DNA 2008-10.keynote.zip (from rev 608, trunk/docs/presentations/JBoss DNA 2008-10.zip)
===================================================================
(Binary files differ)
Deleted: trunk/docs/presentations/JBoss DNA 2008-10.zip
===================================================================
(Binary files differ)
15 years, 6 months
DNA SVN: r608 - trunk/docs/presentations.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 16:07:30 -0400 (Fri, 31 Oct 2008)
New Revision: 608
Added:
trunk/docs/presentations/JBoss DNA 2008-10.zip
Removed:
trunk/docs/presentations/JBoss DNA 2008-10.key/
Log:
Changed to store the presentation via ZIP file.
Added: trunk/docs/presentations/JBoss DNA 2008-10.zip
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 6 months
DNA SVN: r607 - in trunk/docs: presentations and 12 other directories.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 14:57:18 -0400 (Fri, 31 Oct 2008)
New Revision: 607
Added:
trunk/docs/presentations/
trunk/docs/presentations/JBoss DNA 2008-10.key/
trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/
trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/
trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
Log:
Attempt to fix the presentations folder
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo
===================================================================
--- trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo (rev 0)
+++ trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo 2008-10-31 18:57:18 UTC (rev 607)
@@ -0,0 +1 @@
+????????
\ No newline at end of file
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 6 months
DNA SVN: r606 - trunk/docs.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 14:56:28 -0400 (Fri, 31 Oct 2008)
New Revision: 606
Removed:
trunk/docs/presentations/
Log:
Attempt to fix the presentations folder
15 years, 6 months
DNA SVN: r605 - in trunk/docs/presentations: JBoss and 11 other directories.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-31 14:47:41 -0400 (Fri, 31 Oct 2008)
New Revision: 605
Added:
trunk/docs/presentations/JBoss DNA 2008-10.key/
trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/
trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/
trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
Log:
Added incomplete draft of a presentation of JCR and DNA
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo
===================================================================
--- trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo (rev 0)
+++ trunk/docs/presentations/JBoss DNA 2008-10.key/Contents/PkgInfo 2008-10-31 18:47:41 UTC (rev 605)
@@ -0,0 +1 @@
+????????
\ No newline at end of file
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_icon_256x.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg-dark.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/DNA_logotype_blu-lg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/JBoss_DivOfRH_logorgb.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Liferay Portal.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Magnolia.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Mule Galaxy.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/QuickLook/Thumbnail.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/Sun OpenPortal.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/alfresco-logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/asf_logo_wide.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/color-profile
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/exoplatform.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/freecaster_logo.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/ibm-logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/image.img.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/images.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/index.apxl.gz
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/jboss_background_pp.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/nuxeo5logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/oralogo_small.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/rhythmyx.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/sophora_logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/storage_stack.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-0.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/mt0-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st12.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-3.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st13.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st3.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st5.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st7.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-1.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-2.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8-4.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st8.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/thumbs/st9.tiff
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/presentations/JBoss DNA 2008-10.key/xythos.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 6 months
DNA SVN: r604 - in trunk: dna-graph/src/main/java/org/jboss/dna/graph/connectors and 14 other directories.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-30 16:10:06 -0400 (Thu, 30 Oct 2008)
New Revision: 604
Added:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContext.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContextFactory.java
Removed:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContextFactory.java
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphImporterTest.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphTest.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/requests/AbstractRequestTest.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrMultiValuePropertyTest.java
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrPropertyTest.java
trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/TestUtil.java
trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
trunk/dna-repository/src/main/java/org/jboss/dna/repository/util/BasicJcrExecutionContext.java
trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java
trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceIntegrationTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositoryTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionPathRuleTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutorTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/OneContributionMergeStrategyTest.java
trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/SimpleMergeStrategyTest.java
trunk/extensions/dna-connector-jbosscache/src/test/java/org/jboss/dna/connector/jbosscache/JBossCacheConnectionTest.java
trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectionTest.java
Log:
Changed the location of the BasicExecutionContext and BasicExecutionContextFactory implementations. (Not sure why they were under the "connectors" package, so they're now under "org.jboss.dna.graph".)
Copied: trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContext.java (from rev 603, trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java)
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContext.java (rev 0)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContext.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -0,0 +1,201 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph;
+
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginContext;
+import org.jboss.dna.common.component.ClassLoaderFactory;
+import org.jboss.dna.common.component.StandardClassLoaderFactory;
+import org.jboss.dna.common.i18n.I18n;
+import org.jboss.dna.common.monitor.ActivityMonitor;
+import org.jboss.dna.common.monitor.SimpleActivityMonitor;
+import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.graph.properties.NamespaceRegistry;
+import org.jboss.dna.graph.properties.PropertyFactory;
+import org.jboss.dna.graph.properties.ValueFactories;
+import org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry;
+import org.jboss.dna.graph.properties.basic.BasicPropertyFactory;
+import org.jboss.dna.graph.properties.basic.StandardValueFactories;
+
+/**
+ * @author Randall Hauch
+ * @author John Verhaeg
+ */
+public class BasicExecutionContext implements ExecutionContext {
+
+ private final ClassLoaderFactory classLoaderFactory;
+ private final LoginContext loginContext;
+ private final AccessControlContext accessControlContext;
+ private final Subject subject;
+ private final PropertyFactory propertyFactory;
+ private final ValueFactories valueFactories;
+ private final NamespaceRegistry namespaceRegistry;
+
+ public BasicExecutionContext() {
+ this(null, null, null, null, null);
+ }
+
+ public BasicExecutionContext( LoginContext loginContext ) {
+ this(loginContext, null, null, null, null);
+ }
+
+ public BasicExecutionContext( AccessControlContext accessControlContext ) {
+ this(null, accessControlContext, null, null, null);
+ }
+
+ public BasicExecutionContext( NamespaceRegistry namespaceRegistry,
+ ValueFactories valueFactories,
+ PropertyFactory propertyFactory ) {
+ this(null, null, namespaceRegistry, valueFactories, propertyFactory);
+ }
+
+ public BasicExecutionContext( NamespaceRegistry namespaceRegistry ) {
+ this(null, null, namespaceRegistry, null, null);
+ }
+
+ public BasicExecutionContext( LoginContext loginContext,
+ NamespaceRegistry namespaceRegistry,
+ ValueFactories valueFactories,
+ PropertyFactory propertyFactory ) {
+ this(loginContext, null, namespaceRegistry, valueFactories, propertyFactory);
+ }
+
+ public BasicExecutionContext( AccessControlContext accessControlContext,
+ NamespaceRegistry namespaceRegistry,
+ ValueFactories valueFactories,
+ PropertyFactory propertyFactory ) {
+ this(null, accessControlContext, namespaceRegistry, valueFactories, propertyFactory);
+ }
+
+ public BasicExecutionContext( ExecutionContext inheritedContext,
+ NamespaceRegistry namespaceRegistry ) {
+ this(inheritedContext.getLoginContext(), inheritedContext.getAccessControlContext(), namespaceRegistry, null, null);
+ }
+
+ /*
+ * This constructor exists to deal with mutually-exclusive parameters, such as LoginContext and AccessControlContext.
+ */
+ private BasicExecutionContext( LoginContext loginContext,
+ AccessControlContext accessControlContext,
+ NamespaceRegistry namespaceRegistry,
+ ValueFactories valueFactories,
+ PropertyFactory propertyFactory ) {
+ this.loginContext = loginContext;
+ this.accessControlContext = accessControlContext;
+ if (loginContext == null) {
+ this.subject = Subject.getSubject(accessControlContext == null ? AccessController.getContext() : accessControlContext);
+ } else {
+ this.subject = loginContext.getSubject();
+ }
+ this.namespaceRegistry = namespaceRegistry == null ? new BasicNamespaceRegistry() : namespaceRegistry;
+ this.valueFactories = valueFactories == null ? new StandardValueFactories(this.namespaceRegistry) : valueFactories;
+ this.propertyFactory = propertyFactory == null ? new BasicPropertyFactory(this.valueFactories) : propertyFactory;
+ this.classLoaderFactory = new StandardClassLoaderFactory();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#createActivityMonitor(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
+ */
+ public ActivityMonitor createActivityMonitor( I18n activityName,
+ Object... activityNameParameters ) {
+ return new SimpleActivityMonitor(activityName, activityNameParameters);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.common.component.ClassLoaderFactory#getClassLoader(java.lang.String[])
+ */
+ public ClassLoader getClassLoader( String... classpath ) {
+ return this.classLoaderFactory.getClassLoader(classpath);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#getAccessControlContext()
+ */
+ public AccessControlContext getAccessControlContext() {
+ return accessControlContext;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#getLoginContext()
+ */
+ public LoginContext getLoginContext() {
+ return loginContext;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NamespaceRegistry getNamespaceRegistry() {
+ return namespaceRegistry;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public PropertyFactory getPropertyFactory() {
+ return propertyFactory;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#getSubject()
+ */
+ public Subject getSubject() {
+ return subject;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ValueFactories getValueFactories() {
+ return valueFactories;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#getLogger(java.lang.Class)
+ */
+ public Logger getLogger( Class<?> clazz ) {
+ return Logger.getLogger(clazz);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContext#getLogger(java.lang.String)
+ */
+ public Logger getLogger( String name ) {
+ return Logger.getLogger(name);
+ }
+}
Copied: trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContextFactory.java (from rev 603, trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContextFactory.java)
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContextFactory.java (rev 0)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContextFactory.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph;
+
+import java.security.AccessControlContext;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+import org.jboss.dna.graph.properties.NamespaceRegistry;
+import org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry;
+
+/**
+ * Basic implementation of a {@link ExecutionContextFactory} that returns {@link BasicExecutionContext basic}
+ * {@link ExecutionContext}s.
+ *
+ * @author Randall Hauch
+ */
+public class BasicExecutionContextFactory implements ExecutionContextFactory {
+
+ private final NamespaceRegistry defaultNamespaces = new BasicNamespaceRegistry();
+
+ /**
+ * Create a new instance of this factory.
+ */
+ public BasicExecutionContextFactory() {
+ defaultNamespaces.register("jcr", "http://www.jcp.org/jcr/1.0");
+ defaultNamespaces.register("mix", "http://www.jcp.org/jcr/mix/1.0");
+ defaultNamespaces.register("nt", "http://www.jcp.org/jcr/nt/1.0");
+ defaultNamespaces.register("dna", "http://www.jboss.org/dna");
+ defaultNamespaces.register("dnadtd", "http://www.jboss.org/dna/dtd/1.0");
+ defaultNamespaces.register("dnaxml", "http://www.jboss.org/dna/xml/1.0");
+ }
+
+ /**
+ * Create a new instance of this factory.
+ *
+ * @param defaultNamespaceUri the URI of the namespace that should be used with names that have no specified namespace prefix
+ * @throws IllegalArgumentException if the URI is null
+ */
+ public BasicExecutionContextFactory( String defaultNamespaceUri ) {
+ this();
+ defaultNamespaces.register("", defaultNamespaceUri);
+ }
+
+ /**
+ * @return defaultNamespaces
+ */
+ public NamespaceRegistry getDefaultNamespaces() {
+ return defaultNamespaces;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create()
+ */
+ public ExecutionContext create() {
+ ExecutionContext context = new BasicExecutionContext();
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.security.AccessControlContext)
+ */
+ public ExecutionContext create( AccessControlContext accessControlContext ) {
+ ExecutionContext context = new BasicExecutionContext(accessControlContext);
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(javax.security.auth.login.LoginContext)
+ */
+ public ExecutionContext create( LoginContext loginContext ) {
+ ExecutionContext context = new BasicExecutionContext(loginContext);
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String)
+ */
+ public ExecutionContext create( String name ) throws LoginException {
+ LoginContext loginContext = new LoginContext(name);
+ ExecutionContext context = new BasicExecutionContext(loginContext);
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.Subject)
+ */
+ public ExecutionContext create( String name,
+ Subject subject ) throws LoginException {
+ LoginContext loginContext = new LoginContext(name, subject);
+ ExecutionContext context = new BasicExecutionContext(loginContext);
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.callback.CallbackHandler)
+ */
+ public ExecutionContext create( String name,
+ CallbackHandler callbackHandler ) throws LoginException {
+ LoginContext loginContext = new LoginContext(name, callbackHandler);
+ ExecutionContext context = new BasicExecutionContext(loginContext);
+ initialize(context);
+ return context;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.Subject,
+ * javax.security.auth.callback.CallbackHandler)
+ */
+ public ExecutionContext create( String name,
+ Subject subject,
+ CallbackHandler callbackHandler ) throws LoginException {
+ LoginContext loginContext = new LoginContext(name, subject, callbackHandler);
+ ExecutionContext context = new BasicExecutionContext(loginContext);
+ initialize(context);
+ return context;
+ }
+
+ protected synchronized void initialize( ExecutionContext context ) {
+ for (NamespaceRegistry.Namespace namespace : this.defaultNamespaces.getNamespaces()) {
+ context.getNamespaceRegistry().register(namespace.getPrefix(), namespace.getNamespaceUri());
+ }
+ }
+}
Property changes on: trunk/dna-graph/src/main/java/org/jboss/dna/graph/BasicExecutionContextFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -1,202 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.dna.graph.connectors;
-
-import java.security.AccessControlContext;
-import java.security.AccessController;
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
-import org.jboss.dna.common.component.ClassLoaderFactory;
-import org.jboss.dna.common.component.StandardClassLoaderFactory;
-import org.jboss.dna.common.i18n.I18n;
-import org.jboss.dna.common.monitor.ActivityMonitor;
-import org.jboss.dna.common.monitor.SimpleActivityMonitor;
-import org.jboss.dna.common.util.Logger;
-import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.properties.NamespaceRegistry;
-import org.jboss.dna.graph.properties.PropertyFactory;
-import org.jboss.dna.graph.properties.ValueFactories;
-import org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry;
-import org.jboss.dna.graph.properties.basic.BasicPropertyFactory;
-import org.jboss.dna.graph.properties.basic.StandardValueFactories;
-
-/**
- * @author Randall Hauch
- * @author John Verhaeg
- */
-public class BasicExecutionContext implements ExecutionContext {
-
- private final ClassLoaderFactory classLoaderFactory;
- private final LoginContext loginContext;
- private final AccessControlContext accessControlContext;
- private final Subject subject;
- private final PropertyFactory propertyFactory;
- private final ValueFactories valueFactories;
- private final NamespaceRegistry namespaceRegistry;
-
- public BasicExecutionContext() {
- this(null, null, null, null, null);
- }
-
- public BasicExecutionContext( LoginContext loginContext ) {
- this(loginContext, null, null, null, null);
- }
-
- public BasicExecutionContext( AccessControlContext accessControlContext ) {
- this(null, accessControlContext, null, null, null);
- }
-
- public BasicExecutionContext( NamespaceRegistry namespaceRegistry,
- ValueFactories valueFactories,
- PropertyFactory propertyFactory ) {
- this(null, null, namespaceRegistry, valueFactories, propertyFactory);
- }
-
- public BasicExecutionContext( NamespaceRegistry namespaceRegistry ) {
- this(null, null, namespaceRegistry, null, null);
- }
-
- public BasicExecutionContext( LoginContext loginContext,
- NamespaceRegistry namespaceRegistry,
- ValueFactories valueFactories,
- PropertyFactory propertyFactory ) {
- this(loginContext, null, namespaceRegistry, valueFactories, propertyFactory);
- }
-
- public BasicExecutionContext( AccessControlContext accessControlContext,
- NamespaceRegistry namespaceRegistry,
- ValueFactories valueFactories,
- PropertyFactory propertyFactory ) {
- this(null, accessControlContext, namespaceRegistry, valueFactories, propertyFactory);
- }
-
- public BasicExecutionContext( ExecutionContext inheritedContext,
- NamespaceRegistry namespaceRegistry ) {
- this(inheritedContext.getLoginContext(), inheritedContext.getAccessControlContext(), namespaceRegistry, null, null);
- }
-
- /*
- * This constructor exists to deal with mutually-exclusive parameters, such as LoginContext and AccessControlContext.
- */
- private BasicExecutionContext( LoginContext loginContext,
- AccessControlContext accessControlContext,
- NamespaceRegistry namespaceRegistry,
- ValueFactories valueFactories,
- PropertyFactory propertyFactory ) {
- this.loginContext = loginContext;
- this.accessControlContext = accessControlContext;
- if (loginContext == null) {
- this.subject = Subject.getSubject(accessControlContext == null ? AccessController.getContext() : accessControlContext);
- } else {
- this.subject = loginContext.getSubject();
- }
- this.namespaceRegistry = namespaceRegistry == null ? new BasicNamespaceRegistry() : namespaceRegistry;
- this.valueFactories = valueFactories == null ? new StandardValueFactories(this.namespaceRegistry) : valueFactories;
- this.propertyFactory = propertyFactory == null ? new BasicPropertyFactory(this.valueFactories) : propertyFactory;
- this.classLoaderFactory = new StandardClassLoaderFactory();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#createActivityMonitor(org.jboss.dna.common.i18n.I18n, java.lang.Object[])
- */
- public ActivityMonitor createActivityMonitor( I18n activityName,
- Object... activityNameParameters ) {
- return new SimpleActivityMonitor(activityName, activityNameParameters);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.common.component.ClassLoaderFactory#getClassLoader(java.lang.String[])
- */
- public ClassLoader getClassLoader( String... classpath ) {
- return this.classLoaderFactory.getClassLoader(classpath);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#getAccessControlContext()
- */
- public AccessControlContext getAccessControlContext() {
- return accessControlContext;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#getLoginContext()
- */
- public LoginContext getLoginContext() {
- return loginContext;
- }
-
- /**
- * {@inheritDoc}
- */
- public NamespaceRegistry getNamespaceRegistry() {
- return namespaceRegistry;
- }
-
- /**
- * {@inheritDoc}
- */
- public PropertyFactory getPropertyFactory() {
- return propertyFactory;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#getSubject()
- */
- public Subject getSubject() {
- return subject;
- }
-
- /**
- * {@inheritDoc}
- */
- public ValueFactories getValueFactories() {
- return valueFactories;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#getLogger(java.lang.Class)
- */
- public Logger getLogger( Class<?> clazz ) {
- return Logger.getLogger(clazz);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContext#getLogger(java.lang.String)
- */
- public Logger getLogger( String name ) {
- return Logger.getLogger(name);
- }
-}
Deleted: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContextFactory.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContextFactory.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContextFactory.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.dna.graph.connectors;
-
-import java.security.AccessControlContext;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginContext;
-import javax.security.auth.login.LoginException;
-import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.ExecutionContextFactory;
-import org.jboss.dna.graph.properties.NamespaceRegistry;
-import org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry;
-
-/**
- * Basic implementation of a {@link ExecutionContextFactory} that returns {@link BasicExecutionContext basic}
- * {@link ExecutionContext}s.
- *
- * @author Randall Hauch
- */
-public class BasicExecutionContextFactory implements ExecutionContextFactory {
-
- private final NamespaceRegistry defaultNamespaces = new BasicNamespaceRegistry();
-
- /**
- * Create a new instance of this factory.
- */
- public BasicExecutionContextFactory() {
- defaultNamespaces.register("jcr", "http://www.jcp.org/jcr/1.0");
- defaultNamespaces.register("mix", "http://www.jcp.org/jcr/mix/1.0");
- defaultNamespaces.register("nt", "http://www.jcp.org/jcr/nt/1.0");
- defaultNamespaces.register("dna", "http://www.jboss.org/dna");
- defaultNamespaces.register("dnadtd", "http://www.jboss.org/dna/dtd/1.0");
- defaultNamespaces.register("dnaxml", "http://www.jboss.org/dna/xml/1.0");
- }
-
- /**
- * Create a new instance of this factory.
- *
- * @param defaultNamespaceUri the URI of the namespace that should be used with names that have no specified namespace prefix
- * @throws IllegalArgumentException if the URI is null
- */
- public BasicExecutionContextFactory( String defaultNamespaceUri ) {
- this();
- defaultNamespaces.register("", defaultNamespaceUri);
- }
-
- /**
- * @return defaultNamespaces
- */
- public NamespaceRegistry getDefaultNamespaces() {
- return defaultNamespaces;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create()
- */
- public ExecutionContext create() {
- ExecutionContext context = new BasicExecutionContext();
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.security.AccessControlContext)
- */
- public ExecutionContext create( AccessControlContext accessControlContext ) {
- ExecutionContext context = new BasicExecutionContext(accessControlContext);
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(javax.security.auth.login.LoginContext)
- */
- public ExecutionContext create( LoginContext loginContext ) {
- ExecutionContext context = new BasicExecutionContext(loginContext);
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String)
- */
- public ExecutionContext create( String name ) throws LoginException {
- LoginContext loginContext = new LoginContext(name);
- ExecutionContext context = new BasicExecutionContext(loginContext);
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.Subject)
- */
- public ExecutionContext create( String name,
- Subject subject ) throws LoginException {
- LoginContext loginContext = new LoginContext(name, subject);
- ExecutionContext context = new BasicExecutionContext(loginContext);
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.callback.CallbackHandler)
- */
- public ExecutionContext create( String name,
- CallbackHandler callbackHandler ) throws LoginException {
- LoginContext loginContext = new LoginContext(name, callbackHandler);
- ExecutionContext context = new BasicExecutionContext(loginContext);
- initialize(context);
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.dna.graph.ExecutionContextFactory#create(java.lang.String, javax.security.auth.Subject,
- * javax.security.auth.callback.CallbackHandler)
- */
- public ExecutionContext create( String name,
- Subject subject,
- CallbackHandler callbackHandler ) throws LoginException {
- LoginContext loginContext = new LoginContext(name, subject, callbackHandler);
- ExecutionContext context = new BasicExecutionContext(loginContext);
- initialize(context);
- return context;
- }
-
- protected synchronized void initialize( ExecutionContext context ) {
- for (NamespaceRegistry.Namespace namespace : this.defaultNamespaces.getNamespaces()) {
- context.getNamespaceRegistry().register(namespace.getPrefix(), namespace.getNamespaceUri());
- }
- }
-}
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -31,8 +31,8 @@
import org.jboss.dna.common.text.TextDecoder;
import org.jboss.dna.common.text.XmlNameEncoder;
import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.NameFactory;
import org.jboss.dna.graph.properties.NamespaceRegistry;
Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphImporterTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphImporterTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphImporterTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -36,7 +36,6 @@
import javax.transaction.xa.XAResource;
import org.jboss.dna.common.util.StringUtil;
import org.jboss.dna.graph.cache.CachePolicy;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositorySourceException;
Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/GraphTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -40,7 +40,6 @@
import java.util.concurrent.TimeUnit;
import javax.transaction.xa.XAResource;
import org.jboss.dna.graph.cache.CachePolicy;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositorySourceException;
Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/requests/AbstractRequestTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/requests/AbstractRequestTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/requests/AbstractRequestTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -22,9 +22,9 @@
package org.jboss.dna.graph.requests;
import java.util.UUID;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.Property;
Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -34,10 +34,10 @@
import java.util.Map;
import org.jboss.dna.common.text.Jsr283Encoder;
import org.jboss.dna.common.text.TextDecoder;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.JcrLexicon;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.NamespaceRegistry;
import org.jboss.dna.graph.properties.Path;
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrMultiValuePropertyTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrMultiValuePropertyTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrMultiValuePropertyTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -35,8 +35,8 @@
import javax.jcr.Value;
import javax.jcr.ValueFormatException;
import javax.jcr.nodetype.PropertyDefinition;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.Path;
import org.junit.Before;
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrPropertyTest.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrPropertyTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/JcrPropertyTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -34,8 +34,8 @@
import javax.jcr.Value;
import javax.jcr.ValueFormatException;
import javax.jcr.nodetype.PropertyDefinition;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.Path;
import org.junit.Before;
Modified: trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/TestUtil.java
===================================================================
--- trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/TestUtil.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-jcr/src/test/java/org/jboss/dna/jcr/TestUtil.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -26,9 +26,9 @@
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginContext;
import net.jcip.annotations.NotThreadSafe;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.ExecutionContextFactory;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.SimpleRepository;
Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/RepositoryLibrary.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -33,9 +33,9 @@
import java.util.concurrent.locks.ReentrantReadWriteLock;
import net.jcip.annotations.ThreadSafe;
import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.graph.BasicExecutionContextFactory;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.ExecutionContextFactory;
-import org.jboss.dna.graph.connectors.BasicExecutionContextFactory;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositoryConnectionPool;
Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/util/BasicJcrExecutionContext.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/util/BasicJcrExecutionContext.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/util/BasicJcrExecutionContext.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -22,7 +22,7 @@
package org.jboss.dna.repository.util;
import org.jboss.dna.common.util.CheckArg;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.properties.NamespaceRegistry;
import org.jboss.dna.graph.properties.PropertyFactory;
import org.jboss.dna.graph.properties.ValueFactories;
Modified: trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java
===================================================================
--- trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/dna-repository/src/test/java/org/jboss/dna/repository/RepositoryServiceTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -35,9 +35,9 @@
import java.util.concurrent.TimeUnit;
import org.jboss.dna.common.util.Logger;
import org.jboss.dna.connector.federation.FederationException;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositorySource;
import org.jboss.dna.graph.connectors.SimpleRepository;
Modified: trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/docs/examples/gettingstarted/repositories/src/main/java/org/jboss/example/dna/repository/RepositoryClient.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -42,11 +42,11 @@
import org.jboss.dna.common.text.NoOpEncoder;
import org.jboss.dna.common.util.CheckArg;
import org.jboss.dna.connector.inmemory.InMemoryRepositorySource;
+import org.jboss.dna.graph.BasicExecutionContextFactory;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.ExecutionContextFactory;
import org.jboss.dna.graph.Graph;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContextFactory;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.PathFactory;
import org.jboss.dna.graph.properties.PathNotFoundException;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceIntegrationTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceIntegrationTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceIntegrationTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -36,11 +36,11 @@
import java.util.List;
import javax.naming.Context;
import javax.security.auth.callback.CallbackHandler;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.ExecutionContextFactory;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositoryContext;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositorySourceTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -40,10 +40,10 @@
import javax.naming.spi.ObjectFactory;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.login.LoginException;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.ExecutionContextFactory;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositoryContext;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositoryTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositoryTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/FederatedRepositoryTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -27,8 +27,8 @@
import static org.hamcrest.core.IsSame.sameInstance;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItems;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositorySourceListener;
import org.junit.Before;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionPathRuleTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionPathRuleTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionPathRuleTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -28,8 +28,8 @@
import static org.junit.matchers.JUnitMatchers.hasItems;
import org.jboss.dna.common.text.TextEncoder;
import org.jboss.dna.common.text.UrlEncoder;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.NamespaceRegistry;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.PathFactory;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/ProjectionTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -28,8 +28,8 @@
import static org.junit.matchers.JUnitMatchers.hasItems;
import static org.mockito.Mockito.stub;
import java.util.Set;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.PathFactory;
import org.junit.Before;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutorTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutorTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/executor/FederatingCommandExecutorTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -41,11 +41,11 @@
import org.jboss.dna.connector.federation.Projection;
import org.jboss.dna.connector.federation.ProjectionParser;
import org.jboss.dna.connector.federation.contribution.Contribution;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Location;
import org.jboss.dna.graph.cache.BasicCachePolicy;
import org.jboss.dna.graph.cache.CachePolicy;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnection;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.SimpleRepository;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/OneContributionMergeStrategyTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/OneContributionMergeStrategyTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/OneContributionMergeStrategyTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -34,10 +34,10 @@
import org.jboss.dna.connector.federation.contribution.Contribution;
import org.jboss.dna.connector.federation.merge.FederatedNode;
import org.jboss.dna.connector.federation.merge.MergePlan;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.Property;
Modified: trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/SimpleMergeStrategyTest.java
===================================================================
--- trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/SimpleMergeStrategyTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-federation/src/test/java/org/jboss/dna/connector/federation/merge/strategy/SimpleMergeStrategyTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -38,10 +38,10 @@
import org.jboss.dna.common.collection.IsIteratorContaining;
import org.jboss.dna.connector.federation.contribution.Contribution;
import org.jboss.dna.connector.federation.merge.FederatedNode;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.Path;
import org.jboss.dna.graph.properties.Property;
Modified: trunk/extensions/dna-connector-jbosscache/src/test/java/org/jboss/dna/connector/jbosscache/JBossCacheConnectionTest.java
===================================================================
--- trunk/extensions/dna-connector-jbosscache/src/test/java/org/jboss/dna/connector/jbosscache/JBossCacheConnectionTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-jbosscache/src/test/java/org/jboss/dna/connector/jbosscache/JBossCacheConnectionTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -39,12 +39,12 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.Graph;
import org.jboss.dna.graph.Location;
import org.jboss.dna.graph.cache.CachePolicy;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositoryConnectionFactory;
import org.jboss.dna.graph.connectors.RepositorySourceListener;
import org.jboss.dna.graph.properties.Name;
Modified: trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectionTest.java
===================================================================
--- trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectionTest.java 2008-10-30 17:34:02 UTC (rev 603)
+++ trunk/extensions/dna-connector-svn/src/test/java/org/jboss/dna/connector/svn/SVNRepositoryConnectionTest.java 2008-10-30 20:10:06 UTC (rev 604)
@@ -29,10 +29,10 @@
import static org.mockito.Mockito.stub;
import static org.mockito.Mockito.verify;
import java.util.concurrent.TimeUnit;
+import org.jboss.dna.graph.BasicExecutionContext;
import org.jboss.dna.graph.DnaLexicon;
import org.jboss.dna.graph.ExecutionContext;
import org.jboss.dna.graph.cache.CachePolicy;
-import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.connectors.RepositorySourceListener;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.NameFactory;
15 years, 6 months
DNA SVN: r603 - in trunk/dna-graph/src: main/java/org/jboss/dna/graph/properties and 5 other directories.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-30 13:34:02 -0400 (Thu, 30 Oct 2008)
New Revision: 603
Added:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistry.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/BasicNamespaceTest.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistryTest.java
trunk/dna-graph/src/test/resources/xmlHandler/docWithNamespacesWithoutDefault.xml
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/NamespaceRegistry.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java
Log:
DNA-242 - Change the XML importer code to no longer use XmlSequencer
http://jira.jboss.com/jira/browse/DNA-242
Enhanced the XmlHandler to provide a local NamespaceRegistry that mirrors the XML namespaces in the document, and various factories in the XmlHandler that use this local namespace registry. The benefit is that XmlHandler (and subclasses) can simply just use the factories to process any names that use the XML namespace prefixes.
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java 2008-10-30 17:31:14 UTC (rev 602)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/connectors/BasicExecutionContext.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -71,6 +71,10 @@
this(null, null, namespaceRegistry, valueFactories, propertyFactory);
}
+ public BasicExecutionContext( NamespaceRegistry namespaceRegistry ) {
+ this(null, null, namespaceRegistry, null, null);
+ }
+
public BasicExecutionContext( LoginContext loginContext,
NamespaceRegistry namespaceRegistry,
ValueFactories valueFactories,
@@ -85,6 +89,11 @@
this(null, accessControlContext, namespaceRegistry, valueFactories, propertyFactory);
}
+ public BasicExecutionContext( ExecutionContext inheritedContext,
+ NamespaceRegistry namespaceRegistry ) {
+ this(inheritedContext.getLoginContext(), inheritedContext.getAccessControlContext(), namespaceRegistry, null, null);
+ }
+
/*
* This constructor exists to deal with mutually-exclusive parameters, such as LoginContext and AccessControlContext.
*/
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/NamespaceRegistry.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/NamespaceRegistry.java 2008-10-30 17:31:14 UTC (rev 602)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/NamespaceRegistry.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -109,10 +109,27 @@
*/
Set<Namespace> getNamespaces();
+ /**
+ * Representation of a single namespace at a single point in time. This object does not change to reflect changes made to the
+ * {@link NamespaceRegistry registry}.
+ *
+ * @see NamespaceRegistry#getNamespaces()
+ * @author Randall Hauch
+ */
@Immutable
interface Namespace {
+ /**
+ * Get the prefix for the namespace
+ *
+ * @return the prefix; never null but possibly the empty string
+ */
String getPrefix();
+ /**
+ * Get the URI for the namespace
+ *
+ * @return the namespace URI; never null but possibly the empty string
+ */
String getNamespaceUri();
}
Added: trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistry.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistry.java (rev 0)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistry.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph.properties.basic;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import net.jcip.annotations.ThreadSafe;
+import org.jboss.dna.common.util.CheckArg;
+import org.jboss.dna.graph.properties.NamespaceRegistry;
+
+/**
+ * @author Randall Hauch
+ */
+@ThreadSafe
+public class LocalNamespaceRegistry extends BasicNamespaceRegistry {
+
+ private final NamespaceRegistry delegate;
+
+ /**
+ * @param delegate the namespace registry that this registry should delegate to if not found locally
+ */
+ public LocalNamespaceRegistry( NamespaceRegistry delegate ) {
+ super();
+ CheckArg.isNotNull(delegate, "delegate");
+ this.delegate = delegate;
+ unregister(DEFAULT_NAMESPACE_URI);
+ }
+
+ /**
+ * @param delegate the namespace registry that this registry should delegate to if not found locally
+ * @param defaultNamespaceUri the namespace URI to use for the default prefix
+ */
+ public LocalNamespaceRegistry( NamespaceRegistry delegate,
+ final String defaultNamespaceUri ) {
+ super();
+ CheckArg.isNotNull(delegate, "delegate");
+ this.delegate = delegate;
+ register("", defaultNamespaceUri);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#getDefaultNamespaceUri()
+ */
+ @Override
+ public String getDefaultNamespaceUri() {
+ String result = super.getDefaultNamespaceUri();
+ if (result == null) result = this.delegate.getDefaultNamespaceUri();
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#getNamespaceForPrefix(java.lang.String)
+ */
+ @Override
+ public String getNamespaceForPrefix( String prefix ) {
+ String result = super.getNamespaceForPrefix(prefix);
+ if (result == null) result = this.delegate.getNamespaceForPrefix(prefix);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#getNamespaces()
+ */
+ @Override
+ public Set<Namespace> getNamespaces() {
+ Set<Namespace> delegateNamespaces = this.delegate.getNamespaces();
+ Set<Namespace> localNamespaces = super.getNamespaces();
+
+ // Load the local namespaces first ...
+ Set<Namespace> namespaces = new HashSet<Namespace>(localNamespaces);
+
+ // Now build a map of the local prefixes so we can check for prefixes
+ Map<String, Namespace> localNamespacesByPrefix = new HashMap<String, Namespace>();
+ for (Namespace ns : localNamespaces)
+ localNamespacesByPrefix.put(ns.getPrefix(), ns);
+
+ // Now iterate over the local namespaces, removing any existing namespace with the same prefix
+ for (Namespace ns : delegateNamespaces) {
+ if (localNamespacesByPrefix.get(ns.getPrefix()) != null) continue;
+ // Try to add the delegate namespace, which won't work if a local with the same URI was already added...
+ namespaces.add(ns);
+ }
+ return Collections.unmodifiableSet(namespaces);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#getPrefixForNamespaceUri(java.lang.String, boolean)
+ */
+ @Override
+ public String getPrefixForNamespaceUri( String namespaceUri,
+ boolean generateIfMissing ) {
+ String result = super.getPrefixForNamespaceUri(namespaceUri, false);
+ if (result == null) result = this.delegate.getPrefixForNamespaceUri(namespaceUri, false);
+ if (result == null && generateIfMissing) result = super.getPrefixForNamespaceUri(namespaceUri, true);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#getRegisteredNamespaceUris()
+ */
+ @Override
+ public Set<String> getRegisteredNamespaceUris() {
+ Set<String> uris = new HashSet<String>(this.delegate.getRegisteredNamespaceUris());
+ uris.addAll(super.getRegisteredNamespaceUris());
+ return Collections.unmodifiableSet(uris);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#isRegisteredNamespaceUri(java.lang.String)
+ */
+ @Override
+ public boolean isRegisteredNamespaceUri( String namespaceUri ) {
+ return super.isRegisteredNamespaceUri(namespaceUri) || this.delegate.isRegisteredNamespaceUri(namespaceUri);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#register(java.lang.String, java.lang.String)
+ */
+ @Override
+ public String register( String prefix,
+ String namespaceUri ) {
+ // Just register the namespace locally ...
+ String previous = super.register(prefix, namespaceUri);
+ // But check whether there is a "previous" from the delegate ...
+ if (previous == null && delegate != null) previous = delegate.getPrefixForNamespaceUri(namespaceUri, false);
+ return previous;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.dna.graph.properties.basic.BasicNamespaceRegistry#unregister(java.lang.String)
+ */
+ @Override
+ public boolean unregister( String namespaceUri ) {
+ // Unregister locally ...
+ return super.unregister(namespaceUri);
+ }
+
+}
Property changes on: trunk/dna-graph/src/main/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java
===================================================================
--- trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2008-10-30 17:31:14 UTC (rev 602)
+++ trunk/dna-graph/src/main/java/org/jboss/dna/graph/xml/XmlHandler.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -22,15 +22,17 @@
package org.jboss.dna.graph.xml;
import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
+import java.util.Map;
import javax.xml.parsers.SAXParser;
import net.jcip.annotations.NotThreadSafe;
import org.jboss.dna.common.text.TextDecoder;
import org.jboss.dna.common.text.XmlNameEncoder;
import org.jboss.dna.common.util.CheckArg;
import org.jboss.dna.graph.ExecutionContext;
+import org.jboss.dna.graph.connectors.BasicExecutionContext;
import org.jboss.dna.graph.properties.Name;
import org.jboss.dna.graph.properties.NameFactory;
import org.jboss.dna.graph.properties.NamespaceRegistry;
@@ -38,6 +40,7 @@
import org.jboss.dna.graph.properties.PathFactory;
import org.jboss.dna.graph.properties.Property;
import org.jboss.dna.graph.properties.PropertyFactory;
+import org.jboss.dna.graph.properties.basic.LocalNamespaceRegistry;
import org.xml.sax.Attributes;
import org.xml.sax.ext.DefaultHandler2;
@@ -68,6 +71,8 @@
INHERIT_ELEMENT_NAMESPACE;
}
+ private final ExecutionContext context;
+
/**
* Decoder for XML names, to turn '_xHHHH_' sequences in the XML element and attribute names into the corresponding UTF-16
* characters.
@@ -125,10 +130,10 @@
protected final TextDecoder decoder;
/**
- * Local set of the namespace URIs that are registered. This is an optimization, rather than relying upon the (thread-safe)
- * {@link #namespaceRegistry}.
+ * The stack of prefixes for each namespace, which is used to keep the {@link #namespaceRegistry local namespace registry} in
+ * sync with the namespaces in the XML document.
*/
- private final Set<String> namespaceUris = new HashSet<String>();
+ private final Map<String, LinkedList<String>> prefixStackByUri = new HashMap<String, LinkedList<String>>();
private final AttributeScoping attributeScoping;
@@ -191,13 +196,19 @@
this.skipFirstElement = skipRootElement;
this.attributeScoping = scoping != null ? scoping : DEFAULT_ATTRIBUTE_SCOPING;
+ // Use the execution context ...
+ this.context = destination.getExecutionContext();
+ assert this.context != null;
+
+ // Set up a local namespace registry that is kept in sync with the namespaces found in this XML document ...
+ NamespaceRegistry namespaceRegistry = new LocalNamespaceRegistry(this.context.getNamespaceRegistry());
+ final ExecutionContext localContext = new BasicExecutionContext(this.context, namespaceRegistry);
+
// Set up references to frequently-used objects in the context ...
- final ExecutionContext context = destination.getExecutionContext();
- assert context != null;
- this.nameFactory = context.getValueFactories().getNameFactory();
- this.pathFactory = context.getValueFactories().getPathFactory();
- this.propertyFactory = context.getPropertyFactory();
- this.namespaceRegistry = context.getNamespaceRegistry();
+ this.nameFactory = localContext.getValueFactories().getNameFactory();
+ this.pathFactory = localContext.getValueFactories().getPathFactory();
+ this.propertyFactory = localContext.getPropertyFactory();
+ this.namespaceRegistry = localContext.getNamespaceRegistry();
assert this.nameFactory != null;
assert this.pathFactory != null;
assert this.propertyFactory != null;
@@ -222,18 +233,65 @@
public void startPrefixMapping( String prefix,
String uri ) {
assert uri != null;
- if (namespaceUris.add(uri)) {
- // This is a new namespace for this document ...
- if (!namespaceRegistry.isRegisteredNamespaceUri(uri)) {
- if (prefix != null && prefix.length() == 0) prefix = null;
+ // Add the prefix to the stack ...
+ LinkedList<String> prefixStack = this.prefixStackByUri.get(uri);
+ if (prefixStack == null) {
+ prefixStack = new LinkedList<String>();
+ this.prefixStackByUri.put(uri, prefixStack);
+ }
+ prefixStack.addFirst(prefix);
+
+ // If the namespace is already registered, then we'll have to register it in the context's registry, too.
+ if (!namespaceRegistry.isRegisteredNamespaceUri(uri)) {
+ // The namespace is not already registered (locally or in the context's registry), so we have to
+ // register it with the context's registry (which the local register then inherits).
+ NamespaceRegistry contextRegistry = context.getNamespaceRegistry();
+ if (contextRegistry.getNamespaceForPrefix(prefix) != null) {
+ // The prefix is already bound, so register and generate a unique prefix
+ context.getNamespaceRegistry().getPrefixForNamespaceUri(uri, true);
+ // Now register locally with the supplied prefix ...
namespaceRegistry.register(prefix, uri);
+ } else {
+ context.getNamespaceRegistry().register(prefix, uri);
}
+ } else {
+ // It is already registered, but re-register it locally using the supplied prefix ...
+ namespaceRegistry.register(prefix, uri);
}
}
/**
* {@inheritDoc}
*
+ * @see org.xml.sax.helpers.DefaultHandler#endPrefixMapping(java.lang.String)
+ */
+ @Override
+ public void endPrefixMapping( String prefix ) {
+ assert prefix != null;
+ // Get the current URI for this prefix ...
+ String uri = namespaceRegistry.getNamespaceForPrefix(prefix);
+ assert uri != null;
+
+ // Get the previous prefix from the stack ...
+ LinkedList<String> prefixStack = this.prefixStackByUri.get(uri);
+ assert prefixStack != null;
+ assert !prefixStack.isEmpty();
+ String existingPrefix = prefixStack.removeFirst();
+ assert prefix.equals(existingPrefix);
+
+ // If there are no previous prefixes, then remove the mapping ...
+ if (prefixStack.isEmpty()) {
+ namespaceRegistry.unregister(uri);
+ prefixStackByUri.remove(uri);
+ } else {
+ String previous = prefixStack.getFirst();
+ namespaceRegistry.register(previous, uri);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String,
* org.xml.sax.Attributes)
*/
Added: trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/BasicNamespaceTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/BasicNamespaceTest.java (rev 0)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/BasicNamespaceTest.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph.properties.basic;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Randall Hauch
+ */
+public class BasicNamespaceTest {
+
+ private BasicNamespace ns1;
+ private BasicNamespace ns2;
+ private BasicNamespace ns3;
+ private BasicNamespace ns4;
+ private BasicNamespace ns5;
+ private String validUri1;
+ private String validUri2;
+ private String validUri3;
+ private String validPrefix1;
+ private String validPrefix2;
+ private String validPrefix3;
+
+ @Before
+ public void beforeEach() {
+ validUri1 = "";
+ validUri2 = "http://www.example.com";
+ validUri3 = "http://www.acme.com";
+ validPrefix1 = "";
+ validPrefix2 = "a";
+ validPrefix3 = "b";
+ ns1 = new BasicNamespace(validPrefix1, validUri1);
+ ns2 = new BasicNamespace(validPrefix1, validUri2);
+ ns3 = new BasicNamespace(validPrefix2, validUri1);
+ ns4 = new BasicNamespace(validPrefix2, validUri2);
+ ns5 = new BasicNamespace(validPrefix3, validUri3);
+ }
+
+ @Test
+ public void shouldHaveSamePrefixPassedIntoConstructor() {
+ assertThat(ns1.getPrefix(), is(validPrefix1));
+ assertThat(ns2.getPrefix(), is(validPrefix1));
+ assertThat(ns3.getPrefix(), is(validPrefix2));
+ assertThat(ns4.getPrefix(), is(validPrefix2));
+ assertThat(ns5.getPrefix(), is(validPrefix3));
+ }
+
+ @Test
+ public void shouldHaveSameNamespaceUriPassedIntoConstructor() {
+ assertThat(ns1.getNamespaceUri(), is(validUri1));
+ assertThat(ns2.getNamespaceUri(), is(validUri2));
+ assertThat(ns3.getNamespaceUri(), is(validUri1));
+ assertThat(ns4.getNamespaceUri(), is(validUri2));
+ assertThat(ns5.getNamespaceUri(), is(validUri3));
+ }
+
+ @Test
+ public void shouldConsiderAsEqualAnyNamespacesWithSameUri() {
+ assertThat(ns1.equals(ns3), is(true));
+ assertThat(ns3.equals(ns1), is(true));
+ assertThat(ns2.equals(ns4), is(true));
+ assertThat(ns4.equals(ns2), is(true));
+ assertThat(ns5.equals(ns5), is(true));
+ }
+
+ @Test
+ public void shouldNotConsiderAsEqualAnyNamespacesWithDifferentUris() {
+ assertThat(ns1.equals(ns2), is(false));
+ assertThat(ns2.equals(ns1), is(false));
+ assertThat(ns3.equals(ns4), is(false));
+ assertThat(ns4.equals(ns3), is(false));
+ }
+
+}
Property changes on: trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/BasicNamespaceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistryTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistryTest.java (rev 0)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistryTest.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph.properties.basic;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import java.util.HashMap;
+import java.util.Map;
+import org.jboss.dna.graph.properties.NamespaceRegistry;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author Randall Hauch
+ */
+public class LocalNamespaceRegistryTest {
+
+ private NamespaceRegistry local;
+ private NamespaceRegistry delegate;
+ private String uri;
+
+ @Before
+ public void beforeEach() {
+ delegate = new BasicNamespaceRegistry();
+ local = new LocalNamespaceRegistry(delegate);
+ uri = "http://www.example.com";
+ }
+
+ @Test
+ public void shouldMirrorDelegateIfLocalIsEmpty() {
+ assertNamespaces(delegate, "");
+ assertNamespaces(local, "");
+ }
+
+ @Test
+ public void shouldAllowLocalRegistryToChangeDefaultNamespace() {
+ local.register("", uri);
+ assertNamespaces(delegate, "");
+ assertNamespaces(local, "=" + uri);
+ }
+
+ protected void assertNamespaces( NamespaceRegistry registry,
+ String... namespaces ) {
+ // Create the list of expected namespaces ...
+ Map<String, String> expected = new HashMap<String, String>();
+ for (String str : namespaces) {
+ String[] parts = str.length() != 0 ? str.split("=") : new String[] {"", ""};
+ assertThat("invalid namespace string \"" + str + "\"", parts.length, is(2));
+ expected.put(parts[0], parts[1]);
+ }
+ // Now compare the actual to expected ...
+ for (NamespaceRegistry.Namespace actual : registry.getNamespaces()) {
+ String expectedUri = expected.remove(actual.getPrefix());
+ assertThat("namespace URIs differ", actual.getNamespaceUri(), is(expectedUri));
+ String prefix = actual.getPrefix();
+ String uri = actual.getNamespaceUri();
+ assertThat(registry.isRegisteredNamespaceUri(uri), is(true));
+ assertThat(registry.getPrefixForNamespaceUri(uri, false), is(prefix));
+ assertThat(registry.getNamespaceForPrefix(prefix), is(uri));
+ }
+ // Check that there are no more expected ...
+ if (!expected.isEmpty()) {
+ StringBuilder msg = new StringBuilder("actual is missing namespaces ");
+ boolean first = true;
+ for (Map.Entry<String, String> entry : expected.entrySet()) {
+ if (first) first = false;
+ else msg.append(", ");
+ msg.append(entry.getKey()).append("=").append(entry.getValue());
+ }
+ assertThat(msg.toString(), registry.getNamespaces().isEmpty(), is(true));
+ }
+ }
+}
Property changes on: trunk/dna-graph/src/test/java/org/jboss/dna/graph/properties/basic/LocalNamespaceRegistryTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java
===================================================================
--- trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java 2008-10-30 17:31:14 UTC (rev 602)
+++ trunk/dna-graph/src/test/java/org/jboss/dna/graph/xml/XmlHandlerTest.java 2008-10-30 17:34:02 UTC (rev 603)
@@ -159,15 +159,17 @@
public void shouldParseXmlDocumentWithNamespaces() throws IOException, SAXException {
context.getNamespaceRegistry().register("c", "http://default.namespace.com");
parse("xmlHandler/docWithNamespaces.xml");
- // Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
+ // Check the generated content.
+ // Note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
+ // Also, the "jcr:name" attribute values use the default namespace, which is "c" in the registry
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -178,9 +180,9 @@
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("Cars");
assertNode("Cars/c:Hybrid");
- assertNode("Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("Cars/Sports");
assertNode("Cars/Sports/Aston Martin DB9", "i:maker=Aston Martin", "model=DB9");
assertNode("Cars/Sports/Infiniti G37", "i:maker=Infiniti", "model=G37");
@@ -193,12 +195,12 @@
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -216,15 +218,18 @@
String c = reg.getPrefixForNamespaceUri("http://default.namespace.com", false);
String i = reg.getPrefixForNamespaceUri("http://attributes.com", false);
String d = reg.getPrefixForNamespaceUri(reg.getDefaultNamespaceUri(), false);
+ assertThat("Namespace not properly registered in primary registry", c, is(notNullValue()));
+ assertThat("Namespace not properly registered in primary registry", d, is(notNullValue()));
+ assertThat("Namespace not properly registered in primary registry", i, is(notNullValue()));
if (c.length() != 0) c = c + ":";
if (d.length() != 0) d = d + ":";
if (i.length() != 0) i = i + ":";
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode(d + "Cars");
assertNode(d + "Cars/" + c + "Hybrid");
- assertNode(d + "Cars/" + c + "Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode(d + "Cars/" + c + "Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode(d + "Cars/" + c + "Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode(d + "Cars/" + c + "Hybrid/" + c + "Toyota Prius", c + "maker=Toyota", c + "model=Prius");
+ assertNode(d + "Cars/" + c + "Hybrid/" + c + "Toyota Highlander", c + "maker=Toyota", c + "model=Highlander");
+ assertNode(d + "Cars/" + c + "Hybrid/" + c + "Nissan Altima", c + "maker=Nissan", c + "model=Altima");
assertNode(d + "Cars/" + d + "Sports");
assertNode(d + "Cars/" + d + "Sports/Aston Martin DB9", i + "maker=Aston Martin", "model=DB9");
assertNode(d + "Cars/" + d + "Sports/Infiniti G37", i + "maker=Infiniti", "model=G37");
@@ -237,15 +242,29 @@
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
+ public void shouldParseXmlDocumentWithoutDefaultNamespaceThatUsesNameAttribute() throws IOException, SAXException {
+ parse("xmlHandler/docWithNamespacesWithoutDefault.xml");
+ // Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
+ assertNode("Cars");
+ assertNode("Cars/Hybrid");
+ assertNode("Cars/Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
+ assertNode("Cars/Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
+ assertNode("Cars/Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("Cars/Sports");
+ assertNode("Cars/Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
+ assertNode("Cars/Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ }
+
+ @Test
public void shouldParseXmlDocumentThatContainsNoContent() throws IOException, SAXException {
parse("xmlHandler/docWithOnlyRootElement.xml");
assertNode("Cars");
@@ -261,12 +280,12 @@
parse("xmlHandler/docWithNamespaces.xml");
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("c:Hybrid");
- assertNode("c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Sports");
- assertNode("c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -279,12 +298,12 @@
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -297,12 +316,12 @@
// Check the generated content; note that the attribute name DOES match, so the nodes names come from "jcr:name" attribute
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -311,12 +330,12 @@
parse("xmlHandler/docWithComments.xml");
assertNode("c:Cars");
assertNode("c:Cars/c:Hybrid");
- assertNode("c:Cars/c:Hybrid/Toyota Prius", "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports");
- assertNode("c:Cars/c:Sports/Aston Martin DB9", "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", "c:maker=Infiniti", "c:model=G37");
}
@Test
@@ -351,12 +370,12 @@
String carPrimaryType = "jcr:primaryType={http://default.namespace.com}car";
assertNode("c:Cars", unstructPrimaryType);
assertNode("c:Cars/c:Hybrid", unstructPrimaryType);
- assertNode("c:Cars/c:Hybrid/Toyota Prius", carPrimaryType, "maker=Toyota", "model=Prius");
- assertNode("c:Cars/c:Hybrid/Toyota Highlander", carPrimaryType, "maker=Toyota", "model=Highlander");
- assertNode("c:Cars/c:Hybrid/Nissan Altima", carPrimaryType, "maker=Nissan", "model=Altima");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Prius", carPrimaryType, "c:maker=Toyota", "c:model=Prius");
+ assertNode("c:Cars/c:Hybrid/c:Toyota Highlander", carPrimaryType, "c:maker=Toyota", "c:model=Highlander");
+ assertNode("c:Cars/c:Hybrid/c:Nissan Altima", carPrimaryType, "c:maker=Nissan", "c:model=Altima");
assertNode("c:Cars/c:Sports", unstructPrimaryType);
- assertNode("c:Cars/c:Sports/Aston Martin DB9", carPrimaryType, "maker=Aston Martin", "model=DB9");
- assertNode("c:Cars/c:Sports/Infiniti G37", carPrimaryType, "maker=Infiniti", "model=G37");
+ assertNode("c:Cars/c:Sports/c:Aston Martin DB9", carPrimaryType, "c:maker=Aston Martin", "c:model=DB9");
+ assertNode("c:Cars/c:Sports/c:Infiniti G37", carPrimaryType, "c:maker=Infiniti", "c:model=G37");
}
protected void assertNode( String path,
@@ -382,7 +401,7 @@
assertThat(request.at().getPath(), is(expectedPath));
for (Property actual : request.properties()) {
Property expected = expectedProperties.remove(actual.getName());
- assertThat(expected, is(notNullValue()));
+ assertThat("unexpected property: " + actual, expected, is(notNullValue()));
assertThat(actual, is(expected));
}
if (!expectedProperties.isEmpty()) {
Added: trunk/dna-graph/src/test/resources/xmlHandler/docWithNamespacesWithoutDefault.xml
===================================================================
--- trunk/dna-graph/src/test/resources/xmlHandler/docWithNamespacesWithoutDefault.xml (rev 0)
+++ trunk/dna-graph/src/test/resources/xmlHandler/docWithNamespacesWithoutDefault.xml 2008-10-30 17:34:02 UTC (rev 603)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Cars xmlns:jcr="http://www.jcp.org/jcr/1.0">
+ <Hybrid>
+ <car jcr:name="Toyota Prius" maker="Toyota" model="Prius"/>
+ <car jcr:name="Toyota Highlander" maker="Toyota" model="Highlander"/>
+ <car jcr:name="Nissan Altima" maker="Nissan" model="Altima"/>
+ </Hybrid>
+ <Sports>
+ <car jcr:name="Aston Martin DB9" maker="Aston Martin" model="DB9"/>
+ <car jcr:name="Infiniti G37" maker="Infiniti" model="G37" />
+ </Sports>
+</Cars>
\ No newline at end of file
Property changes on: trunk/dna-graph/src/test/resources/xmlHandler/docWithNamespacesWithoutDefault.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
DNA SVN: r602 - trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-10-30 13:31:14 -0400 (Thu, 30 Oct 2008)
New Revision: 602
Modified:
trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
Log:
Minor change.
Modified: trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java
===================================================================
--- trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2008-10-29 20:50:28 UTC (rev 601)
+++ trunk/docs/examples/gettingstarted/repositories/src/test/java/org/jboss/example/dna/repository/RepositoryClientTest.java 2008-10-30 17:31:14 UTC (rev 602)
@@ -262,7 +262,7 @@
@Test
public void shouldBeAbleToExecuteTestsRepeatedly() throws Throwable {
- for (int i = 0; i != 10; ++i) {
+ for (int i = 0; i != 5; ++i) {
shouldHaveContentFromConfigurationRepository();
shouldHaveContentFromCarsRepository();
shouldHaveContentFromAircraftRepository();
15 years, 6 months