[teiid-commits] teiid SVN: r1868 - in branches/JCA: build/kit-jboss-container/deploy/teiid and 15 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Feb 23 15:38:58 EST 2010


Author: rareddy
Date: 2010-02-23 15:38:54 -0500 (Tue, 23 Feb 2010)
New Revision: 1868

Removed:
   branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-engine.rar/
   branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-runtime-ds.xml
   branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPManagementView.java
   branches/JCA/jboss-integration/src/main/java/com/metamatrix/dqp/embedded/
   branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/configuration/
   branches/JCA/runtime/src/main/java/com/metamatrix/dqp/embedded/services/
   branches/JCA/runtime/src/main/java/com/metamatrix/platform/security/authorization/
   branches/JCA/runtime/src/main/java/com/metamatrix/platform/security/membership/spi/
   branches/JCA/runtime/src/main/java/com/metamatrix/platform/security/session/
   branches/JCA/runtime/src/main/java/org/teiid/ConnectionInfo.java
   branches/JCA/runtime/src/main/java/org/teiid/TeiidConnectionFactory.java
   branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnection.java
   branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnectionFactory.java
   branches/JCA/runtime/src/main/java/org/teiid/TeiidResourceAdapter.java
   branches/JCA/runtime/src/main/java/org/teiid/WrappedConnection.java
   branches/JCA/runtime/src/main/java/org/teiid/adminapi/
   branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/membership/spi/
   branches/JCA/runtime/src/test/java/com/metamatrix/platform/security/session/
Modified:
   branches/JCA/build/assembly/jboss-container/dist.xml
   branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
   branches/JCA/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
   branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java
   branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java
   branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
   branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
   branches/JCA/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
   branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
   branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
   branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
Log:
TEIID-862: Teiid engine is exposed as simple bean to avoid the unnecessary dependency issues during the start up. The work manager and Txn manager are grabbed from the Jboss container directly

Modified: branches/JCA/build/assembly/jboss-container/dist.xml
===================================================================
--- branches/JCA/build/assembly/jboss-container/dist.xml	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/build/assembly/jboss-container/dist.xml	2010-02-23 20:38:54 UTC (rev 1868)
@@ -85,7 +85,7 @@
         <binaries>        
           <includeDependencies>false</includeDependencies>
           <unpack>false</unpack>
-          <outputDirectory>deploy/teiid-connectors</outputDirectory>
+          <outputDirectory>deploy/teiid/connectors</outputDirectory>
         </binaries>
       
     </moduleSet>

Modified: branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml	2010-02-23 20:38:54 UTC (rev 1868)
@@ -16,8 +16,6 @@
    <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* $instanceof{org.jboss.kernel.spi.dependency.KernelControllerContextAware}->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))">
       <interceptor-ref name="JndiAspect"/>
    </bind>
-
-    <bean name="SecurityHelper" class="org.teiid.jboss.JBossSecurityHelper"/>
     
     <!-- Teiid Services -->
     <bean name="AuthorizationService" class="org.teiid.services.AuthorizationServiceImpl">
@@ -63,17 +61,40 @@
     
     <bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">
         <annotation>@org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="teiid/engine-deployer")</annotation>
-        <property name="securityHelper"><inject bean="ContainerHelper"/></property>
-        <property name="containerHelper"><inject bean="ContainerHelper"/></property>
         <property name="jdbcSocketConfiguration"><inject bean="JdbcSocketConfiguration"/></property>
         <property name="adminSocketConfiguration"><inject bean="AdminSocketConfiguration"/></property>
-        <property name="VDBRepository"><inject bean="VDBRepository"/></property>
+        <property name="workManager"><inject bean="WorkManager"/></property>
+        <property name="XATerminator"><inject bean="TransactionManager" property="XATerminator"/></property>
         <property name="authorizationService"><inject bean="AuthorizationService"/></property>
         <property name="sessionService"><inject bean="SessionService"/></property>
         <property name="bufferService"><inject bean="BufferService"/></property>
         <property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
-        <property name="DQPManager"><inject bean="DQPManager"/></property>
+        <property name="securityHelper"><inject bean="SecurityHelper"/></property>
+        
+        <!-- Name of the process that uniquely identifies this process -->
+        <property name="processName">localhost</property>
+        <!-- Process pool maximum thread count. (default 16) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8. -->
+        <property name="maxThreads">16</property>
+        <!-- Query processor time slice, in milliseconds. (default 2000) -->
+        <property name="timeSliceInMilli">2000</property>
+        <!-- Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480) -->
+        <property name="maxRowsFetchSize">20480</property>
+        <!-- The max lob chunk size in KB transferred each time when processing blobs, clobs(100KB default) -->
+        <property name="lobChunkSizeInKB">10</property>
+        <!-- The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250)  -->
+        <property name="preparedPlanCacheMaxCount">250</property>
+        <!-- Maximum number of cached lookup tables. Note: this is a memory based cache and should be set to a value of at least 10 to accomidate system usage. (default 200) -->
+        <property name="codeTablesMaxCount">200</property>
+        <!-- Maximum number of records in a single lookup table (default 10000) -->
+        <property name="codeTablesMaxRowsPerTable">10000</property>
+        <!-- Maximum number of records in all lookup tables (default 200000) -->
+        <property name="codeTablesMaxRows">200000</property>
+        <!-- Max Entries allowed for ResultSet Cache -->
+        <property name="resultSetCacheMaxEntries">1024</property>
+        <!-- Enable Resultset Caching -->
+        <property name="resultSetCacheEnabled">true</property>
     </bean>
+
     
     <bean name="JdbcSocketConfiguration" class="org.teiid.transport.SocketConfiguration">
         <property name="enabled">true</property>

Deleted: branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-runtime-ds.xml
===================================================================
--- branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-runtime-ds.xml	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/build/kit-jboss-container/deploy/teiid/teiid-runtime-ds.xml	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<connection-factories>
-    
-    <no-tx-connection-factory>
-      <jndi-name>teiid/runtime-engine</jndi-name>
-      <rar-name>teiid-engine.rar</rar-name>
-      <connection-definition>com.metamatrix.common.comm.api.ServerConnectionFactory</connection-definition>
-      <max-pool-size>20</max-pool-size>
-    </no-tx-connection-factory>
-    
-</connection-factories>

Modified: branches/JCA/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- branches/JCA/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml	2010-02-23 20:38:54 UTC (rev 1868)
@@ -6,6 +6,7 @@
     <bean name="VDBStructure" class="org.teiid.deployers.VDBStructure" />
     <bean name="VDBRepository" class="org.teiid.deployers.VDBRepository"/>
     <bean name="ConnectorManagerRepository" class="org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository"/>
+    <bean name="SecurityHelper" class="org.teiid.jboss.JBossSecurityHelper"/>    
         
     <bean name="VDBParserDeployer" class="org.teiid.deployers.VDBParserDeployer">
         <property name="objectSerializer"><inject bean="ObjectSerializer"/></property>
@@ -55,9 +56,6 @@
         <property name="managedObjectFactory"><inject bean="ManagedObjectFactory"/></property>
     </bean>
     
-    <bean name="DQPManager" class="org.teiid.dqp.internal.process.DQPManagementView">
-        <property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
-    </bean>
         
    <!--  JBOSS Cache -->
    <!-- Uncomment for JBoss Cache -->

Modified: branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/client/src/main/java/org/teiid/adminapi/TeiidAdmin.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -51,4 +51,19 @@
 		//list.add(manager.getProcess());
 		return list;		
 	}
+	
+	@Override
+	public void restart() throws AdminException {
+		// rameshTODO Auto-generated method stub
+	}
+
+	@Override
+	public void shutdown(int millisToWait) throws AdminException {
+		// rameshTODO Auto-generated method stub
+	}
+	
+	@Override
+    public void setRuntimeProperty(String propertyName, String propertyValue) throws AdminException {
+		// rameshTODO Auto-generated method stub
+    }	
 }

Modified: branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/client/src/main/java/org/teiid/transport/LocalServerConnection.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -48,7 +48,7 @@
 import com.metamatrix.platform.security.api.SessionToken;
 
 public class LocalServerConnection implements ServerConnection {
-	private static final String TEIID_RUNTIME = "java:teiid/engine-deployer";
+	private static final String TEIID_RUNTIME = "teiid/engine-deployer";
 	
 	private final LogonResult result;
 	private boolean shutdown;

Modified: branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -23,7 +23,7 @@
 
 import com.metamatrix.dqp.message.RequestMessage;
 
-public class DQPConfiguration {
+public class DQPConfiguration{
 	
     //Constants
     static final int DEFAULT_MAX_CODE_TABLE_RECORDS = 10000;
@@ -51,7 +51,6 @@
 	private boolean resultSetCacheEnabled = false;
 	private int maxResultSetCacheEntries = DQPConfiguration.DEFAULT_MAX_RESULTSET_CACHE_ENTRIES;
 	
-	
 	public String getProcessName() {
 		return processName;
 	}
@@ -64,7 +63,7 @@
 		return maxThreads;
 	}
 
-	public void setMaxThreads(Integer maxThreads) {
+	public void setMaxThreads(int maxThreads) {
 		this.maxThreads = maxThreads;
 	}
 
@@ -72,14 +71,14 @@
 		return timeSliceInMilli;
 	}
 
-	public void setTimeSliceInMilli(Integer timeSliceInMilli) {
+	public void setTimeSliceInMilli(int timeSliceInMilli) {
 		this.timeSliceInMilli = timeSliceInMilli;
 	}
 	
 	public boolean isProcessDebugAllowed() {
 		return processDebugAllowed;
 	}
-	
+
 	public void setProcessDebugAllowed(boolean processDebugAllowed) {
 		this.processDebugAllowed = processDebugAllowed;
 	}
@@ -88,7 +87,7 @@
 		return maxRowsFetchSize;
 	}
 
-	public void setMaxRowsFetchSize(Integer maxRowsFetchSize) {
+	public void setMaxRowsFetchSize(int maxRowsFetchSize) {
 		this.maxRowsFetchSize = maxRowsFetchSize;
 	}
 
@@ -96,7 +95,7 @@
 		return lobChunkSizeInKB;
 	}
 
-	public void setLobChunkSizeInKB(Integer lobChunkSizeInKB) {
+	public void setLobChunkSizeInKB(int lobChunkSizeInKB) {
 		this.lobChunkSizeInKB = lobChunkSizeInKB;
 	}
 
@@ -104,7 +103,7 @@
 		return preparedPlanCacheMaxCount;
 	}
 
-	public void setPreparedPlanCacheMaxCount(Integer preparedPlanCacheMaxCount) {
+	public void setPreparedPlanCacheMaxCount(int preparedPlanCacheMaxCount) {
 		this.preparedPlanCacheMaxCount = preparedPlanCacheMaxCount;
 	}
 
@@ -112,7 +111,7 @@
 		return codeTablesMaxCount;
 	}
 
-	public void setCodeTablesMaxCount(Integer codeTablesMaxCount) {
+	public void setCodeTablesMaxCount(int codeTablesMaxCount) {
 		this.codeTablesMaxCount = codeTablesMaxCount;
 	}
 
@@ -120,7 +119,7 @@
 		return codeTablesMaxRowsPerTable;
 	}
 
-	public void setCodeTablesMaxRowsPerTable(Integer codeTablesMaxRowsPerTable) {
+	public void setCodeTablesMaxRowsPerTable(int codeTablesMaxRowsPerTable) {
 		this.codeTablesMaxRowsPerTable = codeTablesMaxRowsPerTable;
 	}
 
@@ -128,7 +127,7 @@
 		return codeTablesMaxRows;
 	}
 
-	public void setCodeTablesMaxRows(Integer codeTablesMaxRows) {
+	public void setCodeTablesMaxRows(int codeTablesMaxRows) {
 		this.codeTablesMaxRows = codeTablesMaxRows;
 	}
 
@@ -144,7 +143,7 @@
 		return portNumber;
 	}
 
-	public void setPortNumber(Integer portNumber) {
+	public void setPortNumber(int portNumber) {
 		this.portNumber = portNumber;
 	}
 
@@ -152,7 +151,7 @@
 		return this.maxResultSetCacheEntries;
 	}
 	
-	public void setResultSetCacheMaxEntries(Integer value) {
+	public void setResultSetCacheMaxEntries(int value) {
 		this.maxResultSetCacheEntries = value;
 	}
 
@@ -160,7 +159,7 @@
 		return this.resultSetCacheEnabled;
 	}
 	
-	public void setResultSetCacheEnabled(Boolean value) {
+	public void setResultSetCacheEnabled(boolean value) {
 		this.resultSetCacheEnabled = value;
-	}	
+	}		
 }

Modified: branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -443,10 +443,6 @@
             } 
         }
         contextCache.removeSessionScopedCache(sessionId);
-        
-        if (this.sessionService != null) {
-        	this.sessionService.terminateSession(terminateeId, terminatorId);
-        }
     }
 
     public boolean cancelRequest(long sessionId, long requestId) throws MetaMatrixComponentException {
@@ -841,6 +837,10 @@
 		this.connectorManagerRepository = repo;
 	}
 	
+	public ConnectorManagerRepository getConnectorManagerRepository() {
+		return this.connectorManagerRepository;
+	}
+	
 	public void setSessionService(SessionService service) {
 		this.sessionService = service;
 		service.setDqp(this);

Deleted: branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPManagementView.java
===================================================================
--- branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPManagementView.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/engine/src/main/java/org/teiid/dqp/internal/process/DQPManagementView.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,155 +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.dqp.internal.process;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.jboss.managed.api.ManagedOperation.Impact;
-import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementObject;
-import org.jboss.managed.api.annotation.ManagementOperation;
-import org.jboss.managed.api.annotation.ManagementParameter;
-import org.jboss.managed.api.annotation.ManagementProperties;
-import org.jboss.managed.api.annotation.ManagementProperty;
-import org.jboss.managed.api.annotation.ViewUse;
-import org.teiid.adminapi.AdminComponentException;
-import org.teiid.adminapi.AdminException;
-import org.teiid.adminapi.impl.RequestMetadata;
-import org.teiid.adminapi.impl.SessionMetadata;
-import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.security.SessionServiceException;
-import com.metamatrix.dqp.client.DQPManagement;
-
-/**
- * Since DQPCore can not be made into a management bean itself as it has life cycle dependencies associated with
- * runtime connector. Even though we can intercept the deployer for runtime, injection of management bean was not occurring
- * through "ManagedObjectCreator" interface. This is brute force way to introduce a management bean then this can delegate calls to
- * what ever objects it has access to.
- */
- at ManagementObject(isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
-public class DQPManagementView implements DQPManagement {
-
-	private DQPCore dqp;
-	private ConnectorManagerRepository connectorManagerRepository;
-	
-	public DQPCore getDQP() {
-		return this.dqp;
-	}
-	
-	public void setDQP(DQPCore dqp) {
-		this.dqp = dqp;
-	}
-	
-	public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
-		this.connectorManagerRepository = repo;
-	}	
-	
-	@Override
-    @ManagementOperation(description="Requests for perticular session", impact=Impact.ReadOnly,params={@ManagementParameter(name="sessionId",description="The session Identifier")})
-    public List<RequestMetadata> getRequestsForSession(long sessionId) {
-		return this.dqp.getRequestsForSession(sessionId);
-	}
-    
-	@Override
-    @ManagementOperation(description="Active requests", impact=Impact.ReadOnly)
-    public List<RequestMetadata> getRequests() {
-		return this.dqp.getRequests();
-	}
-	
-	@Override
-	@ManagementOperation(description="Get Runtime workmanager statistics", impact=Impact.ReadOnly,params={@ManagementParameter(name="identifier",description="Use \"runtime\" for engine, or connector name for connector")})
-    public WorkerPoolStatisticsMetadata getWorkManagerStatistics(String identifier) {
-		if ("runtime".equalsIgnoreCase(identifier)) {
-			return this.dqp.getWorkManagerStatistics();
-		}
-		ConnectorManager cm = this.connectorManagerRepository.getConnectorManager(identifier);
-		if (cm != null) {
-			return cm.getWorkManagerStatistics();
-		}
-		return null;
-	}
-	
-	@Override
-    @ManagementOperation(description="Terminate a Session",params={@ManagementParameter(name="terminateeId",description="The session to be terminated")})
-    public void terminateSession(long terminateeId) {
-    	this.dqp.terminateSession(terminateeId);
-    }
-    
-	@Override
-    @ManagementOperation(description="Cancel a Request",params={@ManagementParameter(name="sessionId",description="The session Identifier"), @ManagementParameter(name="requestId",description="The request Identifier")})    
-    public boolean cancelRequest(long sessionId, long requestId) throws AdminException {
-    	try {
-			return this.dqp.cancelRequest(sessionId, requestId);
-		} catch (MetaMatrixComponentException e) {
-			throw new AdminComponentException(e);
-		}
-    }
-    
-	@Override
-    @ManagementOperation(description="Get Cache types in the system", impact=Impact.ReadOnly)
-    public Collection<String> getCacheTypes(){
-		return this.dqp.getCacheTypes();
-	}
-	
-	@Override
-	@ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
-	public void clearCache(String cacheType) {
-		this.dqp.clearCache(cacheType);
-	}
-	
-	@Override
-	@ManagementOperation(description="Active sessions", impact=Impact.ReadOnly)
-	public Collection<SessionMetadata> getActiveSessions() throws AdminException {
-		try {
-			return this.dqp.getActiveSessions();
-		} catch (SessionServiceException e) {
-			throw new AdminComponentException(e);
-		}
-	}
-	
-	@Override
-	@ManagementProperty(description="Active session count", use={ViewUse.STATISTIC}, readOnly=true)
-	public int getActiveSessionsCount() throws AdminException{
-		try {
-			return this.dqp.getActiveSessionsCount();
-		} catch (SessionServiceException e) {
-			throw new AdminComponentException(e);
-		}
-	}
-	
-	@Override
-	@ManagementOperation(description="Active Transactions", impact=Impact.ReadOnly)
-	public Collection<org.teiid.adminapi.Transaction> getTransactions() {
-		return this.dqp.getTransactions();
-	}
-	
-	@Override
-	@ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
-	public void terminateTransaction(String xid) throws AdminException {
-		this.dqp.terminateTransaction(xid);
-	}
-}

Modified: branches/JCA/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
===================================================================
--- branches/JCA/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -44,17 +44,20 @@
 
 	
 	public CompositeMetadataStore(MetadataStore metadataStore) {
-		this.schemas.putAll(metadataStore.getSchemas());
-		this.datatypes.addAll(metadataStore.getDatatypes());
+		addMetadataStore(metadataStore);
 	}
 	
 	public CompositeMetadataStore(List<MetadataStore> metadataStores) {
 		for (MetadataStore metadataStore : metadataStores) {
-			this.schemas.putAll(metadataStore.getSchemas());
-			this.datatypes.addAll(metadataStore.getDatatypes());
+			addMetadataStore(metadataStore);
 		}
 	}
 	
+	public void addMetadataStore(MetadataStore metadataStore) {
+		this.schemas.putAll(metadataStore.getSchemas());
+		this.datatypes.addAll(metadataStore.getDatatypes());
+	}
+	
 	public Schema getSchema(String fullName)
 			throws QueryMetadataException {
 		Schema result = getSchemas().get(fullName);

Modified: branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -79,6 +79,7 @@
 import org.teiid.adminapi.impl.SessionMetadata;
 import org.teiid.adminapi.impl.TransactionMetadata;
 import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.jboss.deployers.RuntimeEngineDeployer;
 
 import com.metamatrix.core.CoreConstants;
 
@@ -86,7 +87,6 @@
 	protected Logger log = Logger.getLogger(getClass());
 	private static final ProfileKey DEFAULT_PROFILE_KEY = new ProfileKey(ProfileKey.DEFAULT);
 	
-	private static final String TEIID_RUNTIME_ENGINE = "teiid/runtime-engine";
 	private static final String XA_DATA_SOURCE_TEMPLATE = "XADataSourceTemplate";
 	private static final long serialVersionUID = 7081309086056911304L;
 	private static ComponentType VDBTYPE = new ComponentType("teiid", "vdb");
@@ -95,7 +95,7 @@
 	private static ComponentType TXTYPE = new ComponentType("ConnectionFactory", "Tx");
 	private static ComponentType DQPTYPE = new ComponentType("teiid", "dqp");
 	private static ComponentType DSTYPE = new ComponentType("DataSource", "XA");
-	private static String DQPNAME = "org.teiid.dqp.internal.process.DQPManagementView";
+	private static String DQPNAME = RuntimeEngineDeployer.class.getName();
 	
 	private ManagementView view;
 	private DeploymentManager deploymentMgr;
@@ -301,13 +301,8 @@
 			throw new AdminComponentException(e);
 		}
 	}
-	
+		
 	@Override
-    public void setRuntimeProperty(String propertyName, String propertyValue) throws AdminException {
-    	setConnectorBindingProperty(TEIID_RUNTIME_ENGINE, propertyName, propertyValue);
-    }
-	
-	@Override
 	public void deleteConnectorBinding(String deployedName) throws AdminException {
 		ManagedComponent mc = getConnectorBindingComponent(deployedName);
 		if (mc != null) {
@@ -623,19 +618,7 @@
 		return null;
 	}
 	
-	@Override
-	public void restart() throws AdminException {
-		ConnectorBinding binding = getConnectorBinding(TEIID_RUNTIME_ENGINE);
-		stopConnectorBinding(binding);
-		startConnectorBinding(binding);
-	}
 
-	@Override
-	public void shutdown(int millisToWait) throws AdminException {
-		// TODO: implement the wait.
-		ConnectorBinding binding = getConnectorBinding(TEIID_RUNTIME_ENGINE);
-		stopConnectorBinding(binding);
-	}
 	
 	@Override
 	public Collection<String> getCacheTypes() throws AdminException {

Modified: branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -21,32 +21,39 @@
  */
 package org.teiid.jboss.deployers;
 
+import java.io.Serializable;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.resource.spi.XATerminator;
+import javax.resource.spi.work.WorkManager;
 
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.logging.Logger;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentMetaData;
+import org.jboss.managed.api.ManagedOperation.Impact;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementOperation;
+import org.jboss.managed.api.annotation.ManagementParameter;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+import org.jboss.managed.api.annotation.ViewUse;
 import org.teiid.SecurityHelper;
 import org.teiid.adminapi.Admin;
 import org.teiid.adminapi.AdminComponentException;
+import org.teiid.adminapi.AdminException;
+import org.teiid.adminapi.impl.RequestMetadata;
+import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
 import org.teiid.adminapi.jboss.AdminProvider;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
 import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
-import org.teiid.dqp.internal.process.ContainerServiceProvider;
 import org.teiid.dqp.internal.process.DQPConfiguration;
 import org.teiid.dqp.internal.process.DQPCore;
-import org.teiid.dqp.internal.process.DQPManagementView;
 import org.teiid.dqp.internal.process.DQPWorkContext;
 import org.teiid.dqp.internal.transaction.ContainerTransactionProvider;
 import org.teiid.dqp.internal.transaction.TransactionServerImpl;
@@ -58,180 +65,104 @@
 import org.teiid.transport.SocketTransport;
 
 import com.metamatrix.api.exception.ComponentNotFoundException;
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.security.SessionServiceException;
 import com.metamatrix.client.ExceptionUtil;
-import com.metamatrix.common.comm.api.ServerConnectionFactory;
 import com.metamatrix.common.log.LogManager;
+import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.dqp.client.ClientSideDQP;
+import com.metamatrix.dqp.client.DQPManagement;
 import com.metamatrix.dqp.service.AuthorizationService;
 import com.metamatrix.dqp.service.BufferService;
 import com.metamatrix.dqp.service.TransactionService;
 import com.metamatrix.dqp.util.LogConstants;
+import com.metamatrix.jdbc.LogConfigurationProvider;
+import com.metamatrix.jdbc.LogListernerProvider;
 import com.metamatrix.platform.security.api.ILogon;
 import com.metamatrix.platform.security.api.SessionToken;
 import com.metamatrix.platform.security.api.service.SessionService;
 
-public class RuntimeEngineDeployer extends AbstractSimpleRealDeployer<ManagedConnectionFactoryDeploymentGroup> implements ClientServiceRegistry {
-	private static final String TEIID_RUNTIME = "java:teiid/runtime-engine"; //$NON-NLS-1$
+ at ManagementObject(isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
+public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry  {
+
 	protected Logger log = Logger.getLogger(getClass());
-	//injected state
-	private AuthorizationService authorizationService;
-	private SecurityHelper securityHelper;
-	private SessionService sessionService;
-	private BufferService bufferService;
-	private ConnectorManagerRepository connectorManagerRepository;
-	private DQPManagementView dqpManagementView;
-	private SocketTransport jdbcSocketTransport;
-	private SocketConfiguration jdbcSocketConfiguration;
-	private SocketTransport adminSocketTransport;
-	private SocketConfiguration adminSocketConfiguration;	
-	//locally constructed client services
-	private DQPCore dqp;
-	private ILogon logon;
-	private Admin admin;
-	private ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();
 	
-	public RuntimeEngineDeployer() {
-		super(ManagedConnectionFactoryDeploymentGroup.class);
-		setRelativeOrder(3000);
-	}
+	private transient SocketConfiguration jdbcSocketConfiguration;
+	private transient SocketConfiguration adminSocketConfiguration;	
+	private transient SocketTransport jdbcSocket;	
+	private transient SocketTransport adminSocket;
+	private transient SecurityHelper securityHelper;
+		
+	private transient DQPCore dqpCore = new DQPCore();
+	private transient ILogon logon;
+	private transient Admin admin;
+	private transient ClientServiceRegistryImpl csr = new ClientServiceRegistryImpl();	
+
+    public RuntimeEngineDeployer() {
+		// TODO: this does not belong here
+		LogManager.setLogConfiguration(new LogConfigurationProvider().get());
+		LogManager.setLogListener(new LogListernerProvider().get());
+    }
 	
+	
 	@Override
 	public <T> T getClientService(Class<T> iface)
 			throws ComponentNotFoundException {
 		return this.csr.getClientService(iface);
 	}
-
-	@Override
-	public void deploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) throws DeploymentException {
-		List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
-		
-		for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
-			String connectorDefinition = data.getConnectionDefinition();
-			if (connectorDefinition.equals(ServerConnectionFactory.class.getName())) {
-				startEngine();
-				log.info("Teiid Engine Started = " + new Date(System.currentTimeMillis()).toString()); //$NON-NLS-1$
-			}
-		}
-	}
-
-	@Override
-	public void undeploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup group) {
-		super.undeploy(unit, group);
-		List<ManagedConnectionFactoryDeploymentMetaData> deployments = group.getDeployments();
-
-		for (ManagedConnectionFactoryDeploymentMetaData data : deployments) {
-			String connectorDefinition = data.getConnectionDefinition();
-			if (connectorDefinition.equals(ServerConnectionFactory.class.getName())) {
-				stopEngine();				
-				log.info("Teiid Engine Stopped = " + new Date(System.currentTimeMillis()).toString()); //$NON-NLS-1$
-			}
-		}
-	}
 	
-	public void setSecurityHelper(SecurityHelper securityHelper) {
-		this.securityHelper = securityHelper;
-	}
-	
-	public void setJdbcSocketConfiguration(SocketConfiguration socketConfig) {
-		this.jdbcSocketConfiguration = socketConfig;
-	}
-	
-	public void setAdminSocketConfiguration(SocketConfiguration socketConfig) {
-		this.adminSocketConfiguration = socketConfig;
-	}
-	
-	public void setAuthorizationService(AuthorizationService service) {
-		this.authorizationService = service;
-	}
-	
-	public void setSessionService(SessionService service) {
-		this.sessionService = service;
-	}
-	
-	public void setBufferService(BufferService service) {
-		this.bufferService = service;
-	}
-	
-	public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
-		this.connectorManagerRepository = repo;
-	}
-	
-	public void setDQPManager(DQPManagementView holder) {
-		this.dqpManagementView = holder;
-	}	
-	
-    private void startEngine() throws DeploymentException {
-    	ContainerServiceProvider scf = null;
-		try {
-			InitialContext ic = new InitialContext();
-			scf = (ContainerServiceProvider)ic.lookup(TEIID_RUNTIME);
-		} catch (NamingException e) {
-			throw new DeploymentException(e.getMessage());
-		}
+    public void start() {
 
     	// create the necessary services
-    	createClientServices(scf);
-
-    	// Start the socket transport
-    	DQPConfiguration config = scf.getDQPConfiguration();
-    	if (config.getBindAddress() != null) {
-    		this.jdbcSocketConfiguration.setBindAddress(config.getBindAddress());
-    	}
-    	if (config.getPortNumber() > 0) {
-    		this.jdbcSocketConfiguration.setPortNumber(config.getPortNumber());
-    	}
-
-    	csr.registerClientService(ILogon.class, proxyService(ILogon.class, logon), com.metamatrix.common.util.LogConstants.CTX_SERVER);
-    	csr.registerClientService(ClientSideDQP.class, proxyService(ClientSideDQP.class, dqp), LogConstants.CTX_QUERY_SERVICE);
-    	csr.registerClientService(Admin.class, proxyService(Admin.class, admin), LogConstants.CTX_ADMIN_API);
+    	createClientServices();
     	
-    	this.jdbcSocketTransport = new SocketTransport(this.jdbcSocketConfiguration, csr);
-    	this.jdbcSocketTransport.start();
+    	this.csr.registerClientService(ILogon.class, proxyService(ILogon.class, logon), com.metamatrix.common.util.LogConstants.CTX_SERVER);
+    	this.csr.registerClientService(ClientSideDQP.class, proxyService(ClientSideDQP.class, this.dqpCore), LogConstants.CTX_QUERY_SERVICE);
+    	this.csr.registerClientService(Admin.class, proxyService(Admin.class, admin), LogConstants.CTX_ADMIN_API);
+    	
+    	this.jdbcSocket = new SocketTransport(this.jdbcSocketConfiguration, csr);
+    	this.jdbcSocket.start();
     	log.info("Teiid JDBC = " + (this.jdbcSocketConfiguration.getSSLConfiguration().isSslEnabled()?"mms://":"mm://")+this.jdbcSocketConfiguration.getHostAddress().getHostName()+":"+this.jdbcSocketConfiguration.getPortNumber()); //$NON-NLS-1$
-
-    	this.adminSocketTransport = new SocketTransport(this.adminSocketConfiguration, csr);
-    	this.adminSocketTransport.start(); 
+    	
+    	this.adminSocket = new SocketTransport(this.adminSocketConfiguration, csr);
+    	this.adminSocket.start(); 
     	log.info("Teiid Admin = " + (this.adminSocketConfiguration.getSSLConfiguration().isSslEnabled()?"mms://":"mm://")+this.adminSocketConfiguration.getHostAddress().getHostName()+":"+this.adminSocketConfiguration.getPortNumber()); //$NON-NLS-1$
+    	log.info("Teiid Engine Started = " + new Date(System.currentTimeMillis()).toString()); //$NON-NLS-1$
 	}	
     
-    private void stopEngine() {
-    	if (dqp != null) {
-    		dqp.stop();
-    		dqp = null;
+    public void stop() {
+    	
+    	try {
+	    	this.dqpCore.stop();
+    	} catch(MetaMatrixRuntimeException e) {
+    		// this bean is already shutdown
     	}
     	
     	// Stop socket transport(s)
-    	if (this.jdbcSocketTransport != null) {
-    		this.jdbcSocketTransport.stop();
-    		this.jdbcSocketTransport = null;
+    	if (this.jdbcSocket != null) {
+    		this.jdbcSocket.stop();
+    		this.jdbcSocket = null;
     	}
     	
-    	if (this.adminSocketTransport != null) {
-    		this.adminSocketTransport.stop();
-    		this.adminSocketTransport = null;
+    	if (this.adminSocket != null) {
+    		this.adminSocket.stop();
+    		this.adminSocket = null;
     	}    	
+    	
+    	log.info("Teiid Engine Stopped = " + new Date(System.currentTimeMillis()).toString()); //$NON-NLS-1$
     }
     
-	private void createClientServices(ContainerServiceProvider scf) throws DeploymentException {
-		dqp = new DQPCore();
-        dqp.setTransactionService(getTransactionService("localhost", scf.getXATerminator())); //$NON-NLS-1$
-        dqp.setWorkManager(scf.getWorkManager());
-        dqp.setAuthorizationService(authorizationService);
-        dqp.setBufferService(bufferService);
-        dqp.setSessionService(sessionService);
-        dqp.setConnectorManagerRepository(connectorManagerRepository);
-        dqp.setSecurityHelper(this.securityHelper);
-		dqp.start(scf.getDQPConfiguration()); 	
+	private void createClientServices() {
 		
-		dqpManagementView.setDQP(dqp);
+		this.dqpCore.start(this);
 		
-		this.logon = new LogonImpl(dqp.getSessionService(), "teiid-cluster"); //$NON-NLS-1$
+		this.logon = new LogonImpl(this.dqpCore.getSessionService(), "teiid-cluster"); //$NON-NLS-1$
     	try {
     		this.admin = AdminProvider.getLocal();
     	} catch (AdminComponentException e) {
-    		throw new DeploymentException(e.getCause());
-    	}
+    		throw new MetaMatrixRuntimeException(e.getCause());
+    	}		        
 	}    
 	
     private TransactionService getTransactionService(String processName, XATerminator terminator) {
@@ -241,7 +172,7 @@
 		txnService.setXidFactory(new XidFactory());
 		return (TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, txnService, new Class[] {TransactionService.class}, MessageLevel.DETAIL);
     }	
-    
+	
 	private <T> T proxyService(final Class<T> iface, final T instance) {
 
 		return iface.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {iface}, new InvocationHandler() {
@@ -284,6 +215,127 @@
 		if (context.getSubject() != null) {
 			securityHelper.clearSecurityContext(context.getSecurityDomain());			
 		}
+	}	   
+    
+	public void setJdbcSocketConfiguration(SocketConfiguration socketConfig) {
+		this.jdbcSocketConfiguration = socketConfig;
+	}
+	
+	public void setAdminSocketConfiguration(SocketConfiguration socketConfig) {
+		this.adminSocketConfiguration = socketConfig;
+	}
+    
+    public void setXATerminator(XATerminator xaTerminator){
+       this.dqpCore.setTransactionService(getTransactionService("localhost", xaTerminator));
+    }    
+    
+    public void setWorkManager(WorkManager mgr) {
+    	this.dqpCore.setWorkManager(mgr);
+    }
+	
+	public void setAuthorizationService(AuthorizationService service) {
+		this.dqpCore.setAuthorizationService(service);
+	}
+	
+	public void setSessionService(SessionService service) {
+		this.dqpCore.setSessionService(service);
+	}
+	
+	public void setBufferService(BufferService service) {
+		this.dqpCore.setBufferService(service);
+	}
+	
+	public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
+		this.dqpCore.setConnectorManagerRepository(repo);
+	}
+	
+	public void setSecurityHelper(SecurityHelper helper) {
+		this.securityHelper = helper;
+		this.dqpCore.setSecurityHelper(helper);
+	}
+	
+	@Override
+    @ManagementOperation(description="Requests for perticular session", impact=Impact.ReadOnly,params={@ManagementParameter(name="sessionId",description="The session Identifier")})
+    public List<RequestMetadata> getRequestsForSession(long sessionId) {
+		return this.dqpCore.getRequestsForSession(sessionId);
+	}
+    
+	@Override
+    @ManagementOperation(description="Active requests", impact=Impact.ReadOnly)
+    public List<RequestMetadata> getRequests() {
+		return this.dqpCore.getRequests();
+	}
+	
+	@Override
+	@ManagementOperation(description="Get Runtime workmanager statistics", impact=Impact.ReadOnly,params={@ManagementParameter(name="identifier",description="Use \"runtime\" for engine, or connector name for connector")})
+    public WorkerPoolStatisticsMetadata getWorkManagerStatistics(String identifier) {
+		if ("runtime".equalsIgnoreCase(identifier)) {
+			return this.dqpCore.getWorkManagerStatistics();
+		}
+		ConnectorManager cm = this.dqpCore.getConnectorManagerRepository().getConnectorManager(identifier);
+		if (cm != null) {
+			return cm.getWorkManagerStatistics();
+		}
+		return null;
+	}
+	
+	@Override
+    @ManagementOperation(description="Terminate a Session",params={@ManagementParameter(name="terminateeId",description="The session to be terminated")})
+    public void terminateSession(long terminateeId) {
+		this.dqpCore.getSessionService().terminateSession(terminateeId, SessionToken.getSession().getSessionID());
+    }
+    
+	@Override
+    @ManagementOperation(description="Cancel a Request",params={@ManagementParameter(name="sessionId",description="The session Identifier"), @ManagementParameter(name="requestId",description="The request Identifier")})    
+    public boolean cancelRequest(long sessionId, long requestId) throws AdminException {
+    	try {
+			return this.dqpCore.cancelRequest(sessionId, requestId);
+		} catch (MetaMatrixComponentException e) {
+			throw new AdminComponentException(e);
+		}
+    }
+    
+	@Override
+    @ManagementOperation(description="Get Cache types in the system", impact=Impact.ReadOnly)
+    public Collection<String> getCacheTypes(){
+		return this.dqpCore.getCacheTypes();
+	}
+	
+	@Override
+	@ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
+	public void clearCache(String cacheType) {
+		this.dqpCore.clearCache(cacheType);
+	}
+	
+	@Override
+	@ManagementOperation(description="Active sessions", impact=Impact.ReadOnly)
+	public Collection<SessionMetadata> getActiveSessions() throws AdminException {
+		try {
+			return this.dqpCore.getActiveSessions();
+		} catch (SessionServiceException e) {
+			throw new AdminComponentException(e);
+		}
+	}
+	
+	@Override
+	@ManagementProperty(description="Active session count", use={ViewUse.STATISTIC}, readOnly=true)
+	public int getActiveSessionsCount() throws AdminException{
+		try {
+			return this.dqpCore.getActiveSessionsCount();
+		} catch (SessionServiceException e) {
+			throw new AdminComponentException(e);
+		}
+	}
+	
+	@Override
+	@ManagementOperation(description="Active Transactions", impact=Impact.ReadOnly)
+	public Collection<org.teiid.adminapi.Transaction> getTransactions() {
+		return this.dqpCore.getTransactions();
+	}
+	
+	@Override
+	@ManagementOperation(description="Clear the caches in the system", impact=Impact.ReadOnly)
+	public void terminateTransaction(String xid) throws AdminException {
+		this.dqpCore.terminateTransaction(xid);
 	}	
-        
 }

Deleted: branches/JCA/runtime/src/main/java/org/teiid/ConnectionInfo.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/ConnectionInfo.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/ConnectionInfo.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,35 +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;
-
-import java.util.Properties;
-
-import javax.resource.spi.ConnectionRequestInfo;
-
-public class ConnectionInfo implements ConnectionRequestInfo {
-	Properties properties;
-	
-	public ConnectionInfo(Properties properties) {
-		this.properties = properties;
-	}
-}

Deleted: branches/JCA/runtime/src/main/java/org/teiid/TeiidConnectionFactory.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/TeiidConnectionFactory.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/TeiidConnectionFactory.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,126 +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;
-
-import java.util.Properties;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.XATerminator;
-import javax.resource.spi.work.WorkManager;
-
-import org.teiid.dqp.internal.process.ContainerServiceProvider;
-import org.teiid.dqp.internal.process.DQPConfiguration;
-
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.api.ServerConnectionFactory;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.log.LogManager;
-import com.metamatrix.jdbc.LogConfigurationProvider;
-import com.metamatrix.jdbc.LogListernerProvider;
-
-
-/** 
- * A factory class which creates the connections to the embedded DQP instance.
- * This is also responsible for initializing the DQP if the DQP instance is not
- * already alive.
- */
-public class TeiidConnectionFactory implements ServerConnectionFactory, ContainerServiceProvider {
-    
-	private TeiidResourceAdapter ra;
-	private TeiidManagedConnectionFactory mcf;
-	private ConnectionManager cxManager;
-    
-	public TeiidConnectionFactory(TeiidResourceAdapter ra, TeiidManagedConnectionFactory mcf, ConnectionManager cxmanager) {
-		this.ra = ra;
-		this.mcf = mcf;
-		this.cxManager = cxmanager;
-		// TODO: this does not belong here
-		LogManager.setLogConfiguration(new LogConfigurationProvider().get());
-		LogManager.setLogListener(new LogListernerProvider().get());
-	}
-	
-	@Override
-	public ServerConnection getConnection(Properties connectionProperties) throws CommunicationException, ConnectionException {
-		try {
-			// this code will not be invoked as teiid does not use managed connection.
-			return (ServerConnection)cxManager.allocateConnection(this.mcf, new ConnectionInfo(connectionProperties));
-		} catch (ResourceException e) {
-			throw new ConnectionException(e);
-		}        
-	}
-	
-	@Override
-	public WorkManager getWorkManager() {
-		return this.ra.getWorkManager();
-	}
-	
-	@Override
-	public XATerminator getXATerminator() {
-		return this.ra.getXATerminator();
-	}
-	
-	@Override
-	public DQPConfiguration getDQPConfiguration() {
-		return mcf;
-	}   
-    
-//	public MMProcess getProcess() {
-//		
-//		Properties props = this.bootProperties;
-//		
-//		String hostName = getAddress().getHostName();
-//		String processName = props.getProperty(DQPEmbeddedProperties.PROCESSNAME);
-//
-//		String[] identifierParts = new String[] {hostName, processName};
-//		MMProcess process = new MMProcess(identifierParts);
-//        
-//		Runtime rt = Runtime.getRuntime();
-//		
-//		process.setEnabled(true);
-//		process.setCreated(new Date(getStartTime()));
-//		process.setInetAddress(getAddress());
-//		process.setFreeMemory(rt.freeMemory());
-//		process.setTotalMemory(rt.totalMemory());
-//		process.setProperties(PropertiesUtils.clone(props));
-//		process.setStartTime(new Date(this.starttime));
-//		
-//		if (this.socketTransport != null) {
-//	        SocketListenerStats socketStats = this.socketTransport.getStats();
-//	        if (socketStats != null) {
-//	            process.setSockets(socketStats.sockets);
-//	            process.setMaxSockets(socketStats.maxSockets);
-//	            process.setObjectsRead(socketStats.objectsRead);
-//	            process.setObjectsWritten(socketStats.objectsWritten);
-//	        }
-//	        
-//	        WorkerPoolStatisticsMetadata workerStats = this.socketTransport.getProcessPoolStats();
-//	        process.setQueueWorkerPool(workerStats);
-//	        
-//	        process.setPort(this.socketTransport.getPort());
-//		}
-//		return process;
-//		return null;
-//	}        
-}

Deleted: branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnection.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnection.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnection.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,138 +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;
-
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionEvent;
-import javax.resource.spi.ConnectionEventListener;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.LocalTransaction;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionMetaData;
-import javax.security.auth.Subject;
-import javax.transaction.xa.XAResource;
-
-import org.teiid.connector.api.ConnectorException;
-
-public class TeiidManagedConnection implements ManagedConnection {
-	protected final Collection<ConnectionEventListener> listeners = new ArrayList<ConnectionEventListener>();
-	private PrintWriter log;
-	private WrappedConnection conn;
-	
-	public TeiidManagedConnection() {
-		
-	}
-	
-	@Override
-	public void associateConnection(Object handle) throws ResourceException {
-		if (!(handle instanceof WrappedConnection)) {
-			throw new ConnectorException("Wrong connection supplied to assosiate");
-		}
-		conn = (WrappedConnection)handle;
-		conn.setManagedConnection(this);		
-	}
-
-	@Override
-	public void cleanup() throws ResourceException {
-		if (this.conn != null) {
-			this.conn.close();
-			this.conn = null;
-		}
-	}
-
-	@Override
-	public void destroy() throws ResourceException {
-		cleanup();
-	}
-
-	@Override
-	public Object getConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
-		ConnectionInfo ci = (ConnectionInfo)arg1;
-		// This code will not be invoked as managed connection is not used anywhere.
-		this.conn = new WrappedConnection(null);
-		this.conn.setManagedConnection(this);
-		return this.conn;
-	}
-
-	@Override
-	public LocalTransaction getLocalTransaction() throws ResourceException {
-		return null;
-	}
-
-	@Override
-	public ManagedConnectionMetaData getMetaData() throws ResourceException {
-		return null;
-	}
-
-	@Override
-	public XAResource getXAResource() throws ResourceException {
-		return null;
-	}
-
-	@Override
-	public void addConnectionEventListener(ConnectionEventListener arg0) {
-		synchronized (listeners) {
-			listeners.add(arg0);
-		}
-	}	
-
-	@Override
-	public void removeConnectionEventListener(ConnectionEventListener arg0) {
-		synchronized (listeners) {
-			listeners.remove(arg0);
-		}
-	}
-	
-	@Override
-	public PrintWriter getLogWriter() throws ResourceException {
-		return this.log;
-	}	
-
-	@Override
-	public void setLogWriter(PrintWriter arg0) throws ResourceException {
-		this.log = arg0;
-	}
-
-	/**
-	 * This method called by wrapped Connection when the connection is closed by the user, which will in turn
-	 * remove the managed connection from the pool
-	 */
-	void connectionClosed() {
-		ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
-		ce.setConnectionHandle(this.conn);
-		
-		ArrayList<ConnectionEventListener> copy = null;
-		synchronized (this.listeners) {
-			copy = new ArrayList<ConnectionEventListener>(this.listeners);
-		}
-		
-		for(ConnectionEventListener l: copy) {
-			l.connectionClosed(ce);
-		}		
-	}
-
-}

Deleted: branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnectionFactory.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnectionFactory.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/TeiidManagedConnectionFactory.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,86 +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;
-
-import java.io.PrintWriter;
-import java.util.Set;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ConnectionManager;
-import javax.resource.spi.ConnectionRequestInfo;
-import javax.resource.spi.ManagedConnection;
-import javax.resource.spi.ManagedConnectionFactory;
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterAssociation;
-import javax.security.auth.Subject;
-
-import org.teiid.dqp.internal.process.DQPConfiguration;
-
-public class TeiidManagedConnectionFactory extends DQPConfiguration implements ManagedConnectionFactory,ResourceAdapterAssociation  {
-	private static final long serialVersionUID = -3728121947515526429L;
-
-	private TeiidResourceAdapter ra;
-	private PrintWriter log;
-	private TeiidConnectionFactory connFactory;
-	
-	@Override
-	public Object createConnectionFactory() throws ResourceException {
-		return new ResourceException("Resource Adapter does not currently support running in a non-managed environment.");
-	}
-
-	@Override
-	public Object createConnectionFactory(ConnectionManager arg0) throws ResourceException {
-		this.connFactory =  new TeiidConnectionFactory(this.ra, this, arg0);
-		return this.connFactory;
-	}
-
-	@Override
-	public ManagedConnection createManagedConnection(Subject arg0, ConnectionRequestInfo arg1) throws ResourceException {
-		return new TeiidManagedConnection();
-	}
-
-	@Override
-	public PrintWriter getLogWriter() throws ResourceException {
-		return this.log;
-	}
-
-	@Override
-	public ManagedConnection matchManagedConnections(Set arg0, Subject arg1, ConnectionRequestInfo arg2) throws ResourceException {
-		return null;
-	}
-
-	@Override
-	public void setLogWriter(PrintWriter arg0) throws ResourceException {
-		this.log = arg0;
-	}
-
-	@Override
-	public ResourceAdapter getResourceAdapter() {
-		return this.ra;
-	}
-
-	@Override
-	public void setResourceAdapter(ResourceAdapter arg0) throws ResourceException {
-		this.ra = (TeiidResourceAdapter)arg0;
-	}
-}

Deleted: branches/JCA/runtime/src/main/java/org/teiid/TeiidResourceAdapter.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/TeiidResourceAdapter.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/TeiidResourceAdapter.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.teiid;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.BootstrapContext;
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterInternalException;
-import javax.resource.spi.XATerminator;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.xa.XAResource;
-
-public class TeiidResourceAdapter implements ResourceAdapter {
-	BootstrapContext ctx;
-	
-	@Override
-	public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException {
-	}
-
-	@Override
-	public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) {
-	}
-
-	@Override
-	public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException {
-		return new XAResource[0];
-	}
-
-	@Override
-	public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
-		this.ctx = ctx;
-	}
-
-	@Override
-	public void stop() {
-		// TODO: hook up to shutdown.
-	}
-
-	public WorkManager getWorkManager() {
-		return ctx.getWorkManager();
-	}
-	
-	public XATerminator getXATerminator() {
-		return ctx.getXATerminator();
-	}	
-}

Deleted: branches/JCA/runtime/src/main/java/org/teiid/WrappedConnection.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/WrappedConnection.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/WrappedConnection.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -1,72 +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;
-
-import com.metamatrix.common.comm.api.ServerConnection;
-import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.platform.security.api.LogonResult;
-
-public class WrappedConnection implements ServerConnection {
-
-	private ServerConnection delegate;
-	private TeiidManagedConnection mc;
-	private boolean closed = false;
-	
-	public WrappedConnection(ServerConnection conn) {
-		this.delegate = conn;		
-	}
-	
-	@Override
-	public LogonResult getLogonResult() {
-		return delegate.getLogonResult();
-	}
-	
-	@Override
-	public <T> T getService(Class<T> iface) {
-		return delegate.getService(iface);
-	}
-
-	@Override
-	public boolean isOpen() {
-		return delegate.isOpen();
-	}
-
-	@Override
-	public boolean isSameInstance(ServerConnection conn)
-			throws CommunicationException {
-		return delegate.isSameInstance(conn);
-	}
-
-	@Override
-	public void close() {
-		if (!this.closed && this.mc != null) {
-			this.closed = true;						
-			this.mc.connectionClosed();
-			this.mc = null;
-		}		
-	}
-
-	void setManagedConnection(TeiidManagedConnection teiidManagedConnection) {
-		this.mc = teiidManagedConnection;
-	}
-}

Modified: branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-02-23 16:07:13 UTC (rev 1867)
+++ branches/JCA/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-02-23 20:38:54 UTC (rev 1868)
@@ -128,6 +128,8 @@
 			throw new DeploymentException("System.vdb needs to be loaded before any other VDBs.");
 		}
 		
+		store.addMetadataStore(systemStore);
+		
 		Collection <FunctionMethod> methods = null;
 		if (udf != null) {
 			methods = udf.getMethods();



More information about the teiid-commits mailing list