Author: rareddy
Date: 2012-03-30 19:04:00 -0400 (Fri, 30 Mar 2012)
New Revision: 3959
Added:
trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java
trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
trunk/jboss-integration/src/test/resources/teiid-model-config.txt
trunk/jboss-integration/src/test/resources/teiid-model-json.txt
trunk/jboss-integration/src/test/resources/teiid-sample-config.xml
trunk/pom.xml
trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1981:Fixed the ADMIN API responses for the Domain mode. Also fixed issues related to
object Replication for result set cache and mat view distribution. Upgraded to 7.1.1
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-30 04:57:26 UTC
(rev 3958)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-30 23:04:00 UTC
(rev 3959)
@@ -62,10 +62,12 @@
import org.teiid.adminapi.impl.AdminObjectImpl;
import org.teiid.adminapi.impl.MetadataMapper;
import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.RequestMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.SessionMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.TransactionMetadataMapper;
+import org.teiid.adminapi.impl.VDBTranslatorMetaData;
import org.teiid.core.util.ObjectConverterUtil;
@@ -299,33 +301,43 @@
}
}
- public Set<String> getInstalledJDBCDrivers() throws AdminException {
+ public Set<String> getInstalledJDBCDrivers() throws AdminProcessingException {
HashSet<String> driverList = new HashSet<String>();
driverList.addAll(getChildNodeNames("datasources",
"jdbc-driver"));
- final ModelNode request = buildRequest("datasources",
"installed-drivers-list");
- try {
- ModelNode outcome = this.connection.execute(request);
- if (Util.isSuccess(outcome)) {
- List<String> drivers = getList(outcome, new AbstractMetadatMapper()
{
- @Override
- public String unwrap(ModelNode node) {
- if (node.hasDefined("driver-name")) {
- return node.get("driver-name").asString();
+ if (!this.domainMode) {
+ //'installed-driver-list' not available in the domain mode.
+ final ModelNode request = buildRequest("datasources",
"installed-drivers-list");
+ try {
+ ModelNode outcome = this.connection.execute(request);
+ if (Util.isSuccess(outcome)) {
+ List<String> drivers = getList(outcome, new AbstractMetadatMapper()
{
+ @Override
+ public String unwrap(ModelNode node) {
+ if (node.hasDefined("driver-name")) {
+ return node.get("driver-name").asString();
+ }
+ return null;
}
- return null;
- }
- });
- driverList.addAll(drivers);
- }
- } catch (Exception e) {
- // in domain mode this method does not exist; this is expected in some domain
mode.
- }
+ });
+ driverList.addAll(drivers);
+ }
+ } catch (Exception e) {
+ throw new AdminProcessingException(e);
+ }
+ }
+ else {
+ // TODO: AS7 needs to provide better way to query the deployed JDBC drivers
+ List<String> deployments = getChildNodeNames(null, "deployment");
+ for (String deployment:deployments) {
+ if (!deployment.contains("translator") &&
deployment.endsWith(".jar")) {
+ driverList.add(deployment);
+ }
+ }
+ }
return driverList;
}
-
-
public String getProfileName() throws AdminProcessingException {
if (!this.domainMode) {
return null;
@@ -620,7 +632,7 @@
@Override
public Collection<String> getCacheTypes() throws AdminException {
final ModelNode request = buildRequest("teiid",
"cache-types");//$NON-NLS-1$ //$NON-NLS-2$
- return executeList(request);
+ return new HashSet<String>(executeList(request));
}
private Collection<String> executeList(final ModelNode request) throws
AdminProcessingException {
@@ -1030,8 +1042,10 @@
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return
VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE.unwrap(result);
+ List<VDBTranslatorMetaData> list = getDomainAwareList(outcome,
VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE);
+ if (list != null && !list.isEmpty()) {
+ return list.get(0);
+ }
}
}
@@ -1143,10 +1157,10 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return VDBMetadataMapper.INSTANCE.unwrap(result);
- }
+ List<VDBMetaData> list = getDomainAwareList(outcome,
VDBMetadataMapper.INSTANCE);
+ if (list != null && !list.isEmpty()) {
+ return list.get(0);
+ }
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70035, e);
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -104,6 +104,8 @@
dataPoliciesNodes.add(DataPolicyMetadataMapper.INSTANCE.wrap((DataPolicyMetadata)policy,
new ModelNode()));
}
}
+
+ wrapDomain(vdb, node);
return node;
}
@@ -178,6 +180,7 @@
}
}
+ unwrapDomain(vdb, node);
return vdb;
}
@@ -516,6 +519,7 @@
propsNode.add(PropertyMetaDataMapper.INSTANCE.wrap(prop, new ModelNode()));
}
}
+ wrapDomain(translator, node);
return node;
}
@@ -546,6 +550,7 @@
}
}
}
+ unwrapDomain(translator, node);
return translator;
}
@@ -831,6 +836,7 @@
node.get(HITRATIO).set(object.getHitRatio());
node.get(REQUEST_COUNT).set(object.getRequestCount());
+ wrapDomain(object, node);
return node;
}
@@ -842,6 +848,8 @@
cache.setTotalEntries(node.get(TOTAL_ENTRIES).asInt());
cache.setHitRatio(node.get(HITRATIO).asDouble());
cache.setRequestCount(node.get(REQUEST_COUNT).asInt());
+
+ unwrapDomain(cache, node);
return cache;
}
@@ -884,6 +892,8 @@
}
node.get(STATE).set(request.getState().name());
node.get(THREAD_STATE).set(request.getThreadState().name());
+
+ wrapDomain(request, node);
return node;
}
@@ -905,6 +915,8 @@
}
request.setState(ProcessingState.valueOf(node.get(STATE).asString()));
request.setThreadState(ThreadState.valueOf(node.get(THREAD_STATE).asString()));
+
+ unwrapDomain(request, node);
return request;
}
@@ -959,6 +971,7 @@
if (session.getClientHardwareAddress() != null) {
node.get(CLIENT_HARDWARE_ADRESS).set(session.getClientHardwareAddress());
}
+ wrapDomain(session, node);
return node;
}
@@ -984,6 +997,7 @@
if (node.has(CLIENT_HARDWARE_ADRESS)) {
session.setClientHardwareAddress(node.get(CLIENT_HARDWARE_ADRESS).asString());
}
+ unwrapDomain(session, node);
return session;
}
@@ -1018,7 +1032,7 @@
transaction.get(CREATED_TIME).set(object.getCreatedTime());
transaction.get(SCOPE).set(object.getScope());
transaction.get(ID).set(object.getId());
-
+ wrapDomain(object, transaction);
return transaction;
}
@@ -1031,6 +1045,7 @@
transaction.setCreatedTime(node.get(CREATED_TIME).asLong());
transaction.setScope(node.get(SCOPE).asString());
transaction.setId(node.get(ID).asString());
+ unwrapDomain(transaction, node);
return transaction;
}
@@ -1067,7 +1082,7 @@
node.get(QUEUED).set(stats.getQueued());
node.get(HIGHEST_QUEUED).set(stats.getHighestQueued());
node.get(MAX_THREADS).set(stats.getMaxThreads());
-
+ wrapDomain(stats, node);
return node;
}
@@ -1083,7 +1098,8 @@
stats.setQueueName(node.get(QUEUE_NAME).asString());
stats.setQueued(node.get(QUEUED).asInt());
stats.setHighestQueued(node.get(HIGHEST_QUEUED).asInt());
- stats.setMaxThreads(node.get(MAX_THREADS).asInt());
+ stats.setMaxThreads(node.get(MAX_THREADS).asInt());
+ unwrapDomain(stats, node);
return stats;
}
@@ -1098,8 +1114,35 @@
addAttribute(node, MAX_THREADS,
ModelType.INT, true);
return node;
}
+ }
+
+ public static void wrapDomain(AdminObjectImpl anObj, ModelNode node) {
+ if (anObj.getServerGroup() != null) {
+ node.get(SERVER_GROUP).set(anObj.getServerGroup());
+ }
+ if (anObj.getHostName() != null) {
+ node.get(HOST_NAME).set(anObj.getHostName());
+ }
+ if (anObj.getServerName() != null) {
+ node.get(SERVER_NAME).set(anObj.getServerName());
+ }
+ }
+
+ public static void unwrapDomain(AdminObjectImpl anObj, ModelNode node) {
+ if (node.get(SERVER_GROUP).isDefined()) {
+ anObj.setServerGroup(node.get(SERVER_GROUP).asString());
+ }
+ if (node.get(HOST_NAME).isDefined()) {
+ anObj.setHostName(node.get(HOST_NAME).asString());
+ }
+ if (node.get(SERVER_NAME).isDefined()) {
+ anObj.setServerName(node.get(SERVER_NAME).asString());
+ }
}
+ private static final String SERVER_GROUP = "server-group"; //$NON-NLS-1$
+ private static final String HOST_NAME = "host-name"; //$NON-NLS-1$
+ private static final String SERVER_NAME = "server-name"; //$NON-NLS-1$
private static final String DOT_DESC = ".describe"; //$NON-NLS-1$
private static final String TYPE = "type"; //$NON-NLS-1$
private static final String REQUIRED = "required"; //$NON-NLS-1$
@@ -1111,6 +1154,7 @@
node.get(name, REQUIRED).set(required);
return node;
}
+
}
Modified: trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-30 23:04:00
UTC (rev 3959)
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
-<domain xmlns="urn:jboss:domain:1.1">
-
+<domain xmlns="urn:jboss:domain:1.2">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.clustering.jgroups"/>
@@ -34,12 +33,10 @@
<extension module="org.jboss.as.webservices"/>
<extension module="org.jboss.as.weld"/>
</extensions>
-
<system-properties>
<!-- IPv4 is not required, but setting this helps avoid unintended use of IPv6
-->
<property name="java.net.preferIPv4Stack"
value="true"/>
</system-properties>
-
<profiles>
<profile name="ha">
<subsystem xmlns="urn:jboss:domain:logging:1.1">
@@ -115,10 +112,6 @@
<stateful default-access-timeout="5000"
cache-ref="simple" clustered-cache-ref="clustered"/>
<singleton default-access-timeout="5000"/>
</session-bean>
- <mdb>
- <resource-adapter-ref
resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref
pool-name="mdb-strict-max-pool"/>
- </mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool"
max-pool-size="20" instance-acquisition-timeout="5"
instance-acquisition-timeout-unit="MINUTES"/>
@@ -146,7 +139,7 @@
</thread-pool>
</thread-pools>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1"
default-cache-container="cluster">
+ <subsystem xmlns="urn:jboss:domain:infinispan:1.2"
default-cache-container="cluster">
<cache-container name="cluster"
aliases="ha-partition" default-cache="default">
<transport lock-timeout="60000"/>
<replicated-cache name="default" mode="SYNC"
batching="true">
@@ -169,8 +162,10 @@
<eviction strategy="LRU"/>
<file-store/>
</replicated-cache>
- <!-- Clustered cache used internally by EJB subsytem for managing
the client-mapping(s) of
- the socketbinding referenced by the EJB remoting connector -->
+ <!--
+ ~ Clustered cache used internally by EJB subsytem for managing the
client-mapping(s) of
+ ~ the socketbinding referenced by the EJB remoting
connector
+ -->
<replicated-cache
name="remote-connector-client-mappings" mode="SYNC"
batching="true"/>
<distributed-cache name="dist" mode="ASYNC"
batching="true">
<eviction strategy="LRU"/>
@@ -194,12 +189,11 @@
<eviction strategy="NONE"/>
</replicated-cache>
</cache-container>
- <cache-container name="teiid"
default-cache="resultset">
+ <cache-container name="teiid-cache"
default-cache="resultset">
<transport lock-timeout="60000"/>
<replicated-cache name="resultset" mode="SYNC"
batching="true">
<locking isolation="READ_COMMITTED"/>
- <transaction mode="FULL_XA"/>
- <expiration lifespan="7200" />
+ <expiration lifespan="7200000" />
<eviction max-entries="1024"
strategy="LRU"/>
</replicated-cache>
</cache-container>
@@ -207,7 +201,7 @@
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true"
fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="false"/>
+ <bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
@@ -222,6 +216,7 @@
<keepalive-time time="10"
unit="seconds"/>
</long-running-threads>
</default-workmanager>
+ <cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jgroups:1.1"
default-stack="udp">
@@ -260,7 +255,7 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
- <remoting-connector/>
+ <!--<remoting-connector
use-management-endpoint="false"/>-->
</subsystem>
<subsystem xmlns="urn:jboss:domain:jpa:1.0">
<jpa default-datasource=""/>
@@ -271,7 +266,11 @@
</mail-session>
</subsystem>
<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
- <mod-cluster-config advertise-socket="modcluster"/>
+ <mod-cluster-config advertise-socket="modcluster">
+ <dynamic-load-provider>
+ <load-metric type="busyness"/>
+ </dynamic-load-provider>
+ </mod-cluster-config>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:1.1"/>
<subsystem xmlns="urn:jboss:domain:osgi:1.2"
activation="lazy">
@@ -333,8 +332,8 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:teiid:1.0">
<async-thread-pool>teiid-async</async-thread-pool>
- <distributed-cache jgroups-stack="udp"
channel="teiid-channel"/>
- <resultset-cache infinispan-container="teiid"/>
+ <distributed-cache jgroups-stack="udp"/>
+ <resultset-cache infinispan-container="teiid-cache"/>
<transport name="embedded"/>
<transport name="jdbc" protocol="teiid"
socket-binding="teiid-jdbc">
@@ -392,6 +391,7 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:web:1.1"
default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1"
scheme="http" socket-binding="http"/>
+ <connector name="ajp" protocol="AJP/1.3"
scheme="http" socket-binding="ajp"/>
<virtual-server name="default-host"
enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
@@ -410,34 +410,32 @@
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
</profile>
</profiles>
-
<!--
- Named interfaces that can be referenced elsewhere in the configuration. The
configuration
- for how to associate these logical names with an actual network interface can
either
- be specified here or can be declared on a per-host basis in the equivalent
element in host.xml.
-
- These default configurations require the binding specification to be done in
host.xml.
- -->
+ ~
+ ~ Named interfaces that can be referenced elsewhere in the configuration.
The configuration
+ ~ for how to associate these logical names with an actual network
interface can either
+ ~ be specified here or can be declared on a per-host basis in the
equivalent element in host.xml.
+ ~
+ ~ These default configurations require the binding specification to be
done in host.xml.
+ ~
+ -->
<interfaces>
<interface name="management"/>
<interface name="public"/>
<interface name="unsecure"/>
</interfaces>
-
<socket-binding-groups>
<socket-binding-group name="ha-sockets"
default-interface="public">
+ <!-- Needed for server groups using the 'ha' profile -->
+ <socket-binding name="ajp" port="8009"/>
<socket-binding name="http" port="8080"/>
<socket-binding name="https" port="8443"/>
- <socket-binding name="jacorb" interface="unsecure"
port="3528"/>
- <socket-binding name="jacorb-ssl" interface="unsecure"
port="3529"/>
<socket-binding name="jgroups-diagnostics" port="0"
multicast-address="224.0.75.75" multicast-port="7500"/>
<socket-binding name="jgroups-mping" port="0"
multicast-address="${jboss.default.multicast.address:230.0.0.4}"
multicast-port="45700"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd"
port="57600"/>
<socket-binding name="jgroups-udp" port="55200"
multicast-address="${jboss.default.multicast.address:230.0.0.4}"
multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd"
port="54200"/>
- <socket-binding name="messaging" port="5445"/>
- <socket-binding name="messaging-throughput"
port="5455"/>
<socket-binding name="modcluster" port="0"
multicast-address="224.0.1.105" multicast-port="23364"/>
<socket-binding name="osgi-http"
interface="management" port="8090"/>
<socket-binding name="remoting" port="4447"/>
@@ -450,7 +448,6 @@
</outbound-socket-binding>
</socket-binding-group>
</socket-binding-groups>
-
<server-groups>
<server-group name="main-server-group" profile="ha">
<jvm name="default">
@@ -459,5 +456,4 @@
<socket-binding-group ref="ha-sockets"/>
</server-group>
</server-groups>
-
-</domain>
+</domain>
\ No newline at end of file
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-03-30
23:04:00 UTC (rev 3959)
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
-<server xmlns="urn:jboss:domain:1.1">
-
+<server xmlns="urn:jboss:domain:1.2">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.configadmin"/>
@@ -28,7 +27,6 @@
<extension module="org.jboss.as.webservices"/>
<extension module="org.jboss.as.weld"/>
</extensions>
-
<management>
<security-realms>
<security-realm name="ManagementRealm">
@@ -51,7 +49,6 @@
</http-interface>
</management-interfaces>
</management>
-
<profile>
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE">
@@ -129,10 +126,6 @@
<stateful default-access-timeout="5000"
cache-ref="simple"/>
<singleton default-access-timeout="5000"/>
</session-bean>
- <mdb>
- <resource-adapter-ref
resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref
pool-name="mdb-strict-max-pool"/>
- </mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool"
max-pool-size="20" instance-acquisition-timeout="5"
instance-acquisition-timeout-unit="MINUTES"/>
@@ -158,7 +151,7 @@
</thread-pool>
</thread-pools>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1"
default-cache-container="hibernate">
+ <subsystem xmlns="urn:jboss:domain:infinispan:1.2"
default-cache-container="hibernate">
<cache-container name="hibernate"
default-cache="local-query">
<local-cache name="entity">
<transaction mode="NON_XA"/>
@@ -177,7 +170,7 @@
</cache-container>
<cache-container name="teiid"
default-cache="resultset">
<local-cache name="resultset">
- <expiration lifespan="7200" />
+ <expiration lifespan="7200000" />
<eviction max-entries="1024"
strategy="LRU"/>
</local-cache>
</cache-container>
@@ -185,7 +178,7 @@
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true"
fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="false"/>
+ <bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
@@ -200,6 +193,7 @@
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
+ <cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
@@ -350,7 +344,6 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
</profile>
-
<interfaces>
<interface name="management">
<inet-address
value="${jboss.bind.address.management:127.0.0.1}"/>
@@ -358,14 +351,22 @@
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
+ <!-- TODO - only show this if the jacorb subsystem is added -->
+ <interface name="unsecure">
+ <!--
+ ~ Used for IIOP sockets in the standard configuration.
+ ~ To secure JacORB you need to setup SSL
+ -->
+ <inet-address
value="${jboss.bind.address.unsecure:127.0.0.1}"/>
+ </interface>
</interfaces>
-
<socket-binding-group name="standard-sockets"
default-interface="public"
port-offset="${jboss.socket.binding.port-offset:0}">
- <socket-binding name="http" port="8080"/>
- <socket-binding name="https" port="8443"/>
<socket-binding name="management-native"
interface="management"
port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http"
interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https"
interface="management"
port="${jboss.management.https.port:9443}"/>
+ <socket-binding name="ajp" port="8009"/>
+ <socket-binding name="http" port="8080"/>
+ <socket-binding name="https" port="8443"/>
<socket-binding name="osgi-http" interface="management"
port="8090"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment"
port="4712"/>
@@ -376,4 +377,4 @@
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
-</server>
+</server>
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -65,7 +65,6 @@
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.dqp.service.TransactionService;
@@ -676,8 +675,8 @@
LogManager.logDetail(LogConstants.CTX_DQP, "DQPCore started
maxThreads", this.config.getMaxThreads(), "maxActivePlans",
this.maxActivePlans, "source concurrency", this.userRequestSourceConcurrency);
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- public void setBufferService(BufferService service) {
- this.bufferManager = service.getBufferManager();
+ public void setBufferManager(BufferManager mgr) {
+ this.bufferManager = mgr;
}
public void setTransactionService(TransactionService service) {
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -21,7 +21,9 @@
*/
package org.teiid.dqp.internal.process;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
@@ -30,12 +32,11 @@
import org.teiid.cache.Cache;
import org.teiid.cache.DefaultCache;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBuffer;
-import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.UnitTestUtil;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.FakeBufferService;
import org.teiid.metadata.Table;
import org.teiid.query.processor.FakeProcessorPlan;
@@ -50,7 +51,7 @@
@Test
public void testCaching() throws Exception {
- BufferService fbs = new FakeBufferService(true);
+ FakeBufferService fbs = new FakeBufferService(true);
ElementSymbol x = new ElementSymbol("x"); //$NON-NLS-1$
x.setType(DataTypeManager.DefaultDataClasses.INTEGER);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -116,9 +116,9 @@
Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
BufferManagerImpl bm = BufferManagerFactory.createBufferManager();
bm.setInlineLobs(false);
- BufferService bs = new FakeBufferService(bm, bm);
+ FakeBufferService bs = new FakeBufferService(bm, bm);
core = new DQPCore();
- core.setBufferService(bs);
+ core.setBufferManager(bs.getBufferManager());
core.setResultsetCache(new SessionAwareCache<CachedResults>(new
DefaultCacheFactory(), SessionAwareCache.Type.RESULTSET, new CacheConfiguration()));
core.setPreparedPlanCache(new SessionAwareCache<PreparedPlan>(new
DefaultCacheFactory(), SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration()));
core.setTransactionService(new FakeTransactionService());
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -85,7 +85,7 @@
rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
- rm.setBufferService(new FakeBufferService());
+ rm.setBufferManager(new FakeBufferService().getBufferManager());
rm.setResultsetCache(new SessionAwareCache<CachedResults>(new
DefaultCacheFactory(), SessionAwareCache.Type.RESULTSET, new CacheConfiguration()));
rm.setPreparedPlanCache(new SessionAwareCache<PreparedPlan>(new
DefaultCacheFactory(), SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration()));
rm.start(new DQPConfiguration());
Modified: trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -31,50 +31,48 @@
/**
* Implementation of Cache using Infinispan
*/
-public class JBossCache<K, V> implements Cache<String, V> {
+public class JBossCache<K, V> implements Cache<K, V> {
- protected org.infinispan.Cache<String, V> cacheStore;
+ protected org.infinispan.AdvancedCache<K, V> cacheStore;
private final String name;
+ private ClassLoader classloader;
- public JBossCache(org.infinispan.Cache<String, V> cacheStore, String cacheName) {
- this.cacheStore = cacheStore;
+ public JBossCache(org.infinispan.Cache<K, V> cacheStore, String cacheName,
ClassLoader classloader) {
+ this.cacheStore = cacheStore.getAdvancedCache();
this.name = cacheName;
+ this.classloader = classloader;
}
- private String fqn(String key) {
- return this.name+"."+key; //$NON-NLS-1$
- }
-
@Override
- public V get(String key) {
- return this.cacheStore.get(fqn(key));
+ public V get(K key) {
+ return this.cacheStore.with(this.classloader).get(key);
}
- public V put(String key, V value) {
- return this.cacheStore.put(fqn(key), value);
+ public V put(K key, V value) {
+ return this.cacheStore.with(this.classloader).put(key, value);
}
@Override
- public V put(String key, V value, Long ttl) {
+ public V put(K key, V value, Long ttl) {
if (ttl != null) {
- return this.cacheStore.put(fqn(key), value, ttl, TimeUnit.MILLISECONDS);
+ return this.cacheStore.with(this.classloader).put(key, value, ttl,
TimeUnit.MILLISECONDS);
}
- return this.cacheStore.put(fqn(key), value);
+ return this.cacheStore.with(this.classloader).put(key, value);
}
@Override
- public V remove(String key) {
- return this.cacheStore.remove(fqn(key));
+ public V remove(K key) {
+ return this.cacheStore.with(this.classloader).remove(key);
}
@Override
public int size() {
- return this.cacheStore.size();
+ return this.cacheStore.with(this.classloader).size();
}
@Override
public void clear() {
- this.cacheStore.clear();
+ this.cacheStore.with(this.classloader).clear();
}
@Override
@@ -83,7 +81,7 @@
}
@Override
- public Set<String> keys() {
- return this.cacheStore.keySet();
+ public Set<K> keys() {
+ return this.cacheStore.with(this.classloader).keySet();
}
}
Modified:
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -36,15 +36,17 @@
private static final long serialVersionUID = -2767452034178675653L;
private transient org.infinispan.Cache cacheStore;
private volatile boolean destroyed = false;
+ private ClassLoader classLoader;
- public JBossCacheFactory(String name, CacheContainer cm) {
+ public JBossCacheFactory(String name, CacheContainer cm, ClassLoader classLoader) {
if (name != null) {
this.cacheStore = cm.getCache(name);
}
else {
this.cacheStore = cm.getCache();
}
+ this.classLoader = classLoader;
}
/**
@@ -52,7 +54,7 @@
*/
public Cache get(String location, CacheConfiguration config) {
if (!destroyed) {
- return new JBossCache(this.cacheStore, config.getLocation());
+ return new JBossCache(this.cacheStore, config.getLocation(), this.classLoader);
}
throw new TeiidRuntimeException(IntegrationPlugin.Event.TEIID50066,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50066));
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -57,7 +57,7 @@
}
public void execute(OperationContext context, ModelNode operation) throws
OperationFailedException {
- if (context.getType() == OperationContext.Type.SERVER) {
+ if (context.isNormalServer()) {
context.addStep(new OperationStepHandler() {
public void execute(OperationContext context, ModelNode operation) throws
OperationFailedException {
@@ -69,12 +69,9 @@
context.completeStep();
}
- }, OperationContext.Stage.RUNTIME);
+ }, OperationContext.Stage.RUNTIME);
}
- else {
- context.getResult().set("no metrics available"); //$NON-NLS-1$
- }
- context.completeStep();
+ context.completeStep();
}
@SuppressWarnings("unused")
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -27,60 +27,28 @@
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.TupleBufferCache;
-import org.teiid.dqp.service.BufferService;
-import org.teiid.query.ObjectReplicator;
import org.teiid.services.BufferServiceImpl;
-class BufferManagerService implements Service<BufferService>, BufferService {
-
- private BufferServiceImpl bufferService;
+class BufferManagerService extends BufferServiceImpl implements
Service<BufferManager> {
+ private static final long serialVersionUID = -6797455072198476318L;
+
public final InjectedValue<String> pathInjector = new
InjectedValue<String>();
- public final InjectedValue<ObjectReplicator> replicatorInjector = new
InjectedValue<ObjectReplicator>();
- private BufferManager manager;
- private TupleBufferCache tupleBufferCache;
- public BufferManagerService(BufferServiceImpl buffer) {
- this.bufferService = buffer;
- }
-
@Override
public void start(StartContext context) throws StartException {
- bufferService.setDiskDirectory(pathInjector.getValue());
- bufferService.start();
- manager = bufferService.getBufferManager();
- tupleBufferCache = manager;
- if (replicatorInjector.getValue() != null) {
- try {
- //use a mux name that will not conflict with any vdb
- tupleBufferCache = this.replicatorInjector.getValue().replicate("$BM$",
TupleBufferCache.class, this.manager, 0); //$NON-NLS-1$
- } catch (Exception e) {
- throw new StartException(e);
- }
- }
+ setDiskDirectory(pathInjector.getValue());
+ start();
+
}
@Override
public void stop(StopContext context) {
- bufferService.stop();
- if (this.replicatorInjector.getValue() != null) {
- this.replicatorInjector.getValue().stop(bufferService);
- }
+ stop();
}
@Override
- public BufferManager getBufferManager() {
- return manager;
+ public BufferManager getValue() throws IllegalStateException,IllegalArgumentException {
+ return getBufferManager();
}
-
- @Override
- public TupleBufferCache getTupleBufferCache() {
- return tupleBufferCache;
- }
- @Override
- public BufferService getValue() throws IllegalStateException,IllegalArgumentException {
- return this.bufferService;
- }
-
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -22,6 +22,7 @@
package org.teiid.jboss;
import org.infinispan.manager.CacheContainer;
+import org.jboss.modules.Module;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -44,7 +45,7 @@
public void start(StartContext context) throws StartException {
CacheContainer cc = cacheContainerInjector.getValue();
if (cc != null) {
- this.cacheFactory = new JBossCacheFactory(this.cacheName, cc);
+ this.cacheFactory = new JBossCacheFactory(this.cacheName, cc,
Module.getCallerModule().getClassLoader());
}
else {
this.cacheFactory = new DefaultCacheFactory();
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -28,13 +28,13 @@
import org.jboss.msc.value.InjectedValue;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
+import org.teiid.common.buffer.TupleBufferCache;
import org.teiid.dqp.internal.process.SessionAwareCache;
-import org.teiid.dqp.service.BufferService;
class CacheService<T> implements Service<SessionAwareCache<T>> {
private SessionAwareCache<T> cache;
- protected InjectedValue<BufferService> bufferMgrInjector = new
InjectedValue<BufferService>();
+ protected InjectedValue<TupleBufferCache> tupleBufferCacheInjector = new
InjectedValue<TupleBufferCache>();
protected InjectedValue<CacheFactory> cacheFactoryInjector = new
InjectedValue<CacheFactory>();
private SessionAwareCache.Type type;
@@ -48,7 +48,7 @@
@Override
public void start(StartContext context) throws StartException {
this.cache = new SessionAwareCache<T>(cacheFactoryInjector.getValue(), this.type,
this.config);
- this.cache.setTupleBufferCache(this.bufferMgrInjector.getValue().getTupleBufferCache());
+ this.cache.setTupleBufferCache(this.tupleBufferCacheInjector.getValue());
}
@Override
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -39,6 +39,7 @@
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
import org.teiid.deployers.CompositeVDB;
@@ -50,13 +51,11 @@
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.TransactionServerImpl;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionService;
import org.teiid.events.EventDistributorFactory;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.vdb.runtime.VDBKey;
@@ -69,7 +68,7 @@
private final InjectedValue<WorkManager> workManagerInjector = new
InjectedValue<WorkManager>();
private final InjectedValue<XATerminator> xaTerminatorInjector = new
InjectedValue<XATerminator>();
private final InjectedValue<TransactionManager> txnManagerInjector = new
InjectedValue<TransactionManager>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new
InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new
InjectedValue<BufferManager>();
private final InjectedValue<TranslatorRepository> translatorRepositoryInjector =
new InjectedValue<TranslatorRepository>();
private final InjectedValue<VDBRepository> vdbRepositoryInjector = new
InjectedValue<VDBRepository>();
private final InjectedValue<AuthorizationValidator> authorizationValidatorInjector
= new InjectedValue<AuthorizationValidator>();
@@ -84,7 +83,7 @@
this.transactionServerImpl.setTransactionManager(getTxnManagerInjector().getValue());
setAuthorizationValidator(authorizationValidatorInjector.getValue());
- setBufferService(bufferServiceInjector.getValue());
+ this.dqpCore.setBufferManager(bufferManagerInjector.getValue());
this.dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG,
transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL,
Thread.currentThread().getContextClassLoader()));
this.dqpCore.setEventDistributor(getEventDistributorFactoryInjector().getValue().getEventDistributor());
@@ -158,10 +157,6 @@
LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50002, new
Date(System.currentTimeMillis()).toString()));
}
- public void setBufferService(BufferService service) {
- this.dqpCore.setBufferService(service);
- }
-
public InjectedValue<SessionAwareCache> getResultSetCacheInjector() {
return resultSetCacheInjector;
}
@@ -186,8 +181,8 @@
return authorizationValidatorInjector;
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
public InjectedValue<TransactionManager> getTxnManagerInjector() {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java 2012-03-30 23:04:00
UTC (rev 3959)
@@ -84,7 +84,6 @@
// Object Replicator
DISTRIBUTED_CACHE("distributed-cache"),
DC_STACK_ATTRIBUTE("jgroups-stack",
"distributed-cache-jgroups-stack", ModelType.STRING, false, null),
- DC_CHANNEL_NAME_ATTRIBUTE("channel", "distributed-cache-channel",
ModelType.STRING, false, null),
// Result set cache
RESULTSET_CACHE_ELEMENT("resultset-cache"),
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -37,9 +37,8 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.ObjectReplicator;
-import org.teiid.transport.LocalServerConnection;
-public class EventDistributorFactoryService implements
Service<EventDistributorFactory>, EventDistributorFactory {
+public class EventDistributorFactoryService implements
Service<EventDistributorFactory> {
InjectedValue<ObjectReplicator> objectReplicatorInjector = new
InjectedValue<ObjectReplicator>();
InjectedValue<VDBRepository> vdbRepositoryInjector = new
InjectedValue<VDBRepository>();
@@ -51,7 +50,7 @@
return new EventDistributorFactory() {
@Override
public EventDistributor getEventDistributor() {
- return replicatableEventDistributor;
+ return eventDistributorProxy;
}
};
}
@@ -68,7 +67,7 @@
// this instance is by use of teiid internally; only invokes the remote instances
if (objectReplicatorInjector.getValue() != null) {
try {
- this.replicatableEventDistributor =
objectReplicatorInjector.getValue().replicate(LocalServerConnection.TEIID_RUNTIME_CONTEXT,
EventDistributor.class, ed, 0);
+ this.replicatableEventDistributor =
objectReplicatorInjector.getValue().replicate("$TEIID_ED$",
EventDistributor.class, ed, 0); //$NON-NLS-1$
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50004, this));
}
@@ -99,9 +98,4 @@
this.replicatableEventDistributor = null;
}
}
-
- @Override
- public org.teiid.events.EventDistributor getEventDistributor() {
- return eventDistributorProxy;
- }
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -35,7 +35,6 @@
import org.jboss.security.SimplePrincipal;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.runtime.RuntimePlugin;
import org.teiid.security.Credentials;
import org.teiid.services.SessionServiceImpl;
import org.teiid.services.TeiidLoginContext;
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -34,11 +34,6 @@
public final InjectedValue<ChannelFactory> channelFactoryInjector = new
InjectedValue<ChannelFactory>();
private JGroupsObjectReplicator replicator;
- /**
- * @param clusterName TODO see if this is still useful
- */
- public JGroupsObjectReplicatorService(String clusterName){
- }
@Override
public void start(StartContext context) throws StartException {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -44,6 +44,7 @@
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.services.path.RelativePathService;
import org.jboss.as.naming.ManagedReferenceFactory;
import org.jboss.as.naming.ServiceBasedNamingStore;
import org.jboss.as.naming.deployment.ContextNames;
@@ -51,7 +52,6 @@
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.server.deployment.Phase;
-import org.jboss.as.server.services.path.RelativePathService;
import org.jboss.dmr.ModelNode;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
@@ -68,6 +68,8 @@
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.cache.CacheFactory;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBufferCache;
import org.teiid.deployers.SystemVDBDeployer;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -79,14 +81,12 @@
import org.teiid.dqp.internal.process.DefaultAuthorizationValidator;
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
-import org.teiid.dqp.service.BufferService;
import org.teiid.events.EventDistributorFactory;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.ObjectReplicator;
import org.teiid.query.function.SystemFunctionManager;
import org.teiid.replication.jboss.JGroupsObjectReplicator;
-import org.teiid.services.BufferServiceImpl;
class TeiidAdd extends AbstractAddStepHandler implements DescriptionProvider {
@@ -110,7 +110,6 @@
// object replicator
Element.DC_STACK_ATTRIBUTE,
- Element.DC_CHANNEL_NAME_ATTRIBUTE,
// Buffer Service
Element.USE_DISK_ATTRIBUTE,
@@ -250,13 +249,8 @@
if (Element.DC_STACK_ATTRIBUTE.isDefined(operation)) {
String stack = Element.DC_STACK_ATTRIBUTE.asString(operation);
- String clusterName = "teiid-rep"; //$NON-NLS-1$
- if (Element.DC_CHANNEL_NAME_ATTRIBUTE.isDefined(operation)) {
- clusterName = Element.DC_CHANNEL_NAME_ATTRIBUTE.asString(operation);
- }
-
replicatorAvailable = true;
- JGroupsObjectReplicatorService replicatorService = new
JGroupsObjectReplicatorService(clusterName);
+ JGroupsObjectReplicatorService replicatorService = new
JGroupsObjectReplicatorService();
ServiceBuilder<JGroupsObjectReplicator> serviceBuilder =
target.addService(TeiidServiceNames.OBJECT_REPLICATOR, replicatorService);
serviceBuilder.addDependency(ServiceName.JBOSS.append("jgroups",
"stack", stack), ChannelFactory.class,
replicatorService.channelFactoryInjector); //$NON-NLS-1$ //$NON-NLS-2$
newControllers.add(serviceBuilder.install());
@@ -264,12 +258,18 @@
// TODO: remove verbose service by moving the buffer service from runtime project
newControllers.add(RelativePathService.addService(TeiidServiceNames.BUFFER_DIR,
"teiid-buffer", "jboss.server.temp.dir", target)); //$NON-NLS-1$
//$NON-NLS-2$
- BufferManagerService bufferService = new
BufferManagerService(buildBufferManager(operation));
- ServiceBuilder<BufferService> bufferServiceBuilder =
target.addService(TeiidServiceNames.BUFFER_MGR, bufferService);
+ BufferManagerService bufferService = buildBufferManager(operation);
+ ServiceBuilder<BufferManager> bufferServiceBuilder =
target.addService(TeiidServiceNames.BUFFER_MGR, bufferService);
bufferServiceBuilder.addDependency(TeiidServiceNames.BUFFER_DIR, String.class,
bufferService.pathInjector);
-
bufferServiceBuilder.addDependency(replicatorAvailable?DependencyType.REQUIRED:DependencyType.OPTIONAL,
TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class,
bufferService.replicatorInjector);
newControllers.add(bufferServiceBuilder.install());
+ TupleBufferCacheService tupleBufferService = new TupleBufferCacheService();
+ ServiceBuilder<TupleBufferCache> tupleBufferBuilder =
target.addService(TeiidServiceNames.TUPLE_BUFFER, tupleBufferService);
+ tupleBufferBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class,
tupleBufferService.bufferMgrInjector);
+
tupleBufferBuilder.addDependency(replicatorAvailable?DependencyType.REQUIRED:DependencyType.OPTIONAL,
TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class,
tupleBufferService.replicatorInjector);
+ newControllers.add(tupleBufferBuilder.install());
+
+
EventDistributorFactoryService edfs = new EventDistributorFactoryService();
ServiceBuilder<EventDistributorFactory> edfsServiceBuilder =
target.addService(TeiidServiceNames.EVENT_DISTRIBUTOR_FACTORY, edfs);
edfsServiceBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class,
edfs.vdbRepositoryInjector);
@@ -336,7 +336,7 @@
CacheService<CachedResults> resultSetService = new
CacheService<CachedResults>(SessionAwareCache.Type.RESULTSET,
buildCacheConfig(operation));
ServiceBuilder<SessionAwareCache<CachedResults>> resultsCacheBuilder =
target.addService(TeiidServiceNames.CACHE_RESULTSET, resultSetService);
- resultsCacheBuilder.addDependency(TeiidServiceNames.BUFFER_MGR,
BufferService.class, resultSetService.bufferMgrInjector);
+ resultsCacheBuilder.addDependency(TeiidServiceNames.TUPLE_BUFFER,
TupleBufferCache.class, resultSetService.tupleBufferCacheInjector);
resultsCacheBuilder.addDependency(cfName, CacheFactory.class,
resultSetService.cacheFactoryInjector);
newControllers.add(resultsCacheBuilder.install());
}
@@ -345,7 +345,7 @@
// prepared plan cache, as it is always local)
CacheService<PreparedPlan> preparedPlanService = new
PreparedPlanCacheService(SessionAwareCache.Type.PREPAREDPLAN,
buildPreparedPlanCacheConfig(operation));
ServiceBuilder<SessionAwareCache<PreparedPlan>> preparedPlanCacheBuilder
= target.addService(TeiidServiceNames.CACHE_PREPAREDPLAN, preparedPlanService);
- preparedPlanCacheBuilder.addDependency(TeiidServiceNames.BUFFER_MGR,
BufferService.class, preparedPlanService.bufferMgrInjector);
+ preparedPlanCacheBuilder.addDependency(TeiidServiceNames.TUPLE_BUFFER,
TupleBufferCache.class, preparedPlanService.tupleBufferCacheInjector);
newControllers.add(preparedPlanCacheBuilder.install());
// Query Engine
@@ -359,7 +359,7 @@
engineBuilder.addDependency(ServiceName.JBOSS.append("connector",
"workmanager", workManager), WorkManager.class,
engine.getWorkManagerInjector()); //$NON-NLS-1$ //$NON-NLS-2$
engineBuilder.addDependency(ServiceName.JBOSS.append("txn",
"XATerminator"), XATerminator.class, engine.getXaTerminatorInjector());
//$NON-NLS-1$ //$NON-NLS-2$
engineBuilder.addDependency(ServiceName.JBOSS.append("txn",
"TransactionManager"), TransactionManager.class,
engine.getTxnManagerInjector()); //$NON-NLS-1$ //$NON-NLS-2$
- engineBuilder.addDependency(TeiidServiceNames.BUFFER_MGR,
BufferServiceImpl.class, engine.getBufferServiceInjector());
+ engineBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class,
engine.getBufferManagerInjector());
engineBuilder.addDependency(TeiidServiceNames.SYSTEM_VDB,
SystemVDBDeployer.class, new InjectedValue<SystemVDBDeployer>());
engineBuilder.addDependency(TeiidServiceNames.TRANSLATOR_REPO,
TranslatorRepository.class, engine.getTranslatorRepositoryInjector());
engineBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class,
engine.getVdbRepositoryInjector());
@@ -421,15 +421,15 @@
moduleId = ModuleIdentifier.create(moduleName);
module = Module.getCallerModuleLoader().loadModule(moduleId);
} catch (ModuleLoadException e) {
- throw new OperationFailedException(e, new
ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069,
moduleName))); //$NON-NLS-1$
+ throw new OperationFailedException(e, new
ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069,
moduleName)));
}
ServiceLoader<T> services = module.loadService(type);
return services.iterator().next();
}
- private BufferServiceImpl buildBufferManager(ModelNode node) {
- BufferServiceImpl bufferManger = new BufferServiceImpl();
+ private BufferManagerService buildBufferManager(ModelNode node) {
+ BufferManagerService bufferManger = new BufferManagerService();
if (node == null) {
return bufferManger;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -49,6 +49,9 @@
private static final String RUNTIME_VERSION = "runtime-version";
//$NON-NLS-1$
public static final String TEIID_SUBSYSTEM = "teiid"; //$NON-NLS-1$
+ public static final int MAJOR_VERSION = 1;
+ public static final int MINOR_VERSION = 0;
+
private static TeiidSubsystemParser parser = new TeiidSubsystemParser();
private static TransportAdd TRANSPORT_ADD = new TransportAdd();
private static TransportRemove TRANSPORT_REMOVE = new TransportRemove();
@@ -59,7 +62,7 @@
@Override
public void initialize(ExtensionContext context) {
- final SubsystemRegistration registration = context.registerSubsystem(TEIID_SUBSYSTEM);
+ final SubsystemRegistration registration = context.registerSubsystem(TEIID_SUBSYSTEM,
MAJOR_VERSION, MINOR_VERSION);
LogManager.setLogListener(new JBossLogger());
@@ -150,6 +153,6 @@
@Override
public void initializeParsers(ExtensionParsingContext context) {
- context.setSubsystemXmlMapping(Namespace.CURRENT.getUri(), parser);
+ context.setSubsystemXmlMapping(TEIID_SUBSYSTEM, Namespace.CURRENT.getUri(), parser);
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -33,6 +33,7 @@
public static ServiceName BUFFER_DIR = ServiceName.JBOSS.append("teiid",
"buffer.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName DATA_DIR = ServiceName.JBOSS.append("teiid",
"data.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName BUFFER_MGR = ServiceName.JBOSS.append("teiid",
"buffer-mgr");//$NON-NLS-1$ //$NON-NLS-2$
+ public static ServiceName TUPLE_BUFFER = ServiceName.JBOSS.append("teiid",
"tuple_buffer");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName SYSTEM_VDB = ServiceName.JBOSS.append("teiid",
"system.vdb");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName AUTHORIZATION_VALIDATOR =
ServiceName.JBOSS.append("teiid",
"authorization-validator");//$NON-NLS-1$ //$NON-NLS-2$
private static ServiceName VDB_SVC_BASE = ServiceName.JBOSS.append("teiid",
"vdb"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -124,7 +124,6 @@
private void writeObjectReplicatorConfiguration(XMLExtendedStreamWriter writer,
ModelNode node) throws XMLStreamException {
writeAttribute(writer, Element.DC_STACK_ATTRIBUTE, node);
- writeAttribute(writer, Element.DC_CHANNEL_NAME_ATTRIBUTE, node);
}
private void writeTranslator(XMLExtendedStreamWriter writer, ModelNode node, String
translatorName) throws XMLStreamException {
@@ -374,9 +373,6 @@
case DC_STACK_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
- case DC_CHANNEL_NAME_ATTRIBUTE:
- node.get(element.getModelName()).set(attrValue);
- break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -129,7 +129,7 @@
}
if (!added) {
- throw new OperationFailedException(new
ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50009,
translatorName, moduleName))); //$NON-NLS-1$
+ throw new OperationFailedException(new
ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50009,
translatorName, moduleName)));
}
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -21,7 +21,11 @@
*/
package org.teiid.jboss;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION;
+import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_NAME;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
+import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUEST_PROPERTIES;
import java.util.Arrays;
import java.util.Collections;
@@ -50,12 +54,12 @@
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.net.socket.AuthenticationType;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.LocalServerConnection;
import org.teiid.transport.SSLConfiguration;
@@ -176,7 +180,7 @@
if (socketBinding != null) {
transportBuilder.addDependency(ServiceName.JBOSS.append("binding",
socketBinding), SocketBinding.class, transport.getSocketBindingInjector()); //$NON-NLS-1$
}
- transportBuilder.addDependency(TeiidServiceNames.BUFFER_MGR,
BufferServiceImpl.class, transport.getBufferServiceInjector());
+ transportBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class,
transport.getBufferManagerInjector());
transportBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class,
transport.getVdbRepositoryInjector());
transportBuilder.addDependency(TeiidServiceNames.ENGINE, DQPCore.class,
transport.getDqpInjector());
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -46,6 +46,7 @@
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.process.DQPCore;
@@ -56,7 +57,6 @@
import org.teiid.logging.MessageLevel;
import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.SecurityHelper;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.services.SessionServiceImpl;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -86,7 +86,7 @@
private final InjectedValue<SocketBinding> socketBindingInjector = new
InjectedValue<SocketBinding>();
private final InjectedValue<VDBRepository> vdbRepositoryInjector = new
InjectedValue<VDBRepository>();
private final InjectedValue<DQPCore> dqpInjector = new
InjectedValue<DQPCore>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new
InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new
InjectedValue<BufferManager>();
@Override
public <T> T getClientService(Class<T> iface) throws
ComponentNotFoundException {
@@ -131,12 +131,12 @@
sslEnabled = this.socketConfig.getSSLConfiguration().isSslEnabled();
}
if (protocol == Protocol.teiid) {
- this.socketListener = new SocketListener(address, this.socketConfig, this.csr,
getBufferServiceInjector().getValue().getBufferManager());
+ this.socketListener = new SocketListener(address, this.socketConfig, this.csr,
getBufferManagerInjector().getValue());
LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50012, address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
else if (protocol == Protocol.pg) {
getVdbRepository().odbcEnabled();
- ODBCSocketListener odbc = new ODBCSocketListener(address, this.socketConfig,
this.csr, getBufferServiceInjector().getValue().getBufferManager(),
getMaxODBCLobSizeAllowed(), this.logon);
+ ODBCSocketListener odbc = new ODBCSocketListener(address, this.socketConfig,
this.csr, getBufferManagerInjector().getValue(), getMaxODBCLobSizeAllowed(), this.logon);
odbc.setAuthenticationType(this.sessionService.getAuthenticationType());
LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50037, address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -277,8 +277,8 @@
return dqpInjector;
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
private int getMaxODBCLobSizeAllowed() {
Added: trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.jboss;
+
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
+import org.jboss.msc.value.InjectedValue;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBufferCache;
+import org.teiid.query.ObjectReplicator;
+
+class TupleBufferCacheService implements Service<TupleBufferCache>{
+ public final InjectedValue<ObjectReplicator> replicatorInjector = new
InjectedValue<ObjectReplicator>();
+ protected InjectedValue<BufferManager> bufferMgrInjector = new
InjectedValue<BufferManager>();
+
+ private TupleBufferCache tupleBufferCache;
+
+ @Override
+ public void start(StartContext context) throws StartException {
+ if (this.replicatorInjector.getValue() != null) {
+ try {
+ //use a mux name that will not conflict with any vdb
+ this.tupleBufferCache =
this.replicatorInjector.getValue().replicate("$TEIID_BM$",
TupleBufferCache.class, bufferMgrInjector.getValue(), 0); //$NON-NLS-1$
+ } catch (Exception e) {
+ throw new StartException(e);
+ }
+ }
+ }
+
+ @Override
+ public void stop(StopContext context) {
+ if (this.replicatorInjector.getValue() != null && this.tupleBufferCache !=
null) {
+ this.replicatorInjector.getValue().stop(this.tupleBufferCache);
+ }
+ }
+
+ @Override
+ public TupleBufferCache getValue() throws IllegalStateException,
IllegalArgumentException {
+ if (this.tupleBufferCache!= null) {
+ return tupleBufferCache;
+ }
+ return bufferMgrInjector.getValue();
+ }
+}
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -52,6 +52,7 @@
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.deployers.UDFMetaData;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -64,7 +65,6 @@
import org.teiid.query.ObjectReplicator;
import org.teiid.query.metadata.DDLMetadataRepository;
import org.teiid.query.metadata.NativeMetadataRepository;
-import org.teiid.services.BufferServiceImpl;
class VDBDeployer implements DeploymentUnitProcessor {
@@ -175,7 +175,7 @@
vdbService.addDependency(TeiidServiceNames.TRANSLATOR_REPO, TranslatorRepository.class,
vdb.getTranslatorRepositoryInjector());
vdbService.addDependency(TeiidServiceNames.executorServiceName(this.asyncThreadPoolName),
Executor.class, vdb.getExecutorInjector());
vdbService.addDependency(TeiidServiceNames.OBJECT_SERIALIZER, ObjectSerializer.class,
vdb.getSerializerInjector());
- vdbService.addDependency(TeiidServiceNames.BUFFER_MGR, BufferServiceImpl.class,
vdb.getBufferServiceInjector());
+ vdbService.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class,
vdb.getBufferManagerInjector());
vdbService.addDependency(DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR,
ObjectReplicator.class, vdb.getObjectReplicatorInjector());
vdbService.setInitialMode(Mode.PASSIVE).install();
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -74,7 +74,6 @@
import org.teiid.query.tempdata.GlobalTableStore;
import org.teiid.query.tempdata.GlobalTableStoreImpl;
import org.teiid.runtime.RuntimePlugin;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.translator.DelegatingExecutionFactory;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorException;
@@ -85,7 +84,7 @@
private final InjectedValue<TranslatorRepository> translatorRepositoryInjector =
new InjectedValue<TranslatorRepository>();
private final InjectedValue<Executor> executorInjector = new
InjectedValue<Executor>();
private final InjectedValue<ObjectSerializer> serializerInjector = new
InjectedValue<ObjectSerializer>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new
InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new
InjectedValue<BufferManager>();
private final InjectedValue<ObjectReplicator> objectReplicatorInjector = new
InjectedValue<ObjectReplicator>();
private VDBLifeCycleListener vdbListener;
@@ -133,17 +132,20 @@
}
@Override
- public void finishedDeployment(String name, int version,CompositeVDB vdb) {
+ public void finishedDeployment(String name, int version, CompositeVDB vdb) {
+ if (!name.equals(VDBService.this.vdb.getName()) || version !=
VDBService.this.vdb.getVersion()) {
+ return;
+ }
// add object replication to temp/matview tables
GlobalTableStore gts = new GlobalTableStoreImpl(getBuffermanager(),
vdb.getVDB().getAttachment(TransformationMetadata.class));
if (getObjectReplicatorInjector().getValue() != null) {
try {
gts = getObjectReplicatorInjector().getValue().replicate(name + version,
GlobalTableStore.class, gts, 300000);
+ vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50023, gts));
}
}
- vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
}
};
@@ -432,12 +434,12 @@
return serializerInjector.getValue();
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
private BufferManager getBuffermanager() {
- return getBufferServiceInjector().getValue().getBufferManager();
+ return getBufferManagerInjector().getValue();
}
public InjectedValue<ObjectReplicator> getObjectReplicatorInjector() {
Modified:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -40,6 +40,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -506,19 +507,24 @@
public <T, S> T replicate(String mux_id,
Class<T> iface, final S object, long startTimeout) throws Exception {
Channel channel = channelFactory.createChannel(mux_id);
- Method[] methods = iface.getMethods();
- final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
- final ArrayList<Method> methodList = new ArrayList<Method>();
-
- for (Method method : methods) {
+ // To keep the order of methods same at all the nodes.
+ TreeMap<String, Method> methods = new TreeMap<String, Method>();
+ for (Method method : iface.getMethods()) {
if (method.getAnnotation(Replicated.class) == null) {
continue;
}
- methodList.add(method);
- methodMap.put(method, (short)(methodList.size() - 1));
+ methods.put(method.toGenericString(), method);
}
+ final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
+ final ArrayList<Method> methodList = new ArrayList<Method>();
+
+ for (String method : methods.keySet()) {
+ methodList.add(methods.get(method));
+ methodMap.put(methods.get(method), (short)(methodList.size() - 1));
+ }
+
Method hasState = ReplicatedObject.class.getMethod(HAS_STATE, new Class<?>[]
{Serializable.class});
methodList.add(hasState);
methodMap.put(hasState, (short)(methodList.size() - 1));
@@ -543,8 +549,7 @@
* TODO: could have an object implement streaming
* Override the normal handle method to support streaming
*/
- ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel,
proxy, proxy, object,
- object, methodMap, methodList);
+ ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel,
proxy, proxy, object, object, methodMap, methodList);
proxy.setDisp(disp);
disp.setMethodLookup(new MethodLookup() {
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-03-30
23:04:00 UTC (rev 3959)
@@ -136,7 +136,6 @@
#object replicator
distributed-cache-jgroups-stack.describe=JGroups stack name for cache replication
channel
-distributed-cache-channel.describe=Cache channel name to use for cache entries
replication
#transport
transport-name.describe=Name of the transport
Modified: trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
===================================================================
--- trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd 2012-03-30 23:04:00
UTC (rev 3959)
@@ -239,7 +239,6 @@
</xs:annotation>
<xs:complexType>
<xs:attribute name="jgroups-stack"
type="xs:string" use="required"/>
- <xs:attribute name="channel" type="xs:string"
use="required"/>
</xs:complexType>
</xs:element>
Modified:
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
===================================================================
---
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-03-30
04:57:26 UTC (rev 3958)
+++
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -31,7 +31,6 @@
import junit.framework.Assert;
import org.jboss.as.cli.Util;
-import org.jboss.as.controller.OperationContext.Type;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.subsystem.test.AbstractSubsystemTest;
@@ -54,14 +53,7 @@
@Test
public void testDescribeHandler() throws Exception {
String subsystemXml = ObjectConverterUtil.convertToString(new
FileReader("src/test/resources/teiid-sample-config.xml"));
- KernelServices servicesA = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices servicesA =
super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the describe operations from the first controller
@@ -99,14 +91,7 @@
ModelNode testModel = ModelNode.fromJSONString(json);
String triggered = outputModel(testModel);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services =
super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
@@ -125,14 +110,7 @@
ModelNode testModel = ModelNode.fromJSONString(json);
String triggered = outputModel(testModel);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services =
super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
@@ -146,14 +124,8 @@
String subsystemXml = ObjectConverterUtil.convertToString(new
FileReader("src/test/resources/teiid-sample-config.xml"));
validate(subsystemXml);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services =
super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
+ ;
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
Modified: trunk/jboss-integration/src/test/resources/teiid-model-config.txt
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-model-config.txt 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-model-config.txt 2012-03-30 23:04:00
UTC (rev 3959)
@@ -97,11 +97,6 @@
"description" => "JGroups stack name for cache replication
channel",
"required" => false
},
- "distributed-cache-channel" => {
- "type" => STRING,
- "description" => "Cache channel name to use for cache entries
replication",
- "required" => false
- },
"buffer-service-use-disk" => {
"type" => BOOLEAN,
"description" => "Use disk for buffer management",
Modified: trunk/jboss-integration/src/test/resources/teiid-model-json.txt
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-model-json.txt 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-model-json.txt 2012-03-30 23:04:00
UTC (rev 3959)
@@ -22,7 +22,6 @@
"max-row-fetch-size" : 20480,
"max-source-rows-allowed" : -1,
"max-threads" : 64,
- "distributed-cache-channel" : "cluster",
"distributed-cache-jgroups-stack" : "stack",
"preparedplan-cache-max-age-in-seconds" : 28800,
"preparedplan-cache-max-entries" : 512,
Modified: trunk/jboss-integration/src/test/resources/teiid-sample-config.xml
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-sample-config.xml 2012-03-30 04:57:26
UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-sample-config.xml 2012-03-30 23:04:00
UTC (rev 3959)
@@ -28,7 +28,7 @@
<preparedplan-cache max-entries="512"
max-age-in-seconds="28800"/>
- <distributed-cache jgroups-stack="stack"
channel="cluster"/>
+ <distributed-cache jgroups-stack="stack"/>
<transport name="jdbc" protocol="teiid"
socket-binding="teiid-jdbc" max-socket-threads="1"
input-buffer-size="2" output-buffer-size="3"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/pom.xml 2012-03-30 23:04:00 UTC (rev 3959)
@@ -15,7 +15,7 @@
<properties>
<ant.version>1.7.0</ant.version>
<
site.url>http://www.jboss.org/teiid</site.url>
- <jbossas-version>7.1.0.Final</jbossas-version>
+ <jbossas-version>7.1.1.Final</jbossas-version>
<version.org.jboss.common-core>2.2.17.GA</version.org.jboss.common-core>
<version.org.jboss.staxmapper>1.1.0.Final</version.org.jboss.staxmapper>
<version.org.jboss.jboss-dmr>1.1.1.Final</version.org.jboss.jboss-dmr>
@@ -30,10 +30,10 @@
<version.org.jboss.netty>3.2.6.Final</version.org.jboss.netty>
<version.net.sourceforge.saxon>9.2.1.5</version.net.sourceforge.saxon>
<version.json-simple>1.1</version.json-simple>
- <version.org.jgroups>3.0.5.Final</version.org.jgroups>
+ <version.org.jgroups>3.0.8.Final</version.org.jgroups>
<version.connector-api>1.5</version.connector-api>
<version.jta>1.1</version.jta>
- <version.sun.jaxb>2.2</version.sun.jaxb>
+ <version.sun.jaxb>2.2.4</version.sun.jaxb>
<version.junit>4.10</version.junit>
</properties>
<scm>
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -89,7 +89,7 @@
boolean dsReplaced = false;
if (!cm.getConnectionName().equals(dsName)){
vdb.setStatus(VDB.Status.INACTIVE);
- String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(),
vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName); //$NON-NLS-1$
+ String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(),
vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName);
model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
cm = new ConnectorManager(translatorName, dsName);
cm.setExecutionFactory(ef);
@@ -172,7 +172,7 @@
if (!runnables.isEmpty()) {
//the task themselves will set the status on completion/failure
- for (Runnable runnable : runnables) {
+ for (Runnable runnable : runnables) {
getExecutor().execute(runnable);
}
} else if (valid) {
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2012-03-30
04:57:26 UTC (rev 3958)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2012-03-30
23:04:00 UTC (rev 3959)
@@ -287,7 +287,7 @@
throw new TeiidRuntimeException(e);
}
}
- this.dqp.setBufferService(bs);
+ this.dqp.setBufferManager(bs.getBufferManager());
//TODO: wire in an infinispan cluster rather than this dummy replicated cache
DefaultCacheFactory dcf = new DefaultCacheFactory() {