JBoss Tools SVN: r31902 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal: v7 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-08 04:34:16 -0400 (Wed, 08 Jun 2011)
New Revision: 31902
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java
Log:
AS7 - stopping a local server which was launched outside of eclipse
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-06-08 04:20:43 UTC (rev 31901)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-06-08 08:34:16 UTC (rev 31902)
@@ -46,7 +46,7 @@
*/
public class LocalJBossBehaviorDelegate extends AbstractJBossBehaviourDelegate implements IProcessProvider {
- private PollThread pollThread = null;
+ protected PollThread pollThread = null;
protected IProcess process;
protected boolean nextStopRequiresForce = false;
public LocalJBossBehaviorDelegate() {
@@ -164,10 +164,14 @@
}
protected void pollServer(final boolean expectedState) {
+ IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
+ pollServer(expectedState, poller);
+ }
+
+ protected void pollServer(boolean expectedState, IServerStatePoller poller) {
if( pollThread != null ) {
pollThread.cancel();
}
- IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
this.pollThread = new PollThread(expectedState, poller, getActualBehavior());
pollThread.start();
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-08 04:20:43 UTC (rev 31901)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ServerBehavior.java 2011-06-08 08:34:16 UTC (rev 31902)
@@ -34,6 +34,7 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBoss7ManagerService;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
@@ -84,16 +85,6 @@
initDebugListener(process);
}
- protected void pollServer(final boolean expectedState) {
- if( pollThread != null ) {
- pollThread.cancel();
- }
- //IServerStatePoller poller = PollThreadUtils.getPoller(JBoss7ManagerServicePoller.POLLER_ID, expectedState, getServer());
- IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
- this.pollThread = new PollThread(expectedState, poller, this);
- pollThread.start();
- }
-
private void initDebugListener(IProcess process) {
DebugPlugin.getDefault().addDebugEventListener(serverProcessListener = new JBossServerLifecycleListener());
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-06-08 04:20:43 UTC (rev 31901)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7BehaviorDelegate.java 2011-06-08 08:34:16 UTC (rev 31902)
@@ -12,11 +12,27 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossBehaviorDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
+import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
public class LocalJBoss7BehaviorDelegate extends LocalJBossBehaviorDelegate {
public IStatus canChangeState(String launchMode) {
-// return Status.CANCEL_STATUS;
return Status.OK_STATUS;
}
+ protected void pollServer(final boolean expectedState) {
+ if( pollThread != null )
+ pollThread.cancel();
+
+ IServerStatePoller poller = PollThreadUtils.getPoller(expectedState, getServer());
+ // IF shutting down a process started OUTSIDE of eclipse, force use the web poller,
+ // since there's no process watch for shutdowns
+ if( !expectedState && process == null )
+ poller = PollThreadUtils.getPoller(WebPortPoller.WEB_POLLER_ID, false, getServer());
+
+ this.pollThread = new PollThread(expectedState, poller, getActualBehavior());
+ pollThread.start();
+ }
}
14 years, 10 months
JBoss Tools SVN: r31901 - trunk/bpel/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-06-08 00:20:43 -0400 (Wed, 08 Jun 2011)
New Revision: 31901
Modified:
trunk/bpel/docs/reference/en-US/troubleshooting.xml
Log:
added troubleshooting chapter from bob
Modified: trunk/bpel/docs/reference/en-US/troubleshooting.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/troubleshooting.xml 2011-06-08 04:15:45 UTC (rev 31900)
+++ trunk/bpel/docs/reference/en-US/troubleshooting.xml 2011-06-08 04:20:43 UTC (rev 31901)
@@ -52,6 +52,544 @@
<ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00037_table">00037</ulink>
</entry>
</row>
+ <row>
+ <entry>Target scope "{2}" does not exist.</entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00077_table">00077</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>Target {3} "{2}" must have a compensationHandler or a faultHandler.</entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00078_table">00078</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>{1,choice,0#Node|1#Activity} <{0}> must contain at least {5,choice,1#one node|1<{5} nodes} from {3}</entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02002_table">02002</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>The <{1}> node present in this <{0}> has {2,choice,0# unspecified text value (is empty)| 1<="" td="">
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00038_table">00038</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <{3}> can only occur at most {5,choice,1#one time|1<{5} times} in parent {1,choice,0#node|1#activity} <{0}>
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02002_table">02002</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <{1}> name "{2}" is already defined in this scope/process.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00018_table">00018</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00023_table">00023</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00044_table">00044</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00064_table">00064</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00068_table">00068</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00069_table">00069</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ This <{0}> with name="{1}" was already defined previously
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00022_table">00022</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Cannot import type "{1}" from location "{2}"
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01234_table">01234</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The XSD type "{1}" of {2} "{3}" in this <{0}> is not a simple XSD type.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00045_table">00045</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ This <{0}> uses undefined message part "{1}" in message type "{2}".
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00021_table">00021</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ There is no "{2}" message that is used by this <{0}> - {3,choice,0#node <{4}> |2#attribute "{4}"} must be omitted.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00047_table">00047</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Solicit-response operation "{4}" in portType "{3}" cannot be used in a BPEL process.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00001_table">00001</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ XSD element <{0}> in import {1} conflicts with element of the same name in {2}.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00014_table">00014</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ {1,choice,0#Node|1#Activity} <{0}> must have {2} {3,choice,0#node|1#activity|2#attribute} present.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00080_table">00080</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00081_table">00081</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00083_table">00083</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00090_table">00090</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The variable name "{1}" is used as a counter name in <{2}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00076_table">00076</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The link "{1}" used as a {0} is not defined in the enclosing flow.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00065_table">00065</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Scope "{1}" cannot have a <{2}> because because it is itself inside an FCT-hander.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00079_table">00079</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The <link> "{1}" has a control cycle where the source "{2}" has the target "{3}" as a preceding activity.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00072_table">00072</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <{0}> cannot be a child of <{1}>; it can only be a child of {2}
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02001_table">02001</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The link "{1}" does not have a source.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00066_table">00066</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ {0} attribute refers to an unsupported language URI {1}
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00004_table">00004</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ A catch for fault "{1}" already exist.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00093_table">00093</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Extension "{1}" is not supported by this implementation.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00009_table">00009</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ {1,choice,0#Node|1#Activity} <{0}> must specify one {3,choice,0#node|1#activity|2#attribute} {2}.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00081_table">00081</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00081_table">00090</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The attribute {1} must be set to "{2}" on this <{0}>
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00057_table">00057</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Attribute "{0}" must not be set on this <{1}> {2,choice,0#node|1#activity}.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00046_table">00046</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ {3,choice,0#Node|1#Activity|2#Attribute} {2} must not be specified on {1,choice,0#node|1#activity} <{0}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00090_table">00090</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Attribute "{1}" cannot be set because {2} "{3}" is not an element.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00042_table">00042</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Immediately enclosed {0} "{1}" must have a unique name within the outer scope "{3}".
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00092_table">00092</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ "{1}" is set to "{2}" on this <{0}> {4,choice,0#node|1#activity} but it can only be set to {3}
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00017_table">00017</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00032_table">00032</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00046_table">00046</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00090_table">00090</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01001_table">01001</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01010_table">01010</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02003_table">02003</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02004_table">02004</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {1} of "{2}" is not compatible with {3} of "{4}" - {5}
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00043_table">00043</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Message part "{1}" does not exist in message "{2}"
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00034_table">00034</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00054_table">00054</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ partnerLink "{1}" uses portType "{3}" (via partnerLinkType "{2}") which has an overloaded operation "{4}".
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00002_table">00002</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Attribute "{1}" is not set on this <{0}> {2,choice,0#node|1#activity}.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00000_table">00000</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00010_table">00010</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00024_table">00024</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00032_table">00032</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00046_table">00046</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00047_table">00047</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00081_table">00081</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00088_table">00088</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00090_table">00090</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01001_table">01001</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01004_table">01004</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01010_table">01010</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02003_table">02003</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02004_table">02004</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The <{0}> activity named "{1}" must be in a fault, compensate, or termination handlers.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00007_table">00007</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00008_table">00008</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The "{1}" cannot be used on <{0}> that does not have {2} defined.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00017_table">00017</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <{0}> activity "{1}" specifies a portType "{2}", yet this portType does not match the portType derived from "{4}" of partnerLink "{3}" defined in WSDL "{5}"
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00005_table">00005</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Isolated scope "{1}" cannot exist within another isolated scope (scope "{3}").
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00091_table">00091</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <{0}> activity "{1}" is trying to use partnerLink "{2}" which does not have a "{3}" defined.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00084_table">00084</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Part "{3}" must be specified on this <{2}> - activity <{1}> requires it.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00050_table">00050</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The targetNamespace {2} of the imported document is not the default namespace.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00012_table">00012</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ This <{0}> activity is a start activity and cannot have an onAlarm component.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00062_table">00062</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The import namespace {1} and the imported document target namespace {2} do not match.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00011_table">00011</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {1} start activities must share at least one correlation.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00057_table">00057</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Either "{1}" or "{2}" attribute is required on this <{0}>
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00019_table">00019</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00020_table">00020</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The partner link "{1}" referenced from this <{0}> must have "{2}" defined.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00035_table">00035</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00036_table">00036</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The <{1}> activity named {0} must be in a fault handler.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00006_table">00006</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The part "{1}" is already specified in another <{0}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00053_table">00053</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The link "{1}" is not unique - the link "{2}" also makes an identical connection.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00067_table">00067</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The form of <{0}> is not valid (too many variants detected).
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00032_table">00032</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The variable name "{0}" contains an illegal period (.) character.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00024_table">00024</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Notification operation "{4}" in portType "{3}" (via partnerLinkType "{2}") cannot be used in a BPEL process.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00001_table">00001</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The link "{1}" does not have a target.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00066_table">00066</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The link "{1}" crosses repeatable boundary on <{2}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00070_table">00070</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The "{0}" attribute of this <{1}> is set to "{2}" - it is not a valid NCName.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00000_table">00000</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00024_table">00024</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01004_table">01004</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Either <{1}> *or* attribute "{2}" must be specified on <{0}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00051_table">00051</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00052_table">00052</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00055_table">00055</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00059_table">00059</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00063_table">00063</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00085_table">00085</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {1} "{2}" is not of messageType and a "part" is specified in this <{0}> node.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00034_table">00034</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ "{1}" is set to "{3}" on this <{0}> {2,choice,0#|1#activity} but it cannot be resolved (check value of "{1}", imports, WSDLs or XSDs).
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00010_table">00010</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00017_table">00017</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00021_table">00021</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00032_table">00032</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00045_table">00045</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00081_table">00081</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00088_table">00088</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00090_table">00090</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02003_table">02003</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02004_table">02004</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Link "{1}" must be outbound only; target activity must be outside of the enclosing <{2}>.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00071_table">00071</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ Variable "{0}" must be have either messageType,element, or type defined.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00025_table">00025</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ There is no start activity in process "{1}"
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00015_table">00015</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ {0} "{1}" must have "{2}" and/or "{3}" set.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00016_table">00016</ulink>
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -71,13 +609,35 @@
</thead>
<tbody>
<row>
- <entry>
- </entry>
- <entry>
- </entry>
- </row>
- </tbody>
- </tgroup>
+ <entry>
+ The expression in <{0}> cannot be checked - no expression validator has been registered for language {1}.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00029_table">00029</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00033_table">00033</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA01000_table">01000</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {1} of simple type "{2}" is not compatible with {3} of simple type "{4}" - a BPEL runtime may provide an implicit conversion.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00043_table">00043</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {3,choice,0#node|1#activity} <{0}> refers to a {1} (via the attribute "{2}") - this {1} needs to be defined correctly.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00032_table">00032</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02003_table">02003</ulink>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA02004_table">02004</ulink>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
</section>
<section>
@@ -95,13 +655,23 @@
</thead>
<tbody>
<row>
- <entry>
- </entry>
- <entry>
- </entry>
- </row>
- </tbody>
- </tgroup>
+ <entry>
+ Copy rule not checked - {1} type-of "{2}", {3} type-of "{4}".
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00043_table">00043</ulink>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ The {1} of {0} is not defined in BPEL 2.0 and is not understood by this implementation.
+ </entry>
+ <entry>
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#SA00013_table">00013</ulink>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
</table>
</section>
</chapter>
14 years, 10 months
JBoss Tools SVN: r31900 - branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-06-08 00:15:45 -0400 (Wed, 08 Jun 2011)
New Revision: 31900
Modified:
branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
Log:
test compilation failure in branch
Modified: branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java
===================================================================
--- branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-06-08 00:49:28 UTC (rev 31899)
+++ branches/jbosstools-3.2.x/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/BuildDeployTest.java 2011-06-08 04:15:45 UTC (rev 31900)
@@ -328,4 +328,8 @@
ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
waitForIdle();
}
+ private void waitForIdle() {
+ JobUtils.waitForIdle(2500);
+ }
+
}
14 years, 10 months
JBoss Tools SVN: r31899 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core: generic and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-06-07 20:49:28 -0400 (Tue, 07 Jun 2011)
New Revision: 31899
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanDefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties
Log:
JBIDE-8695
https://issues.jboss.org/browse/JBIDE-8695
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -25,7 +25,8 @@
private static CDISeamSolderPreferences INSTANCE = new CDISeamSolderPreferences();
- public static final String AMBIGUOUS_GENERIC_BEAN = INSTANCE.createSeverityOption("ambiguousGenericBean");
+ public static final String AMBIGUOUS_GENERIC_CONFIGURATION_POINT = INSTANCE.createSeverityOption("ambiguousGenericConfigurationPoint");
+ public static final String WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT = INSTANCE.createSeverityOption("wrongTypeOfGenericConfigurationPoint");
public static CDISeamSolderPreferences getInstance() {
return INSTANCE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -96,9 +96,9 @@
p.addBean(b);
}
- Map<AbstractMemberDefinition, List<IQualifierDeclaration>> ms = c.getGenericProducerBeans();
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> ms = c.getGenericConfigurationPoints();
- Set<TypeDefinition> ts = c.getGenericConfigurationBeans();
+ Set<TypeDefinition> ts = c.getGenericBeans();
for (AbstractMemberDefinition gp: ms.keySet()) {
//check veto
if(gp.getTypeDefinition().isVetoed()) {
@@ -198,7 +198,7 @@
ParametedType p = context.getProject().getTypeFactory().getParametedType(typeDefinition.getType(), "Q" + s + ";");
if(p != null && p.getType() != null) {
GenericConfiguration c = ((GenericBeanDefinitionContext)this.context.getWorkingCopy()).getGenericConfiguration(p.getType().getFullyQualifiedName());
- c.getGenericConfigurationBeans().add(typeDefinition);
+ c.getGenericBeans().add(typeDefinition);
addToDependencies(c, typeDefinition, context);
}
} catch (JavaModelException e) {
@@ -238,7 +238,7 @@
list.add((IQualifierDeclaration)d);
}
}
- c.getGenericProducerBeans().put(def, list);
+ c.getGenericConfigurationPoints().put(def, list);
addToDependencies(c, def, context);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanDefinitionContext.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanDefinitionContext.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -70,7 +70,7 @@
if(annotation.isAnnotationPresent(CDISeamSolderConstants.GENERIC_TYPE_ANNOTATION_TYPE_NAME)) {
annotation.setExtendedKind(CDISeamSolderConstants.GENERIC_ANNOTATION_KIND);
String qn = annotation.getType().getFullyQualifiedName();
- getGenericConfiguration(qn).setGenericTypeDefinition(annotation);
+ getGenericConfiguration(qn).setGenericTypeDefinition(annotation, this);
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -12,20 +12,29 @@
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IMember;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.core.IProducer;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderCorePlugin;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderPreferences;
import org.jboss.tools.cdi.seam.solder.core.validation.SeamSolderValidationMessages;
import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.util.EclipseJavaUtil;
/**
*
@@ -48,22 +57,52 @@
}
public void validateConfiguration(IFile file, GenericConfiguration c, CDICoreValidator validator, CDICoreNature project, GenericBeanDefinitionContext context) throws CoreException {
- Map<AbstractMemberDefinition, List<IQualifierDeclaration>> bs = c.getGenericProducerBeans();
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> bs = c.getGenericConfigurationPoints();
for (AbstractMemberDefinition d: bs.keySet()) {
if(d.getResource() != null && d.getResource().equals(file) && !d.getTypeDefinition().isVetoed()) {
+ ITextSourceReference reference = CDIUtil.convertToSourceReference(((IMember)d.getMember()).getNameRange(), file);
+
+ /*
+ * If several generic configuration points have the same set of qualifiers,
+ * than respective generic beans will result in ambiguous beans for injections
+ * with that set of qualifiers.
+ */
List<IQualifierDeclaration> ds = bs.get(d);
for (AbstractMemberDefinition d1: bs.keySet()) {
List<IQualifierDeclaration> ds2 = bs.get(d1);
if(ds2 != ds && !d1.getTypeDefinition().isVetoed() && CDIProject.areMatchingQualifiers(ds, ds2)) {
- ITextSourceReference reference = CDIUtil.convertToSourceReference(((IMember)d.getMember()).getNameRange(), file);
- validator.addError(SeamSolderValidationMessages.AMBIGUOUS_GENERIC_BEAN, CDISeamSolderPreferences.AMBIGUOUS_GENERIC_BEAN, new String[0], reference, file);
+ validator.addError(SeamSolderValidationMessages.AMBIGUOUS_GENERIC_CONFIGURATION_POINT,
+ CDISeamSolderPreferences.AMBIGUOUS_GENERIC_CONFIGURATION_POINT, new String[0], reference, file);
}
}
+
+ /*
+ * Type of generic configuration point must be assignable to the configuration type.
+ */
+ IParametedType t = c.getConfigType();
+ IBean b = findGenericBean(file, (IMember)d.getMember(), project);
+ if(t == null || b == null || !CDIProject.containsType(b.getAllTypes(), t)) {
+ validator.addError(SeamSolderValidationMessages.WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT,
+ CDISeamSolderPreferences.WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT, new String[0], reference, file);
+ }
+
}
}
//TODO check`
}
+
+ private IBean findGenericBean(IFile file, IMember member, CDICoreNature project) {
+ Set<IBean> bs = project.getDelegate().getBeans(file.getFullPath());
+ for (IBean b: bs) {
+ if(b instanceof IClassBean) {
+ if(member.equals(((IClassBean)b).getBeanClass())) return b;
+ } else if(b instanceof IProducer) {
+ if(member.equals(((IProducer)b).getSourceMember())) return b;
+ }
+ }
+ return null;
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -18,32 +18,72 @@
import java.util.Set;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IParametedType;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderCorePlugin;
+import org.jboss.tools.common.util.EclipseJavaUtil;
/**
+ * This class collects objects bound by one generic configuration:
+ * 1) Generic configuration annotation - annotation type annotatid with GenericType annotation;
+ * 2) Generic configuration type - type as declared by value of GenericType annotation;
+ * 3) Generic configuration points - beans annotated with generic configuration annotation;
+ * 4) Generic beans - beans annotated with GenericConfiguration annotation;
*
* @author Viacheslav Kabanovich
*
*/
public class GenericConfiguration {
+ /**
+ * Generic configuration annotation type name.
+ */
String genericTypeName;
+
+ /**
+ * Generic configuration annotation type definition.
+ */
AnnotationDefinition genericType;
- Map<AbstractMemberDefinition, List<IQualifierDeclaration>> genericProducerBeans = new HashMap<AbstractMemberDefinition, List<IQualifierDeclaration>>();
- Set<TypeDefinition> genericConfigurationBeans = new HashSet<TypeDefinition>();
+ /**
+ * Generic configuration type declared by generic configuration annotation.
+ */
+ IParametedType configType;
+ /**
+ * Generic Configuration point is a bean annotated with 'generic configuration annotation'.
+ * This field maps definitions of such beans to their qualifiers for quick reference.
+ */
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> genericConfigurationPoints = new HashMap<AbstractMemberDefinition, List<IQualifierDeclaration>>();
+
+ /**
+ * Generic Bean is bean class annotated with GenericConfiguration annotation.
+ */
+ Set<TypeDefinition> genericBeans = new HashSet<TypeDefinition>();
+
Set<IPath> involvedResources = new HashSet<IPath>();
public GenericConfiguration(String genericTypeName) {
this.genericTypeName = genericTypeName;
}
- public void setGenericTypeDefinition(AnnotationDefinition genericType) {
+ public void setGenericTypeDefinition(AnnotationDefinition genericType, GenericBeanDefinitionContext context) {
this.genericType = genericType;
+ IAnnotationDeclaration g = genericType.getAnnotation(CDISeamSolderConstants.GENERIC_TYPE_ANNOTATION_TYPE_NAME);
+ Object o = g.getMemberValue(null);
+ if(o != null) {
+ String configTypeName = EclipseJavaUtil.resolveType(genericType.getType(), o.toString());
+ try {
+ configType = context.getRootContext().getProject().getTypeFactory().getParametedType(genericType.getType(), "Q" + o.toString() + ";");
+ } catch (JavaModelException e) {
+ CDISeamSolderCorePlugin.getDefault().logError(e);
+ }
+ }
}
public void clear(IPath path) {
@@ -51,13 +91,13 @@
}
public void clear(String typeName) {
- Iterator<AbstractMemberDefinition> it = genericProducerBeans.keySet().iterator();
+ Iterator<AbstractMemberDefinition> it = genericConfigurationPoints.keySet().iterator();
while(it.hasNext()) {
if(typeName.equals(it.next().getTypeDefinition().getQualifiedName())) {
it.remove();
}
}
- Iterator<TypeDefinition> it2 = genericConfigurationBeans.iterator();
+ Iterator<TypeDefinition> it2 = genericBeans.iterator();
while(it2.hasNext()) {
if(typeName.equals(it2.next().getTypeDefinition().getQualifiedName())) {
it2.remove();
@@ -65,8 +105,13 @@
}
}
- public Map<AbstractMemberDefinition, List<IQualifierDeclaration>> getGenericProducerBeans() {
- return genericProducerBeans;
+ /**
+ * Returns map of definition to qualifiers for generic configuration points.
+ *
+ * @return map of definition to qualifiers for generic configuration points
+ */
+ public Map<AbstractMemberDefinition, List<IQualifierDeclaration>> getGenericConfigurationPoints() {
+ return genericConfigurationPoints;
}
public String getGenericTypeName() {
@@ -77,10 +122,19 @@
return genericType;
}
- public Set<TypeDefinition> getGenericConfigurationBeans() {
- return genericConfigurationBeans;
+ public IParametedType getConfigType() {
+ return configType;
}
+ /**
+ * Returns set of generic beans.
+ *
+ * @return set of generic beans
+ */
+ public Set<TypeDefinition> getGenericBeans() {
+ return genericBeans;
+ }
+
public Set<IPath> getInvolvedTypes() {
return involvedResources;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java 2011-06-08 00:49:28 UTC (rev 31899)
@@ -21,7 +21,8 @@
private static final String BUNDLE_NAME = SeamSolderValidationMessages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
- public static String AMBIGUOUS_GENERIC_BEAN;
+ public static String AMBIGUOUS_GENERIC_CONFIGURATION_POINT;
+ public static String WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT;
static {
NLS.initializeMessages(BUNDLE_NAME, SeamSolderValidationMessages.class);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties 2011-06-08 00:04:35 UTC (rev 31898)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties 2011-06-08 00:49:28 UTC (rev 31899)
@@ -1 +1,2 @@
-AMBIGUOUS_GENERIC_BEAN=Several generic beans for the same generic type have the same set of qualifiers.
+AMBIGUOUS_GENERIC_CONFIGURATION_POINT=Several generic configuration points for the same generic configuration have the same set of qualifiers.
+WRONG_TYPE_OF_GENERIC_CONFIGURATION_POINT=Type of generic configuration point must be assignable to the generic configuration type.
14 years, 10 months
JBoss Tools SVN: r31896 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-06-07 18:50:22 -0400 (Tue, 07 Jun 2011)
New Revision: 31896
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
Log:
fixing message
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2011-06-07 22:46:55 UTC (rev 31895)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/configuration/ProjectBuilderConfigurer.java 2011-06-07 22:50:22 UTC (rev 31896)
@@ -34,9 +34,9 @@
}
// project nature installation triggers the project builder installation, by configuration/association in the plugin.xml file.
if (ProjectBuilderUtils.installProjectBuilder(project, ProjectBuilderUtils.JAXRS_BUILDER_ID)) {
- Logger.info("JAX-RS MediaTypeCapabilitiesBuilder is now installed.");
+ Logger.info("JAX-RS Builder is now installed.");
} else {
- Logger.info("JAX-RS MediaTypeCapabilitiesBuilder was already installed.");
+ Logger.info("JAX-RS Builder was already installed.");
}
}
14 years, 10 months
JBoss Tools SVN: r31895 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core: generic and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-06-07 18:46:55 -0400 (Tue, 07 Jun 2011)
New Revision: 31895
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java
Log:
JBIDE-8695
https://issues.jboss.org/browse/JBIDE-8695
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java 2011-06-07 22:46:55 UTC (rev 31895)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class CDISeamSolderPreferences extends SeverityPreferences {
+ public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
+
+ private static CDISeamSolderPreferences INSTANCE = new CDISeamSolderPreferences();
+
+ public static final String AMBIGUOUS_GENERIC_BEAN = INSTANCE.createSeverityOption("ambiguousGenericBean");
+
+ public static CDISeamSolderPreferences getInstance() {
+ return INSTANCE;
+ }
+
+ private CDISeamSolderPreferences() {}
+
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return SEVERITY_OPTION_NAMES;
+ }
+
+ @Override
+ protected String createSeverityOption(String shortName) {
+ String name = getPluginId() + ".validator.problem." + shortName; //$NON-NLS-1$
+ SEVERITY_OPTION_NAMES.add(name);
+ return name;
+ }
+
+ @Override
+ protected String getPluginId() {
+ return CDISeamSolderCorePlugin.PLUGIN_ID;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderPreferences.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-06-07 22:42:58 UTC (rev 31894)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/CDISeamSolderGenericBeanExtension.java 2011-06-07 22:46:55 UTC (rev 31895)
@@ -31,6 +31,7 @@
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.internal.core.impl.AnnotationDeclaration;
import org.jboss.tools.cdi.internal.core.impl.AnnotationLiteral;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
@@ -43,6 +44,7 @@
import org.jboss.tools.cdi.internal.core.impl.definition.ParameterDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderConstants;
import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderCorePlugin;
import org.jboss.tools.common.model.XModelObject;
@@ -52,7 +54,7 @@
* @author Viacheslav Kabanovich
*
*/
-public class CDISeamSolderGenericBeanExtension implements ICDIExtension, IBuildParticipantFeature, IProcessAnnotatedTypeFeature, CDISeamSolderConstants {
+public class CDISeamSolderGenericBeanExtension implements ICDIExtension, IBuildParticipantFeature, IProcessAnnotatedTypeFeature, IValidatorFeature, CDISeamSolderConstants {
CDICoreNature project;
GenericBeanDefinitionContext context = new GenericBeanDefinitionContext();
@@ -94,7 +96,7 @@
p.addBean(b);
}
- Map<AbstractMemberDefinition, List<IAnnotationDeclaration>> ms = c.getGenericProducerBeans();
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> ms = c.getGenericProducerBeans();
Set<TypeDefinition> ts = c.getGenericConfigurationBeans();
for (AbstractMemberDefinition gp: ms.keySet()) {
@@ -102,9 +104,9 @@
if(gp.getTypeDefinition().isVetoed()) {
continue;
}
- List<IAnnotationDeclaration> list = ms.get(gp);
+ List<IQualifierDeclaration> list = ms.get(gp);
for (TypeDefinition t: ts) {
- TypeDefinition ti = new TypeDefinition();
+ TypeDefinition ti = new TypeDefinition(); //TODO copy, do not create new.
ti.setType(t.getType(), context.getRootContext(), 0);
List<MethodDefinition> ps = ti.getMethods();
for (MethodDefinition m: ps) {
@@ -140,7 +142,7 @@
}
}
- private void replaceGenericInjections(TypeDefinition ti, List<IAnnotationDeclaration> list) {
+ private void replaceGenericInjections(TypeDefinition ti, List<IQualifierDeclaration> list) {
List<FieldDefinition> fs = ti.getFields();
for (FieldDefinition f: fs) {
if(f.isAnnotationPresent(INJECT_ANNOTATION_TYPE_NAME) && f.isAnnotationPresent(GENERIC_QUALIFIER_TYPE_NAME)) {
@@ -229,11 +231,11 @@
private void addGenericProducerBean(AbstractMemberDefinition def, String genericType, IRootDefinitionContext context) {
GenericConfiguration c = ((GenericBeanDefinitionContext)this.context.getWorkingCopy()).getGenericConfiguration(genericType);
- List<IAnnotationDeclaration> list = new ArrayList<IAnnotationDeclaration>();
+ List<IQualifierDeclaration> list = new ArrayList<IQualifierDeclaration>();
List<IAnnotationDeclaration> ds = def.getAnnotations();
for (IAnnotationDeclaration d: ds) {
if(d instanceof IQualifierDeclaration) {
- list.add(d);
+ list.add((IQualifierDeclaration)d);
}
}
c.getGenericProducerBeans().put(def, list);
@@ -264,6 +266,10 @@
}
}
return null;
- }
+ }
+
+ public void validateResource(IFile file, CDICoreValidator validator) {
+ new GenericBeanValidator().validateResource(file, validator, project, context);
+ }
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java 2011-06-07 22:46:55 UTC (rev 31895)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core.generic;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IMember;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderCorePlugin;
+import org.jboss.tools.cdi.seam.solder.core.CDISeamSolderPreferences;
+import org.jboss.tools.cdi.seam.solder.core.validation.SeamSolderValidationMessages;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class GenericBeanValidator {
+
+ public void validateResource(IFile file, CDICoreValidator validator, CDICoreNature project, GenericBeanDefinitionContext context) {
+ Map<String, GenericConfiguration> cs = context.getGenericConfigurations();
+ for (GenericConfiguration c: cs.values()) {
+ if(c.getInvolvedTypes().contains(file.getFullPath())) {
+ try {
+ validateConfiguration(file, c, validator, project, context);
+ } catch (CoreException e) {
+ CDISeamSolderCorePlugin.getDefault().logError(e);
+ }
+ }
+ }
+ }
+
+ public void validateConfiguration(IFile file, GenericConfiguration c, CDICoreValidator validator, CDICoreNature project, GenericBeanDefinitionContext context) throws CoreException {
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> bs = c.getGenericProducerBeans();
+ for (AbstractMemberDefinition d: bs.keySet()) {
+ if(d.getResource() != null && d.getResource().equals(file) && !d.getTypeDefinition().isVetoed()) {
+ List<IQualifierDeclaration> ds = bs.get(d);
+ for (AbstractMemberDefinition d1: bs.keySet()) {
+ List<IQualifierDeclaration> ds2 = bs.get(d1);
+ if(ds2 != ds && !d1.getTypeDefinition().isVetoed() && CDIProject.areMatchingQualifiers(ds, ds2)) {
+ ITextSourceReference reference = CDIUtil.convertToSourceReference(((IMember)d.getMember()).getNameRange(), file);
+ validator.addError(SeamSolderValidationMessages.AMBIGUOUS_GENERIC_BEAN, CDISeamSolderPreferences.AMBIGUOUS_GENERIC_BEAN, new String[0], reference, file);
+ }
+ }
+ }
+ }
+ //TODO check`
+
+ }
+
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericBeanValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java 2011-06-07 22:42:58 UTC (rev 31894)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/generic/GenericConfiguration.java 2011-06-07 22:46:55 UTC (rev 31895)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IQualifierDeclaration;
import org.jboss.tools.cdi.internal.core.impl.definition.AbstractMemberDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
@@ -32,7 +33,7 @@
String genericTypeName;
AnnotationDefinition genericType;
- Map<AbstractMemberDefinition, List<IAnnotationDeclaration>> genericProducerBeans = new HashMap<AbstractMemberDefinition, List<IAnnotationDeclaration>>();
+ Map<AbstractMemberDefinition, List<IQualifierDeclaration>> genericProducerBeans = new HashMap<AbstractMemberDefinition, List<IQualifierDeclaration>>();
Set<TypeDefinition> genericConfigurationBeans = new HashSet<TypeDefinition>();
Set<IPath> involvedResources = new HashSet<IPath>();
@@ -64,7 +65,7 @@
}
}
- public Map<AbstractMemberDefinition, List<IAnnotationDeclaration>> getGenericProducerBeans() {
+ public Map<AbstractMemberDefinition, List<IQualifierDeclaration>> getGenericProducerBeans() {
return genericProducerBeans;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java 2011-06-07 22:46:55 UTC (rev 31895)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.solder.core.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class SeamSolderValidationMessages {
+
+ private static final String BUNDLE_NAME = SeamSolderValidationMessages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
+
+ public static String AMBIGUOUS_GENERIC_BEAN;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, SeamSolderValidationMessages.class);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/SeamSolderValidationMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties 2011-06-07 22:46:55 UTC (rev 31895)
@@ -0,0 +1 @@
+AMBIGUOUS_GENERIC_BEAN=Several generic beans for the same generic type have the same set of qualifiers.
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/validation/messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 10 months
JBoss Tools SVN: r31894 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-06-07 18:42:58 -0400 (Tue, 07 Jun 2011)
New Revision: 31894
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-8695
https://issues.jboss.org/browse/JBIDE-8695
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-06-07 22:27:12 UTC (rev 31893)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-06-07 22:42:58 UTC (rev 31894)
@@ -12,6 +12,7 @@
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -414,7 +415,7 @@
return false;
}
- public static boolean areMatchingQualifiers(Set<IQualifierDeclaration> beanQualifiers, Set<IQualifierDeclaration> injectionQualifiers) throws CoreException {
+ public static boolean areMatchingQualifiers(Collection<IQualifierDeclaration> beanQualifiers, Collection<IQualifierDeclaration> injectionQualifiers) throws CoreException {
if(beanQualifiers.isEmpty()) {
if(injectionQualifiers.isEmpty()) {
return true;
@@ -899,17 +900,8 @@
if(!p.isAnnotationPresent(CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)) continue;
IParametedType type = p.getType();
if(!containsType(types, type)) continue;
- Set<IType> qts = new HashSet<IType>();
- Set<String> ts = ((Parameter)p).getAnnotationTypes();
- for (String t: ts) {
- QualifierElement q = getQualifier(t);
- if(q != null && q.getSourceType() != null) {
- qts.add(q.getSourceType());
- }
- }
- IType[] qtsa = qts.toArray(new IType[0]);
try {
- if(areMatchingQualifiers(qs, qtsa)) {
+ if(areMatchingQualifiers(qs, p.getQualifierDeclarations())) {
match = p;
break;
}
14 years, 10 months
JBoss Tools SVN: r31893 - in trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core: metamodel and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-06-07 18:27:12 -0400 (Tue, 07 Jun 2011)
New Revision: 31893
Removed:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/CollectionFilterUtil.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResolvedUriMapping.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/UriMapping.java
Log:
Removing obsolete files
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/CollectionFilterUtil.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/CollectionFilterUtil.java 2011-06-07 22:25:07 UTC (rev 31892)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/CollectionFilterUtil.java 2011-06-07 22:27:12 UTC (rev 31893)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xavier Coulon - Initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.jaxrs.core.internal.utils;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jdt.core.IMember;
-import org.jboss.tools.ws.jaxrs.core.metamodel.BaseElement;
-import org.jboss.tools.ws.jaxrs.core.metamodel.BaseElement.EnumType;
-
-/**
- * Collection filter utility class.
- * @author xcoulon
- *
- */
-public final class CollectionFilterUtil {
-
- /**
- * Private constructor of the utility class.
- */
- private CollectionFilterUtil() {
-
- }
-
- /**
- * Filter elements in the given collection, given their JAX-RS kind.
- * @param <T> the java type of the elements in the collection
- * @param elements > the collection of elements to filter
- * @param kind the JAX-RS kind to match in the filter
- * @return the matching elements
- */
- public static <T extends BaseElement<? extends IMember>> List<T> filterElementsByKind(final Collection<T> elements,
- final BaseElement.EnumType... kind) {
- List<T> matches = new ArrayList<T>();
- List<EnumType> kinds = Arrays.asList(kind);
- for (T element : elements) {
- if (kinds.contains(element.getKind())) {
- matches.add(element);
- }
- }
- return Collections.unmodifiableList(matches);
- }
-
-}
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResolvedUriMapping.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResolvedUriMapping.java 2011-06-07 22:25:07 UTC (rev 31892)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/ResolvedUriMapping.java 2011-06-07 22:27:12 UTC (rev 31893)
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xavier Coulon - Initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.jaxrs.core.metamodel;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.tools.ws.jaxrs.core.utils.ResourceMethodAnnotatedParameter;
-
-public class ResolvedUriMapping implements Comparable<ResolvedUriMapping> {
-
- private HTTPMethod httpMethod = null;
-
- private final String fullUriPathTemplate;
-
- private final String baseUriPathTemplate;
-
- private final MediaTypeCapabilities mediaTypeCapabilities = new MediaTypeCapabilities();
-
- /**
- * Full constructor
- *
- * @param httpMethod
- * optional http method
- * @param consumes
- * optional single consumed media type
- * @param produces
- * optional single produced media type
- * @param fullUriPathTemplate
- * optional URI path template fragment
- */
- public ResolvedUriMapping(HTTPMethod httpMethod, String uriPathTemplate, List<ResourceMethodAnnotatedParameter> queryParams,
- MediaTypeCapabilities mediaTypeCapabilities) {
- super();
- this.httpMethod = httpMethod;
- this.baseUriPathTemplate = uriPathTemplate;
- this.fullUriPathTemplate = computeUriPathTemplate(uriPathTemplate, queryParams);
- this.mediaTypeCapabilities.merge(mediaTypeCapabilities);
- }
-
- private static String computeUriPathTemplate(String uriPathTemplate, List<ResourceMethodAnnotatedParameter> queryParams) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(uriPathTemplate);
- if (queryParams != null && !queryParams.isEmpty()) {
- buffer.append("?");
- for (Iterator<ResourceMethodAnnotatedParameter> queryParamIterator = queryParams.iterator(); queryParamIterator
- .hasNext();) {
- ResourceMethodAnnotatedParameter queryParam = queryParamIterator.next();
- buffer.append(queryParam.getAnnotationValue()).append("={").append(queryParam.getParameterType()).append("}");
- if (queryParamIterator.hasNext()) {
- buffer.append("&");
- }
-
- }
-
- }
- return buffer.toString();
- }
-
- /**
- * @return the mediaTypeCapabilities
- */
- public final MediaTypeCapabilities getMediaTypeCapabilities() {
- return mediaTypeCapabilities;
- }
-
- /**
- * @return the httpMethod
- */
- public final HTTPMethod getHTTPMethod() {
- return httpMethod;
- }
-
- /**
- * {inheritDoc
- */
- @Override
- public final String toString() {
- StringBuffer buffer = new StringBuffer();
- if (httpMethod != null) {
- buffer.append(httpMethod.getHttpVerb());
- buffer.append(" ");
- }
- String uriPathTemplate = getFullUriPathTemplate();
- if (uriPathTemplate != null) {
- buffer.append(uriPathTemplate);
- buffer.append(" ");
- }
- buffer.append("{Accept:").append(mediaTypeCapabilities.getConsumedMimeTypes()).append(" Content-type: ")
- .append(mediaTypeCapabilities.getProducedMimeTypes()).append("}");
- return buffer.toString();
- }
-
- /**
- * @return the fullUriPathTemplate
- */
- public final String getFullUriPathTemplate() {
- return fullUriPathTemplate;
- }
-
- /**
- * @return the baseUriPathTemplate
- */
- public String getBaseUriPathTemplate() {
- return baseUriPathTemplate;
- }
-
- /**
- * Compares ResolvedURIMapping together. Comparison is first based on the
- * URI Path Template *excluding* the query params, then on the associated
- * HTTP Method for which a special order is used (GET first, etc.).
- */
- @Override
- public final int compareTo(final ResolvedUriMapping other) {
- int u = baseUriPathTemplate.compareTo(other.getBaseUriPathTemplate());
- if (u != 0) {
- return u;
- }
- int h = httpMethod.compareTo(other.getHTTPMethod());
- if (h != 0) {
- return h;
- }
- return mediaTypeCapabilities.compareTo(other.getMediaTypeCapabilities());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public final int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((httpMethod == null) ? 0 : httpMethod.hashCode());
- result = prime * result + ((fullUriPathTemplate == null) ? 0 : fullUriPathTemplate.hashCode());
- result = prime * result + ((mediaTypeCapabilities == null) ? 0 : mediaTypeCapabilities.hashCode());
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public final boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ResolvedUriMapping other = (ResolvedUriMapping) obj;
- if (httpMethod == null) {
- if (other.httpMethod != null) {
- return false;
- }
- } else if (!httpMethod.equals(other.httpMethod)) {
- return false;
- }
- if (mediaTypeCapabilities == null) {
- if (other.mediaTypeCapabilities != null) {
- return false;
- }
- } else if (!mediaTypeCapabilities.equals(other.mediaTypeCapabilities)) {
- return false;
- }
- if (fullUriPathTemplate == null) {
- if (other.fullUriPathTemplate != null) {
- return false;
- }
- } else if (!fullUriPathTemplate.equals(other.fullUriPathTemplate)) {
- return false;
- }
- return true;
- }
-
-}
Deleted: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/UriMapping.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/UriMapping.java 2011-06-07 22:25:07 UTC (rev 31892)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/metamodel/UriMapping.java 2011-06-07 22:27:12 UTC (rev 31893)
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xavier Coulon - Initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.ws.jaxrs.core.metamodel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IAnnotationBinding;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.ws.jaxrs.core.internal.builder.JAXRSAnnotationsScanner;
-import org.jboss.tools.ws.jaxrs.core.internal.builder.JaxrsMetamodelBuilder;
-import org.jboss.tools.ws.jaxrs.core.internal.utils.ValidationMessages;
-import org.jboss.tools.ws.jaxrs.core.utils.JdtUtils;
-import org.jboss.tools.ws.jaxrs.core.utils.ResourceMethodAnnotatedParameter;
-
-public class UriMapping {
-
- private final IMethod javaMethod;
-
- private HTTPMethod httpMethod = null;
-
- private final MediaTypeCapabilities mediaTypeCapabilities = new MediaTypeCapabilities();
-
- private String uriPathTemplateFragment = null;
-
- // private Map<String, String> matrixParams = null;
-
- private final List<ResourceMethodAnnotatedParameter> pathParams = new ArrayList<ResourceMethodAnnotatedParameter>();
-
- private final List<ResourceMethodAnnotatedParameter> queryParams = new ArrayList<ResourceMethodAnnotatedParameter>();
-
- private final Metamodel metamodel;
-
- /**
- * Internal 'Resource' element builder.
- *
- * @author xcoulon
- *
- */
- public static class Builder {
-
- private final IMethod javaMethod;
- private final Metamodel metamodel;
-
- /**
- * Mandatory attributes of the enclosing 'ResourceMethod' element.
- *
- * @param javaMethod
- * @param metamodel
- * @param parentResource
- */
- public Builder(final IMethod javaMethod, final Metamodel metamodel) {
- this.javaMethod = javaMethod;
- this.metamodel = metamodel;
- }
-
- /**
- * Builds and returns the elements. Internally calls the merge() method.
- *
- * @param progressMonitor
- * @return
- * @throws InvalidModelElementException
- * @throws CoreException
- */
- public UriMapping build(final CompilationUnit compilationUnit) throws InvalidModelElementException,
- CoreException {
- UriMapping resourceMethod = new UriMapping(this);
- resourceMethod.merge(compilationUnit);
- return resourceMethod;
- }
- }
-
- /**
- * Full constructor using the inner 'Builder' static class.
- *
- * @param builder
- */
- private UriMapping(Builder builder) {
- this.javaMethod = builder.javaMethod;
- this.metamodel = builder.metamodel;
- }
-
- /**
- * @param javaMethod
- * @param compilationUnit
- * @throws JavaModelException
- * @throws CoreException
- */
- public void merge(CompilationUnit compilationUnit) throws JavaModelException, CoreException {
- HTTPMethod httpMethod = null;
- for (String httpMethodName : metamodel.getHttpMethods().getTypeNames()) {
- IAnnotationBinding httpMethodAnnotationBinding = JdtUtils.resolveAnnotationBinding(javaMethod,
- compilationUnit, httpMethodName);
- if (httpMethodAnnotationBinding != null) {
- // String qualifiedName =
- // JdtUtils.resolveAnnotationFullyQualifiedName(httpMethodAnnotationBinding);
- // httpMethod =
- // metamodel.getHttpMethods().getByTypeName(qualifiedName);
- httpMethod = metamodel.getHttpMethods().getByTypeName(httpMethodName);
- // stop iterating
- break;
- }
- }
- // resource method
- String uriPathTemplateFragment = (String) JdtUtils.resolveAnnotationAttributeValue(javaMethod, compilationUnit,
- Path.class, "value");
- List<ResourceMethodAnnotatedParameter> pathParams = JdtUtils.resolveMethodParameters(javaMethod,
- compilationUnit, PathParam.class);
- List<ResourceMethodAnnotatedParameter> queryParams = JdtUtils.resolveMethodParameters(javaMethod,
- compilationUnit, QueryParam.class);
- setHTTPMethod(httpMethod);
- setUriPathTemplateFragment(uriPathTemplateFragment);
- setPathParams(pathParams);
- setQueryParams(queryParams);
- MediaTypeCapabilities mediaTypeCapabilities = new MediaTypeCapabilities(
- JAXRSAnnotationsScanner.resolveMediaTypeCapabilities(javaMethod, compilationUnit, Consumes.class),
- JAXRSAnnotationsScanner.resolveMediaTypeCapabilities(javaMethod, compilationUnit, Produces.class));
- setMediaTypeCapabilities(mediaTypeCapabilities);
- }
-
- /**
- * Validates the URI Mapping by checking that all
- * <code>javax.ws.rs.PathParam</code> annotation values match a parameter in
- * the URI Path Template fragment defined by the value of the
- * <code>java.ws.rs.Path</code> annotation value.
- *
- * @throws CoreException
- *
- */
- public void validate() throws CoreException {
- if (uriPathTemplateFragment != null) {
- List<String> uriTemplateParams = extractParamsFromUriTemplateFragment(uriPathTemplateFragment);
- for (ResourceMethodAnnotatedParameter pathParam : pathParams) {
- String param = pathParam.getAnnotationValue();
- if (!uriTemplateParams.contains(param)) {
- IMarker marker = this.javaMethod.getResource().createMarker(JaxrsMetamodelBuilder.JAXRS_PROBLEM);
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
- String message = NLS.bind(ValidationMessages.unbound_parameter, "'" + param + "'"); //$NON-NLS-1$
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.LINE_NUMBER, pathParam.getLineNumber());
- marker.setAttribute(IMarker.CHAR_START, pathParam.getCharStart());
- marker.setAttribute(IMarker.CHAR_END, pathParam.getCharEnd());
- }
- }
- }
- }
-
- private static List<String> extractParamsFromUriTemplateFragment(String fragment) {
- List<String> params = new ArrayList<String>();
- int beginIndex = -1;
- while ((beginIndex = fragment.indexOf("{", beginIndex + 1)) != -1) {
- int semicolonIndex = fragment.indexOf(":", beginIndex);
- int closingCurlyBraketIndex = fragment.indexOf("}", beginIndex);
- int endIndex = semicolonIndex != -1 ? semicolonIndex : closingCurlyBraketIndex;
- params.add(fragment.substring(beginIndex + 1, endIndex).trim());
- }
- return params;
- }
-
- /**
- * @return the mediaTypeCapabilities
- */
- public final MediaTypeCapabilities getMediaTypeCapabilities() {
- return mediaTypeCapabilities;
- }
-
- /**
- * @return the httpMethod
- */
- public final HTTPMethod getHTTPMethod() {
- return httpMethod;
- }
-
- /**
- * @param httpMethod
- * the httpMethod to set
- */
- public final void setHTTPMethod(final HTTPMethod httpMethod) {
- this.httpMethod = httpMethod;
- }
-
- /**
- * @return the uriPathTemplateFragment
- */
- public final String getUriPathTemplateFragment() {
- return uriPathTemplateFragment;
- }
-
- /**
- * @param uriPathTemplateFragment
- * the uriPathTemplateFragment to set
- */
- public final void setUriPathTemplateFragment(final String uriPathTemplateFragment) {
- this.uriPathTemplateFragment = uriPathTemplateFragment;
- }
-
- public boolean matches(HTTPMethod httpMethod, String uriPathTemplateFragment, String consumes, String produces) {
- if (httpMethod != null && !httpMethod.equals(this.httpMethod)) {
- return false;
- }
- if (this.httpMethod != null && !this.httpMethod.equals(httpMethod)) {
- return false;
- }
- if (uriPathTemplateFragment != null && !uriPathTemplateFragment.equals(this.uriPathTemplateFragment)) {
- return false;
- }
- if (this.uriPathTemplateFragment != null && !this.uriPathTemplateFragment.equals(uriPathTemplateFragment)) {
- return false;
- }
- if (consumes != null && !this.mediaTypeCapabilities.getConsumedMimeTypes().contains(consumes)) {
- return false;
- }
- if (produces != null && !this.mediaTypeCapabilities.getProducedMimeTypes().contains(produces)) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public final String toString() {
- StringBuffer buffer = new StringBuffer();
- if (httpMethod != null) {
- buffer.append(httpMethod.getHttpVerb());
- buffer.append(" ");
- }
- String uriPathTemplate = getUriPathTemplateFragment();
- if (uriPathTemplate != null) {
- buffer.append(uriPathTemplate);
- buffer.append(" ");
- }
- buffer.append("{Accept:").append(mediaTypeCapabilities.getConsumedMimeTypes()).append(" Content-type: ")
- .append(mediaTypeCapabilities.getProducedMimeTypes()).append("}");
- return buffer.toString();
- }
-
- /**
- * @return the queryParams
- */
- public final List<ResourceMethodAnnotatedParameter> getQueryParams() {
- return queryParams;
- }
-
- /**
- * @param queryParams
- * the queryParams to set
- */
- public final void setQueryParams(final List<ResourceMethodAnnotatedParameter> queryParams) {
- this.queryParams.clear();
- this.queryParams.addAll(queryParams);
- }
-
- /**
- * @return the pathParams
- */
- public final List<ResourceMethodAnnotatedParameter> getPathParams() {
- return pathParams;
- }
-
- /**
- * @param pathParams
- * the pathParams to set
- */
- public final void setPathParams(final List<ResourceMethodAnnotatedParameter> pathParams) {
- this.pathParams.clear();
- this.pathParams.addAll(pathParams);
- }
-
- public final void setMediaTypeCapabilities(final MediaTypeCapabilities mediaTypeCapabilities) {
- this.mediaTypeCapabilities.setConsumedMimeTypes(mediaTypeCapabilities.getConsumedMimeTypes());
- this.mediaTypeCapabilities.setProducedMimeTypes(mediaTypeCapabilities.getProducedMimeTypes());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public final int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((httpMethod == null) ? 0 : httpMethod.hashCode());
- result = prime * result + ((mediaTypeCapabilities == null) ? 0 : mediaTypeCapabilities.hashCode());
- result = prime * result + ((queryParams == null) ? 0 : queryParams.hashCode());
- result = prime * result + ((uriPathTemplateFragment == null) ? 0 : uriPathTemplateFragment.hashCode());
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public final boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- UriMapping other = (UriMapping) obj;
- if (httpMethod == null) {
- if (other.httpMethod != null) {
- return false;
- }
- } else if (!httpMethod.equals(other.httpMethod)) {
- return false;
- }
- if (mediaTypeCapabilities == null) {
- if (other.mediaTypeCapabilities != null) {
- return false;
- }
- } else if (!mediaTypeCapabilities.equals(other.mediaTypeCapabilities)) {
- return false;
- }
- if (queryParams == null) {
- if (other.queryParams != null) {
- return false;
- }
- } else if (!queryParams.equals(other.queryParams)) {
- return false;
- }
- if (uriPathTemplateFragment == null) {
- if (other.uriPathTemplateFragment != null) {
- return false;
- }
- } else if (!uriPathTemplateFragment.equals(other.uriPathTemplateFragment)) {
- return false;
- }
- return true;
- }
-
-}
14 years, 10 months