Author: rareddy
Date: 2012-01-26 14:28:47 -0500 (Thu, 26 Jan 2012)
New Revision: 3830
Modified:
trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
Log:
TEIID-1911: temporary fix for the to avoid metadata deletion during the shutdown.
Modified: trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-01-26 17:43:46 UTC
(rev 3829)
+++ trunk/build/kits/jboss-as7/docs/teiid/teiid-releasenotes.html 2012-01-26 19:28:47 UTC
(rev 3830)
@@ -46,6 +46,7 @@
<li>Support for named parameter syntax using param=value has been deprecated,
since it is ambiguous with a comparison predicate boolean value expression.
param<b>=></b>value should be used instead.
<li>Support for using the FROM clause post item hints MAKEDEP/MAKENOTDEP has been
deprecated. Use the pre item comment hint syntax instead, e.g. /*+ MAKEDEP */ tbl
<li>decodeinteger/decodestring have been deprecated. A CASE expression should be
used instead.
+ <li>allowCreateTemporaryTablesByDefault and allowFunctionCallsByDefault are now
set to false. When data roles are in use the user must explicitly grant these options to
the user on VDB
</ul>
<h4>from 7.x</h4>
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-01-26
17:43:46 UTC (rev 3829)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-01-26
19:28:47 UTC (rev 3830)
@@ -409,7 +409,7 @@
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 VDBDependencyDeployer());
- processorTarget.addDeploymentProcessor(Phase.INSTALL,
Phase.INSTALL_WAR_DEPLOYMENT|0x1000, new VDBDeployer(translatorRepo, asyncThreadPoolName,
statusChecker, shutdownListener));
+ processorTarget.addDeploymentProcessor(Phase.INSTALL,
Phase.INSTALL_WAR_DEPLOYMENT|0x1000, new VDBDeployer(translatorRepo, asyncThreadPoolName,
statusChecker));
// translator deployers
processorTarget.addDeploymentProcessor(Phase.STRUCTURE,
Phase.STRUCTURE_JDBC_DRIVER|0x0001,new TranslatorStructureDeployer());
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-01-26
17:43:46 UTC (rev 3829)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-01-26
19:28:47 UTC (rev 3830)
@@ -34,16 +34,22 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.modules.Module;
-import org.jboss.msc.service.*;
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.ServiceBuilder.DependencyType;
+import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceController.Mode;
import org.jboss.msc.service.ServiceController.State;
+import org.jboss.msc.service.AbstractServiceListener;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
import org.teiid.adminapi.Model;
import org.teiid.adminapi.Translator;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBTranslatorMetaData;
-import org.teiid.deployers.ContainerLifeCycleListener;
import org.teiid.deployers.UDFMetaData;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -61,17 +67,15 @@
private TranslatorRepository translatorRepository;
private String asyncThreadPoolName;
private VDBStatusChecker vdbStatusChecker;
- private ContainerLifeCycleListener shutdownListener;
- public VDBDeployer (TranslatorRepository translatorRepo, String poolName,
VDBStatusChecker vdbStatusChecker, ContainerLifeCycleListener shutdownListener) {
+ public VDBDeployer (TranslatorRepository translatorRepo, String poolName,
VDBStatusChecker vdbStatusChecker) {
this.translatorRepository = translatorRepo;
this.asyncThreadPoolName = poolName;
this.vdbStatusChecker = vdbStatusChecker;
- this.shutdownListener = shutdownListener;
}
public void deploy(final DeploymentPhaseContext context) throws
DeploymentUnitProcessingException {
- DeploymentUnit deploymentUnit = context.getDeploymentUnit();
+ final DeploymentUnit deploymentUnit = context.getDeploymentUnit();
if (!TeiidAttachments.isVDBDeployment(deploymentUnit)) {
return;
}
@@ -125,7 +129,7 @@
// build a VDB service
ArrayList<String> unAvailableDS = new ArrayList<String>();
- VDBService vdb = new VDBService(deployment, this.shutdownListener);
+ VDBService vdb = new VDBService(deployment);
final ServiceBuilder<VDBMetaData> vdbService =
context.getServiceTarget().addService(TeiidServiceNames.vdbServiceName(deployment.getName(),
deployment.getVersion()), vdb);
for (ModelMetaData model:deployment.getModelMetaDatas().values()) {
for (String sourceName:model.getSourceNames()) {
@@ -175,6 +179,21 @@
if (!unAvailableDS.isEmpty()) {
LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50021, deployment.getName(),
deployment.getVersion(), unAvailableDS));
}
+
+ ServiceController<?> scMain =
deploymentUnit.getServiceRegistry().getService(deploymentUnit.getServiceName().append("contents"));
//$NON-NLS-1$
+ scMain.addListener(new AbstractServiceListener<Object>() {
+ @Override
+ public void serviceRemoveRequested(final ServiceController controller) {
+ final VDBMetaData vdb = deploymentUnit.getAttachment(TeiidAttachments.VDB_METADATA);
+
+ ServiceController<?> sc =
deploymentUnit.getServiceRegistry().getService(TeiidServiceNames.OBJECT_SERIALIZER);
+ if (sc != null) {
+ ObjectSerializer serilalizer = ObjectSerializer.class.cast(sc.getValue());
+ serilalizer.removeAttachments(vdb);
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+vdb.getName()+"
metadata removed"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ });
}
private void dataSourceDependencies(VDBMetaData deployment, DependentServices
svcListener) {
@@ -260,7 +279,7 @@
public void undeploy(final DeploymentUnit deploymentUnit) {
if (!TeiidAttachments.isVDBDeployment(deploymentUnit)) {
return;
- }
+ }
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-01-26
17:43:46 UTC (rev 3829)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-01-26
19:28:47 UTC (rev 3830)
@@ -56,7 +56,6 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidException;
import org.teiid.deployers.CompositeVDB;
-import org.teiid.deployers.ContainerLifeCycleListener;
import org.teiid.deployers.MetadataStoreGroup;
import org.teiid.deployers.TranslatorUtil;
import org.teiid.deployers.UDFMetaData;
@@ -89,12 +88,10 @@
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 ContainerLifeCycleListener shutdownListener;
private VDBLifeCycleListener vdbListener;
- public VDBService(VDBMetaData metadata, ContainerLifeCycleListener shutdownListener) {
+ public VDBService(VDBMetaData metadata) {
this.vdb = metadata;
- this.shutdownListener = shutdownListener;
}
@Override
@@ -250,12 +247,6 @@
getVDBRepository().removeVDB(this.vdb.getName(), this.vdb.getVersion());
this.vdb.setRemoved(true);
- // service stopped not due to shutdown then clean-up the data files
- if (!this.shutdownListener.isShutdownInProgress()) {
- getSerializer().removeAttachments(vdb);
- LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+vdb.getName()+"
metadata removed"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50026, this.vdb));
}
@@ -465,7 +456,7 @@
if (vdb.isValid()) {
getVDBRepository().finishDeployment(vdb.getName(), vdb.getVersion());
vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(),
vdb.getVersion()));
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(), vdb.getVersion()));
}
}
}
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2012-01-26 17:43:46
UTC (rev 3829)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2012-01-26 19:28:47
UTC (rev 3830)
@@ -72,7 +72,6 @@
recursive_delegation=For {0}.{1} VDB, recursive delegation {2} found.
TEIID40012=For {0}.{1} VDB, Data Source "{2}" not found.
datasource_replaced=For {0}.{1} VDB, Data Source "{2}" replaced with
"{3}"
-TEIID40003={0}.{1} status has been set to "active"
vdb_inactivated={0}.{1} status has been changed to inactive. Check the required
translators and data sources!
translator_added=Teiid translator "{0}" has been added.
invalid_class={0} invalid type of class specified. Must be of type
org.teiid.connector.api.Connector
@@ -106,4 +105,5 @@
replication_failed=replication failed to {0}
TEIID40014=Kerberos context login failed
TEIID40018=Exception terminitating session
-TEIID40020=Error occurred
\ No newline at end of file
+TEIID40020=Error occurred
+SessionServiceImpl.invalid_session=Invalid Session. Session may have been terminated.
Re-connect and try again.
\ No newline at end of file