[JBoss JIRA] Created: (JBRULES-1329) RuleBase.removeRule() prevents other rules from being applied
by James Sparrow (JIRA)
RuleBase.removeRule() prevents other rules from being applied
-------------------------------------------------------------
Key: JBRULES-1329
URL: http://jira.jboss.com/jira/browse/JBRULES-1329
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.3
Environment: JDK 1.6.0
Reporter: James Sparrow
After adding a package containing two rules and then removing one of the rules, the remaining rule is no longer activated when a matching fact is asserted. Following is a unit test displaying this behavior, along with its .drl file.
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import junit.framework.TestCase;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.StatelessSession;
import org.drools.WorkingMemory;
import org.drools.compiler.PackageBuilder;
import org.drools.compiler.PackageBuilderConfiguration;
import org.drools.event.AfterActivationFiredEvent;
import org.drools.event.DefaultAgendaEventListener;
import org.drools.rule.Package;
import org.drools.rule.Rule;
public class DroolsRemoveRuleTest extends TestCase
{
/**
* Create a new RuleBase from a package containing two rules, "Hello" and
* "Goodbye". First verify both rules are applied as expected. Then remove
* the "Hello" rule and verify the "Hello" rule is no longer applied, but
* the "Goodbye" rule is applied. In Drools 4.0.3, the removal of the
* "Hello" rule causes the "Goodbye" rule to no longer be applied.
*/
public void testRemoveRule() throws Exception
{
Reader removeRuleSource = new InputStreamReader(getClass().getResourceAsStream("testRemoveRule.drl"));
Properties props = new Properties();
props.setProperty("drools.dialect.java.compiler", "JANINO");
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration(props);
PackageBuilder packageBuilder = new PackageBuilder(cfg);
packageBuilder.addPackageFromDrl(removeRuleSource);
assertFalse(packageBuilder.hasErrors());
Package pkg = packageBuilder.getPackage();
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
Message hello = new Message();
hello.setName("Chuck");
hello.setType(Type.HELLO);
Message goodbye = new Message();
goodbye.setName("Charles");
goodbye.setType(Type.GOODBYE);
StatelessSession session = ruleBase.newStatelessSession();
FiredRulesListener listener = new FiredRulesListener();
session.addEventListener(listener);
session.execute(hello);
assertEquals(1, listener.getFiredRules().size());
assertEquals("Hello", listener.getFiredRules().get(0).getName());
session = ruleBase.newStatelessSession();
listener = new FiredRulesListener();
session.addEventListener(listener);
session.execute(goodbye);
assertEquals(1, listener.getFiredRules().size());
assertEquals("Goodbye", listener.getFiredRules().get(0).getName());
ruleBase.removeRule(pkg.getName(), "Hello");
session = ruleBase.newStatelessSession();
listener = new FiredRulesListener();
session.addEventListener(listener);
session.execute(hello);
assertEquals(0, listener.getFiredRules().size());
session = ruleBase.newStatelessSession();
listener = new FiredRulesListener();
session.addEventListener(listener);
session.execute(goodbye);
// The following assertion currently fails
assertEquals(1, listener.getFiredRules().size());
assertEquals("Goodbye", listener.getFiredRules().get(0).getName());
}
public static class FiredRulesListener extends DefaultAgendaEventListener
{
List<Rule> firedRules = new ArrayList<Rule>();
public List<Rule> getFiredRules()
{
return this.firedRules;
}
@Override
public void afterActivationFired(AfterActivationFiredEvent event, WorkingMemory workingMemory)
{
Rule rule = event.getActivation().getRule();
this.firedRules.add(rule);
}
}
public static enum Type
{
HELLO, GOODBYE
};
public static class Message
{
private Type type = null;
private String name = null;
public Type getType()
{
return this.type;
}
public void setType(Type type)
{
this.type = type;
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
}
}
package test
import DroolsRemoveRuleTest.Message
import DroolsRemoveRuleTest.Type
rule "Hello"
dialect "java"
when
Message( type == Type.HELLO, name : name )
then
System.out.println("Hello " + name);
end
rule "Goodbye"
dialect "java"
when
Message( type == Type.GOODBYE, name : name )
then
System.out.println("Goodbye " + name);
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 5 months
[JBoss JIRA] Created: (JGRP-638) Look at IP multicasting and IPv6
by Bela Ban (JIRA)
Look at IP multicasting and IPv6
--------------------------------
Key: JGRP-638
URL: http://jira.jboss.com/jira/browse/JGRP-638
Project: JGroups
Issue Type: Task
Reporter: Bela Ban
Assigned To: Bela Ban
Priority: Minor
Fix For: 2.7
Attachments: SimpleMulticast.java
[Carlo DeWolf's email]
Bug 1:
Aha, in IPv6 mode the incorrect interface is chosen to send out packets.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4742177
So to actually get the right sender into the packet you must bind to the
address.
MultiSocket senderSocket = new MultiSocket(new
InetSocketAddress(sendFrom, 0));
Loopback must always be false. I'm not sure why, but if falls apart if
you set it to true. (Might be because of the above.)
senderSocket.setLoopback(false);
The receiving socket must be bound to INADDR_ANY (because of Windows):
receiverSocket = new MultiSocket(port);
Bug 2:
The receiver socket must join with an interface, because else the
packets sent from the sendSocket are immediately blocked by the
interface (not a member of the group).
receiverSocket.joinGroup(mcastaddr, netIf); // Note that port in
mcastaddr is ignored.
I think it's also possible to have the sendSocket join, but I'm done.
The effect here was that as long as nobody joins on the default
multicast interface, nobody receives packets. This would seldomly occur,
because there is always someone who joins the default interface.
I've attached by own multicast tester. Which works in every config
except on Windows with the counterfeit, doubtful, dubious, equivocal,
fake, false, fictitious, inaccurate, mythical, spurious,
unauthenticated, ungenuine, unsubstantiated, untrue, unverified, wrong
"MS TCP loopback" device.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 5 months
[JBoss JIRA] Created: (JBAS-5171) TxConnectionManager is track-connection-by-tx false by default
by Adrian Brock (JIRA)
TxConnectionManager is track-connection-by-tx false by default
--------------------------------------------------------------
Key: JBAS-5171
URL: http://jira.jboss.com/jira/browse/JBAS-5171
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JCA service
Affects Versions: JBossAS-5.0.0.Beta3
Reporter: Adrian Brock
Assigned To: Alexey Loubyansky
Fix For: JBossAS-5.0.0.Beta4
The TxConnectionManager is always configured to be track-connection-by-tx by default.
The old xslt used to do some complicated logic to try to determine the value
XA with track-connection-by-tx
<xsl:choose>
<xsl:when test="(xa-transaction) and (track-connection-by-tx)">
<attribute name="TrackConnectionByTx">true</attribute>
<attribute name="LocalTransactions">false</attribute>
</xsl:when>
XA with interleaving
<xsl:when test="(xa-transaction)">
<attribute name="TrackConnectionByTx">false</attribute>
<attribute name="LocalTransactions">false</attribute>
</xsl:when>
Non XA MUST BE track-connection-by-tx
<xsl:otherwise>
<attribute name="TrackConnectionByTx">true</attribute>
<attribute name="LocalTransactions">true</attribute>
</xsl:otherwise>
</xsl:choose>
The last part is not being done by the new connection factory deployer/metadata.
In fact, to simplify it (and answer some FAQs), I suggested that <track-connection-by-tx/> should be "dropped" and set to true all the time (with a warning about deprecation when somebody tries to use it).
Instead users of XA should explicity enable <interleaving/>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 5 months
[JBoss JIRA] Created: (JBAS-5191) Manage JBoss Web runtime lifecycle via a JMX service in deploy
by Brian Stansberry (JIRA)
Manage JBoss Web runtime lifecycle via a JMX service in deploy
--------------------------------------------------------------
Key: JBAS-5191
URL: http://jira.jboss.com/jira/browse/JBAS-5191
Project: JBoss Application Server
Issue Type: Task
Security Level: Public (Everyone can see)
Components: Web (Tomcat) service
Reporter: Brian Stansberry
Assigned To: Brian Stansberry
Fix For: JBossAS-5.0.0.Beta4
Temporary workaround to support controlling the lifecycle of the webserver runtime portion of TomcatDeployer via a JMX service in the deploy directory.
We want it in deploy so dependencies on services in deploy can be properly expressed. We want it as a JMX service so the ServiceBindingManager can
alter the connector ports.
Solution involves:
* Creating a wrapper mbean for the TomcatDeployer and deploying it via a deploy/jbossweb.sar/jboss-service.xml
* Encapsulating the code in TomcatDeployer that starts and stops the JBossWeb runtime in public start/stopWebserver methods.
* Disable calling those methods from TomcatDeployer.start/stop. Thus starting/stopping the deployer does not effect the runtime.
* Invoke the TomcatDeployer start/stopWebserver methods from the new wrapper mbean's startService/stopService.
A more long term solution involves:
* separating out the JBossWeb runtime aspects from TomcatDeployer and putting them in a separate class
* developing a ProfileService-based alternative to ServiceBindingManager so this doesn't need to be a JMX service
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 5 months