JBoss Tools SVN: r41394 - trunk/build/aggregate/coretests-site.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-05-24 19:18:59 -0400 (Thu, 24 May 2012)
New Revision: 41394
Modified:
trunk/build/aggregate/coretests-site/site.xml
Log:
JBIDE-11552
Modified: trunk/build/aggregate/coretests-site/site.xml
===================================================================
--- trunk/build/aggregate/coretests-site/site.xml 2012-05-24 23:16:58 UTC (rev 41393)
+++ trunk/build/aggregate/coretests-site/site.xml 2012-05-24 23:18:59 UTC (rev 41394)
@@ -21,6 +21,7 @@
<feature url="features/org.jboss.ide.eclipse.as.test.feature_0.0.0.jar" id="org.jboss.ide.eclipse.as.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.birt.test.feature_0.0.0.jar" id="org.jboss.tools.birt.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.cdi.seam.test.feature_0.0.0.jar" id="org.jboss.tools.cdi.seam.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
+<feature url="features/org.jboss.tools.cdi.deltaspike.test.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.cdi.test.feature_0.0.0.jar" id="org.jboss.tools.cdi.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.central.test.feature_0.0.0.jar" id="org.jboss.tools.central.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
<feature url="features/org.jboss.tools.common.all.test.feature_0.0.0.jar" id="org.jboss.tools.common.all.test.feature" version="0.0.0"><category name="JBoss Tools - Core Tests"/></feature>
12 years, 7 months
JBoss Tools SVN: r41393 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-05-24 19:16:58 -0400 (Thu, 24 May 2012)
New Revision: 41393
Modified:
trunk/build/aggregate/site/site.xml
Log:
JBIDE-11552
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2012-05-24 23:16:14 UTC (rev 41392)
+++ trunk/build/aggregate/site/site.xml 2012-05-24 23:16:58 UTC (rev 41393)
@@ -66,6 +66,11 @@
<category name="WebTools" />
<category name="GeneralTools" />
</feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature" version="0.0.0">
+ <category name="AbridgedTools" />
+ <category name="WebTools" />
+ <category name="GeneralTools" />
+ </feature>
<feature url="features/org.jboss.tools.jmx.feature_0.0.0.jar" id="org.jboss.tools.jmx.feature" version="0.0.0">
<category name="AbridgedTools" />
<category name="GeneralTools" />
@@ -276,6 +281,9 @@
<feature url="features/org.jboss.tools.cdi.seam.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.seam.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature.source" version="0.0.0">
+ <category name="AllSources" />
+ </feature>
<feature url="features/org.jboss.tools.jmx.feature.source_0.0.0.jar" id="org.jboss.tools.jmx.feature.source" version="0.0.0">
<category name="AllSources" />
</feature>
12 years, 7 months
JBoss Tools SVN: r41392 - trunk/cdi/site.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-05-24 19:16:14 -0400 (Thu, 24 May 2012)
New Revision: 41392
Modified:
trunk/cdi/site/category.xml
Log:
JBIDE-11552
Modified: trunk/cdi/site/category.xml
===================================================================
--- trunk/cdi/site/category.xml 2012-05-24 23:12:29 UTC (rev 41391)
+++ trunk/cdi/site/category.xml 2012-05-24 23:16:14 UTC (rev 41392)
@@ -17,6 +17,12 @@
<feature url="features/org.jboss.tools.cdi.seam.test.feature_0.0.0.jar" id="org.jboss.tools.cdi.seam.test.feature" version="0.0.0">
<category name="JBoss Tools cdi Nightly Build Update Site"/>
</feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature" version="0.0.0">
+ <catagory name="JBoss Tools cdi Nightly Build Update Sete"/>
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.test.feature_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.test.feature" version="0.0.0">
+ <catagory name="JBoss Tools cdi Nightly Build Update Sete"/>
+ </feature>
<!-- Sources -->
<feature url="features/org.jboss.tools.cdi.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.feature.source" version="0.0.0">
<category name="JBoss Tools cdi Nightly Build Update Site"/>
@@ -30,5 +36,11 @@
<feature url="features/org.jboss.tools.cdi.seam.test.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.seam.test.feature.source" version="0.0.0">
<category name="JBoss Tools cdi Nightly Build Update Site"/>
</feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.feature.source" version="0.0.0">
+ <category name="JBoss Tools cdi Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.cdi.deltaspike.test.feature.source_0.0.0.jar" id="org.jboss.tools.cdi.deltaspike.test.feature.source" version="0.0.0">
+ <category name="JBoss Tools cdi Nightly Build Update Site"/>
+ </feature>
</site>
12 years, 7 months
JBoss Tools SVN: r41391 - in trunk: openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-05-24 19:12:29 -0400 (Thu, 24 May 2012)
New Revision: 41391
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobResultFuture.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobUtils.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
[JBIDE-11314] added timeout dialog for app creation
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobResultFuture.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobResultFuture.java 2012-05-24 21:25:18 UTC (rev 41390)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobResultFuture.java 2012-05-24 23:12:29 UTC (rev 41391)
@@ -29,20 +29,31 @@
*/
public class JobResultFuture implements Future<IStatus> {
- private AtomicBoolean done = new AtomicBoolean();
- private AtomicBoolean cancelled = new AtomicBoolean();
+ private AtomicBoolean done = new AtomicBoolean(false);
+ private AtomicBoolean cancelled = new AtomicBoolean(false);
private ArrayBlockingQueue<IStatus> queue = new ArrayBlockingQueue<IStatus>(1);
+ private Job job;
public JobResultFuture(Job job) {
+ this.job = job;
addJobFinishedListener(job);
}
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
- cancelled.set(true);
- return true;
+ if ((isRunning(job)
+ && mayInterruptIfRunning)
+ || !isRunning(job)) {
+ cancelled.set(true);
+ job.cancel();
+ }
+ return isRunning(job);
}
+ private boolean isRunning(Job job) {
+ return job.getState() == Job.RUNNING;
+ }
+
@Override
public boolean isCancelled() {
return cancelled.get();
@@ -50,6 +61,9 @@
@Override
public boolean isDone() {
+ if (isCancelled()) {
+ return false;
+ }
return done.get();
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobUtils.java 2012-05-24 21:25:18 UTC (rev 41390)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JobUtils.java 2012-05-24 23:12:29 UTC (rev 41391)
@@ -35,4 +35,10 @@
return status != null
&& status.isOK();
}
+
+ public static boolean isCancel(IStatus status) {
+ return status != null
+ && status.getSeverity() == IStatus.CANCEL;
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2012-05-24 21:25:18 UTC (rev 41390)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/WizardUtils.java 2012-05-24 23:12:29 UTC (rev 41391)
@@ -12,7 +12,6 @@
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.eclipse.core.databinding.DataBindingContext;
@@ -25,6 +24,7 @@
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;
/**
@@ -32,6 +32,9 @@
*/
public class WizardUtils {
+ private static final long THREAD_SLEEP = 1 * 1000;
+ private static final int DEFAULT_TIMEOUT = 120 * 1000;
+
private WizardUtils() {
// inhibit instantiation
}
@@ -80,7 +83,7 @@
*/
public static IStatus runInWizard(final Job job, final DelegatingProgressMonitor delegatingMonitor,
final IWizardContainer container) throws InvocationTargetException, InterruptedException {
- return runInWizard(job, delegatingMonitor, container, 120);
+ return runInWizard(job, delegatingMonitor, container, DEFAULT_TIMEOUT);
}
/**
@@ -122,10 +125,11 @@
if (delegatingMonitor != null) {
delegatingMonitor.add(monitor);
}
+
monitor.beginTask(job.getName(), IProgressMonitor.UNKNOWN);
job.schedule();
try {
- future.get(timeout, TimeUnit.SECONDS);
+ waitForFuture(timeout, future, monitor);
} catch (ExecutionException e) {
} catch (TimeoutException e) {
} finally {
@@ -133,12 +137,37 @@
}
}
});
+
+ return getStatus(job, future);
+ }
+
+ private static void waitForFuture(long timeout, JobResultFuture future, IProgressMonitor monitor)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ long startTime = System.currentTimeMillis();
+ while (!future.isDone()
+ && (System.currentTimeMillis() - startTime) < timeout) {
+ if (monitor.isCanceled()) {
+ future.cancel(true);
+ break;
+ }
+ Thread.sleep(THREAD_SLEEP);
+ }
+ }
+
+ private static IStatus getStatus(final Job job, final JobResultFuture future) {
+
+ if (future.isCancelled()) {
+ String message = NLS.bind("The operation ''{0}'' was cancelled", job.getName());
+ CommonUIPlugin.getDefault().logError(message);
+ return new Status(IStatus.CANCEL, CommonUIPlugin.PLUGIN_ID, message);
+ }
if (future.isDone()) {
return job.getResult();
}
- CommonUIPlugin.getDefault().logError("Operation did not complete in a reasonnable amount of time");
- return new Status(IStatus.ERROR, CommonUIPlugin.PLUGIN_ID,
- "Operation did not complete in a reasonnable amount of time");
+ String message =
+ NLS.bind("The operation ''{0}'' did not complete in a reasonnable amount of time", job.getName());
+ CommonUIPlugin.getDefault().logError(message);
+ return new Status(IStatus.ERROR, CommonUIPlugin.PLUGIN_ID, message);
}
/**
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java 2012-05-24 21:25:18 UTC (rev 41390)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java 2012-05-24 23:12:29 UTC (rev 41391)
@@ -10,12 +10,17 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.job;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
@@ -23,7 +28,10 @@
import com.openshift.client.ApplicationScale;
import com.openshift.client.IApplication;
import com.openshift.client.ICartridge;
+import com.openshift.client.IDomain;
import com.openshift.client.IGearProfile;
+import com.openshift.client.OpenShiftException;
+import com.openshift.client.OpenShiftTimeoutException;
/**
* @author Andre Dietisheim
@@ -52,8 +60,17 @@
protected IStatus doRun(IProgressMonitor monitor) {
try {
lock.lock();
- this.application = user.createApplication(name, cartridge, scale, gear);
- return Status.OK_STATUS;
+ try {
+ this.application = user.createApplication(name, cartridge, scale, gear);
+ } catch (OpenShiftTimeoutException e) {
+ this.application = refreshAndCreateApplication(monitor);
+ }
+ if (application == null) {
+ return OpenShiftUIActivator.createCancelStatus(NLS.bind(
+ "User cancelled creation of application {0}", name));
+ } else {
+ return Status.OK_STATUS;
+ }
} catch (Exception e) {
return OpenShiftUIActivator.createErrorStatus(
OpenShiftExpressUIMessages.COULD_NOT_CREATE_APPLICATION, e, name);
@@ -62,6 +79,26 @@
}
}
+ private IApplication refreshAndCreateApplication(IProgressMonitor monitor) throws OpenShiftException {
+ IApplication application = null;
+ do {
+ try {
+ IDomain domain = user.getDefaultDomain();
+ domain.refresh();
+ application = domain.getApplicationByName(name);
+ if (application == null) {
+ // app is not created yet, try again
+ application = user.createApplication(name, cartridge, scale, gear);
+ }
+ } catch (OpenShiftTimeoutException ex) {
+ // ignore
+ }
+ } while (application == null
+ && openKeepTryingDialog()
+ && !monitor.isCanceled());
+ return application;
+ }
+
public IApplication getApplication() {
try {
lock.lock();
@@ -70,4 +107,30 @@
lock.unlock();
}
}
+
+ protected boolean openKeepTryingDialog() {
+ final AtomicBoolean keepTrying = new AtomicBoolean(false);
+ final Display display = Display.getDefault();
+ Display.getDefault().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog dialog =
+ new MessageDialog(display.getActiveShell()
+ , NLS.bind("Creating {0}", name)
+ , display.getSystemImage(SWT.ICON_QUESTION)
+ , NLS.bind("Could not create application {0}. Connection timed out.\n\nKeep trying?",
+ name)
+ , MessageDialog.QUESTION
+ , new String[] { "Keep trying",
+ OpenShiftExpressUIMessages.BTN_CLOSE_WIZARD }
+ , MessageDialog.QUESTION);
+ // style &= SWT.SHEET;
+ // dialog.setShellStyle(dialog.getShellStyle() | style);
+ keepTrying.set(dialog.open() == IDialogConstants.OK_ID);
+ }
+ });
+ return keepTrying.get();
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-05-24 21:25:18 UTC (rev 41390)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-05-24 23:12:29 UTC (rev 41391)
@@ -143,18 +143,26 @@
public boolean performFinish() {
boolean success = getWizardModel().isUseExistingApplication();
if (!success) {
- if (createApplication()) {
- if (success = waitForApplication(wizardModel.getApplication())) {
- success = addRemoveCartridges(
- getWizardModel().getApplication(), getWizardModel().getSelectedEmbeddableCartridges());
- } else {
- getContainer().getShell().close();
- }
+
+ IStatus status = createApplication();
+ if (JobUtils.isCancel(status)) {
+ getContainer().getShell().close();
+ } else if (!JobUtils.isOk(status)) {
+ return false;
}
+
+ if (success = waitForApplication(wizardModel.getApplication())) {
+ success = addRemoveCartridges(
+ getWizardModel().getApplication(), getWizardModel().getSelectedEmbeddableCartridges());
+ } else {
+ getContainer().getShell().close();
+ }
}
+
if (success) {
success = importProject();
}
+
wizardModel.addUserToModel();
return success;
}
@@ -183,7 +191,7 @@
}
}
- private boolean createApplication() {
+ private IStatus createApplication() {
try {
CreateApplicationJob job = new CreateApplicationJob(
wizardModel.getApplicationName()
@@ -194,9 +202,10 @@
IStatus status = WizardUtils.runInWizard(
job, job.getDelegatingProgressMonitor(), getContainer(), APP_CREATE_TIMEOUT);
wizardModel.setApplication(job.getApplication());
- return status.isOK();
+ return status;
} catch (Exception e) {
- return false;
+ return OpenShiftUIActivator.createErrorStatus(
+ NLS.bind("Could not create application {0}", wizardModel.getApplicationName()), e);
}
}
12 years, 7 months
JBoss Tools SVN: r41390 - in trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike: core/validation and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-05-24 17:25:18 -0400 (Thu, 24 May 2012)
New Revision: 41390
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikeConfigBlockDescriptionProvider.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.properties
Log:
JBIDE-11552
https://issues.jboss.org/browse/JBIDE-11552
Validation of handler method is implemented.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeExceptionExtension.java 2012-05-24 21:25:18 UTC (rev 41390)
@@ -27,6 +27,7 @@
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
+import org.jboss.tools.cdi.deltaspike.core.validation.DeltaspikeValidationMessages;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.BeanMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
@@ -34,6 +35,7 @@
import org.jboss.tools.common.java.IAnnotated;
import org.jboss.tools.common.java.IAnnotationDeclaration;
import org.jboss.tools.common.java.IJavaAnnotation;
+import org.jboss.tools.common.java.IJavaSourceReference;
import org.jboss.tools.common.java.impl.AnnotationLiteral;
import org.jboss.tools.common.preferences.SeverityPreferences;
@@ -70,17 +72,27 @@
for (IBean b: beans) {
if(b instanceof IClassBean) {
IClassBean cb = (IClassBean)b;
- if(cb.getAnnotation(EXCEPTION_HANDLER_ANNOTATION_TYPE_NAME) != null) {
- Set<IBeanMethod> ms = cb.getAllMethods();
- for (IBeanMethod m: ms) {
- for (IParameter p: m.getParameters()) {
- if(isHandler(p)) {
- IType t = p.getType().getType();
- if(t != null && !EXCEPTION_EVENT_TYPE_NAME.equals(t.getFullyQualifiedName())) {
- //TODO add error marker
- System.out.println("wrong handler");
- }
+ boolean isExceptionHandler = cb.isAnnotationPresent(EXCEPTION_HANDLER_ANNOTATION_TYPE_NAME);
+ Set<IBeanMethod> ms = cb.getAllMethods();
+ for (IBeanMethod m: ms) {
+ for (IParameter p: m.getParameters()) {
+ if(isHandler(p)) {
+ if(!isExceptionHandler) {
+ IJavaSourceReference s = p.getAnnotation(HANDLES_ANNOTATION_TYPE_NAME);
+ if(s == null) s = p.getAnnotation(BEFORE_HANDLES_ANNOTATION_TYPE_NAME);
+ if(s == null) s = p;
+ validator.addError(DeltaspikeValidationMessages.NOT_A_HANDLER_BEAN,
+ DeltaspikeSeverityPreferences.NOT_A_HANDLER_BEAN,
+ new String[]{},
+ s, file);
}
+ IType t = p.getType().getType();
+ if(t != null && !EXCEPTION_EVENT_TYPE_NAME.equals(t.getFullyQualifiedName())) {
+ validator.addError(DeltaspikeValidationMessages.INVALID_HANDLER_TYPE,
+ DeltaspikeSeverityPreferences.INVALID_HANDLER_TYPE,
+ new String[]{},
+ p, file);
+ }
}
}
}
@@ -111,10 +123,9 @@
}
return result;
}
+
@Override
public SeverityPreferences getSeverityPreferences() {
- // TODO Auto-generated method stub
- return null;
+ return DeltaspikeSeverityPreferences.getInstance();
}
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/DeltaspikeSeverityPreferences.java 2012-05-24 21:25:18 UTC (rev 41390)
@@ -28,6 +28,10 @@
public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
public static final String WARNING_GROUP_ID = "deltaspike"; //$NON-NLS-1$
+
+ public static final String INVALID_HANDLER_TYPE = INSTANCE.createSeverityOption("invalidHandlerType", "invalid-handler"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String NOT_A_HANDLER_BEAN = INSTANCE.createSeverityOption("notAHandlerBean", "invalid-handler"); //$NON-NLS-1$ //$NON-NLS-2$
+
public static final String AMBIGUOUS_AUTHORIZER = INSTANCE.createSeverityOption("ambiguousAuthorizer", "ambiguous-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
public static final String UNRESOLVED_AUTHORIZER = INSTANCE.createSeverityOption("unresolvedAuthorizer", "unresolved-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
public static final String INVALID_AUTHORIZER = INSTANCE.createSeverityOption("invalidAuthorizer", "invalid-authorizer"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/DeltaspikeValidationMessages.java 2012-05-24 21:25:18 UTC (rev 41390)
@@ -20,6 +20,9 @@
public class DeltaspikeValidationMessages extends NLS {
private static final String BUNDLE_NAME = DeltaspikeValidationMessages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
+ public static String NOT_A_HANDLER_BEAN;
+ public static String INVALID_HANDLER_TYPE;
+
public static String AMBIGUOUS_AUTHORIZER;
public static String UNRESOLVED_AUTHORIZER;
public static String INVALID_AUTHORIZER_MULTIPLE_BINDINGS;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/core/validation/messages.properties 2012-05-24 21:25:18 UTC (rev 41390)
@@ -1,3 +1,6 @@
+NOT_A_HANDLER_BEAN=Exception handler methods must be registered on beans annotated with @ExceptionHandler
+INVALID_HANDLER_TYPE=Parameter of a handler method must be a ExceptionEvent
+
AMBIGUOUS_AUTHORIZER=Ambiguous authorizers found for security binding type {0} on method {1}
UNRESOLVED_AUTHORIZER=No matching authorizer found for security binding type {0} on method {1}
INVALID_AUTHORIZER_MULTIPLE_BINDINGS=Authorizer method {0} declares multiple security binding types
@@ -2,2 +5,2 @@
INVALID_AUTHORIZER_NO_BINDINGS=Authorizer method {0} does not declare a security binding type
-INVALID_AUTHORIZER_NOT_BOOLEAN=Authorizer method {0} does not return a boolean
\ No newline at end of file
+INVALID_AUTHORIZER_NOT_BOOLEAN=Authorizer method {0} does not return a boolean
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikeConfigBlockDescriptionProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikeConfigBlockDescriptionProvider.java 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikeConfigBlockDescriptionProvider.java 2012-05-24 21:25:18 UTC (rev 41390)
@@ -23,6 +23,8 @@
private static SectionDescription SECTION_DELTASPIKE = new SectionDescription(
DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_section_deltaspike,
new String[][]{
+ {DeltaspikeSeverityPreferences.NOT_A_HANDLER_BEAN, DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_pb_notAHandlerBean_label},
+ {DeltaspikeSeverityPreferences.INVALID_HANDLER_TYPE, DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_pb_invalidHandlerType_label},
{DeltaspikeSeverityPreferences.AMBIGUOUS_AUTHORIZER, DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_pb_ambiguousAuthorizer_label},
{DeltaspikeSeverityPreferences.UNRESOLVED_AUTHORIZER, DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_pb_unresolvedAuthorizer_label},
{DeltaspikeSeverityPreferences.INVALID_AUTHORIZER, DeltaspikePreferencesMessages.CDIValidatorConfigurationBlock_pb_invalidAuthorizer_label},
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.java 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.java 2012-05-24 21:25:18 UTC (rev 41390)
@@ -20,6 +20,8 @@
//Section Deltaspike
public static String CDIValidatorConfigurationBlock_section_deltaspike;
+ public static String CDIValidatorConfigurationBlock_pb_notAHandlerBean_label;
+ public static String CDIValidatorConfigurationBlock_pb_invalidHandlerType_label;
public static String CDIValidatorConfigurationBlock_pb_ambiguousAuthorizer_label;
public static String CDIValidatorConfigurationBlock_pb_unresolvedAuthorizer_label;
public static String CDIValidatorConfigurationBlock_pb_invalidAuthorizer_label;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.properties 2012-05-24 21:11:09 UTC (rev 41389)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.deltaspike.core/src/org/jboss/tools/cdi/deltaspike/ui/preferences/DeltaspikePreferencesMessages.properties 2012-05-24 21:25:18 UTC (rev 41390)
@@ -1,6 +1,10 @@
##Section Deltaspike
CDIValidatorConfigurationBlock_section_deltaspike=Deltaspike
+
+CDIValidatorConfigurationBlock_pb_notAHandlerBean_label=Bean is not annotated @ExceptionHandler:
+CDIValidatorConfigurationBlock_pb_invalidHandlerType_label=Invalid hander method parameter type:
+
CDIValidatorConfigurationBlock_pb_ambiguousAuthorizer_label=Umbiguous authorizer for a secured method:
CDIValidatorConfigurationBlock_pb_unresolvedAuthorizer_label=Unresolved authorizer for a secured method:
-CDIValidatorConfigurationBlock_pb_invalidAuthorizer_label=Invalid authorizer:
\ No newline at end of file
+CDIValidatorConfigurationBlock_pb_invalidAuthorizer_label=Invalid authorizer:
12 years, 7 months
JBoss Tools SVN: r41389 - trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-05-24 17:11:09 -0400 (Thu, 24 May 2012)
New Revision: 41389
Modified:
trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java
Log:
JBIDE-11727 - explore providing an .project_example.xml file in root of quickstarts distributions for easy loading/detection in jboss tools
Modified: trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java
===================================================================
--- trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java 2012-05-24 20:17:46 UTC (rev 41388)
+++ trunk/examples/tests/org.jboss.tools.project.examples.test/src/org/jboss/tools/project/examples/test/SiteTest.java 2012-05-24 21:11:09 UTC (rev 41389)
@@ -32,7 +32,7 @@
Set<IProjectExampleSite> sites = new HashSet<IProjectExampleSite>();
sites.addAll(ProjectExampleUtil.getPluginSites());
sites.addAll(ProjectExampleUtil.getUserSites());
- sites.addAll(ProjectExampleUtil.getServerSites());
+ sites.addAll(ProjectExampleUtil.getRuntimeSites());
assertTrue(sites.size() > 0);
}
12 years, 7 months
JBoss Tools SVN: r41388 - in trunk/cdi: plugins and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-05-24 16:17:46 -0400 (Thu, 24 May 2012)
New Revision: 41388
Modified:
trunk/cdi/features/pom.xml
trunk/cdi/plugins/pom.xml
trunk/cdi/tests/org.jboss.tools.cdi.test.launcher/META-INF/MANIFEST.MF
trunk/cdi/tests/pom.xml
Log:
JBIDE-11552
Modified: trunk/cdi/features/pom.xml
===================================================================
--- trunk/cdi/features/pom.xml 2012-05-24 20:17:41 UTC (rev 41387)
+++ trunk/cdi/features/pom.xml 2012-05-24 20:17:46 UTC (rev 41388)
@@ -16,6 +16,8 @@
<module>org.jboss.tools.cdi.test.feature</module>
<module>org.jboss.tools.cdi.seam.feature</module>
<module>org.jboss.tools.cdi.seam.test.feature</module>
+ <module>org.jboss.tools.cdi.deltaspike.feature</module>
+ <module>org.jboss.tools.cdi.deltaspike.test.feature</module>
</modules>
</project>
Modified: trunk/cdi/plugins/pom.xml
===================================================================
--- trunk/cdi/plugins/pom.xml 2012-05-24 20:17:41 UTC (rev 41387)
+++ trunk/cdi/plugins/pom.xml 2012-05-24 20:17:46 UTC (rev 41388)
@@ -17,6 +17,7 @@
<module>org.jboss.tools.cdi.ui</module>
<module>org.jboss.tools.cdi.xml</module>
<module>org.jboss.tools.cdi.xml.ui</module>
+ <module>org.jboss.tools.cdi.deltaspike.core</module>
<module>org.jboss.tools.cdi.seam.core</module>
<module>org.jboss.tools.cdi.seam.solder.core</module>
<module>org.jboss.tools.cdi.seam.config.core</module>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.test.launcher/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.test.launcher/META-INF/MANIFEST.MF 2012-05-24 20:17:41 UTC (rev 41387)
+++ trunk/cdi/tests/org.jboss.tools.cdi.test.launcher/META-INF/MANIFEST.MF 2012-05-24 20:17:46 UTC (rev 41388)
@@ -15,6 +15,7 @@
org.jboss.tools.cdi.seam.text.ext.test;bundle-version="1.2.0";visibility:=reexport,
org.jboss.tools.cdi.text.ext.test;bundle-version="1.2.0";visibility:=reexport,
org.jboss.tools.cdi.ui.test;bundle-version="1.2.0";visibility:=reexport,
+ org.jboss.tools.cdi.deltaspike.core.test;bundle-version="1.2.0";visibility:=reexport,
org.junit
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: trunk/cdi/tests/pom.xml
===================================================================
--- trunk/cdi/tests/pom.xml 2012-05-24 20:17:41 UTC (rev 41387)
+++ trunk/cdi/tests/pom.xml 2012-05-24 20:17:46 UTC (rev 41388)
@@ -46,6 +46,7 @@
<module>org.jboss.tools.cdi.seam.text.ext.test</module>
<module>org.jboss.tools.cdi.text.ext.test</module>
<module>org.jboss.tools.cdi.ui.test</module>
+ <module>org.jboss.tools.cdi.deltaspike.core.test</module>
</modules>
</profile>
12 years, 7 months
JBoss Tools SVN: r41387 - trunk/download.jboss.org/jbosstools/builds/cascade.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-05-24 16:17:41 -0400 (Thu, 24 May 2012)
New Revision: 41387
Modified:
trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
Log:
central depends on cdi because maven depends on cdi
Modified: trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
===================================================================
--- trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2012-05-24 20:17:35 UTC (rev 41386)
+++ trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2012-05-24 20:17:41 UTC (rev 41387)
@@ -40,7 +40,7 @@
examples -> portlet, jst, runtime, as, archives, jmx, hibernate, xulrunner, vpe, jsf, seam
portlet -> seam, as, tests, usage
seam -> hibernate, jsf
-central -> examples, portlet, seam, as, archives, jmx, jsf, vpe, jst, hibernate, freemarker, runtime, common, tests, maven, usage
+central -> examples, portlet, seam, as, archives, jmx, jsf, vpe, jst, hibernate, freemarker, runtime, common, tests, maven, cdi, usage
runtime -> common, tests, jmx, as, seam
cdi -> jst
usage -> common, tests
12 years, 7 months
JBoss Tools SVN: r41386 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-05-24 16:17:35 -0400 (Thu, 24 May 2012)
New Revision: 41386
Modified:
trunk/build/pom.xml
Log:
central depends on cdi because maven depends on cdi
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-05-24 20:17:28 UTC (rev 41385)
+++ trunk/build/pom.xml 2012-05-24 20:17:35 UTC (rev 41386)
@@ -642,6 +642,7 @@
<module>../portlet</module>
<module>../examples</module>
<module>../maven</module>
+ <module>../cdi</module>
<module>../central</module>
</modules>
</profile>
12 years, 7 months
JBoss Tools SVN: r41385 - trunk/download.jboss.org/jbosstools/builds/cascade.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-05-24 16:17:28 -0400 (Thu, 24 May 2012)
New Revision: 41385
Modified:
trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
Log:
examples depends on hibernate, xulrunner, vpe, jsf, and seam
Modified: trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt
===================================================================
--- trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2012-05-24 20:17:20 UTC (rev 41384)
+++ trunk/download.jboss.org/jbosstools/builds/cascade/swimlanes.txt 2012-05-24 20:17:28 UTC (rev 41385)
@@ -1,4 +1,4 @@
-Revised swimlanes, as implemented in 3.2_stable_branch, 3.3_stable_branch and 3.3_trunk jobs, 2012/05/17
+Revised swimlanes, as implemented in 3.2_stable_branch, 3.3_stable_branch and 3.3_trunk jobs, 2012/05/24
See also https://svn.jboss.org/repos/jbosstools/trunk/build/ -> pom*.xml
@@ -37,7 +37,7 @@
(all but common and tests) -> usage
jmx -> tests, common, usage
-examples -> portlet, jst, runtime, as, archives, jmx
+examples -> portlet, jst, runtime, as, archives, jmx, hibernate, xulrunner, vpe, jsf, seam
portlet -> seam, as, tests, usage
seam -> hibernate, jsf
central -> examples, portlet, seam, as, archives, jmx, jsf, vpe, jst, hibernate, freemarker, runtime, common, tests, maven, usage
12 years, 7 months