[teiid-commits] teiid SVN: r3191 - in branches/7.4.x: jboss-integration/src/main/java/org/teiid/jboss/deployers and 1 other directory.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Mon May 23 22:00:12 EDT 2011
Author: shawkins
Date: 2011-05-23 22:00:12 -0400 (Mon, 23 May 2011)
New Revision: 3191
Modified:
branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
Log:
TEIID-1592 changes to ensure that events are distributed correctly
Modified: branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java
===================================================================
--- branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java 2011-05-24 00:42:29 UTC (rev 3190)
+++ branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/events/jboss/JGroupsEventDistributor.java 2011-05-24 02:00:12 UTC (rev 3191)
@@ -117,7 +117,9 @@
}
channel = this.channelFactory.createMultiplexerChannel(this.multiplexerStack, "teiid-events"); //$NON-NLS-1$
channel.connect(this.clusterName);
-
+ if (channel.getView() != null) {
+ viewAccepted(channel.getView());
+ }
proxyEventDistributor = (EventDistributor) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new ProxyHandler());
//wrap the local in a proxy to prevent unintended methods from being called
rpcDispatcher = new RpcDispatcher(channel, this, this, Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
Modified: branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-05-24 00:42:29 UTC (rev 3190)
+++ branches/7.4.x/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2011-05-24 02:00:12 UTC (rev 3191)
@@ -22,6 +22,7 @@
package org.teiid.jboss.deployers;
import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -151,6 +152,7 @@
private String eventDistributorName;
private transient EventDistributor eventDistributor;
+ private transient EventDistributor eventDistributorProxy;
public RuntimeEngineDeployer() {
// TODO: this does not belong here
@@ -183,6 +185,18 @@
this.dqpCore.setMetadataRepository(this.vdbRepository.getMetadataRepository());
this.dqpCore.setEventDistributor(this.eventDistributor);
this.dqpCore.start(this);
+ this.eventDistributorProxy = (EventDistributor)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {EventDistributor.class}, new InvocationHandler() {
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ method.invoke(RuntimeEngineDeployer.this, args);
+ if (eventDistributor != null) {
+ method.invoke(eventDistributor, args);
+ }
+ return null;
+ }
+ });
// create the necessary services
createClientServices();
@@ -684,7 +698,7 @@
}
long ts = System.currentTimeMillis();
for (String name:objectNames) {
- Table table = s.getTables().get(name);
+ Table table = s.getTables().get(name.toUpperCase());
if (table == null) {
continue;
}
@@ -799,10 +813,7 @@
@Override
public EventDistributor getEventDistributor() {
- if (this.eventDistributor != null) {
- return eventDistributor;
- }
- return this;
+ return this.eventDistributorProxy;
}
}
More information about the teiid-commits
mailing list