[teiid-commits] teiid SVN: r3468 - in branches/as7: engine/src/main/java/org/teiid/common/buffer and 9 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Sep 13 16:05:12 EDT 2011


Author: rareddy
Date: 2011-09-13 16:05:11 -0400 (Tue, 13 Sep 2011)
New Revision: 3468

Added:
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructureDeployer.java
Removed:
   branches/as7/build/kits/jboss-as7/domain/domain-teiid.xml
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyProcessor.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructure.java
Modified:
   branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
   branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
   branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
   branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidBootServicesAdd.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
   branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
   branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
   branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
   branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt
   branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml
   branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
Log:
TEIID-1720: Added Object replication to Buffer Manager for resultset replication; fixed schema file to current code

Deleted: branches/as7/build/kits/jboss-as7/domain/domain-teiid.xml
===================================================================
--- branches/as7/build/kits/jboss-as7/domain/domain-teiid.xml	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/build/kits/jboss-as7/domain/domain-teiid.xml	2011-09-13 20:05:11 UTC (rev 3468)
@@ -1,702 +0,0 @@
-<!--
-  ~ JBoss, Home of Professional Open Source.
-  ~ Copyright 2010, Red Hat, Inc., and individual contributors
-  ~ as indicated by the @author tags. See the copyright.txt file in the
-  ~ distribution for a full listing of individual contributors.
-  ~
-  ~ This 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 software 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 software; if not, write to the Free
-  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  -->
-
-<domain xmlns="urn:jboss:domain:1.0">
-
-    <extensions>
-        <extension module="org.jboss.as.clustering.infinispan"/>
-        <extension module="org.jboss.as.clustering.jgroups"/>
-        <extension module="org.jboss.as.connector"/>
-        <extension module="org.jboss.as.ee"/>
-        <extension module="org.jboss.as.ejb3"/>
-        <extension module="org.jboss.as.jaxrs"/>
-        <extension module="org.jboss.as.jmx"/>
-        <extension module="org.jboss.as.jpa"/>
-        <extension module="org.jboss.as.logging"/>
-        <extension module="org.jboss.as.modcluster"/>
-        <extension module="org.jboss.as.naming"/>
-        <extension module="org.jboss.as.osgi"/>
-        <extension module="org.jboss.as.remoting"/>
-        <extension module="org.jboss.as.sar"/>
-        <extension module="org.jboss.as.security"/>
-        <extension module="org.jboss.teiid"/>
-        <extension module="org.jboss.as.threads"/>
-        <extension module="org.jboss.as.transactions"/>
-        <extension module="org.jboss.as.web"/>
-        <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="default">
-            <subsystem xmlns="urn:jboss:domain:logging:1.1">
-                <console-handler name="CONSOLE">
-                    <level name="INFO"/>
-                    <formatter>
-                        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
-                    </formatter>
-                </console-handler>
-
-                <periodic-rotating-file-handler name="FILE">
-                    <level name="INFO"/>
-                    <formatter>
-                        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
-                    </formatter>
-                    <file relative-to="jboss.server.log.dir" path="server.log"/>
-                    <suffix value=".yyyy-MM-dd"/>
-                </periodic-rotating-file-handler>
-
-                <logger category="com.arjuna">
-                    <level name="WARN"/>
-                </logger>
-                <logger category="org.apache.tomcat.util.modeler">
-                    <level name="WARN"/>
-                </logger>
-                <logger category="sun.rmi">
-                    <level name="WARN"/>
-                </logger>
-
-                <root-logger>
-                    <level name="INFO"/>
-                    <handlers>
-                        <handler name="CONSOLE"/>
-                        <handler name="FILE"/>
-                    </handlers>
-                </root-logger>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:datasources:1.0">
-                <datasources>
-                    <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
-                        <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
-                        <driver>h2</driver>
-                        <pool></pool>
-                        <security>
-                            <user-name>sa</user-name>
-                            <password>sa</password>
-                        </security>
-                    </datasource>
-                    <drivers>
-                        <driver name="h2" module="com.h2database.h2">
-                            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
-                        </driver>
-                    </drivers>
-                </datasources>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:ejb3:1.1" lite="true">
-                <!-- EJB3 pools -->
-                <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"/>
-                    </bean-instance-pools>
-                </pools>
-
-                <!-- Session bean configurations -->
-                <session-bean>
-                    <stateless>
-                        <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
-                    </stateless>
-                </session-bean>
-
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:infinispan:1.0" default-cache-container="hibernate">
-                <cache-container name="hibernate" default-cache="local-query">
-                    <local-cache name="entity">
-                        <eviction strategy="LRU" max-entries="10000"/>
-                        <expiration max-idle="100000"/>
-                    </local-cache>
-                    <local-cache name="local-query">
-                        <eviction strategy="LRU" max-entries="10000"/>
-                        <expiration max-idle="100000"/>
-                    </local-cache>
-                    <local-cache name="timestamps">
-                        <eviction strategy="NONE"/>
-                    </local-cache>
-                </cache-container>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:jca:1.0">
-                <archive-validation enabled="true"/>
-                <bean-validation enabled="true"/>
-                <default-workmanager>
-                    <short-running-threads blocking="true">
-                        <core-threads count="10" per-cpu="20"/>
-                        <queue-length count="10" per-cpu="20"/>
-                        <max-threads count="10" per-cpu="20"/>
-                        <keepalive-time time="10" unit="seconds"/>
-                    </short-running-threads>
-                    <long-running-threads blocking="true">
-                        <core-threads count="10" per-cpu="20"/>
-                        <queue-length count="10" per-cpu="20"/>
-                        <max-threads count="10" per-cpu="20"/>
-                        <keepalive-time time="10" unit="seconds"/>
-                    </long-running-threads>
-                </default-workmanager>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jmx:1.0">
-                 <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server" />
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jpa:1.0">
-                 <jpa default-datasource=""/>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:naming:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
-                <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
-                    <property name="manager.root">jboss-osgi</property>
-                </configuration>
-                <properties>
-                    <!--
-                        A comma seperated list of module identifiers. Each system module
-                        is added as a dependency to the OSGi framework module. The packages
-                        from these system modules can be made visible as framework system packages.
-                        http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#FRAMEWORK_SYSTEMPACKAGES_EXTRA
-                    -->
-                    <property name="org.jboss.osgi.system.modules">
-                        org.apache.commons.logging,
-                        org.apache.log4j,
-                        org.jboss.as.osgi,
-                        org.slf4j,
-                    </property>
-                    <!--
-                        Framework environment property identifying extra packages which the system bundle
-                        must export from the current execution environment
-                    -->
-                    <property name="org.osgi.framework.system.packages.extra">
-                        org.apache.commons.logging;version=1.1.1,
-                        org.apache.log4j;version=1.2,
-                        org.jboss.as.osgi.service;version=7.0,
-                        org.jboss.osgi.deployment.interceptor;version=1.0,
-                        org.jboss.osgi.spi.capability;version=1.0,
-                        org.jboss.osgi.spi.util;version=1.0,
-                        org.jboss.osgi.testing;version=1.0,
-                        org.jboss.osgi.vfs;version=1.0,
-                        org.slf4j;version=1.5.10,
-                    </property>
-                    <!-- Specifies the beginning start level of the framework -->
-                    <property name="org.osgi.framework.startlevel.beginning">1</property>
-                </properties>
-                <modules>
-                    <!-- modules registered with the OSGi layer on startup -->
-                    <module identifier="javaee.api"/>
-                    <module identifier="org.jboss.logging"/>
-                    <!-- bundles installed on startup -->
-                    <module identifier="org.apache.aries.util"/>
-                    <module identifier="org.jboss.osgi.webconsole"/>
-                    <module identifier="org.osgi.compendium"/>
-                    <!-- bundles started in startlevel 1 -->
-                    <module identifier="org.apache.felix.log" startlevel="1"/>
-                    <module identifier="org.jboss.osgi.logging" startlevel="1"/>
-                    <module identifier="org.apache.felix.configadmin" startlevel="1"/>
-                    <module identifier="org.jboss.as.osgi.configadmin" startlevel="1"/>
-                    <!-- bundles started in startlevel 2 -->
-                    <module identifier="org.apache.aries.jmx" startlevel="2"/>
-                    <module identifier="org.apache.felix.eventadmin" startlevel="2"/>
-                    <module identifier="org.apache.felix.metatype" startlevel="2"/>
-                    <module identifier="org.apache.felix.webconsole" startlevel="2"/>
-                    <module identifier="org.jboss.osgi.jmx" startlevel="2"/>
-                    <module identifier="org.jboss.osgi.http" startlevel="2"/>
-                    <!-- bundles started in startlevel 3 -->
-                    <module identifier="org.jboss.osgi.blueprint" startlevel="3"/>
-                    <module identifier="org.jboss.osgi.webapp" startlevel="3"/>
-                    <module identifier="org.jboss.osgi.xerces" startlevel="3"/>
-                </modules>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:remoting:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:security:1.0">
-                <security-domains>
-                    <security-domain name="other">
-                        <authentication>
-                            <login-module code="UsersRoles" flag="required"/>
-                        </authentication>
-                    </security-domain>
-                    <security-domain name="teiid-security" cache-type="default">
-                        <authentication>
-                            <login-module code="UsersRoles" flag="required">
-                                <module-option name="usersProperties" value="teiid-security-users.properties"/>
-                                <module-option name="rolesProperties" value="teiid-security-roles.properties"/>
-                            </login-module>
-                        </authentication>
-                    </security-domain>                       
-                </security-domains>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:teiid:1.0">
-                <async-thread-group>teiid-async</async-thread-group>
-                
-                <query-engine name = "default">
-                    <object-replicator-name>teiid/replicator</object-replicator-name>
-                    <security-domain>teiid-security</security-domain>
-                    <jdbc socket-binding="teiid-jdbc"/>
-                    <odbc socket-binding="teiid-odbc"/>
-                </query-engine>
-                
-                <translator name="jdbc-simple" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="jdbc-ansi" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="access" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="db2" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="derby" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="h2" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="hsql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="informix" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="metamatrix" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="mysql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="mysql5" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="oracle" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="postgresql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="sqlserver" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="sybase" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="teiid" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="teradata" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="modeshape" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="ingres" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="ingres93" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="intersystems-cache" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="netezza" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="file" module="org.jboss.teiid.translator.file"/>
-                <translator name="ldap" module="org.jboss.teiid.translator.ldap"/>
-                <translator name="loopback" module="org.jboss.teiid.translator.loopback"/>
-                <translator name="olap" module="org.jboss.teiid.translator.olap"/>
-                <translator name="ws" module="org.jboss.teiid.translator.ws"/>
-            </subsystem>
-
-            <subsystem xmlns="urn:jboss:domain:threads:1.0">
-                <queueless-thread-pool name="teiid-async">
-                    <max-threads count="2" per-cpu="2" />
-                </queueless-thread-pool>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:transactions:1.0">
-                <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
-                <core-environment>
-                    <process-id>
-                        <uuid />
-                    </process-id>
-                </core-environment>
-                <coordinator-environment default-timeout="300"/>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
-                <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
-                <virtual-server name="default-host">
-                    <alias name="localhost" />
-                    <alias name="example.com" />
-                </virtual-server>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
-        </profile>
-
-        <profile name="ha">
-            <subsystem xmlns="urn:jboss:domain:logging:1.1">
-                <console-handler name="CONSOLE">
-                    <level name="INFO"/>
-                    <formatter>
-                        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
-                    </formatter>
-                </console-handler>
-
-                <periodic-rotating-file-handler name="FILE">
-                    <level name="INFO"/>
-                    <formatter>
-                        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
-                    </formatter>
-                    <file relative-to="jboss.server.log.dir" path="server.log"/>
-                    <suffix value=".yyyy-MM-dd"/>
-                </periodic-rotating-file-handler>
-
-                <logger category="com.arjuna">
-                    <level name="WARN"/>
-                </logger>
-                <logger category="org.apache.tomcat.util.modeler">
-                    <level name="WARN"/>
-                </logger>
-                <logger category="sun.rmi">
-                    <level name="WARN"/>
-                </logger>
-
-                <root-logger>
-                    <level name="INFO"/>
-                    <handlers>
-                        <handler name="CONSOLE"/>
-                        <handler name="FILE"/>
-                    </handlers>
-                </root-logger>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:datasources:1.0">
-                <datasources>
-                    <datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS">
-                        <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
-                        <driver>h2</driver>
-                        <pool></pool>
-                        <security>
-                            <user-name>sa</user-name>
-                            <password>sa</password>
-                        </security>
-                    </datasource>
-                    <drivers>
-                        <driver name="h2" module="com.h2database.h2">
-                            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
-                        </driver>
-                    </drivers>
-                </datasources>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:ejb3:1.1" lite="true">
-                <!-- EJB3 pools -->
-                <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"/>
-                    </bean-instance-pools>
-                </pools>
-
-                <!-- Session bean configurations -->
-                <session-bean>
-                    <stateless>
-                        <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
-                    </stateless>
-                </session-bean>
-
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:infinispan:1.0" default-cache-container="cluster">
-                <cache-container name="cluster" default-cache="default">
-                    <alias>ha-partition</alias>
-                    <replicated-cache name="default" mode="SYNC" batching="true">
-                        <locking isolation="REPEATABLE_READ"/>
-                    </replicated-cache>
-                </cache-container>
-                <cache-container name="web" default-cache="repl">
-                    <alias>standard-session-cache</alias>
-                    <replicated-cache name="repl" mode="ASYNC" batching="true">
-                        <locking isolation="REPEATABLE_READ"/>
-                        <file-store/>
-                    </replicated-cache>
-                    <distributed-cache name="dist" mode="ASYNC" batching="true">
-                        <locking isolation="REPEATABLE_READ"/>
-                        <file-store/>
-                    </distributed-cache>
-                </cache-container>
-                <cache-container name="sfsb" default-cache="repl">
-                    <alias>sfsb-cache</alias>
-                    <alias>jboss.cache:service=EJB3SFSBClusteredCache</alias>
-                    <replicated-cache name="repl" mode="ASYNC" batching="true">
-                        <locking isolation="REPEATABLE_READ"/>
-                        <eviction strategy="LRU" max-entries="10000"/>
-                        <file-store/>
-                    </replicated-cache>
-                </cache-container>
-                <cache-container name="hibernate" default-cache="local-query">
-                    <invalidation-cache name="entity" mode="SYNC">
-                        <eviction strategy="LRU" max-entries="10000"/>
-                        <expiration max-idle="100000"/>
-                    </invalidation-cache>
-                    <local-cache name="local-query">
-                        <eviction strategy="LRU" max-entries="10000"/>
-                        <expiration max-idle="100000"/>
-                    </local-cache>
-                    <replicated-cache name="timestamps" mode="ASYNC">
-                        <eviction strategy="NONE"/>
-                    </replicated-cache>
-                </cache-container>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:jca:1.0">
-                <archive-validation enabled="true"/>
-                <bean-validation enabled="true"/>
-                <default-workmanager>
-                    <short-running-threads blocking="true">
-                        <core-threads count="10" per-cpu="20"/>
-                        <queue-length count="10" per-cpu="20"/>
-                        <max-threads count="10" per-cpu="20"/>
-                        <keepalive-time time="10" unit="seconds"/>
-                    </short-running-threads>
-                    <long-running-threads blocking="true">
-                        <core-threads count="10" per-cpu="20"/>
-                        <queue-length count="10" per-cpu="20"/>
-                        <max-threads count="10" per-cpu="20"/>
-                        <keepalive-time time="10" unit="seconds"/>
-                    </long-running-threads>
-                </default-workmanager>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jgroups:1.0" default-stack="udp">
-                <stack name="udp">
-                    <transport type="UDP" socket-binding="jgroups-udp" diagnostics-socket-binding="jgroups-diagnostics"/>
-                    <protocol type="PING"/>
-                    <protocol type="MERGE2"/>
-                    <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
-                    <protocol type="FD"/>
-                    <protocol type="VERIFY_SUSPECT"/>
-                    <protocol type="BARRIER"/>
-                    <protocol type="pbcast.NAKACK"/>
-                    <protocol type="UNICAST"/>
-                    <protocol type="pbcast.STABLE"/>
-                    <protocol type="VIEW_SYNC"/>
-                    <protocol type="pbcast.GMS"/>
-                    <protocol type="UFC"/>
-                    <protocol type="MFC"/>
-                    <protocol type="FRAG2"/>
-                    <protocol type="pbcast.STREAMING_STATE_TRANSFER"/>
-                    <protocol type="pbcast.FLUSH"/>
-                </stack>
-                <stack name="tcp">
-                    <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
-                    <protocol type="MPING" socket-binding="jgroups-mping"/>
-                    <protocol type="MERGE2"/>
-                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
-                    <protocol type="FD"/>
-                    <protocol type="VERIFY_SUSPECT"/>
-                    <protocol type="BARRIER"/>
-                    <protocol type="pbcast.NAKACK"/>
-                    <protocol type="UNICAST"/>
-                    <protocol type="pbcast.STABLE"/>
-                    <protocol type="VIEW_SYNC"/>
-                    <protocol type="pbcast.GMS"/>
-                    <protocol type="UFC"/>
-                    <protocol type="MFC"/>
-                    <protocol type="FRAG2"/>
-                    <protocol type="pbcast.STREAMING_STATE_TRANSFER"/>
-                    <protocol type="pbcast.FLUSH"/>
-                </stack>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jmx:1.0">
-                 <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server" />
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:jpa:1.0">
-                 <jpa default-datasource=""/>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:modcluster:1.0">
-                <mod-cluster-config advertise-socket="modcluster"/>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:naming:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
-                <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
-                    <property name="manager.root">jboss-osgi</property>
-                </configuration>
-                <properties>
-                    <!--
-                        A comma seperated list of module identifiers. Each system module
-                        is added as a dependency to the OSGi framework module. The packages
-                        from these system modules can be made visible as framework system packages.
-                        http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#FRAMEWORK_SYSTEMPACKAGES_EXTRA
-                    -->
-                    <property name="org.jboss.osgi.system.modules">
-                        org.apache.commons.logging,
-                        org.apache.log4j,
-                        org.jboss.as.osgi,
-                        org.slf4j,
-                    </property>
-                    <!--
-                        Framework environment property identifying extra packages which the system bundle
-                        must export from the current execution environment
-                    -->
-                    <property name="org.osgi.framework.system.packages.extra">
-                        org.apache.commons.logging;version=1.1.1,
-                        org.apache.log4j;version=1.2,
-                        org.jboss.as.osgi.service;version=7.0,
-                        org.jboss.osgi.deployment.interceptor;version=1.0,
-                        org.jboss.osgi.spi.capability;version=1.0,
-                        org.jboss.osgi.spi.util;version=1.0,
-                        org.jboss.osgi.testing;version=1.0,
-                        org.jboss.osgi.vfs;version=1.0,
-                        org.slf4j;version=1.5.10,
-                    </property>
-                    <!-- Specifies the beginning start level of the framework -->
-                    <property name="org.osgi.framework.startlevel.beginning">1</property>
-                </properties>
-                <modules>
-                    <!-- modules registered with the OSGi layer on startup -->
-                    <module identifier="javaee.api"/>
-                    <module identifier="org.jboss.logging"/>
-                    <!-- bundles installed on startup -->
-                    <module identifier="org.apache.aries.util"/>
-                    <module identifier="org.jboss.osgi.webconsole"/>
-                    <module identifier="org.osgi.compendium"/>
-                    <!-- bundles started in startlevel 1 -->
-                    <module identifier="org.apache.felix.log" startlevel="1"/>
-                    <module identifier="org.jboss.osgi.logging" startlevel="1"/>
-                    <module identifier="org.apache.felix.configadmin" startlevel="1"/>
-                    <module identifier="org.jboss.as.osgi.configadmin" startlevel="1"/>
-                    <!-- bundles started in startlevel 2 -->
-                    <module identifier="org.apache.aries.jmx" startlevel="2"/>
-                    <module identifier="org.apache.felix.eventadmin" startlevel="2"/>
-                    <module identifier="org.apache.felix.metatype" startlevel="2"/>
-                    <module identifier="org.apache.felix.webconsole" startlevel="2"/>
-                    <module identifier="org.jboss.osgi.jmx" startlevel="2"/>
-                    <module identifier="org.jboss.osgi.http" startlevel="2"/>
-                    <!-- bundles started in startlevel 3 -->
-                    <module identifier="org.jboss.osgi.blueprint" startlevel="3"/>
-                    <module identifier="org.jboss.osgi.webapp" startlevel="3"/>
-                    <module identifier="org.jboss.osgi.xerces" startlevel="3"/>
-                </modules>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:remoting:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
-            <subsystem xmlns="urn:jboss:domain:security:1.0">
-                <security-domains>
-                    <security-domain name="other">
-                        <authentication>
-                            <login-module code="UsersRoles" flag="required"/>
-                        </authentication>
-                    </security-domain>
-                    <security-domain name="teiid-security" cache-type="default">
-                        <authentication>
-                            <login-module code="UsersRoles" flag="required">
-                                <module-option name="usersProperties" value="teiid-security-users.properties"/>
-                                <module-option name="rolesProperties" value="teiid-security-roles.properties"/>
-                            </login-module>
-                        </authentication>
-                    </security-domain>                     
-                </security-domains>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:teiid:1.0">
-                <async-thread-group>teiid-async</async-thread-group>
-                
-                <query-engine name = "default">
-                    <object-replicator-name>teiid/replicator</object-replicator-name>
-                    <security-domain>teiid-security</security-domain>
-                    <jdbc socket-binding="teiid-jdbc"/>
-                    <odbc socket-binding="teiid-odbc"/>
-                </query-engine>
-                
-                <translator name="jdbc-simple" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="jdbc-ansi" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="access" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="db2" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="derby" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="h2" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="hsql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="informix" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="metamatrix" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="mysql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="mysql5" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="oracle" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="postgresql" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="sqlserver" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="sybase" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="teiid" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="teradata" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="modeshape" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="ingres" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="ingres93" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="intersystems-cache" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="netezza" module="org.jboss.teiid.translator.jdbc"/>
-                <translator name="file" module="org.jboss.teiid.translator.file"/>
-                <translator name="ldap" module="org.jboss.teiid.translator.ldap"/>
-                <translator name="loopback" module="org.jboss.teiid.translator.loopback"/>
-                <translator name="olap" module="org.jboss.teiid.translator.olap"/>
-                <translator name="ws" module="org.jboss.teiid.translator.ws"/>
-            </subsystem>            
-            <subsystem xmlns="urn:jboss:domain:threads:1.0">
-                <queueless-thread-pool name="teiid-async">
-                    <max-threads count="2" per-cpu="2" />
-                </queueless-thread-pool>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:transactions:1.0">
-                <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
-                <core-environment>
-                    <process-id>
-                        <uuid />
-                    </process-id>
-                </core-environment>
-                <coordinator-environment default-timeout="300"/>
-            </subsystem>
-            <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
-                <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
-                <virtual-server name="default-host">
-                    <alias name="localhost" />
-                    <alias name="example.com" />
-                </virtual-server>
-            </subsystem>
-            <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.
-    -->
-    <interfaces>
-        <interface name="management"/>
-        <interface name="public"/>
-    </interfaces>
-
-    <socket-binding-groups>
-        <socket-binding-group name="standard-sockets" default-interface="public">
-            <socket-binding name="http" port="8080"/>
-            <socket-binding name="https" port="8443"/>
-            <socket-binding name="jmx-connector-registry" port="1090"/>
-            <socket-binding name="jmx-connector-server" port="1091"/>
-            <socket-binding name="jndi" port="1099"/>
-            <socket-binding name="osgi-http" port="8090"/>
-            <socket-binding name="remoting" port="4447"/>
-            <socket-binding name="txn-recovery-environment" port="4712"/>
-            <socket-binding name="txn-status-manager" port="4713"/>
-            <socket-binding name="teiid-jdbc" port="31000"/>
-            <socket-binding name="teiid-odbc" port="35432"/>  
-        </socket-binding-group>
-        <socket-binding-group name="ha-sockets" default-interface="public">
-            <socket-binding name="http" port="8080"/>
-            <socket-binding name="https" port="8443"/>
-            <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="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="230.0.0.4" multicast-port="45688"/>
-            <socket-binding name="jgroups-udp-fd" port="54200"/>
-            <socket-binding name="jmx-connector-registry" port="1090"/>
-            <socket-binding name="jmx-connector-server" port="1091"/>
-            <socket-binding name="jndi" port="1099"/>
-            <socket-binding name="modcluster" port="0"  multicast-address="224.0.1.105" multicast-port="23364"/>
-            <socket-binding name="osgi-http" port="8090"/>
-            <socket-binding name="remoting" port="4447"/>
-            <socket-binding name="txn-recovery-environment" port="4712"/>
-            <socket-binding name="txn-status-manager" port="4713"/>
-            <socket-binding name="teiid-jdbc" port="31000"/>
-            <socket-binding name="teiid-odbc" port="35432"/>             
-        </socket-binding-group>
-    </socket-binding-groups>
-
-    <server-groups>
-        <server-group name="main-server-group" profile="default">
-            <jvm name="default">
-               <heap size="64m" max-size="512m"/>
-            </jvm>
-            <socket-binding-group ref="standard-sockets"/>
-        </server-group>
-
-        <server-group name="other-server-group" profile="ha">
-            <jvm name="default">
-               <heap size="64m" max-size="512m"/>
-            </jvm>
-            <socket-binding-group ref="ha-sockets"/>
-        </server-group>
-    </server-groups>
-
-</domain>

Modified: branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/engine/src/main/java/org/teiid/common/buffer/BufferManager.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -24,6 +24,7 @@
 
 import java.util.List;
 
+import org.teiid.Replicated;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.query.sql.symbol.Expression;
 
@@ -130,4 +131,7 @@
 	 * @param maxActivePlans
 	 */
 	void setMaxActivePlans(int maxActivePlans);		
+	
+	@Replicated(replicateState=true)
+	void distributeTupleBuffer(String uuid, TupleBuffer tb);
 }

Modified: branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -22,25 +22,12 @@
 
 package org.teiid.common.buffer.impl;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
+import java.io.*;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
+import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
@@ -49,14 +36,7 @@
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.teiid.common.buffer.BatchManager;
-import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.FileStore;
-import org.teiid.common.buffer.LobManager;
-import org.teiid.common.buffer.STree;
-import org.teiid.common.buffer.StorageManager;
-import org.teiid.common.buffer.TupleBatch;
-import org.teiid.common.buffer.TupleBuffer;
+import org.teiid.common.buffer.*;
 import org.teiid.common.buffer.BatchManager.ManagedBatch;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.core.TeiidRuntimeException;
@@ -67,7 +47,9 @@
 import org.teiid.logging.LogManager;
 import org.teiid.logging.MessageLevel;
 import org.teiid.query.QueryPlugin;
+import org.teiid.query.ReplicatedObject;
 import org.teiid.query.processor.relational.ListNestedSortComparator;
+import org.teiid.query.sql.symbol.ElementSymbol;
 import org.teiid.query.sql.symbol.Expression;
 
 
@@ -87,7 +69,7 @@
  * TODO: add detection of pinned batches to prevent unnecessary purging of non-persistent batches
  *       - this is not necessary for already persistent batches, since we hold a weak reference
  */
-public class BufferManagerImpl implements BufferManager, StorageManager {
+public class BufferManagerImpl implements BufferManager, StorageManager, ReplicatedObject {
 	
 	private static final int IO_BUFFER_SIZE = 1 << 14;
 	private static final int COMPACTION_THRESHOLD = 1 << 25; //start checking at 32 megs
@@ -122,7 +104,7 @@
 		private AtomicLong unusedSpace = new AtomicLong();
 		private int[] lobIndexes;
 		private SizeUtility sizeUtility;
-
+		
 		private BatchManagerImpl(String newID, int[] lobIndexes) {
 			this.id = newID;
 			this.store = createFileStore(id);
@@ -701,6 +683,12 @@
 	}
 	
 	@Override
+	public void distributeTupleBuffer(String uuid, TupleBuffer tb) {
+		tb.setId(uuid);
+		addTupleBuffer(tb);
+	}
+	
+	@Override
 	public TupleBuffer getTupleBuffer(String id) {		
 		cleanDefunctTupleBuffers();
 		Reference<TupleBuffer> r = this.tupleBufferMap.get(id);
@@ -730,6 +718,130 @@
 	
 	public void setUseWeakReferences(boolean useWeakReferences) {
 		this.useWeakReferences = useWeakReferences;
+	}	
+	
+	@Override
+	public void getState(OutputStream ostream) {
+		try {
+			ObjectOutputStream out = new ObjectOutputStream(ostream);
+			for(String id:this.tupleBufferMap.keySet()) {
+				TupleReference tr = this.tupleBufferMap.get(id);
+				TupleBuffer tb = tr.get();
+				if (tb != null) {
+					out.writeObject(tb.getId());
+					getTupleBufferState(out, tb);
+				}
+			}
+		} catch (TeiidComponentException e) {
+			throw new TeiidRuntimeException(e);
+		} catch (IOException e) {
+			throw new TeiidRuntimeException(e);
+		}				
 	}
 	
+	@Override
+	public void getState(String state_id, OutputStream ostream) {
+		TupleBuffer buffer = this.getTupleBuffer(state_id);
+		if (buffer != null) {
+			try {
+				ObjectOutputStream out = new ObjectOutputStream(ostream);
+				getTupleBufferState(out, buffer);
+			} catch (TeiidComponentException e) {
+				throw new TeiidRuntimeException(e);
+			} catch (IOException e) {
+				throw new TeiidRuntimeException(e);
+			}
+		}
+	}
+
+	private void getTupleBufferState(ObjectOutputStream out, TupleBuffer buffer) throws TeiidComponentException, IOException {
+		out.writeInt(buffer.getRowCount());
+		out.writeInt(buffer.getBatchSize());
+		out.writeObject(buffer.getTypes());
+		out.writeBoolean(buffer.isPrefersMemory());
+		for (int row = 1; row <= buffer.getRowCount(); row+=buffer.getBatchSize()) {
+			TupleBatch b = buffer.getBatch(row);
+			b.preserveTypes();
+			out.writeObject(b);
+		}
+	}
+
+	@Override
+	public void setState(InputStream istream) {
+		try {
+			ObjectInputStream in = new ObjectInputStream(istream);
+			while (true) {
+				String state_id = null;
+				try {
+					state_id = (String)in.readObject();
+				} catch (IOException e) {
+					break;
+				}
+				if (state_id != null) {
+					setTupleBufferState(state_id, in);
+				}
+			}
+		} catch (IOException e) {
+			throw new TeiidRuntimeException(e);
+		} catch(ClassNotFoundException e) {
+			throw new TeiidRuntimeException(e);
+		} catch(TeiidComponentException e) {
+			throw new TeiidRuntimeException(e);
+		}
+		
+	}	
+	
+	@Override
+	public void setState(String state_id, InputStream istream) {
+		TupleBuffer buffer = this.getTupleBuffer(state_id);
+		if (buffer == null) {
+			try {
+				ObjectInputStream in = new ObjectInputStream(istream);
+				setTupleBufferState(state_id, in);
+			} catch (IOException e) {
+				throw new TeiidRuntimeException(e);
+			} catch(ClassNotFoundException e) {
+				throw new TeiidRuntimeException(e);
+			} catch(TeiidComponentException e) {
+				throw new TeiidRuntimeException(e);
+			}
+		}
+	}
+
+	private void setTupleBufferState(String state_id, ObjectInputStream in) throws IOException, ClassNotFoundException, TeiidComponentException {
+		int rowCount = in.readInt();
+		int batchSize = in.readInt();
+		String[] types = (String[])in.readObject();
+		boolean prefersMemory = in.readBoolean();
+		
+		List<ElementSymbol> schema = new ArrayList<ElementSymbol>(types.length);
+		for (String type : types) {
+			ElementSymbol es = new ElementSymbol("x"); //$NON-NLS-1$
+			es.setType(DataTypeManager.getDataTypeClass(type));
+			schema.add(es);
+		}
+		TupleBuffer buffer = createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
+		buffer.setBatchSize(batchSize);
+		buffer.setId(state_id);
+		buffer.setPrefersMemory(prefersMemory);
+		
+		for (int row = 1; row <= rowCount; row+=batchSize) {
+			TupleBatch batch = (TupleBatch)in.readObject();
+			if (batch == null) {					
+				buffer.remove();
+				throw new IOException(QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
+			}		
+			buffer.addTupleBatch(batch, true);
+		}
+		buffer.close();
+		addTupleBuffer(buffer);
+	}
+
+	@Override
+	public void setLocalAddress(Serializable address) {
+	}
+
+	@Override
+	public void droppedMembers(Collection<Serializable> addresses) {
+	}	
 }

Modified: branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -23,20 +23,15 @@
 package org.teiid.dqp.internal.process;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
 
 import org.teiid.api.exception.query.QueryParserException;
 import org.teiid.api.exception.query.QueryResolverException;
 import org.teiid.cache.Cachable;
 import org.teiid.cache.Cache;
 import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.TupleBatch;
 import org.teiid.common.buffer.TupleBuffer;
-import org.teiid.common.buffer.BufferManager.TupleSourceType;
 import org.teiid.core.TeiidComponentException;
 import org.teiid.core.TeiidException;
-import org.teiid.core.types.DataTypeManager;
 import org.teiid.core.util.Assertion;
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
@@ -48,7 +43,6 @@
 import org.teiid.query.resolver.QueryResolver;
 import org.teiid.query.sql.lang.CacheHint;
 import org.teiid.query.sql.lang.Command;
-import org.teiid.query.sql.symbol.ElementSymbol;
 
 
 public class CachedResults implements Serializable, Cachable {
@@ -57,11 +51,8 @@
 	private transient Command command;
 	private transient TupleBuffer results;
 
-	private String[] types;
 	private CacheHint hint;
-	private int batchSize;
 	private String uuid;
-	private int rowCount;
 	private boolean hasLobs;
 	
 	private AccessInfo accessInfo = new AccessInfo();
@@ -76,9 +67,6 @@
 	
 	public void setResults(TupleBuffer results, ProcessorPlan plan) {
 		this.results = results;
-		this.batchSize = results.getBatchSize();
-		this.types = TupleBuffer.getTypeNames(results.getSchema());
-		this.rowCount = results.getRowCount();
 		this.uuid = results.getId();
 		this.hasLobs = results.isLobs();
 		this.accessInfo.populate(plan.getContext(), true);
@@ -108,7 +96,7 @@
 	@Override
 	public boolean prepare(Cache cache, BufferManager bufferManager) {
 		Assertion.assertTrue(!this.results.isForwardOnly());
-		bufferManager.addTupleBuffer(this.results);
+		bufferManager.distributeTupleBuffer(this.results.getId(), results);
 		return true;
 	}
 
@@ -118,40 +106,15 @@
 			if (this.hasLobs) {
 				return false; //the lob store is local only and not distributed
 			}
-			TupleBuffer buffer = null;
+			TupleBuffer buffer = bufferManager.getTupleBuffer(this.uuid);
+			if (buffer != null) {
+				this.results = buffer;
+			}
+			
 			try {
-				List<ElementSymbol> schema = new ArrayList<ElementSymbol>(types.length);
-				for (String type : types) {
-					ElementSymbol es = new ElementSymbol("x"); //$NON-NLS-1$
-					es.setType(DataTypeManager.getDataTypeClass(type));
-					schema.add(es);
-				}
-				buffer = bufferManager.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
-				buffer.setBatchSize(this.batchSize);
-				buffer.setId(this.uuid);
-				if (this.hint != null) {
-					buffer.setPrefersMemory(this.hint.getPrefersMemory());
-				}
-				
-				for (int row = 1; row <= this.rowCount; row+=this.batchSize) {
-					TupleBatch batch = (TupleBatch)cache.get(uuid+","+row); //$NON-NLS-1$
-					if (batch == null) {					
-						LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.getString("not_found_cache")); //$NON-NLS-1$
-						buffer.remove();
-						return false;
-					}		
-					buffer.addTupleBatch(batch, true);
-					cache.remove(uuid+","+row); //$NON-NLS-1$
-				}
-				this.results = buffer;	
-				bufferManager.addTupleBuffer(this.results);
-				this.results.close();
 				this.accessInfo.restore();
 			} catch (TeiidException e) {
 				LogManager.logWarning(LogConstants.CTX_DQP, e, QueryPlugin.Util.getString("unexpected_exception_restoring_results")); //$NON-NLS-1$
-				if (buffer != null) {
-					buffer.remove();
-				}
 				return false;
 			}
 		}

Modified: branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/engine/src/main/resources/org/teiid/query/i18n.properties	2011-09-13 20:05:11 UTC (rev 3468)
@@ -940,4 +940,5 @@
 DdlPlan.event_already_exists={0} already has an INSTEAD OF trigger defined for {1}.
 error_refresh=error occurred during refreshing the materialized view entries for view {0}
 
-support_required=Without required support property {0}, pushdown will not be enabled for {1} on translator {2}.
\ No newline at end of file
+support_required=Without required support property {0}, pushdown will not be enabled for {1} on translator {2}.
+full_state_not_supported=Full state transfer is not supported in the resultset cache distribution
\ No newline at end of file

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/Element.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -87,7 +87,7 @@
 	CONTAINER_NAME_ELEMENT(CONTAINER_NAME),
 	
 	//socket config
-	MAX_SOCKET_SIZE_ELEMENT(MAX_SOCKET_THREAD_SIZE),
+	MAX_SOCKET_THREAD_SIZE_ELEMENT(MAX_SOCKET_THREAD_SIZE),
 	IN_BUFFER_SIZE_ELEMENT(IN_BUFFER_SIZE),
 	OUT_BUFFER_SIZE_ELEMENT(OUT_BUFFER_SIZE),
 	SOCKET_BINDING_ELEMENT(SOCKET_BINDING),

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -27,6 +27,7 @@
 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.replication.jboss.JGroupsObjectReplicator;
 
 class JGroupsObjectReplicatorService implements Service<JGroupsObjectReplicator> {
@@ -34,6 +35,7 @@
 	public final InjectedValue<ChannelFactory> channelFactoryInjector = new InjectedValue<ChannelFactory>();
 	private JGroupsObjectReplicator replicator; 
 	private String clusterName;
+	private BufferManager buffermanager;
 	
 	public JGroupsObjectReplicatorService(String clusterName){
 		this.clusterName = clusterName;
@@ -41,12 +43,18 @@
 	
 	@Override
 	public void start(StartContext context) throws StartException {
-		replicator = new JGroupsObjectReplicator(this.clusterName) {
+		this.replicator = new JGroupsObjectReplicator(this.clusterName) {
 			@Override
 			public ChannelFactory getChannelFactory() {
 				return channelFactoryInjector.getValue();
 			}
 		};
+		
+		try {
+			this.replicator.replicate(clusterName, BufferManager.class, this.buffermanager, 0);
+		} catch (Exception e) {
+			throw new StartException(e);
+		}
 	}
 
 	@Override
@@ -57,5 +65,9 @@
 	public JGroupsObjectReplicator getValue() throws IllegalStateException,IllegalArgumentException {
 		return replicator;
 	}
+	
+	public void setBufferManager(BufferManager buffermanager) {
+		this.buffermanager = buffermanager;
+	}
 
 }

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidBootServicesAdd.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidBootServicesAdd.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidBootServicesAdd.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -153,19 +153,14 @@
     	newControllers.add(service);
     	
     	// system function tree
-		SystemFunctionManager systemFunctionManager = null;
-		try {
-			systemFunctionManager = new SystemFunctionManager();
-			if (operation.hasDefined(Configuration.ALLOW_ENV_FUNCTION)) {
-				systemFunctionManager.setAllowEnvFunction(operation.get(Configuration.ALLOW_ENV_FUNCTION).asBoolean());
-			}
-			else {
-				systemFunctionManager.setAllowEnvFunction(false);
-			}
-			systemFunctionManager.setClassloader(Module.getCallerModule().getModule(ModuleIdentifier.create("org.jboss.teiid")).getClassLoader()); //$NON-NLS-1$
-		} catch (ModuleLoadException e) {
-			throw new OperationFailedException(e, operation);
+		SystemFunctionManager systemFunctionManager = new SystemFunctionManager();
+		if (operation.hasDefined(Configuration.ALLOW_ENV_FUNCTION)) {
+			systemFunctionManager.setAllowEnvFunction(operation.get(Configuration.ALLOW_ENV_FUNCTION).asBoolean());
 		}
+		else {
+			systemFunctionManager.setAllowEnvFunction(false);
+		}
+		systemFunctionManager.setClassloader(Module.getCallerModule().getClassLoader()); 
     	
     	// VDB repository
     	final VDBRepository vdbRepository = new VDBRepository();
@@ -253,6 +248,7 @@
     			clusterName = node.get(Configuration.CLUSTER_NAME).asString();
     		}
     		JGroupsObjectReplicatorService replicatorService = new JGroupsObjectReplicatorService(clusterName);
+    		replicatorService.setBufferManager(bufferManager.getBufferManager());
 			ServiceBuilder<JGroupsObjectReplicator> serviceBuilder = target.addService(TeiidServiceNames.OBJECT_REPLICATOR, replicatorService);
 			serviceBuilder.addDependency(ServiceName.JBOSS.append("jgroups", stack), ChannelFactory.class, replicatorService.channelFactoryInjector); //$NON-NLS-1$
 			newControllers.add(serviceBuilder.install());
@@ -263,9 +259,9 @@
         context.addStep(new AbstractDeploymentChainStep() {
 			@Override
 			public void execute(DeploymentProcessorTarget processorTarget) {
-				processorTarget.addDeploymentProcessor(Phase.STRUCTURE, Phase.STRUCTURE_WAR_DEPLOYMENT_INIT|0x0001,new VDBStructure());
+				processorTarget.addDeploymentProcessor(Phase.STRUCTURE, Phase.STRUCTURE_WAR_DEPLOYMENT_INIT|0x0001,new VDBStructureDeployer());
 				processorTarget.addDeploymentProcessor(Phase.PARSE, Phase.PARSE_WEB_DEPLOYMENT|0x0001, new VDBParserDeployer());
-				processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES, Phase.DEPENDENCIES_WAR_MODULE|0x0001, new VDBDependencyProcessor());
+				processorTarget.addDeploymentProcessor(Phase.DEPENDENCIES, Phase.DEPENDENCIES_WAR_MODULE|0x0001, new VDBDependencyDeployer());
 				processorTarget.addDeploymentProcessor(Phase.INSTALL, Phase.INSTALL_WAR_DEPLOYMENT|0x0001, new VDBDeployer(translatorRepo, asyncThreadPoolName));            			
 			}
         	

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -155,7 +155,7 @@
     
     private void writeSocketConfiguration(XMLExtendedStreamWriter writer, ModelNode node) throws XMLStreamException {
     	writeAttribute(writer, Element.SOCKET_BINDING_ELEMENT, node);
-    	writeElement(writer, Element.MAX_SOCKET_SIZE_ELEMENT, node);
+    	writeElement(writer, Element.MAX_SOCKET_THREAD_SIZE_ELEMENT, node);
     	writeElement(writer, Element.IN_BUFFER_SIZE_ELEMENT, node);
     	writeElement(writer, Element.OUT_BUFFER_SIZE_ELEMENT, node);
     	
@@ -462,7 +462,7 @@
         while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
             Element element = Element.forName(reader.getLocalName());
             switch (element) {
-            case MAX_SOCKET_SIZE_ELEMENT:
+            case MAX_SOCKET_THREAD_SIZE_ELEMENT:
             case IN_BUFFER_SIZE_ELEMENT:
             case OUT_BUFFER_SIZE_ELEMENT:
             	node.get(reader.getLocalName()).set(Integer.parseInt(reader.getElementText()));

Copied: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java (from rev 3464, branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyProcessor.java)
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java	                        (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -0,0 +1,94 @@
+/*
+ * 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 java.io.Closeable;
+import java.io.IOException;
+import java.util.List;
+
+import org.jboss.as.server.deployment.*;
+import org.jboss.as.server.deployment.module.*;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoadException;
+import org.jboss.modules.ModuleLoader;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VirtualFileFilter;
+import org.jboss.vfs.VisitorAttributes;
+import org.jboss.vfs.util.SuffixMatchFilter;
+import org.teiid.deployers.TeiidAttachments;
+
+class VDBDependencyDeployer implements DeploymentUnitProcessor {
+	public static final String LIB = "/lib"; //$NON-NLS-1$
+	private static final VirtualFileFilter DEFAULT_JAR_LIB_FILTER = new SuffixMatchFilter(".jar", VisitorAttributes.DEFAULT); //$NON-NLS-1$
+	
+	@Override
+	public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
+		DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+		if (!TeiidAttachments.isVDBDeployment(deploymentUnit)) {
+			return;
+		}
+		
+		if (!TeiidAttachments.isDynamicVDB(deploymentUnit)) {
+			final ResourceRoot deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
+			final VirtualFile deploymentRoot = deploymentResourceRoot.getRoot();
+	        if(deploymentRoot == null) {
+	            return;
+	        }
+			
+			try {
+				final VirtualFile libDir = deploymentRoot.getChild(LIB);
+				if (libDir.exists()) {
+					final List<VirtualFile> archives = libDir.getChildren(DEFAULT_JAR_LIB_FILTER);
+					for (final VirtualFile archive : archives) {
+						try {
+							final Closeable closable = VFS.mountZip(archive, archive,TempFileProviderService.provider());
+							final ResourceRoot jarArchiveRoot = new ResourceRoot(archive.getName(), archive, new MountHandle(closable));
+							ModuleRootMarker.mark(jarArchiveRoot);
+							deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, jarArchiveRoot);
+						} catch (IOException e) {
+							throw new DeploymentUnitProcessingException("failed to process " + archive, e); //$NON-NLS-1$
+						}
+					}
+				}	
+			} catch(IOException e) {
+				throw new DeploymentUnitProcessingException(e);
+			}
+		}
+		
+		// add translators as dependent modules to this VDB.
+        try {
+			final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
+			final ModuleLoader moduleLoader = Module.getCallerModule().getModule(ModuleIdentifier.create("org.jboss.teiid")).getModuleLoader(); //$NON-NLS-1$
+			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.api"), false, false, false)); //$NON-NLS-1$
+			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.common-core"), false, false, false)); //$NON-NLS-1$
+			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.api"), false, false, false)); //$NON-NLS-1$
+		} catch (ModuleLoadException e) {
+			throw new DeploymentUnitProcessingException(e);
+		}
+	}
+
+	@Override
+	public void undeploy(DeploymentUnit context) {
+	}
+}


Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Deleted: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyProcessor.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyProcessor.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyProcessor.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -1,94 +0,0 @@
-/*
- * 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 java.io.Closeable;
-import java.io.IOException;
-import java.util.List;
-
-import org.jboss.as.server.deployment.*;
-import org.jboss.as.server.deployment.module.*;
-import org.jboss.modules.Module;
-import org.jboss.modules.ModuleIdentifier;
-import org.jboss.modules.ModuleLoadException;
-import org.jboss.modules.ModuleLoader;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.VirtualFileFilter;
-import org.jboss.vfs.VisitorAttributes;
-import org.jboss.vfs.util.SuffixMatchFilter;
-import org.teiid.deployers.TeiidAttachments;
-
-class VDBDependencyProcessor implements DeploymentUnitProcessor {
-	public static final String LIB = "/lib"; //$NON-NLS-1$
-	private static final VirtualFileFilter DEFAULT_JAR_LIB_FILTER = new SuffixMatchFilter(".jar", VisitorAttributes.DEFAULT); //$NON-NLS-1$
-	
-	@Override
-	public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
-		DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
-		if (!TeiidAttachments.isVDBDeployment(deploymentUnit)) {
-			return;
-		}
-		
-		if (!TeiidAttachments.isDynamicVDB(deploymentUnit)) {
-			final ResourceRoot deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
-			final VirtualFile deploymentRoot = deploymentResourceRoot.getRoot();
-	        if(deploymentRoot == null) {
-	            return;
-	        }
-			
-			try {
-				final VirtualFile libDir = deploymentRoot.getChild(LIB);
-				if (libDir.exists()) {
-					final List<VirtualFile> archives = libDir.getChildren(DEFAULT_JAR_LIB_FILTER);
-					for (final VirtualFile archive : archives) {
-						try {
-							final Closeable closable = VFS.mountZip(archive, archive,TempFileProviderService.provider());
-							final ResourceRoot jarArchiveRoot = new ResourceRoot(archive.getName(), archive, new MountHandle(closable));
-							ModuleRootMarker.mark(jarArchiveRoot);
-							deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, jarArchiveRoot);
-						} catch (IOException e) {
-							throw new DeploymentUnitProcessingException("failed to process " + archive, e); //$NON-NLS-1$
-						}
-					}
-				}	
-			} catch(IOException e) {
-				throw new DeploymentUnitProcessingException(e);
-			}
-		}
-		
-		// add translators as dependent modules to this VDB.
-        try {
-			final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
-			final ModuleLoader moduleLoader = Module.getCallerModule().getModule(ModuleIdentifier.create("org.jboss.teiid")).getModuleLoader(); //$NON-NLS-1$
-			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.api"), false, false, false)); //$NON-NLS-1$
-			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.common-core"), false, false, false)); //$NON-NLS-1$
-			moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.api"), false, false, false)); //$NON-NLS-1$
-		} catch (ModuleLoadException e) {
-			throw new DeploymentUnitProcessingException(e);
-		}
-	}
-
-	@Override
-	public void undeploy(DeploymentUnit context) {
-	}
-}

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -25,10 +25,9 @@
 import java.util.concurrent.Executor;
 
 import org.jboss.as.server.deployment.*;
-import org.jboss.msc.service.ServiceBuilder;
-import org.jboss.msc.service.ServiceController;
+import org.jboss.msc.service.*;
+import org.jboss.msc.service.ServiceBuilder.DependencyType;
 import org.jboss.msc.service.ServiceController.Mode;
-import org.jboss.msc.service.ServiceName;
 import org.jboss.vfs.VirtualFile;
 import org.teiid.adminapi.Translator;
 import org.teiid.adminapi.impl.ModelMetaData;
@@ -41,7 +40,9 @@
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
 import org.teiid.metadata.index.IndexMetadataFactory;
+import org.teiid.query.ObjectReplicator;
 import org.teiid.runtime.RuntimePlugin;
+import org.teiid.services.BufferServiceImpl;
 
 
 class VDBDeployer implements DeploymentUnitProcessor {
@@ -108,7 +109,7 @@
 		ServiceBuilder<VDBMetaData> vdbService = context.getServiceTarget().addService(TeiidServiceNames.vdbServiceName(deployment.getName(), deployment.getVersion()), vdb);
 		for (ModelMetaData model:deployment.getModelMetaDatas().values()) {
 			for (String sourceName:model.getSourceNames()) {
-				vdbService.addDependency(ServiceName.JBOSS.append("data-source", model.getSourceConnectionJndiName(sourceName)));	//$NON-NLS-1$
+				vdbService.addDependency(DependencyType.OPTIONAL, ServiceName.JBOSS.append("data-source", model.getSourceConnectionJndiName(sourceName)));	//$NON-NLS-1$
 			}
 		}
 		
@@ -123,6 +124,8 @@
 		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(DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class, vdb.getObjectReplicatorInjector());
 		vdbService.setInitialMode(Mode.PASSIVE).install();
 	}
 
@@ -136,6 +139,9 @@
 		VDBMetaData deployment = deploymentUnit.getAttachment(TeiidAttachments.VDB_METADATA);
         final ServiceController<?> controller = deploymentUnit.getServiceRegistry().getService(TeiidServiceNames.vdbServiceName(deployment.getName(), deployment.getVersion()));
         if (controller != null) {
+        	VDBService vdbService = (VDBService)controller.getService();
+        	vdbService.undeployinProgress();
+        	
             controller.setMode(ServiceController.Mode.REMOVE);
         }
 	}

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -27,8 +27,10 @@
 import java.util.*;
 import java.util.concurrent.Executor;
 
-import org.jboss.msc.service.*;
-import org.jboss.msc.service.ServiceContainer.TerminateListener;
+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.adminapi.Model;
 import org.teiid.adminapi.Translator;
@@ -37,6 +39,7 @@
 import org.teiid.adminapi.impl.SourceMappingMetadata;
 import org.teiid.adminapi.impl.VDBMetaData;
 import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.common.buffer.BufferManager;
 import org.teiid.core.TeiidException;
 import org.teiid.deployers.*;
 import org.teiid.dqp.internal.datamgr.ConnectorManager;
@@ -46,8 +49,13 @@
 import org.teiid.logging.LogManager;
 import org.teiid.metadata.MetadataStore;
 import org.teiid.metadata.index.IndexMetadataFactory;
+import org.teiid.query.ObjectReplicator;
+import org.teiid.query.metadata.TransformationMetadata;
 import org.teiid.query.metadata.TransformationMetadata.Resource;
+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;
@@ -59,6 +67,9 @@
 	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<ObjectReplicator> objectReplicatorInjector = new InjectedValue<ObjectReplicator>();
+	private boolean undeployInProgress = false;
 	
 	public VDBService(VDBMetaData metadata) {
 		this.vdb = metadata;
@@ -178,24 +189,38 @@
 		this.vdb.removeAttachment(MetadataStoreGroup.class);
 		this.vdb.removeAttachment(IndexMetadataFactory.class);	
 		
+		// add object replication to temp/matview tables
+		GlobalTableStore gts = new GlobalTableStoreImpl(getBuffermanager(), vdb.getAttachment(TransformationMetadata.class));
+		if (getObjectReplicatorInjector().getValue() != null) {
+			try {
+				gts = getObjectReplicatorInjector().getValue().replicate(vdb.getName() + vdb.getVersion(), GlobalTableStore.class, gts, 300000);
+			} catch (Exception e) {
+				LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("replication_failed", gts)); //$NON-NLS-1$
+			}
+		}
+		vdb.addAttchment(GlobalTableStore.class, gts);		
+		
 		LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_deployed",vdb, valid?"active":"inactive")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$		
 	}
 
 	@Override
 	public void stop(StopContext context) {
 		
+		// stop object replication
+		if (getObjectReplicatorInjector().getValue() != null) {
+			GlobalTableStore gts = vdb.getAttachment(GlobalTableStore.class);
+			getObjectReplicatorInjector().getValue().stop(gts);
+		}		
+		
 		getVDBRepository().removeVDB(this.vdb.getName(), this.vdb.getVersion());
 		this.vdb.setRemoved(true);
 
-		context.getController().getServiceContainer().addTerminateListener(new TerminateListener() {
-			@Override
-			public void handleTermination(Info info) {
-				if (info.getShutdownInitiated() < 0) {
-					getSerializer().removeAttachments(vdb); 
-					LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+vdb.getName()+" metadata removed"); //$NON-NLS-1$ //$NON-NLS-2$
-				}
-			}			
-		});
+		// service stopped not due to shutdown then clean-up the data files
+		if (undeployInProgress) {
+			getSerializer().removeAttachments(vdb); 
+			LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+vdb.getName()+" metadata removed"); //$NON-NLS-1$ //$NON-NLS-2$
+		}
+
 		LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_undeployed", this.vdb)); //$NON-NLS-1$
 	}
 
@@ -416,4 +441,20 @@
 	private ObjectSerializer getSerializer() {
 		return serializerInjector.getValue();
 	}
+	
+	public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
+		return bufferServiceInjector;
+	}
+	
+	private BufferManager getBuffermanager() {
+		return getBufferServiceInjector().getValue().getBufferManager();
+	}
+	
+	public InjectedValue<ObjectReplicator> getObjectReplicatorInjector() {
+		return objectReplicatorInjector;
+	}	
+	
+	public void undeployinProgress() {
+		this.undeployInProgress = true;
+	}
 }

Deleted: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructure.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructure.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructure.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -1,67 +0,0 @@
-/*
- * 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.as.server.deployment.*;
-import org.jboss.vfs.VirtualFile;
-import org.teiid.deployers.TeiidAttachments;
-import org.teiid.metadata.VdbConstants;
-
-
-
-class VDBStructure  implements DeploymentUnitProcessor {
-	private static final String VDB_EXTENSION = ".vdb"; //$NON-NLS-1$
-	private static final String DYNAMIC_VDB_STRUCTURE = "-vdb.xml"; //$NON-NLS-1$
-	
-	@Override
-	public void deploy(final DeploymentPhaseContext phaseContext)  throws DeploymentUnitProcessingException {
-		
-        DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
-        
-        VirtualFile file = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
-        if (file == null) {
-        	return;
-        }
-        
-        if(file.getName().toLowerCase().endsWith(VDB_EXTENSION)) {
-			VirtualFile metainf = file.getChild("META-INF"); //$NON-NLS-1$
-			if (metainf == null) {
-				return;
-			}
-			
-			if (metainf.getChild(VdbConstants.DEPLOYMENT_FILE) == null) {
-				return;
-			}
-			// adds a TYPE attachment.
-			TeiidAttachments.setAsVDBDeployment(deploymentUnit);
-        }
-        else if (file.getName().toLowerCase().endsWith(DYNAMIC_VDB_STRUCTURE)) {
-	        TeiidAttachments.setAsDynamicVDBDeployment(deploymentUnit);			        	
-        }
-	}
-	
-	
-	@Override
-	public void undeploy(final DeploymentUnit context) {
-	}
-
-}

Copied: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructureDeployer.java (from rev 3464, branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructure.java)
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructureDeployer.java	                        (rev 0)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructureDeployer.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -0,0 +1,67 @@
+/*
+ * 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.as.server.deployment.*;
+import org.jboss.vfs.VirtualFile;
+import org.teiid.deployers.TeiidAttachments;
+import org.teiid.metadata.VdbConstants;
+
+
+
+class VDBStructureDeployer  implements DeploymentUnitProcessor {
+	private static final String VDB_EXTENSION = ".vdb"; //$NON-NLS-1$
+	private static final String DYNAMIC_VDB_STRUCTURE = "-vdb.xml"; //$NON-NLS-1$
+	
+	@Override
+	public void deploy(final DeploymentPhaseContext phaseContext)  throws DeploymentUnitProcessingException {
+		
+        DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+        
+        VirtualFile file = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
+        if (file == null) {
+        	return;
+        }
+        
+        if(file.getName().toLowerCase().endsWith(VDB_EXTENSION)) {
+			VirtualFile metainf = file.getChild("META-INF"); //$NON-NLS-1$
+			if (metainf == null) {
+				return;
+			}
+			
+			if (metainf.getChild(VdbConstants.DEPLOYMENT_FILE) == null) {
+				return;
+			}
+			// adds a TYPE attachment.
+			TeiidAttachments.setAsVDBDeployment(deploymentUnit);
+        }
+        else if (file.getName().toLowerCase().endsWith(DYNAMIC_VDB_STRUCTURE)) {
+	        TeiidAttachments.setAsDynamicVDBDeployment(deploymentUnit);			        	
+        }
+	}
+	
+	
+	@Override
+	public void undeploy(final DeploymentUnit context) {
+	}
+
+}


Property changes on: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/VDBStructureDeployer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -86,7 +86,6 @@
 import org.teiid.query.optimizer.relational.RelationalPlanner;
 import org.teiid.query.processor.DdlPlan;
 import org.teiid.query.tempdata.GlobalTableStore;
-import org.teiid.query.tempdata.GlobalTableStoreImpl;
 import org.teiid.security.SecurityHelper;
 import org.teiid.services.BufferServiceImpl;
 import org.teiid.services.SessionServiceImpl;
@@ -242,23 +241,10 @@
 			@Override
 			public void removed(String name, int version, CompositeVDB vdb) {
 				recentlyRemoved.add(new VDBKey(name, version));
-				if (getObjectReplicatorInjector().getValue() != null) {
-					GlobalTableStore gts = vdb.getVDB().getAttachment(GlobalTableStore.class);
-					getObjectReplicatorInjector().getValue().stop(gts);
-				}
 			}
 			
 			@Override
 			public void added(String name, int version, CompositeVDB vdb) {
-				GlobalTableStore gts = new GlobalTableStoreImpl(dqpCore.getBufferManager(), vdb.getVDB().getAttachment(TransformationMetadata.class));
-				if (getObjectReplicatorInjector().getValue() != null) {
-					try {
-						gts = getObjectReplicatorInjector().getValue().replicate(name + version, GlobalTableStore.class, gts, 300000);
-					} catch (Exception e) {
-						LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.getString("replication_failed", gts)); //$NON-NLS-1$
-					}
-				}
-				vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
 				if (!recentlyRemoved.remove(new VDBKey(name, version))) {
 					return;
 				}

Modified: branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
===================================================================
--- branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/main/resources/schema/jboss-teiid.xsd	2011-09-13 20:05:11 UTC (rev 3468)
@@ -61,35 +61,37 @@
                 </xs:annotation>
             </xs:element>
 
-            <xs:element name="resultset-cache" type="xs:string" maxOccurs="1" minOccurs="0">
+            <xs:element name="resultset-cache" maxOccurs="1" minOccurs="0">
                 <xs:annotation>
-                    <xs:documentation>Configuration for result set caching.
-                        There will be 2 caches with these settings.
-                        One cache holds results that are specific to sessions.
-                        The other cache holds vdb scoped results and can
-                        be replicated.</xs:documentation>
+                    <xs:documentation>Configuration for result set caching.</xs:documentation>
                 </xs:annotation>
-                <xs:attribute name="container-name" type="xs:string" use="required"/>
-                <xs:attribute name="name" type="xs:string" use="required"/>
-                <xs:attribute name="enable" type="xs:boolean" default="true"/>
-                <xs:attribute name="max-staleness" type="xs:int" default="60"/>
+                <xs:complexType>
+                    <xs:attribute name="name" type="xs:string" use="required"/>
+                    <xs:attribute name="container-name" type="xs:string" use="required"/>
+                    <xs:attribute name="enable" type="xs:boolean" default="true"/>
+                    <xs:attribute name="max-staleness" type="xs:int" default="60"/>
+                </xs:complexType>
             </xs:element>
             
-            <xs:element name="preparedplan-cache" type="xs:string" maxOccurs="1" minOccurs="0">
+            <xs:element name="preparedplan-cache" maxOccurs="1" minOccurs="0">
                 <xs:annotation>
                     <xs:documentation>Configuration for prepared plan caching. (local memory only)</xs:documentation>
                 </xs:annotation>
-                <xs:attribute name="max-entries" type="xs:string"/>
-                <xs:attribute name="max-age-in-seconds" type="xs:boolean" default="true"/>
-                <xs:attribute name="max-staleness" type="xs:int" default="0"/>                
+                <xs:complexType>
+                    <xs:attribute name="max-entries" type="xs:int" default="512"/>
+                    <xs:attribute name="max-age-in-seconds" type="xs:int" default="28800"/>
+                    <xs:attribute name="max-staleness" type="xs:int" default="0"/>    
+                </xs:complexType>            
             </xs:element>
             
-            <xs:element name="object-replicator" type="xs:string" maxOccurs="1" minOccurs="0">
+            <xs:element name="object-replicator" maxOccurs="1" minOccurs="0">
                 <xs:annotation>
                     <xs:documentation>Cluster wide results distributor </xs:documentation>
                 </xs:annotation>
-                <xs:attribute name="stack" type="xs:string" use="required"/>
-                <xs:attribute name="cluster-name" type="xs:string" use="required"/>
+                <xs:complexType>
+                    <xs:attribute name="stack" type="xs:string" use="required"/>
+                    <xs:attribute name="cluster-name" type="xs:string" use="required"/>
+                </xs:complexType>
             </xs:element>            
         
             <xs:element name="query-engine" type="runtime-engine-type" maxOccurs="2" minOccurs="1">

Modified: branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
===================================================================
--- branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -31,7 +31,6 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
 import javax.xml.stream.*;
 import javax.xml.transform.Source;
@@ -49,21 +48,25 @@
 import org.jboss.as.controller.operations.global.GlobalOperationHandlers;
 import org.jboss.as.controller.persistence.ConfigurationPersistenceException;
 import org.jboss.as.controller.persistence.ConfigurationPersister;
-import org.jboss.as.controller.persistence.ModelMarshallingContext;
 import org.jboss.as.controller.persistence.SubsystemMarshallingContext;
 import org.jboss.as.controller.registry.ManagementResourceRegistration;
 import org.jboss.as.controller.registry.Resource;
 import org.jboss.dmr.ModelNode;
 import org.jboss.dmr.ModelType;
 import org.jboss.dmr.Property;
+import org.jboss.modules.Module;
+import org.jboss.modules.ModuleClassLoader;
+import org.jboss.modules.ModuleIdentifier;
+import org.jboss.modules.ModuleLoader;
 import org.jboss.msc.service.*;
 import org.jboss.staxmapper.XMLElementWriter;
-import org.jboss.staxmapper.XMLExtendedStreamWriter;
 import org.jboss.staxmapper.XMLMapper;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations.Mock;
+import org.mockito.internal.stubbing.Stubber;
 import org.teiid.core.util.ObjectConverterUtil;
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
@@ -191,7 +194,7 @@
         }
     }     
 	
-    static List<ModelNode> createSubSystem(String xmlContent) throws XMLStreamException {
+    static List<ModelNode> createSubSystem(String xmlContent) throws Exception {
 
         final Reader reader = new StringReader(xmlContent);
         XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(reader);
@@ -211,7 +214,6 @@
             }
             update.get(OP_ADDR).set(subsystemAddress);
         }
-
         return updates;
     }	
     

Modified: branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt
===================================================================
--- branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/test/resources/teiid-model-config.txt	2011-09-13 20:05:11 UTC (rev 3468)
@@ -1,11 +1,5 @@
 {
     "attributes" => {
-        "name" => {
-            "type" => STRING,
-            "description" => "Name of the subsystem",
-            "required" => true,
-            "max-occurs" => 1
-        },
         "max-threads" => {
             "type" => INT,
             "description" => "Process pool maximum thread count. (default 64)",
@@ -76,13 +70,6 @@
             "max-occurs" => 1,
             "default" => 5242880
         },
-        "event-distributor-name" => {
-            "type" => STRING,
-            "description" => "The JNDI name of the Teiid Event Distributor",
-            "required" => false,
-            "max-occurs" => 1,
-            "default" => "teiid/event-distributor"
-        },
         "detect-change-events" => {
             "type" => BOOLEAN,
             "description" => "Set to true for the engine to detect local change events. Should be disabled if using external change data capture tools. (default true)",
@@ -92,7 +79,7 @@
         },
         "security-domain" => {
             "type" => LIST,
-            "description" => "Comma separated list of domains to be used to login into Teiid",
+            "description" => "List of domains to be used to login into Teiid",
             "required" => false,
             "max-occurs" => 1
         },
@@ -119,28 +106,21 @@
             "max-occurs" => 1,
             "min-occurs" => 1,
             "attributes" => {
-                "enabled" => {
-                    "type" => BOOLEAN,
-                    "description" => "enabled",
-                    "required" => false,
-                    "max-occurs" => 1,
-                    "default" => true
-                },
-                "maxSocketThreads" => {
+                "max-socket-threads" => {
                     "type" => INT,
                     "description" => "Max number of threads dedicated to initial request processing. Zero indicates the system default of max available processors. (default 0)  Setting this value above the max available processors is not recommended.",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => 0
                 },
-                "inputBufferSize" => {
+                "input-buffer-size" => {
                     "type" => INT,
                     "description" => "SO_RCVBUF size, 0 indicates that system default should be used (default 0)",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => 0
                 },
-                "outputBufferSize" => {
+                "output-buffer-size" => {
                     "type" => INT,
                     "description" => "SO_SNDBUF size, 0 indicates that system default should be used (default 0)",
                     "required" => false,
@@ -148,7 +128,7 @@
                     "default" => 0
                 },
                 "socket-binding" => {
-                    "type" => INT,
+                    "type" => STRING,
                     "description" => "Socket binding for the profile",
                     "required" => true,
                     "max-occurs" => 1
@@ -160,52 +140,52 @@
                     "max-occurs" => 1,
                     "default" => "login"
                 },
-                "keystoreFilename" => {
+                "keystore-name" => {
                     "type" => STRING,
                     "description" => "Keystore File Name",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "keystorePassword" => {
+                "keystore-password" => {
                     "type" => STRING,
                     "description" => "Keystore password",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "keystoreType" => {
+                "keystore-type" => {
                     "type" => STRING,
                     "description" => "Keystore type",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => "JKS"
                 },
-                "sslProtocol" => {
+                "ssl-protocol" => {
                     "type" => BOOLEAN,
                     "description" => "SSL protocol used",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => false
                 },
-                "keymanagementAlgorithm" => {
+                "keymanagement-algorithm" => {
                     "type" => STRING,
                     "description" => "Use key management algorithm",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => "false"
                 },
-                "truststoreFilename" => {
+                "truststore-name" => {
                     "type" => STRING,
                     "description" => "Truststore Name",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "truststorePassword" => {
+                "truststore-password" => {
                     "type" => STRING,
                     "description" => "Truststore Password",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "authenticationMode" => {
+                "authentication-mode" => {
                     "type" => STRING,
                     "description" => "Authentication Mode (1-way, 2-way, anonymous)",
                     "required" => false,
@@ -228,28 +208,21 @@
             "max-occurs" => 1,
             "min-occurs" => 1,
             "attributes" => {
-                "enabled" => {
-                    "type" => BOOLEAN,
-                    "description" => "enabled",
-                    "required" => false,
-                    "max-occurs" => 1,
-                    "default" => true
-                },
-                "maxSocketThreads" => {
+                "max-socket-threads" => {
                     "type" => INT,
                     "description" => "Max number of threads dedicated to initial request processing. Zero indicates the system default of max available processors. (default 0)  Setting this value above the max available processors is not recommended.",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => 0
                 },
-                "inputBufferSize" => {
+                "input-buffer-size" => {
                     "type" => INT,
                     "description" => "SO_RCVBUF size, 0 indicates that system default should be used (default 0)",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => 0
                 },
-                "outputBufferSize" => {
+                "output-buffer-size" => {
                     "type" => INT,
                     "description" => "SO_SNDBUF size, 0 indicates that system default should be used (default 0)",
                     "required" => false,
@@ -257,7 +230,7 @@
                     "default" => 0
                 },
                 "socket-binding" => {
-                    "type" => INT,
+                    "type" => STRING,
                     "description" => "Socket binding for the profile",
                     "required" => true,
                     "max-occurs" => 1
@@ -269,52 +242,52 @@
                     "max-occurs" => 1,
                     "default" => "login"
                 },
-                "keystoreFilename" => {
+                "keystore-name" => {
                     "type" => STRING,
                     "description" => "Keystore File Name",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "keystorePassword" => {
+                "keystore-password" => {
                     "type" => STRING,
                     "description" => "Keystore password",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "keystoreType" => {
+                "keystore-type" => {
                     "type" => STRING,
                     "description" => "Keystore type",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => "JKS"
                 },
-                "sslProtocol" => {
+                "ssl-protocol" => {
                     "type" => BOOLEAN,
                     "description" => "SSL protocol used",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => false
                 },
-                "keymanagementAlgorithm" => {
+                "keymanagement-algorithm" => {
                     "type" => STRING,
                     "description" => "Use key management algorithm",
                     "required" => false,
                     "max-occurs" => 1,
                     "default" => "false"
                 },
-                "truststoreFilename" => {
+                "truststore-name" => {
                     "type" => STRING,
                     "description" => "Truststore Name",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "truststorePassword" => {
+                "truststore-password" => {
                     "type" => STRING,
                     "description" => "Truststore Password",
                     "required" => false,
                     "max-occurs" => 1
                 },
-                "authenticationMode" => {
+                "authentication-mode" => {
                     "type" => STRING,
                     "description" => "Authentication Mode (1-way, 2-way, anonymous)",
                     "required" => false,

Modified: branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml
===================================================================
--- branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/jboss-integration/src/test/resources/teiid-sample-config.xml	2011-09-13 20:05:11 UTC (rev 3468)
@@ -16,25 +16,13 @@
         <authorization-validator-module>javax.api</authorization-validator-module>
         <policy-decider-module>javax.api</policy-decider-module>
          -->
-        <distributed-cache-factory>
-            <cache-service-jndi-name>java:TeiidCacheManager</cache-service-jndi-name>
-            <resultsetCacheName>teiid-resultset-cache</resultsetCacheName>
-        </distributed-cache-factory>
         
-        <resultset-cache>
-            <maxEntries>1024</maxEntries>
-            <maxAgeInSeconds>7200</maxAgeInSeconds>
-            <maxStaleness>60</maxStaleness>
-            <type>EXPIRATION</type>
-            <location>resultset</location>
-        </resultset-cache>
+        <resultset-cache name="cache" container-name="container" enable="false" max-staleness="90"/>
         
-        <preparedplan-cache>
-            <maxEntries>512</maxEntries>
-            <maxAgeInSeconds>28800</maxAgeInSeconds>
-            <maxStaleness>0</maxStaleness>
-        </preparedplan-cache>    
-    
+        <preparedplan-cache max-entries="512" max-age-in-seconds="28800" max-staleness="90"/>
+        
+        <object-replicator stack="stack" cluster-name="cluster"/>
+        
     <query-engine name="default">
         <max-threads>64</max-threads>
         <max-active-plans>20</max-active-plans>
@@ -46,25 +34,22 @@
         <max-source-rows-allowed>-1</max-source-rows-allowed>
         <exception-on-max-source-rows>true</exception-on-max-source-rows>
         <max-odbc-lob-size-allowed>5242880</max-odbc-lob-size-allowed>
-        <event-distributor-name>teiid/event-distributor</event-distributor-name>
         <detect-change-events>true</detect-change-events>
         <security-domain>teiid-security</security-domain>
         <security-domain>teiid-security2</security-domain>
         <max-sessions-allowed>5000</max-sessions-allowed>
         <sessions-expiration-timelimit>0</sessions-expiration-timelimit>
                 
-        <jdbc>
-            <maxSocketThreads>0</maxSocketThreads>
-            <inputBufferSize>0</inputBufferSize>
-            <outputBufferSize>0</outputBufferSize>
-            <socket-binding>teiid-jdbc</socket-binding>
+        <jdbc socket-binding="teiid-jdbc">
+            <max-socket-threads>0</max-socket-threads>
+            <input-buffer-size>0</input-buffer-size>
+            <output-buffer-size>0</output-buffer-size>
         </jdbc>
 
-        <odbc>
-            <maxSocketThreads>0</maxSocketThreads>
-            <inputBufferSize>0</inputBufferSize>
-            <outputBufferSize>0</outputBufferSize>
-            <socket-binding>teiid-odbc</socket-binding>
+        <odbc socket-binding="teiid-odbc">
+            <max-socket-threads>0</max-socket-threads>
+            <input-buffer-size>0</input-buffer-size>
+            <output-buffer-size>0</output-buffer-size>
         </odbc>
     </query-engine>
     

Modified: branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java	2011-09-13 18:58:53 UTC (rev 3467)
+++ branches/as7/runtime/src/test/java/org/teiid/dqp/service/buffer/TestLocalBufferService.java	2011-09-13 20:05:11 UTC (rev 3468)
@@ -24,16 +24,24 @@
 
 import static org.junit.Assert.*;
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.junit.Test;
 import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBatch;
+import org.teiid.common.buffer.TupleBuffer;
+import org.teiid.common.buffer.BufferManager.TupleSourceType;
 import org.teiid.common.buffer.impl.BufferManagerImpl;
 import org.teiid.common.buffer.impl.FileStorageManager;
 import org.teiid.core.types.DataTypeManager;
+import org.teiid.core.types.DataTypeManager.DefaultDataTypes;
 import org.teiid.core.util.UnitTestUtil;
 import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.ElementSymbol;
 import org.teiid.query.sql.symbol.Expression;
 import org.teiid.services.BufferServiceImpl;
 
@@ -94,4 +102,58 @@
         assertEquals(13141, mgr.getSchemaSize(schema));
     }
     
+    @Test
+    public void testStateTransfer() throws Exception {
+    	BufferServiceImpl svc = new BufferServiceImpl();
+        svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
+        svc.setUseDisk(true);
+        svc.start();
+    	
+        BufferManager mgr = svc.getBufferManager();
+		List<ElementSymbol> schema = new ArrayList<ElementSymbol>(2);
+		ElementSymbol es = new ElementSymbol("x"); //$NON-NLS-1$
+		es.setType(DataTypeManager.getDataTypeClass(DefaultDataTypes.STRING));
+		schema.add(es);
+		
+		ElementSymbol es2 = new ElementSymbol("y"); //$NON-NLS-1$
+		es2.setType(DataTypeManager.getDataTypeClass(DefaultDataTypes.INTEGER));
+		schema.add(es2);
+		
+		for (int i = 0; i < 5; i++) {
+			TupleBuffer buffer = mgr.createTupleBuffer(schema, "cached", TupleSourceType.FINAL); //$NON-NLS-1$
+			buffer.setBatchSize(50);
+			buffer.setId("state_id"+i);
+			
+			for(int batch = 0; batch < 3; batch++) {
+				for (int row = 0; row < 50; row++) {
+					buffer.addTuple(Arrays.asList(new Object[] {"String"+row, new Integer(row)}));
+				}
+			}
+			mgr.distributeTupleBuffer(buffer.getId(), buffer);
+		}
+		
+		((BufferManagerImpl)mgr).getState(new FileOutputStream(UnitTestUtil.getTestScratchPath()+"/teiid/statetest"));
+		
+		// now read back
+    	BufferServiceImpl svc2 = new BufferServiceImpl();
+        svc2.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
+        svc2.setUseDisk(true);
+        svc2.start();
+    	
+        BufferManager mgr2 = svc2.getBufferManager();		
+		((BufferManagerImpl)mgr2).setState(new FileInputStream(UnitTestUtil.getTestScratchPath()+"/teiid/statetest"));
+		
+		for (int i = 0; i < 5; i++) {
+			String id = "state_id"+i;
+			TupleBuffer buffer = mgr.getTupleBuffer(id);
+			
+			TupleBatch tb = buffer.getBatch(50);
+			List[] rows = tb.getAllTuples();
+			for (int row = 0; row < 50; row++) {
+				assertEquals("String"+row, rows[row].get(0));
+				assertEquals(row, rows[row].get(1));
+			}
+		}
+    }
+    
 }



More information about the teiid-commits mailing list