Author: rareddy
Date: 2012-01-11 14:18:32 -0500 (Wed, 11 Jan 2012)
New Revision: 3785
Added:
trunk/jboss-integration/src/main/java/org/teiid/cache/
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLogger.java
trunk/jboss-integration/src/main/java/org/teiid/replication/
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
Removed:
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/Log4jListener.java
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/AdminComponentException.java
trunk/admin/src/main/java/org/teiid/adminapi/AdminException.java
trunk/admin/src/main/java/org/teiid/adminapi/AdminProcessingException.java
trunk/api/src/main/java/org/teiid/logging/LogManager.java
trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java
trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooPlugin.java
trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCPlugin.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPPlugin.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForcePlugin.java
trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/ThreadReuseExecutor.java
trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/ObjectSerializer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java
trunk/runtime/src/main/java/org/teiid/deployers/TranslatorUtil.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
trunk/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java
trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
trunk/test-integration/common/pom.xml
Log:
TEIID-1889: Adding Event ID for messages that are at INFO or at higher level
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminComponentException.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminComponentException.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminComponentException.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -58,7 +58,7 @@
* @param msg the error message.
* @since 4.3
*/
- public AdminComponentException(int code, String msg) {
+ public AdminComponentException(String code, String msg) {
super(code, msg);
}
@@ -66,7 +66,7 @@
super(msg, cause);
}
- public AdminComponentException(int code, String msg, Throwable cause) {
+ public AdminComponentException(String code, String msg, Throwable cause) {
super(code, msg, cause);
}
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminException.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminException.java 2012-01-10 17:28:44
UTC (rev 3784)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminException.java 2012-01-11 19:18:32
UTC (rev 3785)
@@ -74,16 +74,16 @@
* @param msg the error message.
* @since 4.3
*/
- AdminException(int code, String msg) {
- super(Integer.toString(code), msg);
+ AdminException(String code, String msg) {
+ super(code, msg);
}
AdminException(String msg, Throwable cause) {
super(cause, msg);
}
- AdminException(int code, String msg, Throwable cause) {
- super(cause, Integer.toString(code),msg);
+ AdminException(String code, String msg, Throwable cause) {
+ super(cause, code,msg);
}
/**
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminProcessingException.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminProcessingException.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminProcessingException.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -63,7 +63,7 @@
* @param msg the error message.
* @since 4.3
*/
- public AdminProcessingException(int code, String msg) {
+ public AdminProcessingException(String code, String msg) {
super(code, msg);
}
@@ -71,7 +71,7 @@
super(msg, cause);
}
- public AdminProcessingException(int code, String msg, Throwable cause) {
+ public AdminProcessingException(String code, String msg, Throwable cause) {
super(code, msg, cause);
}
Modified: trunk/api/src/main/java/org/teiid/logging/LogManager.java
===================================================================
--- trunk/api/src/main/java/org/teiid/logging/LogManager.java 2012-01-10 17:28:44 UTC (rev
3784)
+++ trunk/api/src/main/java/org/teiid/logging/LogManager.java 2012-01-11 19:18:32 UTC (rev
3785)
@@ -146,7 +146,7 @@
* @param message the log message; the message is
* not logged if this parameter is null
*/
- public static void logCritical(String context, String message) {
+ public static void logCritical(String context, Object message) {
logMessage(MessageLevel.CRITICAL, context, message);
}
@@ -165,7 +165,7 @@
* not logged if this parameter is null
* @param message the log message (may be null)
*/
- public static void logCritical(String context, Throwable e, String message) {
+ public static void logCritical(String context, Throwable e, Object message) {
log(MessageLevel.CRITICAL,context,e,message);
}
@@ -181,7 +181,7 @@
* @param message the log message; the message is
* not logged if this parameter is null
*/
- public static void logError(String context, String message) {
+ public static void logError(String context, Object message) {
logMessage(MessageLevel.ERROR, context,message);
}
@@ -198,7 +198,7 @@
* not logged if this parameter is null
* @param message the log message (may be null)
*/
- public static void logError(String context, Throwable e, String message) {
+ public static void logError(String context, Throwable e, Object message) {
log(MessageLevel.ERROR,context,e,message);
}
@@ -214,7 +214,7 @@
* @param message the log message; the message is
* not logged if this parameter is null
*/
- public static void logWarning(String context, String message) {
+ public static void logWarning(String context, Object message) {
logMessage(MessageLevel.WARNING, context,message);
}
@@ -231,7 +231,7 @@
* not logged if this parameter is null
* @param message the log message (may be null)
*/
- public static void logWarning(String context, Throwable e, String message) {
+ public static void logWarning(String context, Throwable e, Object message) {
log(MessageLevel.WARNING,context,e,message);
}
@@ -248,7 +248,7 @@
* @param message the log message; the message is
* not logged if this parameter is null
*/
- public static void logInfo(String context, String message) {
+ public static void logInfo(String context, Object message) {
logMessage(MessageLevel.INFO, context,message);
}
Deleted: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,89 +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.cache.jboss;
-
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import org.teiid.cache.Cache;
-
-
-/**
- * Implementation of Cache using Infinispan
- */
-public class JBossCache<K, V> implements Cache<String, V> {
-
- protected org.infinispan.Cache<String, V> cacheStore;
- private final String name;
-
- public JBossCache(org.infinispan.Cache<String, V> cacheStore, String cacheName) {
- this.cacheStore = cacheStore;
- this.name = cacheName;
- }
-
- private String fqn(String key) {
- return this.name+"."+key; //$NON-NLS-1$
- }
-
- @Override
- public V get(String key) {
- return this.cacheStore.get(fqn(key));
- }
-
- public V put(String key, V value) {
- return this.cacheStore.put(fqn(key), value);
- }
-
- @Override
- public V put(String key, V value, Long ttl) {
- if (ttl != null) {
- return this.cacheStore.put(fqn(key), value, ttl, TimeUnit.MILLISECONDS);
- }
- return this.cacheStore.put(fqn(key), value);
- }
-
- @Override
- public V remove(String key) {
- return this.cacheStore.remove(fqn(key));
- }
-
- @Override
- public int size() {
- return this.cacheStore.size();
- }
-
- @Override
- public void clear() {
- this.cacheStore.clear();
- }
-
- @Override
- public String getName() {
- return this.name;
- }
-
- @Override
- public Set<String> keys() {
- return this.cacheStore.keySet();
- }
-}
Deleted:
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,71 +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.cache.jboss;
-
-import java.io.Serializable;
-
-import org.infinispan.manager.CacheContainer;
-import org.teiid.cache.Cache;
-import org.teiid.cache.CacheConfiguration;
-import org.teiid.cache.CacheFactory;
-import org.teiid.core.TeiidRuntimeException;
-
-
-public class JBossCacheFactory implements CacheFactory, Serializable{
- private static final long serialVersionUID = -2767452034178675653L;
- private transient org.infinispan.Cache cacheStore;
- private volatile boolean destroyed = false;
-
-
- public JBossCacheFactory(String name, CacheContainer cm) {
- if (name != null) {
- this.cacheStore = cm.getCache(name);
- }
- else {
- this.cacheStore = cm.getCache();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public Cache get(String location, CacheConfiguration config) {
- if (!destroyed) {
- return new JBossCache(this.cacheStore, config.getLocation());
- }
- throw new TeiidRuntimeException("Cache system has been shutdown");
//$NON-NLS-1$
- }
-
- public void destroy() {
- this.destroyed = true;
- }
-
- public void stop() {
- destroy();
- }
-
- @Override
- public boolean isReplicated() {
- return true;
- }
-}
Deleted:
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -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.replication.jboss;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.jgroups.Address;
-import org.teiid.core.util.ReflectionHelper;
-
-/**
- * Allows JGroups {@link Address} objects to be serializable
- */
-public final class AddressWrapper implements Externalizable {
-
- Address address;
-
- public AddressWrapper() {
-
- }
-
- public AddressWrapper(Address address) {
- this.address = address;
- }
-
- @Override
- public int hashCode() {
- return address.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof AddressWrapper)) {
- return false;
- }
- return address.equals(((AddressWrapper)obj).address);
- }
-
- @Override
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- String className = in.readUTF();
- try {
- this.address = (Address) ReflectionHelper.create(className, null,
Thread.currentThread().getContextClassLoader());
- this.address.readFrom(in);
- } catch (Exception e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(address.getClass().getName());
- try {
- address.writeTo(out);
- } catch (Exception e) {
- throw new IOException(e);
- }
- }
-
-}
\ No newline at end of file
Deleted:
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,114 +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.replication.jboss;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-public class JGroupsInputStream extends InputStream {
-
- private long timeout = 15000;
- private volatile byte[] buf;
- private volatile int index=0;
- private ReentrantLock lock = new ReentrantLock();
- private Condition write = lock.newCondition();
- private Condition doneReading = lock.newCondition();
-
- public JGroupsInputStream(long timeout) {
- this.timeout = timeout;
- }
-
- @Override
- public int read() throws IOException {
- if (index < 0) {
- return -1;
- }
- if (buf == null) {
- lock.lock();
- try {
- write.await(timeout, TimeUnit.MILLISECONDS);
- if (index < 0) {
- return -1;
- }
- if (buf == null) {
- throw new IOException(new TimeoutException());
- }
- } catch(InterruptedException e) {
- throw new IOException(e);
- } finally {
- lock.unlock();
- }
- }
- if (index == buf.length) {
- lock.lock();
- try {
- buf = null;
- index = 0;
- doneReading.signal();
- } finally {
- lock.unlock();
- }
- return read();
- }
- return buf[index++] & 0xff;
- }
-
- @Override
- public void close() {
- lock.lock();
- try {
- buf = null;
- index = -1;
- doneReading.signal();
- } finally {
- lock.unlock();
- }
- }
-
- public void receive(byte[] bytes) throws InterruptedException {
- lock.lock();
- try {
- if (index == -1) {
- return;
- }
- if (buf != null) {
- doneReading.await();
- }
- if (index == -1) {
- return;
- }
- buf = bytes;
- if (bytes == null) {
- index = -1;
- }
- write.signal();
- } finally {
- lock.unlock();
- }
- }
-
-}
\ No newline at end of file
Deleted:
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,609 +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.replication.jboss;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-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.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-import org.jboss.as.clustering.jgroups.ChannelFactory;
-import org.jgroups.Address;
-import org.jgroups.Channel;
-import org.jgroups.MembershipListener;
-import org.jgroups.Message;
-import org.jgroups.MessageListener;
-import org.jgroups.ReceiverAdapter;
-import org.jgroups.View;
-import org.jgroups.blocks.MethodCall;
-import org.jgroups.blocks.MethodLookup;
-import org.jgroups.blocks.RequestOptions;
-import org.jgroups.blocks.ResponseMode;
-import org.jgroups.blocks.RpcDispatcher;
-import org.jgroups.util.Buffer;
-import org.jgroups.util.Promise;
-import org.jgroups.util.Rsp;
-import org.jgroups.util.RspList;
-import org.teiid.Replicated;
-import org.teiid.Replicated.ReplicationMode;
-import org.teiid.core.TeiidRuntimeException;
-import org.teiid.core.util.ObjectInputStreamWithClassloader;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.query.ObjectReplicator;
-import org.teiid.query.ReplicatedObject;
-
-@SuppressWarnings("unchecked")
-public class JGroupsObjectReplicator implements ObjectReplicator, Serializable {
-
- private static final int IO_TIMEOUT = 15000;
-
- private final class ReplicatorRpcDispatcher<S> extends RpcDispatcher {
- private final S object;
- private boolean initialized;
- private final HashMap<Method, Short> methodMap;
- private final ArrayList<Method> methodList;
- Map<List<?>, JGroupsInputStream> inputStreams = new
ConcurrentHashMap<List<?>, JGroupsInputStream>();
-
- private ReplicatorRpcDispatcher(Channel channel, MessageListener l,
- MembershipListener l2, Object serverObj, S object,
- HashMap<Method, Short> methodMap, ArrayList<Method> methodList) {
- super(channel, l, l2, serverObj);
- this.object = object;
- this.methodMap = methodMap;
- this.methodList = methodList;
- setMarshaller(new ContextAwareMarshaller(getClass().getClassLoader()));
- }
-
- @Override
- public Object handle(Message req) {
- Object body=null;
-
- if(req == null || req.getLength() == 0) {
- if(log.isErrorEnabled()) log.error("message or message buffer is
null"); //$NON-NLS-1$
- return null;
- }
-
- try {
- body=req_marshaller != null?
- req_marshaller.objectFromBuffer(req.getBuffer(), req.getOffset(),
req.getLength())
- : req.getObject();
- }
- catch(Throwable e) {
- if(log.isErrorEnabled()) log.error("exception marshalling object",
e); //$NON-NLS-1$
- return e;
- }
-
- if(!(body instanceof MethodCall)) {
- if(log.isErrorEnabled()) log.error("message does not contain a MethodCall
object"); //$NON-NLS-1$
-
- // create an exception to represent this and return it
- return new IllegalArgumentException("message does not contain a
MethodCall object") ; //$NON-NLS-1$
- }
-
- final MethodCall method_call=(MethodCall)body;
-
- try {
- if(log.isTraceEnabled())
- log.trace("[sender=" + req.getSrc() + "], method_call:
" + method_call); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (method_call.getId() >= methodList.size() - 5 &&
req.getSrc().equals(local_addr)) {
- return null;
- }
-
- if (method_call.getId() >= methodList.size() - 3) {
- Serializable address = new AddressWrapper(req.getSrc());
- Serializable stateId = (Serializable)method_call.getArgs()[0];
- List<?> key = Arrays.asList(stateId, address);
- JGroupsInputStream is = inputStreams.get(key);
- if (method_call.getId() == methodList.size() - 3) {
- LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "create
state", stateId); //$NON-NLS-1$
- if (is != null) {
- is.receive(null);
- }
- is = new JGroupsInputStream(IO_TIMEOUT);
- this.inputStreams.put(key, is);
- executor.execute(new StreamingRunner(object, stateId, is, null));
- } else if (method_call.getId() == methodList.size() - 2) {
- LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "building
state", stateId); //$NON-NLS-1$
- if (is != null) {
- is.receive((byte[])method_call.getArgs()[1]);
- }
- } else if (method_call.getId() == methodList.size() - 1) {
- LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "finished
state", stateId); //$NON-NLS-1$
- if (is != null) {
- is.receive(null);
- }
- this.inputStreams.remove(key);
- }
- return null;
- } else if (method_call.getId() == methodList.size() - 5) {
- //hasState
- ReplicatedObject ro = (ReplicatedObject)object;
- Serializable stateId = (Serializable)method_call.getArgs()[0];
-
- if (stateId == null) {
- synchronized (this) {
- if (initialized) {
- return Boolean.TRUE;
- }
- return null;
- }
- }
-
- if (ro.hasState(stateId)) {
- return Boolean.TRUE;
- }
- return null;
- } else if (method_call.getId() == methodList.size() - 4) {
- //sendState
- ReplicatedObject ro = (ReplicatedObject)object;
- String stateId = (String)method_call.getArgs()[0];
- AddressWrapper dest = (AddressWrapper)method_call.getArgs()[1];
-
- JGroupsOutputStream oStream = new JGroupsOutputStream(this,
Arrays.asList(dest.address), stateId, (short)(methodMap.size() - 3), false);
- try {
- if (stateId == null) {
- ro.getState(oStream);
- } else {
- ro.getState(stateId, oStream);
- }
- } finally {
- oStream.close();
- }
- LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state",
stateId); //$NON-NLS-1$
- return null;
- }
-
- Method m=method_lookup.findMethod(method_call.getId());
- if(m == null)
- throw new Exception("no method found for " +
method_call.getId()); //$NON-NLS-1$
- method_call.setMethod(m);
-
- return method_call.invoke(server_obj);
- }
- catch(Throwable x) {
- return x;
- }
- }
- }
-
- private static final long serialVersionUID = -6851804958313095166L;
- private static final String HAS_STATE = "hasState"; //$NON-NLS-1$
- private static final String SEND_STATE = "sendState"; //$NON-NLS-1$
- private static final String CREATE_STATE = "createState"; //$NON-NLS-1$
- private static final String BUILD_STATE = "buildState"; //$NON-NLS-1$
- private static final String FINISH_STATE = "finishState"; //$NON-NLS-1$
-
- private final static class StreamingRunner implements Runnable {
- private final Object object;
- private final Serializable stateId;
- private final JGroupsInputStream is;
- private Promise<Boolean> promise;
-
- private StreamingRunner(Object object, Serializable stateId, JGroupsInputStream is,
Promise<Boolean> promise) {
- this.object = object;
- this.stateId = stateId;
- this.is = is;
- this.promise = promise;
- }
-
- @Override
- public void run() {
- try {
- if (stateId == null) {
- ((ReplicatedObject<?>)object).setState(is);
- } else {
- ((ReplicatedObject)object).setState(stateId, is);
- }
- if (promise != null) {
- promise.setResult(Boolean.TRUE);
- }
- LogManager.logDetail(LogConstants.CTX_RUNTIME, "state set", stateId);
//$NON-NLS-1$
- } catch (Exception e) {
- if (promise != null) {
- promise.setResult(Boolean.FALSE);
- }
- LogManager.logError(LogConstants.CTX_RUNTIME, e, "error setting state " +
stateId); //$NON-NLS-1$
- } finally {
- is.close();
- }
- }
- }
-
- private final class ReplicatedInvocationHandler<S> extends ReceiverAdapter
implements
- InvocationHandler, Serializable {
-
- private static final int PULL_RETRIES = 3;
- private static final long serialVersionUID = -2943462899945966103L;
- private final S object;
- private transient ReplicatorRpcDispatcher<S> disp;
- private final HashMap<Method, Short> methodMap;
- protected List<Address> remoteMembers = Collections.synchronizedList(new
ArrayList<Address>());
- private Map<Serializable, Promise<Boolean>> loadingStates = new
HashMap<Serializable, Promise<Boolean>>();
-
- private ReplicatedInvocationHandler(S object,HashMap<Method, Short> methodMap) {
- this.object = object;
- this.methodMap = methodMap;
- }
-
- List<Address> getRemoteMembersCopy() {
- synchronized (remoteMembers) {
- return new ArrayList<Address>(remoteMembers);
- }
- }
-
- public void setDisp(ReplicatorRpcDispatcher<S> disp) {
- this.disp = disp;
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable {
- Short methodNum = methodMap.get(method);
- if (methodNum == null || remoteMembers.isEmpty()) {
- if (methodNum != null) {
- Replicated annotation = method.getAnnotation(Replicated.class);
- if (annotation != null && annotation.remoteOnly()) {
- return null;
- }
- }
- try {
- return method.invoke(object, args);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
- }
- try {
- Replicated annotation = method.getAnnotation(Replicated.class);
- if (annotation.replicateState() != ReplicationMode.NONE) {
- return handleReplicateState(method, args, annotation);
- }
- MethodCall call=new MethodCall(methodNum, args);
- List<Address> dests = null;
- if (annotation.remoteOnly()) {
- dests = getRemoteMembersCopy();
- if (dests.isEmpty()) {
- return null;
- }
- }
- RspList<Object> responses = disp.callRemoteMethods(dests, call, new
RequestOptions().setMode(annotation.asynch()?ResponseMode.GET_NONE:ResponseMode.GET_ALL).setTimeout(annotation.timeout()).setAnycasting(dests
!= null));
- if (annotation.asynch()) {
- return null;
- }
- List<Object> results = responses.getResults();
- if (method.getReturnType() == boolean.class) {
- for (Object o : results) {
- if (!Boolean.TRUE.equals(o)) {
- return false;
- }
- }
- return true;
- } else if (method.getReturnType() == Collection.class) {
- ArrayList<Object> result = new ArrayList<Object>();
- for (Object o : results) {
- result.addAll((Collection)o);
- }
- return results;
- }
- return null;
- } catch(Exception e) {
- throw new RuntimeException(method + " " + args + " failed",
e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- protected Address whereIsState(Serializable stateId, long timeout) throws Exception {
- if (remoteMembers.isEmpty()) {
- return null;
- }
- RspList<Boolean> resp = this.disp.callRemoteMethods(getRemoteMembersCopy(), new
MethodCall((short)(methodMap.size() - 5), new Object[]{stateId}), new
RequestOptions(ResponseMode.GET_ALL, timeout));
- Collection<Rsp<Boolean>> values = resp.values();
- Rsp<Boolean> rsp = null;
- for (Rsp<Boolean> response : values) {
- if (Boolean.TRUE.equals(response.getValue())) {
- rsp = response;
- break;
- }
- }
- if (rsp == null) {
- return null;
- }
- return rsp.getSender();
- }
-
- private Object handleReplicateState(Method method, Object[] args,
- Replicated annotation) throws IllegalAccessException,
- Throwable, IOException, IllegalStateException, Exception {
- Object result = null;
- try {
- result = method.invoke(object, args);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
- ReplicatedObject ro = (ReplicatedObject)object;
- Serializable stateId = (Serializable)args[0];
- if (annotation.replicateState() == ReplicationMode.PUSH) {
- if (!remoteMembers.isEmpty()) {
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "replicating
state", stateId); //$NON-NLS-1$
- JGroupsOutputStream oStream = new JGroupsOutputStream(disp, null, stateId,
(short)(methodMap.size() - 3), true);
- try {
- ro.getState(stateId, oStream);
- } finally {
- oStream.close();
- }
- LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state",
stateId); //$NON-NLS-1$
- }
- return result;
- }
- if (result != null) {
- return result;
- }
- long timeout = annotation.timeout();
- return pullState(method, args, stateId, timeout);
- }
-
- /**
- * Pull the remote state. The method and args are optional
- * to determine if the state has been made available.
- */
- Object pullState(Method method, Object[] args, Serializable stateId,
- long timeout) throws Throwable {
- Object result = null;
- for (int i = 0; i < PULL_RETRIES; i++) {
- Promise<Boolean> p = null;
- boolean wait = true;
- synchronized (loadingStates) {
- p = loadingStates.get(stateId);
- if (p == null) {
- wait = false;
- if (method != null) {
- try {
- result = method.invoke(object, args);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
- if (result != null) {
- return result;
- }
- }
- p = new Promise<Boolean>();
- loadingStates.put(stateId, p);
- }
- }
- if (wait) {
- p.getResult(timeout);
- continue;
- }
- try {
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "pulling state",
stateId); //$NON-NLS-1$
- Address addr = whereIsState(stateId, timeout);
- if (addr == null) {
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "timeout exceeded or
first member"); //$NON-NLS-1$
- break;
- }
- JGroupsInputStream is = new JGroupsInputStream(IO_TIMEOUT);
- StreamingRunner runner = new StreamingRunner(object, stateId, is, p);
- List<?> key = Arrays.asList(stateId, new AddressWrapper(addr));
- disp.inputStreams.put(key, is);
- executor.execute(runner);
-
- this.disp.callRemoteMethod(addr, new MethodCall((short)(methodMap.size() - 4),
stateId, new AddressWrapper(this.disp.getChannel().getAddress())), new
RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(true));
-
- Boolean fetched = p.getResult(timeout);
-
- if (fetched != null) {
- if (fetched) {
- LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "pulled state",
stateId); //$NON-NLS-1$
- if (method !=null) {
- try {
- result = method.invoke(object, args);
- } catch (InvocationTargetException e) {
- throw e.getCause();
- }
- if (result != null) {
- return result;
- }
- }
- break;
- }
- LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " failed to pull
" + stateId); //$NON-NLS-1$
- } else {
- LogManager.logWarning(LogConstants.CTX_RUNTIME, object + " timeout pulling
" + stateId); //$NON-NLS-1$
- }
- } finally {
- synchronized (loadingStates) {
- loadingStates.remove(stateId);
- }
- }
- }
- return null; //could not fetch the remote state
- }
-
- @Override
- public void viewAccepted(View newView) {
- if (newView.getMembers() != null) {
- synchronized (remoteMembers) {
- remoteMembers.removeAll(newView.getMembers());
- if (object instanceof ReplicatedObject<?> && !remoteMembers.isEmpty())
{
- HashSet<Serializable> dropped = new HashSet<Serializable>();
- for (Address address : remoteMembers) {
- dropped.add(new AddressWrapper(address));
- }
- ((ReplicatedObject<?>)object).droppedMembers(dropped);
- }
- remoteMembers.clear();
- remoteMembers.addAll(newView.getMembers());
- remoteMembers.remove(this.disp.getChannel().getAddress());
- }
- }
- }
- }
-
- private interface Streaming {
- void sendState(Serializable id, AddressWrapper dest);
- void createState(Serializable id);
- void buildState(Serializable id, byte[] bytes);
- void finishState(Serializable id);
- }
-
- //TODO: this should be configurable, or use a common executor
- private transient Executor executor = Executors.newCachedThreadPool();
- private transient ChannelFactory channelFactory;
-
- public JGroupsObjectReplicator(ChannelFactory channelFactory) {
- this.channelFactory = channelFactory;
- }
-
- public void stop(Object object) {
- if (!Proxy.isProxyClass(object.getClass())) {
- return;
- }
- ReplicatedInvocationHandler<?> handler = (ReplicatedInvocationHandler<?>)
Proxy.getInvocationHandler(object);
- Channel c = handler.disp.getChannel();
- handler.disp.stop();
- c.close();
- }
-
- @Override
- public <T, S> T replicate(String mux_id,
- Class<T> iface, final S object, long startTimeout) throws Exception {
- Channel channel = channelFactory.createChannel(mux_id);
- Method[] methods = iface.getMethods();
-
- final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
- final ArrayList<Method> methodList = new ArrayList<Method>();
-
- for (Method method : methods) {
- if (method.getAnnotation(Replicated.class) == null) {
- continue;
- }
- methodList.add(method);
- methodMap.put(method, (short)(methodList.size() - 1));
- }
-
- Method hasState = ReplicatedObject.class.getMethod(HAS_STATE, new Class<?>[]
{Serializable.class});
- methodList.add(hasState);
- methodMap.put(hasState, (short)(methodList.size() - 1));
-
- Method sendState = JGroupsObjectReplicator.Streaming.class.getMethod(SEND_STATE, new
Class<?>[] {Serializable.class, AddressWrapper.class});
- methodList.add(sendState);
- methodMap.put(sendState, (short)(methodList.size() - 1));
-
- //add in streaming methods
- Method createState = JGroupsObjectReplicator.Streaming.class.getMethod(CREATE_STATE,
new Class<?>[] {Serializable.class});
- methodList.add(createState);
- methodMap.put(createState, (short)(methodList.size() - 1));
- Method buildState = JGroupsObjectReplicator.Streaming.class.getMethod(BUILD_STATE, new
Class<?>[] {Serializable.class, byte[].class});
- methodList.add(buildState);
- methodMap.put(buildState, (short)(methodList.size() - 1));
- Method finishState = JGroupsObjectReplicator.Streaming.class.getMethod(FINISH_STATE,
new Class<?>[] {Serializable.class});
- methodList.add(finishState);
- methodMap.put(finishState, (short)(methodList.size() - 1));
-
- ReplicatedInvocationHandler<S> proxy = new
ReplicatedInvocationHandler<S>(object, methodMap);
- /*
- * TODO: could have an object implement streaming
- * Override the normal handle method to support streaming
- */
- ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel,
proxy, proxy, object,
- object, methodMap, methodList);
-
- proxy.setDisp(disp);
- disp.setMethodLookup(new MethodLookup() {
- public Method findMethod(short id) {
- return methodList.get(id);
- }
- });
-
- T replicatedProxy = (T)
Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]
{iface}, proxy);
- boolean success = false;
- try {
- channel.connect(mux_id);
- if (object instanceof ReplicatedObject) {
- ((ReplicatedObject)object).setAddress(new AddressWrapper(channel.getAddress()));
- proxy.pullState(null, null, null, startTimeout);
- }
- success = true;
- return replicatedProxy;
- } catch (Throwable e) {
- if (e instanceof Exception) {
- throw (Exception)e;
- }
- throw new TeiidRuntimeException(e);
- } finally {
- if (!success) {
- channel.close();
- } else {
- synchronized (disp) {
- //mark as initialized so that state can be pulled if needed
- disp.initialized = true;
- }
- }
- }
- }
-
- // This class is used so that the objects are loaded with the current classes class
loader
- // rather than foreign class loader
- static class ContextAwareMarshaller implements RpcDispatcher.Marshaller {
- private ClassLoader classloader;
-
- public ContextAwareMarshaller(ClassLoader classloader) {
- this.classloader = classloader;
- }
-
- @Override
- public Buffer objectToBuffer(Object obj) throws Exception {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(baos);
- out.writeObject(obj);
- out.close();
- return new Buffer(baos.toByteArray());
- }
-
- @Override
- public Object objectFromBuffer(byte[] buf, int offset, int length) throws Exception {
- ObjectInputStream in = new ObjectInputStreamWithClassloader(new
ByteArrayInputStream(buf, offset, length), this.classloader);
- Object anObj = in.readObject();
- in.close();
- return anObj;
- }
- }
-
-}
Deleted:
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,104 +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.replication.jboss;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jgroups.Address;
-import org.jgroups.blocks.MethodCall;
-import org.jgroups.blocks.RequestOptions;
-import org.jgroups.blocks.ResponseMode;
-import org.jgroups.blocks.RpcDispatcher;
-import org.teiid.core.types.Streamable;
-
-public class JGroupsOutputStream extends OutputStream {
-
- static final int CHUNK_SIZE=Streamable.STREAMING_BATCH_SIZE_IN_BYTES;
-
- protected final RpcDispatcher disp;
- protected final List<Address> dests;
- protected final Serializable stateId;
- protected final short methodOffset;
-
- private volatile boolean closed=false;
- private final byte[] buffer=new byte[CHUNK_SIZE];
- private int index=0;
-
- public JGroupsOutputStream(RpcDispatcher disp, List<Address> dests,
Serializable stateId, short methodOffset, boolean sendCreate) throws IOException {
- this.disp=disp;
- this.dests=dests;
- this.stateId=stateId;
- this.methodOffset = methodOffset;
- if (sendCreate) {
- try {
- disp.callRemoteMethods(this.dests, new MethodCall(methodOffset, new Object[]
{stateId}), new RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests != null));
- } catch(Exception e) {
- throw new IOException(e);
- }
- }
- }
-
- public void close() throws IOException {
- if(closed) {
- return;
- }
- flush();
- try {
- disp.callRemoteMethods(dests, new MethodCall((short)(methodOffset + 2), new
Object[] {stateId}), new RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests !=
null));
- } catch(Exception e) {
- }
- closed=true;
- }
-
- public void flush() throws IOException {
- checkClosed();
- try {
- if(index == 0) {
- return;
- }
- disp.callRemoteMethods(dests, new MethodCall((short)(methodOffset + 1), new
Object[] {stateId, Arrays.copyOf(buffer, index)}), new
RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests != null));
- index=0;
- } catch(Exception e) {
- throw new IOException(e);
- }
- }
-
- private void checkClosed() throws IOException {
- if(closed) {
- throw new IOException("output stream is closed"); //$NON-NLS-1$
- }
- }
-
- public void write(int b) throws IOException {
- checkClosed();
- if(index >= buffer.length) {
- flush();
- }
- buffer[index++]=(byte)b;
- }
-
-}
\ No newline at end of file
Modified: trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java 2012-01-10 17:28:44 UTC
(rev 3784)
+++ trunk/common-core/src/main/java/org/teiid/core/BundleUtil.java 2012-01-11 19:18:32 UTC
(rev 3785)
@@ -50,6 +50,10 @@
protected final String pluginId;
+ public interface Event {
+ //String id();
+ }
+
/**
* Return the {@link BundleUtil} for the class. The bundle must be in the same
package or a parent package of the class.
* @param clazz
@@ -224,6 +228,18 @@
return MessageFormat.format(text, parameters);
}
+
+ public String gs(final String key, final Object... parameters) {
+ return getString(key, parameters);
+ }
+
+ public String gs(final Event key, final Object... parameters) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(key);
+ sb.append(" "); //$NON-NLS-1$
+ sb.append(getString(key.toString(), parameters));
+ return sb.toString();
+ }
public String getStringOrKey(final String key) {
ArgCheck.isNotNull(key);
Modified: trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/common-core/src/main/java/org/teiid/core/TeiidRuntimeException.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -70,6 +70,12 @@
// The following setCode call should be executed after setting the message
setCode(code);
}
+
+ public TeiidRuntimeException(final String[] message) {
+ super(message[1]);
+ // The following setCode call should be executed after setting the message
+ setCode(message[0]);
+ }
/**
* Construct an instance with a linked exception specified. If the exception is a
{@link TeiidException} or a
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooExecution.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -200,7 +200,7 @@
row.add(new java.sql.Date(date.getTime()));
} catch(ParseException e) {
Object[] params = new Object[] { data, e.getMessage() };
- LogManager.logWarning(LogConstants.CTX_CONNECTOR,
YahooPlugin.Util.getString("YahooExecution.Parse_date_error", params));
//$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
YahooPlugin.Util.gs(YahooPlugin.Event.TEIID14001, params));
row.add(null);
}
} else{
@@ -213,7 +213,7 @@
row.add(new java.sql.Time(time.getTime()));
} catch(ParseException e) {
Object[] params = new Object[] { data, e.getMessage() };
- LogManager.logWarning(LogConstants.CTX_CONNECTOR,
YahooPlugin.Util.getString("YahooExecution.Parse_time_value", params));
//$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
YahooPlugin.Util.gs(YahooPlugin.Event.TEIID14002, params));
row.add(null);
}
} else {
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooPlugin.java
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooPlugin.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/java/org/teiid/translator/yahoo/YahooPlugin.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -30,4 +30,9 @@
public class YahooPlugin {
public static final String PLUGIN_ID = "org.teiid.translator.yahoo" ;
//$NON-NLS-1$
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,PLUGIN_ID +
".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$
//$NON-NLS-2$
+
+ public static enum Event implements BundleUtil.Event{
+ TEIID14001, // parse data error
+ TEIID14002, // parse time error.
+ }
}
Modified:
trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties
===================================================================
---
trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/sandbox/translator-yahoo/src/main/resources/org/teiid/translator/yahoo/i18n.properties 2012-01-11
19:18:32 UTC (rev 3785)
@@ -27,6 +27,6 @@
TickerCollectorVisitor.Unexpected_expression=Unable to parse expression: {0}
YahooExecution.No_tickers=Yahoo connector must be called with tickers in the criteria
YahooExecution.Must_have_criteria=Query against Yahoo connector must have criteria
-YahooExecution.Parse_date_error=Unable to parse date value: {0}, got: {1}
-YahooExecution.Parse_time_value=Unable to parse time value: {0}, got: {1}
+TEIID14001=Unable to parse date value: {0}, got: {1}
+TEIID14002=Unable to parse time value: {0}, got: {1}
YahooExecution.Invalid_select_symbol=Yahoo connector can''t handle {0} in SELECT
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1026,8 +1026,7 @@
LogManager.logInfo(LogConstants.CTX_CONNECTOR, sb.toString());
} catch (SQLException e) {
- String errorStr =
JDBCPlugin.Util.getString("ConnectionListener.failed_to_report_jdbc_connection_details");
//$NON-NLS-1$
- LogManager.logInfo(LogConstants.CTX_CONNECTOR, errorStr);
+ LogManager.logInfo(LogConstants.CTX_CONNECTOR,
JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID11002));
}
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCPlugin.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCPlugin.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCPlugin.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -35,4 +35,11 @@
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
PLUGIN_ID + ".i18n",
ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+
+ public static enum Event implements BundleUtil.Event{
+ TEIID11001, // connection details
+ TEIID11002, // connection creation failed
+ TEIID11003, // invalid hint
+ }
}
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
---
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -362,7 +362,7 @@
comment += payloadString + " "; //$NON-NLS-1$
usingPayloadComment = true;
} else {
- String msg =
JDBCPlugin.Util.getString("OraleExecutionFactory.invalid_hint", "Execution
Payload", payloadString); //$NON-NLS-1$ //$NON-NLS-2$
+ String msg = JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID11003, "Execution
Payload", payloadString); //$NON-NLS-1$
context.addWarning(new TranslatorException(msg));
LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
}
@@ -381,7 +381,7 @@
if (!hint.contains(HINT_PREFIX)) {
comment += HINT_PREFIX + ' ' + hint + ' ' + HINT_SUFFIX + '
';
} else {
- String msg =
JDBCPlugin.Util.getString("OraleExecutionFactory.invalid_hint", "Source
Hint", hint); //$NON-NLS-1$ //$NON-NLS-2$
+ String msg = JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID11003, "Source
Hint", hint); //$NON-NLS-1$
context.addWarning(new TranslatorException(msg));
LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
}
Modified:
trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties
===================================================================
---
trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-jdbc/src/main/resources/org/teiid/translator/jdbc/i18n.properties 2012-01-11
19:18:32 UTC (rev 3785)
@@ -28,6 +28,6 @@
JDBCQueryExecution.Error_executing_query__1 = ''{0}'' error executing
statement(s): {1}
SQLConversionVisitor.invalid_parameter=Invalid parameter {0}. Must be between 1 and
{1}.
SQLConversionVisitor.not_in_parameter=Invalid parameter {0}. Native query procedures
cannot use non IN parameters.
-OraleExecutionFactory.invalid_hint=Not using oracle execution payload {0} as hint, since
it apprears to contain more than just a single comment.
-ConnectionListener.failed_to_report_jdbc_connection_details=Failed to report the JDBC
driver and connection information
+TEIID11003=Not using oracle execution payload {0} as hint, since it apprears to contain
more than just a single comment.
+TEIID11002=Failed to report the JDBC driver and connection information
JDBCMetadataProcessor.not_unique=Teiid runtime names, which are case insensitive, for the
imported metadata are not unique. If not already set, use the setting
importer.useFullSchemaName to create Teiid names that include the source schema.
\ No newline at end of file
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/IQueryToLdapSearchParser.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -400,13 +400,13 @@
} else {
if(e instanceof AggregateFunction) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Received IAggregate, but it is
not supported. Check capabilities."); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12001));
} else if(e instanceof Function) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Received IFunction, but it is
not supported. Check capabilties."); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12005));
} else if(e instanceof ScalarSubquery) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Received IScalarSubquery, but
it is not supported. Check capabilties."); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12006));
} else if (e instanceof SearchedCase) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Received
ISearchedCaseExpression, but it is not supported. Check capabilties.");
//$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12007));
}
final String msg =
LDAPPlugin.Util.getString("IQueryToLdapSearchParser.unsupportedElementError");
//$NON-NLS-1$
throw new TranslatorException(msg + e.toString());
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPPlugin.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPPlugin.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPPlugin.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -38,4 +38,14 @@
*/
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID, PLUGIN_ID +
".i18n", ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$
//$NON-NLS-2$
+ public static enum Event implements BundleUtil.Event {
+ TEIID12001, // unsupported capability
+ TEIID12002, // search failed
+ TEIID12003, // close context
+ TEIID12004, // attribute fetch error
+ TEIID12005,
+ TEIID12006,
+ TEIID12007,
+ TEIID12008
+ }
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -200,8 +200,7 @@
ldapCtx = (LdapContext) this.ldapConnection.lookup(searchDetails.getContextName());
} catch (NamingException ne) {
if (searchDetails.getContextName() != null) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Attempted to search context:
" //$NON-NLS-1$
- + searchDetails.getContextName());
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12002, searchDetails.getContextName()));
}
final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.createContextError");
//$NON-NLS-1$
throw new TranslatorException(msg);
@@ -275,8 +274,7 @@
try {
ldapCtx.close();
} catch (NamingException ne) {
- final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.closeContextError",ne.getExplanation());
//$NON-NLS-1$
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12003, ne.getExplanation()));
}
}
}
@@ -330,7 +328,7 @@
return result;
} catch (SizeLimitExceededException e) {
if (resultCount != searchDetails.getCountLimit()) {
- String msg = "LDAP Search results exceeded size limit. Results may be
incomplete."; //$NON-NLS-1$
+ String msg = LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12008);
TranslatorException te = new TranslatorException(e, msg);
if (executionFactory.isExceptionOnSizeLimitExceeded()) {
throw te;
@@ -340,7 +338,7 @@
}
return null; // GHH 20080326 - if size limit exceeded don't try to read more
results
} catch (NamingException ne) {
- throw new TranslatorException(ne, "Ldap error while processing next batch of
results"); //$NON-NLS-1$
+ throw new TranslatorException(ne, LDAPPlugin.Util.gs("ldap_error"));
//$NON-NLS-1$
}
}
@@ -436,7 +434,7 @@
//just a single value
objResult = resultAttr.get();
} catch (NamingException ne) {
- final String msg =
LDAPPlugin.Util.getString("LDAPSyncQueryExecution.attrValueFetchError",modelAttrName)
+" : "+ne.getExplanation(); //$NON-NLS-1$m//$NON-NLS-2$
+ final String msg = LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12004,
modelAttrName) +" : "+ne.getExplanation(); //$NON-NLS-1$m
LogManager.logWarning(LogConstants.CTX_CONNECTOR, msg);
throw new TranslatorException(msg);
}
Modified:
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java
===================================================================
---
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPUpdateExecution.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -431,8 +431,7 @@
ldapCtx.close();
}
} catch (NamingException ne) {
- final String msg =
LDAPPlugin.Util.getString("LDAPUpdateExecution.closeContextError",ne.getExplanation());
//$NON-NLS-1$
- LogManager.logWarning(LogConstants.CTX_CONNECTOR,msg);
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12003, ne.getExplanation()));
}
}
Modified:
trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties
===================================================================
---
trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-ldap/src/main/resources/org/teiid/translator/ldap/i18n.properties 2012-01-11
19:18:32 UTC (rev 3785)
@@ -35,9 +35,9 @@
LDAPSyncQueryExecution.createContextError=Failed to create LDAP search context from the
specified context name. Check the table/group name in source to ensure the context
exists.
LDAPSyncQueryExecution.execSearchError=Execute search failed. Please check logs for
search details.
LDAPSyncQueryExecution.nullAttrError=Encountered null attribute name for a select symbol.
Please check name in source for each column.
-LDAPSyncQueryExecution.attrValueFetchError=Failed to fetch attribute value for attribute
{0}. Rowset cannot be constructed from incomplete LDAP results.
+TEIID12004=Failed to fetch attribute value for attribute {0}. Rowset cannot be
constructed from incomplete LDAP results.
LDAPSyncQueryExecution.supportedClassNotFoundError=Supported class not found.
-LDAPSyncQueryExecution.closeContextError=LDAP error occurred during attempt to close
context : {0}
+TEIID12003=LDAP error occurred during attempt to close context : {0}
#
LDAPUpdateExecution.createContextError=Failed to create copy of the initial LDAP context:
{0}
LDAPUpdateExecution.incorrectCommandError=Incorrect command type. Expecting INSERT,
UPDATE, or DELETE.
@@ -58,6 +58,13 @@
LDAPUpdateExecution.criteriaSrcColumnError=criteria is on source column {0}, but should
be on a source column named DN
LDAPUpdateExecution.criteriaRHSNotLiteralError=right side of equals comparison against DN
is not a literal - must be a string literal
LDAPUpdateExecution.criteriaRHSNotStringError=right side of equals comparison against DN
is not a string - must be a string literal
-LDAPUpdateExecution.closeContextError=LDAP error occurred during attempt to close context
: {0}
LDAPSyncQueryExecution.timestampParseFailed=Timestamp could not be parsed. Please check
to ensure the Format field for attribute {0} is configured using SimpleDateFormat
conventions.
+ldap_error=Ldap error while processing next batch of results
+
+TEIID12001=Received IAggregate, but it is not supported. Check capabilities.
+TEIID12005=Received IFunction, but it is not supported. Check capabilties.
+TEIID12006=Received IScalarSubquery, but it is not supported. Check capabilties.
+TEIID12007=Received ISearchedCaseExpression, but it is not supported. Check capabilties.
+TEIID12002=Attempted to search context: {0}
+TEIID12008=LDAP Search results exceeded size limit. Results may be incomplete.
\ No newline at end of file
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/MetadataProcessor.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -270,7 +270,7 @@
column.setNativeType(sfTypeName);
}
if(null == column) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Unknown type returned by
SalesForce: " + sfTypeName);
+ LogManager.logError(LogConstants.CTX_CONNECTOR,
SalesForcePlugin.Util.gs(SalesForcePlugin.Event.TEIID13001, sfTypeName));
continue;
} else {
column.setNameInSource(field.getName());
Modified:
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForcePlugin.java
===================================================================
---
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForcePlugin.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForcePlugin.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -42,5 +42,7 @@
private static final String BUNDLE_NAME = PLUGIN_ID + ".i18n";
//$NON-NLS-1$
public static final BundleUtil Util = new
BundleUtil(PLUGIN_ID,BUNDLE_NAME,ResourceBundle.getBundle(BUNDLE_NAME));
-
+ public static enum Event implements BundleUtil.Event{
+ TEIID13001
+ }
}
Modified:
trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties
===================================================================
---
trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/connectors/translator-salesforce/src/main/resources/org/teiid/translator/salesforce/i18n.properties 2012-01-11
19:18:32 UTC (rev 3785)
@@ -38,3 +38,4 @@
CriteriaVisitor.LIKE.not.supported.on.multiselect=LIKE criteria are not allowed on
columns of native type Multi-Select Picklist
Util.query.exceeds.max.length=Queries cannot exceed 10,000 characters
+TEIID13001=Unknown type returned by SalesForce: {0}
Modified:
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferFrontedFileStoreCache.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -445,7 +445,7 @@
sleep = false;
} while (shouldDefrag(blockStore, segment));
} catch (IOException e) {
- LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, e, "Error performing
defrag"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30022));
} catch (InterruptedException e) {
throw new TeiidRuntimeException(e);
}
@@ -464,7 +464,7 @@
long newLength = (endBlock + 1) * blockStore.blockSize;
blockStore.stores[segment].setLength(newLength);
} catch (IOException e) {
- LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, e, "Error performing defrag
truncate"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_BUFFER_MGR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30023));
} finally {
blockStore.locks[segment].writeLock().unlock();
}
@@ -613,9 +613,9 @@
//entries are mutable after adding, the original should be removed shortly so just
ignore
LogManager.logDetail(LogConstants.CTX_BUFFER_MGR, "Object "+ entry.getId()
+" changed size since first persistence, keeping the original."); //$NON-NLS-1$
//$NON-NLS-2$
} else if (e == BlockOutputStream.exceededMax){
- LogManager.logError(LogConstants.CTX_BUFFER_MGR, "Max block number exceeded.
Increase the maxStorageObjectSize to support larger storage objects. Alternatively you
could make the processor batch size smaller."); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_BUFFER_MGR,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30001));
} else {
- LogManager.logError(LogConstants.CTX_BUFFER_MGR, e, "Error persisting, attempts
to read "+ entry.getId() +" later will result in an exception.");
//$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logError(LogConstants.CTX_BUFFER_MGR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30002,entry.getId()));
}
} finally {
if (hasPermit) {
@@ -902,7 +902,7 @@
block = blockStore.writeToStorageBlock(info, is);
}
} catch (IOException e) {
- LogManager.logError(LogConstants.CTX_BUFFER_MGR, e, "Error transferring block to
storage " + oid); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_BUFFER_MGR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30016, oid));
} finally {
//ensure post conditions
synchronized (info) {
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -711,7 +711,7 @@
try {
evicted = evict(ce);
} catch (Throwable e) {
- LogManager.logError(LogConstants.CTX_BUFFER_MGR, e, "Error persisting batch,
attempts to read batch "+ ce.getId() +" later will result in an
exception"); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logError(LogConstants.CTX_BUFFER_MGR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30017, ce.getId() ));
} finally {
synchronized (ce) {
if (evicted && memoryEntries.remove(ce.getId()) != null) {
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -152,7 +152,7 @@
}
for (Capability capability : required) {
if (!tgtCaps.supportsCapability(capability)) {
- LogManager.logWarning(LogConstants.CTX_CONNECTOR,
QueryPlugin.Util.getString("support_required", cap, capability, connectorID));
//$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30003, cap, capability, connectorID));
supports = false;
}
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -124,7 +124,7 @@
LogManager.logDetail(LogConstants.CTX_CONNECTOR,
QueryPlugin.Util.getString("DQPCore.The_atomic_request_has_been_cancelled",
this.id)); //$NON-NLS-1$
}
} catch (TranslatorException e) {
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, e,
QueryPlugin.Util.getString("Cancel_request_failed", this.id)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30024, this.id));
}
}
@@ -343,7 +343,7 @@
if ( !lastBatch && currentRowCount == 0 ) {
// Defect 13366 - Should send all batches, even if they're zero size.
// Log warning if received a zero-size non-last batch from the connector.
- LogManager.logWarning(LogConstants.CTX_CONNECTOR,
QueryPlugin.Util.getString("ConnectorWorker.zero_size_non_last_batch",
requestMsg.getConnectorName())); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30004, requestMsg.getConnectorName()));
}
AtomicResultsMessage response = createResultsMessage(rows.toArray(new
List[currentRowCount]));
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -113,7 +113,7 @@
try {
this.accessInfo.restore();
} catch (TeiidException e) {
- LogManager.logWarning(LogConstants.CTX_DQP, e,
QueryPlugin.Util.getString("unexpected_exception_restoring_results"));
//$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30025));
return false;
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -351,7 +351,7 @@
wi.requestCancel();
}
} catch (TeiidComponentException e) {
- LogManager.logError(LogConstants.CTX_DQP, e, "Error processing cancellation
task."); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018));
}
}
}, timeout));
@@ -524,7 +524,7 @@
try {
cancelRequest(reqId);
} catch (TeiidComponentException err) {
- LogManager.logWarning(LogConstants.CTX_DQP, err, "Failed to cancel
" + reqId); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, err,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30026,reqId));
}
}
}
@@ -532,7 +532,7 @@
try {
transactionService.cancelTransactions(sessionId, false);
} catch (XATransactionException err) {
- LogManager.logWarning(LogConstants.CTX_DQP, "rollback failed for
requestID=" + sessionId); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30005,sessionId));
}
}
@@ -653,7 +653,7 @@
this.maxActivePlans = config.getMaxActivePlans();
if (this.maxActivePlans > config.getMaxThreads()) {
- LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.getString("DQPCore.invalid_max_active_plan",
this.maxActivePlans, config.getMaxThreads())); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30006, this.maxActivePlans,
config.getMaxThreads()));
this.maxActivePlans = config.getMaxThreads();
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/LobWorkItem.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -75,7 +75,7 @@
chunk = stream.getNextChunk();
shouldClose = chunk.isLast();
} catch (TeiidComponentException e) {
- LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e,
QueryPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
+ LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30027));
ex = e;
} catch (IOException e) {
ex = e;
@@ -102,7 +102,7 @@
stream.close();
}
} catch (IOException e) {
- LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e,
QueryPlugin.Util.getString("ProcessWorker.LobError")); //$NON-NLS-1$
+ LogManager.logWarning(org.teiid.logging.LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30027));
}
parent.removeLobStream(streamRequestId);
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -343,9 +343,9 @@
} else {
elem = cause.getMessage();
}
- LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.getString("ProcessWorker.processing_error", e.getMessage(),
requestID, e.getClass().getName(), elem)); //$NON-NLS-1$
- }else {
- LogManager.logError(LogConstants.CTX_DQP, e,
QueryPlugin.Util.getString("ProcessWorker.error", requestID)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30020, e.getMessage(), requestID,
e.getClass().getName(), elem));
+ } else {
+ LogManager.logError(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30019, requestID));
}
}
@@ -460,7 +460,7 @@
try {
this.transactionService.rollback(transactionContext);
} catch (XATransactionException e1) {
- LogManager.logWarning(LogConstants.CTX_DQP, e1,
QueryPlugin.Util.getString("ProcessWorker.failed_rollback")); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e1,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30028));
}
} else {
suspend();
@@ -612,7 +612,7 @@
}
if (determinismLevel.compareTo(Determinism.SESSION_DETERMINISTIC) <= 0) {
- LogManager.logInfo(LogConstants.CTX_DQP,
QueryPlugin.Util.getString("RequestWorkItem.cache_nondeterministic",
originalCommand)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30008, originalCommand));
}
dqpCore.getRsCache().put(cid, determinismLevel, cr,
originalCommand.getCacheHint() != null?originalCommand.getCacheHint().getTtl():null);
}
@@ -942,7 +942,7 @@
try {
requestCancel();
} catch (TeiidComponentException e) {
- LogManager.logWarning(LogConstants.CTX_DQP, e, "Failed to cancel " +
requestID); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30026,requestID));
}
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/ThreadReuseExecutor.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/ThreadReuseExecutor.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/ThreadReuseExecutor.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -240,7 +240,7 @@
@Override
protected void afterExecute(Runnable r, Throwable t) {
if (t != null) {
- LogManager.logError(LogConstants.CTX_RUNTIME, t,
QueryPlugin.Util.getString("WorkerPool.uncaughtException")); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_RUNTIME, t,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021));
}
}
@@ -305,7 +305,7 @@
if (success) {
long warnTime = warnWaitTime;
if (r != null && System.currentTimeMillis() - r.getCreationTime() >
warnTime) {
- LogManager.logWarning(LogConstants.CTX_RUNTIME,
QueryPlugin.Util.getString("WorkerPool.Max_thread", maximumPoolSize, poolName,
highestQueueSize, warnTime)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_RUNTIME,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30009, maximumPoolSize, poolName,
highestQueueSize, warnTime));
warnWaitTime*=2; //we don't really care if this is synchronized
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-01-10 17:28:44 UTC
(rev 3784)
+++ trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-01-11 19:18:32 UTC
(rev 3785)
@@ -41,4 +41,39 @@
public static final BundleUtil Util = new BundleUtil(PLUGIN_ID,
PLUGIN_ID + ".i18n",
ResourceBundle.getBundle(PLUGIN_ID + ".i18n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+
+ public static enum Event implements BundleUtil.Event{
+ TEIID30001, // buffer manager max block exceeded
+ TEIID30002, // error persisting buffer manager
+ TEIID30003, // capability required
+ TEIID30004, // zero size batch
+ TEIID30005, // rollback failed
+ TEIID30006, // invalid max active plans
+ TEIID30007, // general process worker error
+ TEIID30008, // request not deterministic
+ TEIID30009, // max threads exceeded
+ TEIID30010, // duplicate function
+ TEIID30011, // dependent criteria over max
+ TEIID30012, // mat row refresh
+ TEIID30013, // mat table loading
+ TEIID30014, // mat table loaded
+ TEIID30015, //faild to load mat table
+ TEIID30016, // error transfer
+ TEIID30017, // error persisting batch in bm
+ TEIID30018,
+ TEIID30019, // process worker error
+ TEIID30020, // process worker error
+ TEIID30021, // uncaught exception during work
+ TEIID30022, // error defrag
+ TEIID30023, // error defrag truncate
+ TEIID30024, // cancel request failed
+ TEIID30025, // failed to restore results
+ TEIID30026, // failed to cancel
+ TEIID30027, // lob error
+ TEIID30028, // failed to rollback
+ TEIID30029, // unexpected format
+ TEIID30030, // unexpected exp1
+ TEIID30031, // unexpected exp2
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/engine/src/main/java/org/teiid/query/function/FunctionTree.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -104,7 +104,7 @@
// Add to tree
addFunction(name, source, method);
} else if (!CoreConstants.SYSTEM_MODEL.equalsIgnoreCase(name)) {
- LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE,
QueryPlugin.Util.getString("ERR.015.001.0046", new Object[]{method}));
//$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_FUNCTION_TREE,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30011, new Object[]{method}));
}
}
}
Modified:
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/NewCalculateCostUtil.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -980,8 +980,8 @@
costMultiple = 0;
}
cost = childCost * costMultiple;
- }catch(IllegalArgumentException e) {
- LogManager.logWarning(LogConstants.CTX_QUERY_PLANNER, e,
QueryPlugin.Util.getString("NewCalculateCostUtil.badCost")); //$NON-NLS-1$
+ } catch(IllegalArgumentException e) {
+ LogManager.logWarning(LogConstants.CTX_QUERY_PLANNER, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30029));
// If we were unable to parse the timestamp we will revert to the divide by
three estimate
if (unknownChildCost) {
return UNKNOWN_VALUE;
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/query/processor/relational/DependentCriteriaProcessor.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -109,7 +109,7 @@
last = next;
}
if (!setState.overMax && distinctCount > setState.maxNdv)
{
- LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.getString("DependentCriteriaProcessor.dep_join_backoff",
valueSource, setState.valueExpression, setState.maxNdv)); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30011, valueSource, setState.valueExpression,
setState.maxNdv));
setState.overMax = true;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLPlan.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -387,9 +387,7 @@
try{
return "XMLPlan:\n" +
ProgramUtil.programToString(this.originalProgram); //$NON-NLS-1$
} catch (Exception e){
- e.printStackTrace();
- LogManager.logWarning(LogConstants.CTX_XML_PLAN, e,
-
QueryPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_XML_PLAN, e,
QueryPlugin.Util.getString("ERR.015.006.0001")); //$NON-NLS-1$
}
return "XMLPlan"; //$NON-NLS-1$
}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -302,7 +302,7 @@
throw new
QueryProcessingException(QueryPlugin.Util.getString("TempTableDataManager.row_refresh_updatable",
matViewName)); //$NON-NLS-1$
}
Constant key = (Constant)proc.getParameter(2).getExpression();
- LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.getString("TempTableDataManager.row_refresh", matViewName,
key)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30012, matViewName, key));
Object id = ids.iterator().next();
String targetTypeName = metadata.getElementType(id);
Object value = DataTypeManager.transformValue(key.getValue(),
DataTypeManager.getDataTypeClass(targetTypeName));
@@ -432,7 +432,7 @@
private int loadGlobalTable(CommandContext context,
GroupSymbol group, final String tableName, GlobalTableStore globalStore)
throws TeiidComponentException, TeiidProcessingException {
- LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.getString("TempTableDataManager.loading", tableName));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30013, tableName));
QueryMetadataInterface metadata = context.getMetadata();
List<ElementSymbol> allColumns = ResolverUtil.resolveElementsInGroup(group,
metadata);
TempTable table = globalStore.createMatTable(tableName, group);
@@ -463,17 +463,17 @@
table.setUpdatable(hint.isUpdatable());
}
} catch (TeiidComponentException e) {
- LogManager.logError(LogConstants.CTX_MATVIEWS, e,
QueryPlugin.Util.getString("TempTableDataManager.failed_load", tableName));
//$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_MATVIEWS, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30015, tableName));
throw e;
} catch (TeiidProcessingException e) {
- LogManager.logError(LogConstants.CTX_MATVIEWS, e,
QueryPlugin.Util.getString("TempTableDataManager.failed_load", tableName));
//$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_MATVIEWS, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30015, tableName));
throw e;
} finally {
if (rowCount == -1) {
globalStore.failedLoad(tableName);
} else {
globalStore.loaded(tableName, table);
- LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.getString("TempTableDataManager.loaded", tableName, rowCount));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_MATVIEWS,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30014, tableName, rowCount));
}
}
return rowCount;
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -663,7 +663,7 @@
try {
reusableExecution.dispose();
} catch (Exception e) {
- LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception disposing
reusable execution"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30030));
}
}
this.globalState.reusableExecutions.clear();
@@ -673,7 +673,7 @@
try {
listener.commandClosed(this);
} catch (Exception e) {
- LogManager.logWarning(LogConstants.CTX_DQP, e, "Unhandled exception calling
CommandListener"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_DQP, e,
QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30031));
}
}
this.globalState.commandListeners.clear();
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-01-10 17:28:44
UTC (rev 3784)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-01-11 19:18:32
UTC (rev 3785)
@@ -39,7 +39,7 @@
ERR.015.001.0042 = Illegal argument for formating: {0}
ERR.015.001.0043 = Parse Exception occurs for executing: {0} {1}
ERR.015.001.0044 = Function metadata source is of invalid type: {0}
-ERR.015.001.0046 = The function "{0}" will not be added because a function with
the same name and signature already exists.
+TEIID30011 = The function "{0}" will not be added because a function with the
same name and signature already exists.
ERR.015.001.0047 = Unexpected exception while loading "{1}.{2}" for UDF
"{0}"
FunctionTree.not_void = UDF "{0}" method "{1}" must not return void.
FunctionTree.not_public = UDF "{0}" method "{1}" must be public.
@@ -747,10 +747,10 @@
QueryUtil.Error_executing_conversion_function_to_convert_value=Error converting parameter
number {0} with value "{1}" to expected type {2}.
InsertResolver.cant_convert_query_type=Cannot convert insert query expression projected
symbol ''{0}'' of type {1} to insert column ''{2}'' of
type {3}
SetClause.resolvingError=Cannot set symbol ''{1}'' with expected type {2}
to expression ''{0}''
-NewCalculateCostUtil.badCost=Unexpected format encountered for max or min value
+TEIID30029=Unexpected format encountered for max or min value
-WorkerPool.Max_thread=Reached maximum thread count "{0}" for worker pool
"{1}" with a queue size high of "{2}". Queued work waited {3} ms prior
to executing. To avoid queuing of work you may consider increasing "max-threads"
or decreasing the "max-active-plans" in the "standalone-teiid.xml"
file.
-WorkerPool.uncaughtException=Uncaught exception processing work
+TEIID30009=Reached maximum thread count "{0}" for worker pool "{1}"
with a queue size high of "{2}". Queued work waited {3} ms prior to executing.
To avoid queuing of work you may consider increasing "max-threads" or decreasing
the "max-active-plans" in the "standalone-teiid.xml" file.
+TEIID30021=Uncaught exception processing work
TempTable.duplicate_key=Duplicate key
@@ -821,15 +821,15 @@
XMLTableNode.path_error=Error evaluating XMLTable column path expression for column: {0}
XMLTableName.multi_value=Unexpected multi-valued result was returned for XMLTable column
"{0}". Path expressions for non-XML type columns should return at most a single
result.
-TempTableDataManager.failed_load=Failed to load materialized view table {0}.
-TempTableDataManager.loaded=Loaded materialized view table {0} with row count {1}.
-TempTableDataManager.loading=Loading materialized view table {0}
+TEIID30015=Failed to load materialized view table {0}.
+TEIID30014=Loaded materialized view table {0} with row count {1}.
+TEIID30013=Loading materialized view table {0}
TempTableDataManager.cache_load=Loaded materialized view table {0} from cached contents
from another clustered node.
TempTableDataManager.not_implicit_matview={0} does not target an internal materialized
view.
TempTableDataManager.row_refresh_pk=Materialized view {0} cannot have a row refreshed
since there is no primary key.
TempTableDataManager.row_refresh_composite=Materialized view {0} cannot have a row
refreshed because it uses a composite key.
TempTableDataManager.row_refresh_updatable=Materialized view {0} cannot have a row
refreshed because it's cache hint did not specify \"updatable\".
-TempTableDataManager.row_refresh=Refreshing row {1} for materialized view {0}.
+TEIID30012=Refreshing row {1} for materialized view {0}.
CriteriaPlanner.no_context=No root node found.
BasicInterceptor.ProcessTree_for__4=ProcessTree for
@@ -841,7 +841,8 @@
Cancel_request_failed=AtomicRequest {0} failed to cancel.
ConnectorWorker.MaxResultRowsExceed=The number of result rows has exceeded the maximum
result rows "{0}"
-ConnectorWorker.zero_size_non_last_batch=Connector returned a 0 row non-last batch: {0}.
+TEIID30004=Connector returned a 0 row non-last batch: {0}.
+TEIID30005=rollback failed for requestID={0}
ConnectorWorker.process_failed=Connector worker process failed for atomic-request={0}
ConnectorWorker.ConnectorWorker_result_set_unexpected_columns=Could not process stored
procedure results for {0}. Expected {1} result set columns, but was {2}. Please update
your models to allow for stored procedure results batching.
@@ -858,11 +859,11 @@
DQPCore.The_request_has_been_closed.=The request {0} has been closed.
DQPCore.The_atomic_request_has_been_cancelled=The atomic request {0} has been canceled.
DQPCore.failed_to_cancel=Failed to Cancel request, as request already finished
processing
-DQPCore.invalid_max_active_plan=The maxActivePlan {0} setting should never be greater
than the max processing threads {1}.
+TEIID30006=The maxActivePlan {0} setting should never be greater than the max processing
threads {1}.
-ProcessWorker.failed_rollback=Failed to properly rollback autowrap transaction properly
-ProcessWorker.error=Unexpected exception for request {0}
-ProcessWorker.processing_error=Processing exception ''{0}'' for request
{1}. Exception type {2} thrown from {3}. Enable more detailed logging to see the entire
stacktrace.
+TEIID30028=Failed to properly rollback autowrap transaction properly
+TEIID30019=Unexpected exception for request {0}
+TEIID30020=Processing exception ''{0}'' for request {1}. Exception type
{2} thrown from {3}. Enable more detailed logging to see the entire stacktrace.
# #query (018.005)
@@ -875,7 +876,7 @@
Request.result_set=The query does not return an update count.
ProcessWorker.wrongdata=Wrong type of data found or no data found; expecting streamable
object from the buffer manager.
-ProcessWorker.LobError=An error occurred during streaming of Lob Chunks to Client.
+TEIID30027=An error occurred during streaming of Lob Chunks to Client.
TransactionServer.existing_transaction=Client thread already involved in a transaction.
Transaction nesting is not supported. The current transaction must be completed first.
TransactionServer.no_transaction=No transaction found for client {0}.
@@ -912,9 +913,9 @@
translator_not_found=Translator {0} not accessible.
datasource_not_found=Data Source {0} not accessible.
-RequestWorkItem.cache_nondeterministic=Caching command "{0}" at a session
level, but less deterministic functions were evaluated.
+TEIID30008=Caching command "{0}" at a session level, but less deterministic
functions were evaluated.
not_found_cache=Failed to restore results, since batch entries were missing. The entry
will be re-populated.
-unexpected_exception_restoring_results=Failed to restore results. The entry will be
re-populated.
+TEIID30025=Failed to restore results. The entry will be re-populated.
failed_to_cache=Failed to store the result set contents to disk.
failed_to_unwrap_connection=Failed to unwrap the source connection.
connection_factory_not_found=Failed to find the Connection Factory with JNDI name {0}.
Please check the name or deploy the Connection Factory with specified name.
@@ -939,9 +940,19 @@
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}.
+TEIID30003=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
RuleAssignOutputElements.couldnt_push_expression=Expression(s) {0} cannot be pushed to
source.
RuleAssignOutputElements.cannot_introduce_expressions=Cannot introduce new expressions
{1} in duplicate removal.
-DependentCriteriaProcessor.dep_join_backoff=Not performing dependent join using source
{0}, since the number of distinct rows for expression {1} exceeds {2}. You should ensure
that your source statistics, including column distinct value counts, accurately reflect
the source or use a MAKE_DEP hint to force the join.
\ No newline at end of file
+TEIID30011=Not performing dependent join using source {0}, since the number of distinct
rows for expression {1} exceeds {2}. You should ensure that your source statistics,
including column distinct value counts, accurately reflect the source or use a MAKE_DEP
hint to force the join.
+TEIID30001=Max block number exceeded. Increase the maxStorageObjectSize to support larger
storage objects. Alternatively you could make the processor batch size smaller.
+TEIID30002=Error persisting, attempts to read {0} later will result in an exception.
+TEIID30016=Error transferring block to storage {0}
+TEIID30017=Error persisting batch, attempts to read batch {0} later will result in an
exception
+TEIID30018=Error processing cancellation task.
+TEIID30022=Error performing defrag
+TEIID30023=Error performing defrag truncate
+TEIID30026=Failed to cancel {0}
+TEIID30030=Unhandled exception disposing reusable execution
+TEIID30031=Unhandled exception calling CommandListener
Copied: trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java (from
rev 3777, trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCache.java)
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
(rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,89 @@
+/*
+ * 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.cache.jboss;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.teiid.cache.Cache;
+
+
+/**
+ * Implementation of Cache using Infinispan
+ */
+public class JBossCache<K, V> implements Cache<String, V> {
+
+ protected org.infinispan.Cache<String, V> cacheStore;
+ private final String name;
+
+ public JBossCache(org.infinispan.Cache<String, V> cacheStore, String cacheName) {
+ this.cacheStore = cacheStore;
+ this.name = cacheName;
+ }
+
+ private String fqn(String key) {
+ return this.name+"."+key; //$NON-NLS-1$
+ }
+
+ @Override
+ public V get(String key) {
+ return this.cacheStore.get(fqn(key));
+ }
+
+ public V put(String key, V value) {
+ return this.cacheStore.put(fqn(key), value);
+ }
+
+ @Override
+ public V put(String key, V value, Long ttl) {
+ if (ttl != null) {
+ return this.cacheStore.put(fqn(key), value, ttl, TimeUnit.MILLISECONDS);
+ }
+ return this.cacheStore.put(fqn(key), value);
+ }
+
+ @Override
+ public V remove(String key) {
+ return this.cacheStore.remove(fqn(key));
+ }
+
+ @Override
+ public int size() {
+ return this.cacheStore.size();
+ }
+
+ @Override
+ public void clear() {
+ this.cacheStore.clear();
+ }
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public Set<String> keys() {
+ return this.cacheStore.keySet();
+ }
+}
Copied: trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
(from rev 3777,
trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java)
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,71 @@
+/*
+ * 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.cache.jboss;
+
+import java.io.Serializable;
+
+import org.infinispan.manager.CacheContainer;
+import org.teiid.cache.Cache;
+import org.teiid.cache.CacheConfiguration;
+import org.teiid.cache.CacheFactory;
+import org.teiid.core.TeiidRuntimeException;
+
+
+public class JBossCacheFactory implements CacheFactory, Serializable{
+ private static final long serialVersionUID = -2767452034178675653L;
+ private transient org.infinispan.Cache cacheStore;
+ private volatile boolean destroyed = false;
+
+
+ public JBossCacheFactory(String name, CacheContainer cm) {
+ if (name != null) {
+ this.cacheStore = cm.getCache(name);
+ }
+ else {
+ this.cacheStore = cm.getCache();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Cache get(String location, CacheConfiguration config) {
+ if (!destroyed) {
+ return new JBossCache(this.cacheStore, config.getLocation());
+ }
+ throw new TeiidRuntimeException("Cache system has been shutdown");
//$NON-NLS-1$
+ }
+
+ public void destroy() {
+ this.destroyed = true;
+ }
+
+ public void stop() {
+ destroy();
+ }
+
+ @Override
+ public boolean isReplicated() {
+ return true;
+ }
+}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -140,7 +140,7 @@
}
});
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("engine_started",
this.dqpCore.getRuntimeVersion(), new Date(System.currentTimeMillis()).toString()));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50001,
this.dqpCore.getRuntimeVersion(), new Date(System.currentTimeMillis()).toString()));
}
@Override
@@ -156,7 +156,7 @@
// this bean is already shutdown
}
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("engine_stopped", new
Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50002, new
Date(System.currentTimeMillis()).toString()));
}
public void setBufferService(BufferService service) {
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -70,9 +70,9 @@
try {
this.replicatableEventDistributor =
objectReplicatorInjector.getValue().replicate(LocalServerConnection.TEIID_RUNTIME_CONTEXT,
EventDistributor.class, ed, 0);
} catch (Exception e) {
- LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.getString("replication_failed", this)); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50004, this));
}
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("distributed_cache_enabled")); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50003));
}
else {
LogManager.logDetail(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("distributed_cache_not_enabled"));
//$NON-NLS-1$
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/IntegrationPlugin.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -37,5 +37,53 @@
locale = Locale.getDefault();
}
return ResourceBundle.getBundle(IntegrationPlugin.BUNDLE_NAME, locale);
- }
+ }
+
+ public static enum Event implements BundleUtil.Event {
+ TEIID50001,
+ TEIID50002,
+ TEIID50003,
+ TEIID50004,
+ TEIID50005,
+ TEIID50006,
+ TEIID50007, // failed to load module
+ TEIID50008,
+ TEIID50009,
+ TEIID50010,
+ TEIID50011,
+ TEIID50012, // socket enabled
+ TEIID50013, // Wrong socket protocol
+ TEIID50014, // socket disabled
+ TEIID50015, // admin max sessions
+ TEIID50016, // invalid vdb file
+ TEIID50017, // vdb.xml parse exception
+ TEIID50018, // failed VDB dependency processing
+ TEIID50019, // redeploying VDB
+ TEIID50020, // replication error failed to pull
+ TEIID50021, // vdb defined translator not found
+ TEIID50022, // replication error timeout during the pull
+ TEIID50023, // replication failed
+ TEIID50024, // failed metadata load
+ TEIID50025, // VDB deployed
+ TEIID50026, // VDB undeployed
+ TEIID50027, // metadata in-process of loading
+ TEIID50028, // failed metadata loading
+ TEIID50029, // dynamic metadata loaded
+ TEIID50030, // no sources to retrieve data
+ TEIID50031, // failed to load cached index files
+ TEIID50032, // duplicate VDB
+ TEIID50033, // duplicate source name in vdb
+ TEIID50034, // Source name mismatch
+ TEIID50035, // translator not found
+ TEIID50036, // failed to retrive metadata
+ TEIID50037, // odbc enabled
+ TEIID50038, // embedded enabled
+ TEIID50039, // socket_disabled
+ TEIID50040, // odbc_disabled
+ TEIID50041, // embedded disabled
+ TEIID50042, // error state
+ TEIID50043,
+ TEIID50044, // vdb save failed
+
+ }
}
Added: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLogger.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLogger.java
(rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLogger.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,112 @@
+/*
+ * 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.logging.Logger;
+import org.jboss.logging.Logger.Level;
+import org.teiid.logging.MessageLevel;
+
+public class JBossLogger implements org.teiid.logging.Logger {
+
+ @Override
+ public boolean isEnabled(String context, int level) {
+ if ( context == null ) {
+ return false;
+ }
+ Level logLevel = convert2JbossLevel(level);
+ Logger log = getLogger(context);
+ return log.isEnabled(logLevel);
+ }
+
+ @Override
+ public void log(int level, String context, Object msg) {
+ Logger logger = getLogger(context);
+ logger.log(convert2JbossLevel(level), msg);
+ }
+
+ @Override
+ public void log(int level, String context, Throwable t, Object msg) {
+ Logger logger = getLogger(context);
+ logger.log(convert2JbossLevel(level), msg, t);
+ }
+
+ /**
+ * Convert {@link MessageLevel} to {@link Level}
+ * @param level
+ * @return
+ */
+ public static Level convert2JbossLevel(int level) {
+ switch (level) {
+ case MessageLevel.CRITICAL:
+ return Level.FATAL;
+ case MessageLevel.ERROR:
+ return Level.ERROR;
+ case MessageLevel.WARNING:
+ return Level.WARN;
+ case MessageLevel.INFO:
+ return Level.INFO;
+ case MessageLevel.DETAIL:
+ return Level.DEBUG;
+ case MessageLevel.TRACE:
+ return Level.TRACE;
+ }
+ return Level.DEBUG;
+ }
+
+ /**
+ * Convert {@link Level} to {@link MessageLevel}
+ * @param level
+ * @return
+ */
+ public static int convert2MessageLevel(Level level) {
+ switch (level) {
+ case FATAL:
+ return MessageLevel.CRITICAL;
+ case ERROR:
+ return MessageLevel.ERROR;
+ case WARN:
+ return MessageLevel.WARNING;
+ case INFO:
+ return MessageLevel.INFO;
+ case DEBUG:
+ return MessageLevel.DETAIL;
+ case TRACE:
+ return MessageLevel.NONE;
+ }
+ return MessageLevel.DETAIL;
+ }
+
+ /**
+ * Get the logger for the given context.
+ * @param context
+ * @return
+ */
+ private Logger getLogger(String context) {
+ return Logger.getLogger(context);
+ }
+
+ @Override
+ public void shutdown() {
+ }
+
+}
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossLogger.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/jboss-integration/src/main/java/org/teiid/jboss/Log4jListener.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/Log4jListener.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/Log4jListener.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -1,120 +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.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.teiid.logging.MessageLevel;
-
-
-/**
- * Log4J Listener
- */
-public class Log4jListener implements org.teiid.logging.Logger {
-
- @Override
- public boolean isEnabled(String context, int level) {
- if ( context == null ) {
- return false;
- }
- Level logLevel = convert2Log4JLevel(level);
- if ( logLevel == Level.OFF) {
- return false;
- }
- Logger log = getLogger(context);
- return log.isEnabledFor(logLevel);
- }
-
- @Override
- public void log(int level, String context, Object msg) {
- Logger log4j = getLogger(context);
- log4j.log(convert2Log4JLevel(level), msg);
- }
-
- public void log(int level, String context, Throwable t, Object msg) {
- Logger log4j = getLogger(context);
- log4j.log(convert2Log4JLevel(level), msg, t);
- }
-
- /**
- * Convert {@link MessageLevel} to {@link Level}
- * @param level
- * @return
- */
- public static Level convert2Log4JLevel(int level) {
- switch (level) {
- case MessageLevel.CRITICAL:
- return Level.FATAL;
- case MessageLevel.ERROR:
- return Level.ERROR;
- case MessageLevel.WARNING:
- return Level.WARN;
- case MessageLevel.INFO:
- return Level.INFO;
- case MessageLevel.DETAIL:
- return Level.DEBUG;
- case MessageLevel.TRACE:
- return Level.TRACE;
- case MessageLevel.NONE:
- return Level.OFF;
- }
- return Level.DEBUG;
- }
-
- /**
- * Convert {@link Level} to {@link MessageLevel}
- * @param level
- * @return
- */
- public static int convert2MessageLevel(Level level) {
- switch (level.toInt()) {
- case Level.FATAL_INT:
- return MessageLevel.CRITICAL;
- case Level.ERROR_INT:
- return MessageLevel.ERROR;
- case Level.WARN_INT:
- return MessageLevel.WARNING;
- case Level.INFO_INT:
- return MessageLevel.INFO;
- case Level.DEBUG_INT:
- return MessageLevel.DETAIL;
- case Level.OFF_INT:
- return MessageLevel.NONE;
- }
- return MessageLevel.DETAIL;
- }
-
- /**
- * Get the logger for the given context.
- * @param context
- * @return
- */
- public static Logger getLogger(String context) {
- return Logger.getLogger(context);
- }
-
- @Override
- public void shutdown() {
- }
-
-}
\ No newline at end of file
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/ObjectSerializer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/ObjectSerializer.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/ObjectSerializer.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -21,14 +21,19 @@
*/
package org.teiid.jboss;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
import org.jboss.logging.Logger;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.core.util.FileUtils;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.runtime.RuntimePlugin;
public class ObjectSerializer {
@@ -114,7 +119,7 @@
}
return null;
} catch (Exception e) {
- LogManager.logWarning(LogConstants.CTX_RUNTIME, e,
RuntimePlugin.Util.getString("invalid_metadata_file",
cacheFile.getAbsolutePath())); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50043,
cacheFile.getAbsolutePath()));
}
cacheFile.delete();
return null;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -61,7 +61,7 @@
public void initialize(ExtensionContext context) {
final SubsystemRegistration registration = context.registerSubsystem(TEIID_SUBSYSTEM);
- LogManager.setLogListener(new Log4jListener());
+ LogManager.setLogListener(new JBossLogger());
registration.registerXMLElementWriter(parser);
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -427,11 +427,11 @@
if (operation.hasDefined(OperationsConstants.VDB_NAME) &&
operation.hasDefined(OperationsConstants.VDB_VERSION)) {
String vdbName = operation.get(OperationsConstants.VDB_NAME).asString();
int vdbVersion = operation.get(OperationsConstants.VDB_VERSION).asInt();
- LogManager.logInfo(LogConstants.CTX_DQP,
IntegrationPlugin.Util.getString("clearing_cache_vdb", cacheType, vdbName,
vdbVersion)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50005, cacheType, vdbName,
vdbVersion));
cache.clearForVDB(vdbName, vdbVersion);
}
else {
- LogManager.logInfo(LogConstants.CTX_DQP,
IntegrationPlugin.Util.getString("clearing_cache", cacheType)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50005, cacheType));
cache.clearAll();
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -100,7 +100,7 @@
module = ml.loadModule(ModuleIdentifier.create(moduleName));
translatorLoader = module.getClassLoader();
} catch (ModuleLoadException e) {
- throw new OperationFailedException(e, new
ModelNode().set(IntegrationPlugin.Util.getString("failed_load_module",
moduleName, translatorName))); //$NON-NLS-1$
+ throw new OperationFailedException(e, new
ModelNode().set(IntegrationPlugin.Util.getString("failed_load_module",
IntegrationPlugin.Event.TEIID50007, moduleName, translatorName))); //$NON-NLS-1$
}
}
@@ -110,12 +110,12 @@
for (ExecutionFactory ef:serviceLoader) {
VDBTranslatorMetaData metadata = TranslatorUtil.buildTranslatorMetadata(ef,
moduleName);
if (metadata == null) {
- throw new OperationFailedException( new
ModelNode().set(IntegrationPlugin.Util.getString("error_adding_translator",
translatorName))); //$NON-NLS-1$
+ throw new OperationFailedException( new
ModelNode().set(IntegrationPlugin.Util.getString("error_adding_translator",
IntegrationPlugin.Event.TEIID50008, translatorName))); //$NON-NLS-1$
}
metadata.addAttchment(ClassLoader.class, translatorLoader);
if (translatorName.equalsIgnoreCase(metadata.getName())) {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("translator.added", metadata.getName()));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50006, metadata.getName()));
TranslatorService translatorService = new TranslatorService(metadata);
ServiceBuilder<VDBTranslatorMetaData> builder =
target.addService(TeiidServiceNames.translatorServiceName(metadata.getName()),
translatorService);
@@ -129,7 +129,7 @@
}
if (!added) {
- throw new OperationFailedException(new
ModelNode().set(IntegrationPlugin.Util.getString("translator.failed-to-load",
translatorName, moduleName))); //$NON-NLS-1$
+ throw new OperationFailedException(new
ModelNode().set(IntegrationPlugin.Util.getString("translator.failed-to-load",
IntegrationPlugin.Event.TEIID50009, translatorName, moduleName))); //$NON-NLS-1$
}
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorDeployer.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorDeployer.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorDeployer.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -68,7 +68,7 @@
}
metadata.addAttchment(ClassLoader.class, translatorLoader);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("translator.added", metadata.getName()));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50006, metadata.getName()));
TranslatorService translatorService = new TranslatorService(metadata);
ServiceBuilder<VDBTranslatorMetaData> builder =
target.addService(TeiidServiceNames.translatorServiceName(metadata.getName()),
translatorService);
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorService.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorService.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorService.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -53,7 +53,7 @@
public void stop(StopContext context) {
this.repositoryInjector.getValue().removeTranslatorMetadata(this.translator.getName());
this.statusCheckerInjector.getValue().translatorRemoved(this.translator.getName());
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("translator.removed",
this.translator.getName())); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50010,
this.translator.getName()));
}
@Override
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -183,7 +183,7 @@
// add security domains
for (String domain:domainList) {
- LogManager.logInfo(LogConstants.CTX_SECURITY,
IntegrationPlugin.Util.getString("security_enabled", domain, transportName));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_SECURITY,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50011, domain, transportName));
transportBuilder.addDependency(ServiceName.JBOSS.append("security",
"security-domain", domain), SecurityDomainContext.class, new
ConcurrentMapInjector<String,SecurityDomainContext>(transport.securityDomains,
domain)); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -132,20 +132,20 @@
}
if (protocol == Protocol.teiid) {
this.socketListener = new SocketListener(address, this.socketConfig, this.csr,
getBufferServiceInjector().getValue().getBufferManager());
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("socket_enabled", address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50012, address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
else if (protocol == Protocol.pg) {
getVdbRepository().odbcEnabled();
ODBCSocketListener odbc = new ODBCSocketListener(address, this.socketConfig,
this.csr, getBufferServiceInjector().getValue().getBufferManager(),
getMaxODBCLobSizeAllowed(), this.logon);
odbc.setAuthenticationType(this.sessionService.getAuthenticationType());
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("odbc_enabled", address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50037, address.getHostName(),
String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"),
authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
else {
- throw new
StartException(IntegrationPlugin.Util.getString("wrong_protocol"));
//$NON-NLS-1$
+ throw new
StartException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50013));
}
}
else {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("embedded_enabled",
LocalServerConnection.TEIID_RUNTIME_CONTEXT)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50038,
LocalServerConnection.TEIID_RUNTIME_CONTEXT));
}
DQP dqpProxy = proxyService(DQP.class, getDQP(), LogConstants.CTX_DQP);
@@ -165,14 +165,14 @@
if (this.socketConfig != null) {
Protocol protocol = Protocol.valueOf(socketConfig.getProtocol());
if (protocol == Protocol.teiid) {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("socket_disabled", this.address.getHostName(),
String.valueOf(this.address.getPort()))); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50039, this.address.getHostName(),
String.valueOf(this.address.getPort())));
}
else if (protocol == Protocol.pg) {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("odbc_disabled", this.address.getHostName(),
String.valueOf(this.address.getPort()))); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50040, this.address.getHostName(),
String.valueOf(this.address.getPort())));
}
}
else {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("embedded_disabled",
LocalServerConnection.TEIID_RUNTIME_CONTEXT)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50041,
LocalServerConnection.TEIID_RUNTIME_CONTEXT));
}
}
Modified:
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDependencyDeployer.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -75,7 +75,7 @@
ModuleRootMarker.mark(jarArchiveRoot);
deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, jarArchiveRoot);
} catch (IOException e) {
- throw new DeploymentUnitProcessingException("failed to process " +
archive, e); //$NON-NLS-1$
+ throw new
DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50018.name()+IntegrationPlugin.Util.getString("failed_to_process_vdb_archive",
archive), e); //$NON-NLS-1$
}
}
}
@@ -92,7 +92,7 @@
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);
+ throw new DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50018.name(),
e);
}
}
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-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -81,7 +81,7 @@
// check to see if there is old vdb already deployed.
final ServiceController<?> controller =
context.getServiceRegistry().getService(TeiidServiceNames.vdbServiceName(deployment.getName(),
deployment.getVersion()));
if (controller != null) {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("redeploying_vdb", deployment)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50019, deployment));
controller.setMode(ServiceController.Mode.REMOVE);
}
@@ -89,7 +89,7 @@
if (!preview) {
List<String> errors = deployment.getValidityErrors();
if (errors != null && !errors.isEmpty()) {
- throw new
DeploymentUnitProcessingException(RuntimePlugin.Util.getString("validity_errors_in_vdb",
deployment)); //$NON-NLS-1$
+ throw new
DeploymentUnitProcessingException(RuntimePlugin.Util.getString("validity_errors_in_vdb",
RuntimePlugin.Event.TEIID40004, deployment)); //$NON-NLS-1$
}
}
@@ -100,7 +100,7 @@
String type = data.getType();
Translator parent = this.translatorRepository.getTranslatorMetaData(type);
if ( parent == null) {
- throw new
DeploymentUnitProcessingException(RuntimePlugin.Util.getString("translator_type_not_found",
deploymentName)); //$NON-NLS-1$
+ throw new
DeploymentUnitProcessingException(RuntimePlugin.Util.getString("translator_type_not_found",
IntegrationPlugin.Event.TEIID50021, deploymentName)); //$NON-NLS-1$
}
}
@@ -173,7 +173,7 @@
vdbService.setInitialMode(Mode.PASSIVE).install();
if (!unAvailableDS.isEmpty()) {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.getString("vdb-inactive", deployment.getName(),
deployment.getVersion(), unAvailableDS)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50021, deployment.getName(),
deployment.getVersion(), unAvailableDS));
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java 2012-01-10
17:28:44 UTC (rev 3784)
+++
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBParserDeployer.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -114,9 +114,9 @@
LogManager.logDetail(LogConstants.CTX_RUNTIME,"VDB "+file.getName()+"
has been parsed."); //$NON-NLS-1$ //$NON-NLS-2$
return vdb;
} catch (XMLStreamException e) {
- throw new DeploymentUnitProcessingException(e);
+ throw new DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50017.name(),
e);
} catch (IOException e) {
- throw new DeploymentUnitProcessingException(e);
+ throw new DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50017.name(),
e);
}
}
@@ -130,7 +130,7 @@
VirtualFile file =
deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
if (vdb == null) {
- LogManager.logError(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("invlaid_vdb_file",file.getName())); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.gs(IntegrationPlugin.Event.TEIID50016,file.getName()));
return null;
}
@@ -158,9 +158,9 @@
}
}
} catch(IOException e) {
- throw new DeploymentUnitProcessingException(e);
+ throw new DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50017.name(),
e);
} catch (XMLStreamException e) {
- throw new DeploymentUnitProcessingException(e);
+ throw new DeploymentUnitProcessingException(IntegrationPlugin.Event.TEIID50017.name(),
e);
}
LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB", file.getName(),
"has been parsed."); //$NON-NLS-1$ //$NON-NLS-2$
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-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -142,7 +142,7 @@
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$
+ LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50023, gts));
}
}
vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
@@ -174,7 +174,7 @@
try {
store.addStore(indexFactory.getMetadataStore(getVDBRepository().getSystemStore().getDatatypes()));
} catch (IOException e) {
- throw new StartException(e);
+ throw new StartException(IntegrationPlugin.Event.TEIID50031.name(), e);
}
}
else {
@@ -188,7 +188,7 @@
}
if (store == null) {
- LogManager.logError(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("failed_matadata_load", this.vdb.getName(),
vdb.getVersion())); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50024, this.vdb.getName(),
vdb.getVersion()));
}
LinkedHashMap<String, Resource> visibilityMap = null;
@@ -201,7 +201,7 @@
// add transformation metadata to the repository.
getVDBRepository().addVDB(this.vdb, store, visibilityMap, udf, cmr);
} catch (VirtualDatabaseException e) {
- throw new StartException(e);
+ throw new StartException(IntegrationPlugin.Event.TEIID50032.name(), e);
}
boolean valid = true;
@@ -212,7 +212,7 @@
LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB ", vdb.getName(),
" metadata has been cached to data folder"); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch (IOException e1) {
- LogManager.logWarning(LogConstants.CTX_RUNTIME, e1,
RuntimePlugin.Util.getString("vdb_save_failed",
vdb.getName()+"."+vdb.getVersion())); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logWarning(LogConstants.CTX_RUNTIME, e1,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50044, vdb.getName(),
vdb.getVersion()));
}
}
if (!preview) {
@@ -235,7 +235,7 @@
this.vdb.removeAttachment(MetadataStoreGroup.class);
this.vdb.removeAttachment(IndexMetadataFactory.class);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("vdb_deployed",vdb,
valid?"active":"inactive")); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50025, vdb,
valid?"active":"inactive")); //$NON-NLS-1$ //$NON-NLS-2$
}
@Override
@@ -256,7 +256,7 @@
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$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50026, this.vdb));
}
@Override
@@ -270,7 +270,7 @@
for (Model model:deployment.getModels()) {
List<String> sourceNames = model.getSourceNames();
if (sourceNames.size() != new HashSet<String>(sourceNames).size()) {
- throw new
StartException(IntegrationPlugin.Util.getString("duplicate_source_name",
model.getName(), deployment.getName(), deployment.getVersion())); //$NON-NLS-1$
+ throw new
StartException(IntegrationPlugin.Util.getString("duplicate_source_name",
model.getName(), deployment.getName(), deployment.getVersion(),
IntegrationPlugin.Event.TEIID50033)); //$NON-NLS-1$
}
for (String source:sourceNames) {
ConnectorManager cm = cmr.getConnectorManager(source);
@@ -279,7 +279,7 @@
if (cm != null) {
if (!cm.getTranslatorName().equals(name)
|| !cm.getConnectionName().equals(connection)) {
- throw new
StartException(IntegrationPlugin.Util.getString("source_name_mismatch", source,
deployment.getName(), deployment.getVersion())); //$NON-NLS-1$
+ throw new
StartException(IntegrationPlugin.Util.getString("source_name_mismatch", source,
deployment.getName(), deployment.getVersion(),IntegrationPlugin.Event.TEIID50034));
//$NON-NLS-1$
}
continue;
}
@@ -291,9 +291,9 @@
cmr.addConnectorManager(source, cm);
} catch (TranslatorNotFoundException e) {
if (e.getCause() != null) {
- throw new StartException(e.getCause());
+ throw new StartException(IntegrationPlugin.Event.TEIID50035.name(), e.getCause());
}
- throw new StartException(e.getMessage());
+ throw new StartException(IntegrationPlugin.Event.TEIID50035.name()+"
"+e.getMessage()); //$NON-NLS-1$
}
}
}
@@ -453,19 +453,19 @@
synchronized (vdb) {
if (loaded == null || !loaded) {
vdb.setStatus(VDB.Status.INACTIVE);
- String failed_msg =
RuntimePlugin.Util.getString(loaded==null?"failed_to_retrive_metadata":"nosources_to_retrive_metadata",
vdb.getName(), vdb.getVersion(), model.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ String failed_msg =
IntegrationPlugin.Util.gs(loaded==null?IntegrationPlugin.Event.TEIID50036:IntegrationPlugin.Event.TEIID50030,
vdb.getName(), vdb.getVersion(), model.getName());
model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(),
failed_msg);
if (exceptionMessage != null) {
model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(),
exceptionMessage);
}
LogManager.logWarning(LogConstants.CTX_RUNTIME, failed_msg);
} else {
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("metadata_loaded",vdb.getName(), vdb.getVersion(),
model.getName())); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50029,vdb.getName(),
vdb.getVersion(), model.getName()));
model.clearErrors();
if (vdb.isValid()) {
getVDBRepository().finishDeployment(vdb.getName(), vdb.getVersion());
vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion()));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(),
vdb.getVersion()));
}
}
}
Copied:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
(from rev 3777,
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java)
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/AddressWrapper.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,86 @@
+/*
+ * 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.replication.jboss;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.jgroups.Address;
+import org.teiid.core.util.ReflectionHelper;
+
+/**
+ * Allows JGroups {@link Address} objects to be serializable
+ */
+public final class AddressWrapper implements Externalizable {
+
+ Address address;
+
+ public AddressWrapper() {
+
+ }
+
+ public AddressWrapper(Address address) {
+ this.address = address;
+ }
+
+ @Override
+ public int hashCode() {
+ return address.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof AddressWrapper)) {
+ return false;
+ }
+ return address.equals(((AddressWrapper)obj).address);
+ }
+
+ @Override
+ public void readExternal(ObjectInput in) throws IOException,
+ ClassNotFoundException {
+ String className = in.readUTF();
+ try {
+ this.address = (Address) ReflectionHelper.create(className, null,
Thread.currentThread().getContextClassLoader());
+ this.address.readFrom(in);
+ } catch (Exception e) {
+ throw new IOException(e);
+ }
+ }
+
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeUTF(address.getClass().getName());
+ try {
+ address.writeTo(out);
+ } catch (Exception e) {
+ throw new IOException(e);
+ }
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/AddressWrapper.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
/branches/7.6.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java:3673-3711,3754-3769
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/AddressWrapper.java:3507-3666
Copied:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
(from rev 3777,
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java)
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,114 @@
+/*
+ * 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.replication.jboss;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class JGroupsInputStream extends InputStream {
+
+ private long timeout = 15000;
+ private volatile byte[] buf;
+ private volatile int index=0;
+ private ReentrantLock lock = new ReentrantLock();
+ private Condition write = lock.newCondition();
+ private Condition doneReading = lock.newCondition();
+
+ public JGroupsInputStream(long timeout) {
+ this.timeout = timeout;
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (index < 0) {
+ return -1;
+ }
+ if (buf == null) {
+ lock.lock();
+ try {
+ write.await(timeout, TimeUnit.MILLISECONDS);
+ if (index < 0) {
+ return -1;
+ }
+ if (buf == null) {
+ throw new IOException(new TimeoutException());
+ }
+ } catch(InterruptedException e) {
+ throw new IOException(e);
+ } finally {
+ lock.unlock();
+ }
+ }
+ if (index == buf.length) {
+ lock.lock();
+ try {
+ buf = null;
+ index = 0;
+ doneReading.signal();
+ } finally {
+ lock.unlock();
+ }
+ return read();
+ }
+ return buf[index++] & 0xff;
+ }
+
+ @Override
+ public void close() {
+ lock.lock();
+ try {
+ buf = null;
+ index = -1;
+ doneReading.signal();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ public void receive(byte[] bytes) throws InterruptedException {
+ lock.lock();
+ try {
+ if (index == -1) {
+ return;
+ }
+ if (buf != null) {
+ doneReading.await();
+ }
+ if (index == -1) {
+ return;
+ }
+ buf = bytes;
+ if (bytes == null) {
+ index = -1;
+ }
+ write.signal();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
/branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3535-3555
/branches/7.6.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3673-3711,3754-3769
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsInputStream.java:3507-3666
Copied:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
(from rev 3777,
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java)
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,610 @@
+/*
+ * 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.replication.jboss;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+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.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+
+import org.jboss.as.clustering.jgroups.ChannelFactory;
+import org.jgroups.Address;
+import org.jgroups.Channel;
+import org.jgroups.MembershipListener;
+import org.jgroups.Message;
+import org.jgroups.MessageListener;
+import org.jgroups.ReceiverAdapter;
+import org.jgroups.View;
+import org.jgroups.blocks.MethodCall;
+import org.jgroups.blocks.MethodLookup;
+import org.jgroups.blocks.RequestOptions;
+import org.jgroups.blocks.ResponseMode;
+import org.jgroups.blocks.RpcDispatcher;
+import org.jgroups.util.Buffer;
+import org.jgroups.util.Promise;
+import org.jgroups.util.Rsp;
+import org.jgroups.util.RspList;
+import org.teiid.Replicated;
+import org.teiid.Replicated.ReplicationMode;
+import org.teiid.core.TeiidRuntimeException;
+import org.teiid.core.util.ObjectInputStreamWithClassloader;
+import org.teiid.jboss.IntegrationPlugin;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.query.ObjectReplicator;
+import org.teiid.query.ReplicatedObject;
+
+@SuppressWarnings("unchecked")
+public class JGroupsObjectReplicator implements ObjectReplicator, Serializable {
+
+ private static final int IO_TIMEOUT = 15000;
+
+ private final class ReplicatorRpcDispatcher<S> extends RpcDispatcher {
+ private final S object;
+ private boolean initialized;
+ private final HashMap<Method, Short> methodMap;
+ private final ArrayList<Method> methodList;
+ Map<List<?>, JGroupsInputStream> inputStreams = new
ConcurrentHashMap<List<?>, JGroupsInputStream>();
+
+ private ReplicatorRpcDispatcher(Channel channel, MessageListener l,
+ MembershipListener l2, Object serverObj, S object,
+ HashMap<Method, Short> methodMap, ArrayList<Method> methodList) {
+ super(channel, l, l2, serverObj);
+ this.object = object;
+ this.methodMap = methodMap;
+ this.methodList = methodList;
+ setMarshaller(new ContextAwareMarshaller(getClass().getClassLoader()));
+ }
+
+ @Override
+ public Object handle(Message req) {
+ Object body=null;
+
+ if(req == null || req.getLength() == 0) {
+ if(log.isErrorEnabled()) log.error("message or message buffer is
null"); //$NON-NLS-1$
+ return null;
+ }
+
+ try {
+ body=req_marshaller != null?
+ req_marshaller.objectFromBuffer(req.getBuffer(), req.getOffset(),
req.getLength())
+ : req.getObject();
+ }
+ catch(Throwable e) {
+ if(log.isErrorEnabled()) log.error("exception marshalling object",
e); //$NON-NLS-1$
+ return e;
+ }
+
+ if(!(body instanceof MethodCall)) {
+ if(log.isErrorEnabled()) log.error("message does not contain a MethodCall
object"); //$NON-NLS-1$
+
+ // create an exception to represent this and return it
+ return new IllegalArgumentException("message does not contain a
MethodCall object") ; //$NON-NLS-1$
+ }
+
+ final MethodCall method_call=(MethodCall)body;
+
+ try {
+ if(log.isTraceEnabled())
+ log.trace("[sender=" + req.getSrc() + "], method_call:
" + method_call); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (method_call.getId() >= methodList.size() - 5 &&
req.getSrc().equals(local_addr)) {
+ return null;
+ }
+
+ if (method_call.getId() >= methodList.size() - 3) {
+ Serializable address = new AddressWrapper(req.getSrc());
+ Serializable stateId = (Serializable)method_call.getArgs()[0];
+ List<?> key = Arrays.asList(stateId, address);
+ JGroupsInputStream is = inputStreams.get(key);
+ if (method_call.getId() == methodList.size() - 3) {
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "create
state", stateId); //$NON-NLS-1$
+ if (is != null) {
+ is.receive(null);
+ }
+ is = new JGroupsInputStream(IO_TIMEOUT);
+ this.inputStreams.put(key, is);
+ executor.execute(new StreamingRunner(object, stateId, is, null));
+ } else if (method_call.getId() == methodList.size() - 2) {
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "building
state", stateId); //$NON-NLS-1$
+ if (is != null) {
+ is.receive((byte[])method_call.getArgs()[1]);
+ }
+ } else if (method_call.getId() == methodList.size() - 1) {
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "finished
state", stateId); //$NON-NLS-1$
+ if (is != null) {
+ is.receive(null);
+ }
+ this.inputStreams.remove(key);
+ }
+ return null;
+ } else if (method_call.getId() == methodList.size() - 5) {
+ //hasState
+ ReplicatedObject ro = (ReplicatedObject)object;
+ Serializable stateId = (Serializable)method_call.getArgs()[0];
+
+ if (stateId == null) {
+ synchronized (this) {
+ if (initialized) {
+ return Boolean.TRUE;
+ }
+ return null;
+ }
+ }
+
+ if (ro.hasState(stateId)) {
+ return Boolean.TRUE;
+ }
+ return null;
+ } else if (method_call.getId() == methodList.size() - 4) {
+ //sendState
+ ReplicatedObject ro = (ReplicatedObject)object;
+ String stateId = (String)method_call.getArgs()[0];
+ AddressWrapper dest = (AddressWrapper)method_call.getArgs()[1];
+
+ JGroupsOutputStream oStream = new JGroupsOutputStream(this,
Arrays.asList(dest.address), stateId, (short)(methodMap.size() - 3), false);
+ try {
+ if (stateId == null) {
+ ro.getState(oStream);
+ } else {
+ ro.getState(stateId, oStream);
+ }
+ } finally {
+ oStream.close();
+ }
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state",
stateId); //$NON-NLS-1$
+ return null;
+ }
+
+ Method m=method_lookup.findMethod(method_call.getId());
+ if(m == null)
+ throw new Exception("no method found for " +
method_call.getId()); //$NON-NLS-1$
+ method_call.setMethod(m);
+
+ return method_call.invoke(server_obj);
+ }
+ catch(Throwable x) {
+ return x;
+ }
+ }
+ }
+
+ private static final long serialVersionUID = -6851804958313095166L;
+ private static final String HAS_STATE = "hasState"; //$NON-NLS-1$
+ private static final String SEND_STATE = "sendState"; //$NON-NLS-1$
+ private static final String CREATE_STATE = "createState"; //$NON-NLS-1$
+ private static final String BUILD_STATE = "buildState"; //$NON-NLS-1$
+ private static final String FINISH_STATE = "finishState"; //$NON-NLS-1$
+
+ private final static class StreamingRunner implements Runnable {
+ private final Object object;
+ private final Serializable stateId;
+ private final JGroupsInputStream is;
+ private Promise<Boolean> promise;
+
+ private StreamingRunner(Object object, Serializable stateId, JGroupsInputStream is,
Promise<Boolean> promise) {
+ this.object = object;
+ this.stateId = stateId;
+ this.is = is;
+ this.promise = promise;
+ }
+
+ @Override
+ public void run() {
+ try {
+ if (stateId == null) {
+ ((ReplicatedObject<?>)object).setState(is);
+ } else {
+ ((ReplicatedObject)object).setState(stateId, is);
+ }
+ if (promise != null) {
+ promise.setResult(Boolean.TRUE);
+ }
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, "state set", stateId);
//$NON-NLS-1$
+ } catch (Exception e) {
+ if (promise != null) {
+ promise.setResult(Boolean.FALSE);
+ }
+ LogManager.logError(LogConstants.CTX_RUNTIME, e,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50042,stateId));
+ } finally {
+ is.close();
+ }
+ }
+ }
+
+ private final class ReplicatedInvocationHandler<S> extends ReceiverAdapter
implements
+ InvocationHandler, Serializable {
+
+ private static final int PULL_RETRIES = 3;
+ private static final long serialVersionUID = -2943462899945966103L;
+ private final S object;
+ private transient ReplicatorRpcDispatcher<S> disp;
+ private final HashMap<Method, Short> methodMap;
+ protected List<Address> remoteMembers = Collections.synchronizedList(new
ArrayList<Address>());
+ private Map<Serializable, Promise<Boolean>> loadingStates = new
HashMap<Serializable, Promise<Boolean>>();
+
+ private ReplicatedInvocationHandler(S object,HashMap<Method, Short> methodMap) {
+ this.object = object;
+ this.methodMap = methodMap;
+ }
+
+ List<Address> getRemoteMembersCopy() {
+ synchronized (remoteMembers) {
+ return new ArrayList<Address>(remoteMembers);
+ }
+ }
+
+ public void setDisp(ReplicatorRpcDispatcher<S> disp) {
+ this.disp = disp;
+ }
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
+ Short methodNum = methodMap.get(method);
+ if (methodNum == null || remoteMembers.isEmpty()) {
+ if (methodNum != null) {
+ Replicated annotation = method.getAnnotation(Replicated.class);
+ if (annotation != null && annotation.remoteOnly()) {
+ return null;
+ }
+ }
+ try {
+ return method.invoke(object, args);
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ }
+ }
+ try {
+ Replicated annotation = method.getAnnotation(Replicated.class);
+ if (annotation.replicateState() != ReplicationMode.NONE) {
+ return handleReplicateState(method, args, annotation);
+ }
+ MethodCall call=new MethodCall(methodNum, args);
+ List<Address> dests = null;
+ if (annotation.remoteOnly()) {
+ dests = getRemoteMembersCopy();
+ if (dests.isEmpty()) {
+ return null;
+ }
+ }
+ RspList<Object> responses = disp.callRemoteMethods(dests, call, new
RequestOptions().setMode(annotation.asynch()?ResponseMode.GET_NONE:ResponseMode.GET_ALL).setTimeout(annotation.timeout()).setAnycasting(dests
!= null));
+ if (annotation.asynch()) {
+ return null;
+ }
+ List<Object> results = responses.getResults();
+ if (method.getReturnType() == boolean.class) {
+ for (Object o : results) {
+ if (!Boolean.TRUE.equals(o)) {
+ return false;
+ }
+ }
+ return true;
+ } else if (method.getReturnType() == Collection.class) {
+ ArrayList<Object> result = new ArrayList<Object>();
+ for (Object o : results) {
+ result.addAll((Collection)o);
+ }
+ return results;
+ }
+ return null;
+ } catch(Exception e) {
+ throw new RuntimeException(method + " " + args + " failed",
e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ protected Address whereIsState(Serializable stateId, long timeout) throws Exception {
+ if (remoteMembers.isEmpty()) {
+ return null;
+ }
+ RspList<Boolean> resp = this.disp.callRemoteMethods(getRemoteMembersCopy(), new
MethodCall((short)(methodMap.size() - 5), new Object[]{stateId}), new
RequestOptions(ResponseMode.GET_ALL, timeout));
+ Collection<Rsp<Boolean>> values = resp.values();
+ Rsp<Boolean> rsp = null;
+ for (Rsp<Boolean> response : values) {
+ if (Boolean.TRUE.equals(response.getValue())) {
+ rsp = response;
+ break;
+ }
+ }
+ if (rsp == null) {
+ return null;
+ }
+ return rsp.getSender();
+ }
+
+ private Object handleReplicateState(Method method, Object[] args,
+ Replicated annotation) throws IllegalAccessException,
+ Throwable, IOException, IllegalStateException, Exception {
+ Object result = null;
+ try {
+ result = method.invoke(object, args);
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ }
+ ReplicatedObject ro = (ReplicatedObject)object;
+ Serializable stateId = (Serializable)args[0];
+ if (annotation.replicateState() == ReplicationMode.PUSH) {
+ if (!remoteMembers.isEmpty()) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "replicating
state", stateId); //$NON-NLS-1$
+ JGroupsOutputStream oStream = new JGroupsOutputStream(disp, null, stateId,
(short)(methodMap.size() - 3), true);
+ try {
+ ro.getState(stateId, oStream);
+ } finally {
+ oStream.close();
+ }
+ LogManager.logTrace(LogConstants.CTX_RUNTIME, object, "sent state",
stateId); //$NON-NLS-1$
+ }
+ return result;
+ }
+ if (result != null) {
+ return result;
+ }
+ long timeout = annotation.timeout();
+ return pullState(method, args, stateId, timeout);
+ }
+
+ /**
+ * Pull the remote state. The method and args are optional
+ * to determine if the state has been made available.
+ */
+ Object pullState(Method method, Object[] args, Serializable stateId,
+ long timeout) throws Throwable {
+ Object result = null;
+ for (int i = 0; i < PULL_RETRIES; i++) {
+ Promise<Boolean> p = null;
+ boolean wait = true;
+ synchronized (loadingStates) {
+ p = loadingStates.get(stateId);
+ if (p == null) {
+ wait = false;
+ if (method != null) {
+ try {
+ result = method.invoke(object, args);
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ }
+ if (result != null) {
+ return result;
+ }
+ }
+ p = new Promise<Boolean>();
+ loadingStates.put(stateId, p);
+ }
+ }
+ if (wait) {
+ p.getResult(timeout);
+ continue;
+ }
+ try {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "pulling state",
stateId); //$NON-NLS-1$
+ Address addr = whereIsState(stateId, timeout);
+ if (addr == null) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "timeout exceeded or
first member"); //$NON-NLS-1$
+ break;
+ }
+ JGroupsInputStream is = new JGroupsInputStream(IO_TIMEOUT);
+ StreamingRunner runner = new StreamingRunner(object, stateId, is, p);
+ List<?> key = Arrays.asList(stateId, new AddressWrapper(addr));
+ disp.inputStreams.put(key, is);
+ executor.execute(runner);
+
+ this.disp.callRemoteMethod(addr, new MethodCall((short)(methodMap.size() - 4),
stateId, new AddressWrapper(this.disp.getChannel().getAddress())), new
RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(true));
+
+ Boolean fetched = p.getResult(timeout);
+
+ if (fetched != null) {
+ if (fetched) {
+ LogManager.logDetail(LogConstants.CTX_RUNTIME, object, "pulled state",
stateId); //$NON-NLS-1$
+ if (method !=null) {
+ try {
+ result = method.invoke(object, args);
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ }
+ if (result != null) {
+ return result;
+ }
+ }
+ break;
+ }
+ LogManager.logWarning(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50020, object, stateId));
+ } else {
+ LogManager.logWarning(LogConstants.CTX_RUNTIME,
IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50022, object, stateId));
+ }
+ } finally {
+ synchronized (loadingStates) {
+ loadingStates.remove(stateId);
+ }
+ }
+ }
+ return null; //could not fetch the remote state
+ }
+
+ @Override
+ public void viewAccepted(View newView) {
+ if (newView.getMembers() != null) {
+ synchronized (remoteMembers) {
+ remoteMembers.removeAll(newView.getMembers());
+ if (object instanceof ReplicatedObject<?> && !remoteMembers.isEmpty())
{
+ HashSet<Serializable> dropped = new HashSet<Serializable>();
+ for (Address address : remoteMembers) {
+ dropped.add(new AddressWrapper(address));
+ }
+ ((ReplicatedObject<?>)object).droppedMembers(dropped);
+ }
+ remoteMembers.clear();
+ remoteMembers.addAll(newView.getMembers());
+ remoteMembers.remove(this.disp.getChannel().getAddress());
+ }
+ }
+ }
+ }
+
+ private interface Streaming {
+ void sendState(Serializable id, AddressWrapper dest);
+ void createState(Serializable id);
+ void buildState(Serializable id, byte[] bytes);
+ void finishState(Serializable id);
+ }
+
+ //TODO: this should be configurable, or use a common executor
+ private transient Executor executor = Executors.newCachedThreadPool();
+ private transient ChannelFactory channelFactory;
+
+ public JGroupsObjectReplicator(ChannelFactory channelFactory) {
+ this.channelFactory = channelFactory;
+ }
+
+ public void stop(Object object) {
+ if (!Proxy.isProxyClass(object.getClass())) {
+ return;
+ }
+ ReplicatedInvocationHandler<?> handler = (ReplicatedInvocationHandler<?>)
Proxy.getInvocationHandler(object);
+ Channel c = handler.disp.getChannel();
+ handler.disp.stop();
+ c.close();
+ }
+
+ @Override
+ public <T, S> T replicate(String mux_id,
+ Class<T> iface, final S object, long startTimeout) throws Exception {
+ Channel channel = channelFactory.createChannel(mux_id);
+ Method[] methods = iface.getMethods();
+
+ final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
+ final ArrayList<Method> methodList = new ArrayList<Method>();
+
+ for (Method method : methods) {
+ if (method.getAnnotation(Replicated.class) == null) {
+ continue;
+ }
+ methodList.add(method);
+ methodMap.put(method, (short)(methodList.size() - 1));
+ }
+
+ Method hasState = ReplicatedObject.class.getMethod(HAS_STATE, new Class<?>[]
{Serializable.class});
+ methodList.add(hasState);
+ methodMap.put(hasState, (short)(methodList.size() - 1));
+
+ Method sendState = JGroupsObjectReplicator.Streaming.class.getMethod(SEND_STATE, new
Class<?>[] {Serializable.class, AddressWrapper.class});
+ methodList.add(sendState);
+ methodMap.put(sendState, (short)(methodList.size() - 1));
+
+ //add in streaming methods
+ Method createState = JGroupsObjectReplicator.Streaming.class.getMethod(CREATE_STATE,
new Class<?>[] {Serializable.class});
+ methodList.add(createState);
+ methodMap.put(createState, (short)(methodList.size() - 1));
+ Method buildState = JGroupsObjectReplicator.Streaming.class.getMethod(BUILD_STATE, new
Class<?>[] {Serializable.class, byte[].class});
+ methodList.add(buildState);
+ methodMap.put(buildState, (short)(methodList.size() - 1));
+ Method finishState = JGroupsObjectReplicator.Streaming.class.getMethod(FINISH_STATE,
new Class<?>[] {Serializable.class});
+ methodList.add(finishState);
+ methodMap.put(finishState, (short)(methodList.size() - 1));
+
+ ReplicatedInvocationHandler<S> proxy = new
ReplicatedInvocationHandler<S>(object, methodMap);
+ /*
+ * TODO: could have an object implement streaming
+ * Override the normal handle method to support streaming
+ */
+ ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel,
proxy, proxy, object,
+ object, methodMap, methodList);
+
+ proxy.setDisp(disp);
+ disp.setMethodLookup(new MethodLookup() {
+ public Method findMethod(short id) {
+ return methodList.get(id);
+ }
+ });
+
+ T replicatedProxy = (T)
Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[]
{iface}, proxy);
+ boolean success = false;
+ try {
+ channel.connect(mux_id);
+ if (object instanceof ReplicatedObject) {
+ ((ReplicatedObject)object).setAddress(new AddressWrapper(channel.getAddress()));
+ proxy.pullState(null, null, null, startTimeout);
+ }
+ success = true;
+ return replicatedProxy;
+ } catch (Throwable e) {
+ if (e instanceof Exception) {
+ throw (Exception)e;
+ }
+ throw new TeiidRuntimeException(e);
+ } finally {
+ if (!success) {
+ channel.close();
+ } else {
+ synchronized (disp) {
+ //mark as initialized so that state can be pulled if needed
+ disp.initialized = true;
+ }
+ }
+ }
+ }
+
+ // This class is used so that the objects are loaded with the current classes class
loader
+ // rather than foreign class loader
+ static class ContextAwareMarshaller implements RpcDispatcher.Marshaller {
+ private ClassLoader classloader;
+
+ public ContextAwareMarshaller(ClassLoader classloader) {
+ this.classloader = classloader;
+ }
+
+ @Override
+ public Buffer objectToBuffer(Object obj) throws Exception {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(baos);
+ out.writeObject(obj);
+ out.close();
+ return new Buffer(baos.toByteArray());
+ }
+
+ @Override
+ public Object objectFromBuffer(byte[] buf, int offset, int length) throws Exception {
+ ObjectInputStream in = new ObjectInputStreamWithClassloader(new
ByteArrayInputStream(buf, offset, length), this.classloader);
+ Object anObj = in.readObject();
+ in.close();
+ return anObj;
+ }
+ }
+
+}
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
/branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3535-3555
/branches/7.6.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3673-3711,3754-3769
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java:3507-3666
Copied:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
(from rev 3777,
trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java)
===================================================================
---
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
(rev 0)
+++
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -0,0 +1,104 @@
+/*
+ * 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.replication.jboss;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jgroups.Address;
+import org.jgroups.blocks.MethodCall;
+import org.jgroups.blocks.RequestOptions;
+import org.jgroups.blocks.ResponseMode;
+import org.jgroups.blocks.RpcDispatcher;
+import org.teiid.core.types.Streamable;
+
+public class JGroupsOutputStream extends OutputStream {
+
+ static final int CHUNK_SIZE=Streamable.STREAMING_BATCH_SIZE_IN_BYTES;
+
+ protected final RpcDispatcher disp;
+ protected final List<Address> dests;
+ protected final Serializable stateId;
+ protected final short methodOffset;
+
+ private volatile boolean closed=false;
+ private final byte[] buffer=new byte[CHUNK_SIZE];
+ private int index=0;
+
+ public JGroupsOutputStream(RpcDispatcher disp, List<Address> dests,
Serializable stateId, short methodOffset, boolean sendCreate) throws IOException {
+ this.disp=disp;
+ this.dests=dests;
+ this.stateId=stateId;
+ this.methodOffset = methodOffset;
+ if (sendCreate) {
+ try {
+ disp.callRemoteMethods(this.dests, new MethodCall(methodOffset, new Object[]
{stateId}), new RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests != null));
+ } catch(Exception e) {
+ throw new IOException(e);
+ }
+ }
+ }
+
+ public void close() throws IOException {
+ if(closed) {
+ return;
+ }
+ flush();
+ try {
+ disp.callRemoteMethods(dests, new MethodCall((short)(methodOffset + 2), new
Object[] {stateId}), new RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests !=
null));
+ } catch(Exception e) {
+ }
+ closed=true;
+ }
+
+ public void flush() throws IOException {
+ checkClosed();
+ try {
+ if(index == 0) {
+ return;
+ }
+ disp.callRemoteMethods(dests, new MethodCall((short)(methodOffset + 1), new
Object[] {stateId, Arrays.copyOf(buffer, index)}), new
RequestOptions(ResponseMode.GET_NONE, 0).setAnycasting(dests != null));
+ index=0;
+ } catch(Exception e) {
+ throw new IOException(e);
+ }
+ }
+
+ private void checkClosed() throws IOException {
+ if(closed) {
+ throw new IOException("output stream is closed"); //$NON-NLS-1$
+ }
+ }
+
+ public void write(int b) throws IOException {
+ checkClosed();
+ if(index >= buffer.length) {
+ flush();
+ }
+ buffer[index++]=(byte)b;
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:mergeinfo
+
/branches/7.4.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3535-3555
/branches/7.6.x/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3673-3711,3754-3769
/trunk/cache-jbosscache/src/main/java/org/teiid/replication/jboss/JGroupsOutputStream.java:3507-3666
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-01-11
19:18:32 UTC (rev 3785)
@@ -20,15 +20,14 @@
# 02110-1301 USA.
#
-engine_started=Teiid Engine {0} Started = {1}
-socket_enabled=Teiid JDBC - Host = {0}, Port = {1}, SSL = {2}, security-domains = {3}
-socket_disabled=Teiid JDBC - Host = {0}, Port = {1} has been shutdown.
-odbc_not_enabled=ODBC transport is not enabled in Teiid.
-odbc_enabled=Teiid ODBC - Host = {0}, Port = {1}, SSL = {2}, security-domains = {3}
-odbc_disabled=Teiid ODBC - Host = {0}, Port = {1} has been shutdown.
-embedded_enabled=Teiid Embedded transport enabled. Bound to: {0}
-embedded_disabled=Teiid Embedded transport disabled. Local Connections will fail. UnBound
: {0}
-engine_stopped=Teiid Engine stopped {0}
+TEIID50001=Teiid Engine {0} Started = {1}
+TEIID50012=Teiid JDBC - Host = {0}, Port = {1}, SSL = {2}, security-domains = {3}
+TEIID50039=Teiid JDBC - Host = {0}, Port = {1} has been shutdown.
+TEIID50037=Teiid ODBC - Host = {0}, Port = {1}, SSL = {2}, security-domains = {3}
+TEIID50040=Teiid ODBC - Host = {0}, Port = {1} has been shutdown.
+TEIID50038=Teiid Embedded transport enabled. Bound to: {0}
+TEIID50041=Teiid Embedded transport disabled. Local Connections will fail. UnBound : {0}
+TEIID50002=Teiid Engine stopped {0}
admin_connection_closed=Teiid admin connection is already closed.
bad_vdb_extension=The extension of the file name must be either ".vdb" for
designer vdb or "xxx-vdb.xml" for dynamic VDBs
vdb_not_found=VDB with name "{0}" version "{1}" not found in
configuration
@@ -42,6 +41,8 @@
source_not_found=Source with name {0} not found in the Model {1} in VDB {2}.{3}
model_not_found=Model with name {0} not found in the VDB {1}.{2}
event_distributor_bound=org.teiid.events.EventDistributorFactory is bound to {0} for
manual control of Teiid events.
+TEIID50004=Could not replicate object {0}
+TEIID50019=Re-deploying VDB {0}
no_operation=No operation found with given name = {0}
failed_to_remove=Failed to remove the deployment
@@ -54,23 +55,36 @@
datasource_template_not_found=Template {0} for creating the data source is not found.
jndi_failed=JNDI lookup failed {0}.
distributed_cache_not_enabled= Distributed caching NOT enabled. Missing
"distributed-cache" property in the configuration or running in standalone
mode.
-distributed_cache_enabled=Distributed caching enabled.
+TEIID50003=Distributed caching enabled.
distribute_failed=Deploy of the archive failed {0}
template_not_found=Template not found for {0}
admin_executing=JOPR admin {0} is executing command {1}
error_adding_translator=Error loading the Translator {0}. Execution Factory class is not
valid class or not defined.
-failed_load_module=Failed to load module "{0}"
+failed_load_module={0} Failed to load module "{1}"
translator.add=Add Translator
translator.remove=Remove Translator
protocol_not_found=protocol is not defined for the transport configuration.
-security_enabled=Security enabled for transport "{1}" with security-domain set
to {0}
+TEIID50011=Security enabled for transport "{1}" with security-domain set to
{0}
DQPCore.unable_to_process_event=Unable to process event.
-translator.added = Teiid translator "{0}" added.
-wrong_protocol=Wrong type of protocol supplied
+TEIID50006 = Teiid translator "{0}" added.
+TEIID50013=Wrong type of protocol supplied
socket_binding_not_defined=Socket binding not specified for transport {0}; only embedded
access is granted.
vdb-undeploy-failed=error during the undeploy of vdb {0}.{1}
error_adding_translator_deployment=Error adding translator from deployment {0}
cache_not_found=Cache Type {0} not found in the configuration
+failed_to_process_vdb_archive= failed to process VDB archive {0}
+TEIID50023=replication failed {0}
+TEIID50024=Failed to load metadata for VDB {0}.{1}
+TEIID50044=Failed to save metadata for VDB {0}.{1}
+TEIID50025=VDB "{0}" deployed in {1} state.
+TEIID50026=VDB "{0}" undeployed.
+TEIID50036={0}.{1} is now "incomplete", because model "{2}" can not
retrieve metadata. Please fix any errors and re-deploy relevant DataSources and/or the
VDB.
+TEIID50030={0}.{1} is now "incomplete", because model "{2}" can not
retrieve metadata. Please deploy the necessary DataSources.
+TEIID50029=VDB {0}.{1} model {2} metadata is currently being loaded.
+TEIID50042=error setting state {0}
+duplicate_source_name={3} Source names are not unique for model {0} in {1}.{2}
+source_name_mismatch={3} There are different sources with the name {0} in {1}.{2}
+TEIID50043=Invalid metadata file found at {0}; delete this file and restart server.
# subsystem description
teiid.add = Add the Teiid Subsystem
@@ -178,16 +192,18 @@
transport.describe = transport description
engine_service_not_found= Query Engine Service with name {0} is not found
-translator.removed = Translator "{0}" removed
+TEIID50010 = Translator "{0}" removed
translator.failed-to-load = Translator "{0}" not found in the module
"{1}"
cache-container-name-required=container-name required for the resultset cache
configuration
enable.describe=enabled
clearing_cache=Clearing cache {0} for all the deployed vdbs.
-clearing_cache_vdb=Clearing cache {0} for vdb {1}.{2}
-vdb-inactive=VDB {0}.{1} deployed in inactive state due to unavailability of data sources
{2}
+TEIID50005=Clearing cache {0} for vdb {1}.{2}
+TEIID50021=VDB {0}.{1} deployed in inactive state due to unavailability of data sources
{2}
+TEIID50016=Invalid VDB file deployment failed {0}
+TEIID50020= {0} Failed to Pull {1}
+TEIID50022={0} timeout pulling {1}
-
remove.reply.describe=remove service
remove.describe=remove service
@@ -353,5 +369,3 @@
mark-datasource-available.ds-name.describe=Data Source name
mark-datasource-available.reply=void
-duplicate_source_name=Source names are not unique for model {0} in {1}.{2}
-source_name_mismatch=There are different sources with the name {0} in {1}.{2}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -57,7 +57,7 @@
try {
gts.updateMatViewRow((RelationalPlanner.MAT_PREFIX + schema + '.' +
viewName).toUpperCase(), tuple, delete);
} catch (TeiidComponentException e) {
- LogManager.logError(LogConstants.CTX_RUNTIME, e,
RuntimePlugin.Util.getString("replication_failed",
"updateMatViewRow")); //$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logError(LogConstants.CTX_RUNTIME, e,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40013, "updateMatViewRow"));
//$NON-NLS-1$
}
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/TranslatorUtil.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/TranslatorUtil.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/deployers/TranslatorUtil.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -125,7 +125,7 @@
}
caseInsensitivProps.remove(Translator.EXECUTION_FACTORY_CLASS);
if (!caseInsensitivProps.isEmpty()) {
- LogManager.logWarning(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("undefined_translator_props",
caseInsensitivProps.keySet(), data.getName())); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40001, caseInsensitivProps.keySet(),
data.getName()));
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2012-01-10 17:28:44
UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2012-01-11 19:18:32
UTC (rev 3785)
@@ -235,7 +235,7 @@
PgCatalogMetadataStore pg = new PgCatalogMetadataStore(CoreConstants.ODBC_MODEL,
getBuiltinDatatypes(), new Properties());
return pg.getMetadataStore();
} catch (TranslatorException e) {
- LogManager.logError(LogConstants.CTX_DQP,
RuntimePlugin.Util.getString("failed_to_load_odbc_metadata")); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_DQP,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40002));
}
return null;
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -178,7 +178,7 @@
}
} else if (valid) {
vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion()));
//$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40003,vdb.getName(), vdb.getVersion()));
}
}
}
@@ -198,14 +198,14 @@
vdb.setStatus(VDB.Status.INACTIVE);
String msg = null;
if (translator) {
- msg = RuntimePlugin.Util.getString("translator_not_found",
vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName));
//$NON-NLS-1$
+ msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40005, vdb.getName(),
vdb.getVersion(), model.getSourceTranslatorName(sourceName));
}
else {
- msg = RuntimePlugin.Util.getString("datasource_not_found",
vdb.getName(), vdb.getVersion(), resourceName); //$NON-NLS-1$
+ msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40012, vdb.getName(),
vdb.getVersion(), resourceName);
}
model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.getString("vdb_inactivated",vdb.getName(),
vdb.getVersion())); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_RUNTIME,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40006,vdb.getName(), vdb.getVersion()));
}
}
}
Modified: trunk/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java 2012-01-10 17:28:44
UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java 2012-01-11 19:18:32
UTC (rev 3785)
@@ -31,4 +31,26 @@
private static final String BUNDLE_NAME = PLUGIN_ID + ".i18n";
//$NON-NLS-1$
public static final BundleUtil Util = new
BundleUtil(PLUGIN_ID,BUNDLE_NAME,ResourceBundle.getBundle(BUNDLE_NAME));
+ public static enum Event implements BundleUtil.Event{
+ TEIID40001, // undefined translator properties
+ TEIID40002, // failed to load ODBC metadata
+ TEIID40003, // VDB Active
+ TEIID40004, // VDB validity errors
+ TEIID40005, // datasource or translator not found
+ TEIID40006, // VDB inactive
+ TEIID40007, // keep alive failed
+ TEIID40008, // expired session
+ TEIID40009, // terminate session
+ TEIID40010, // odbc error
+ TEIID40011, // processing error
+ TEIID40012, // data source not found
+ TEIID40013, // replication failed
+ TEIID40014, // krb5 failed
+ TEIID40015, // pg error
+ TEIID40016, // pg ssl error
+ TEIID40017, // unexpected exp for session
+ TEIID40018,
+ TEIID40019,
+ TEIID40020
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -104,10 +104,10 @@
for (SessionMetadata info : sessionCache.values()) {
try {
if (!info.isEmbedded() && currentTime - info.getLastPingTime() >
ServerConnection.PING_INTERVAL * 5) {
- LogManager.logInfo(LogConstants.CTX_SECURITY, RuntimePlugin.Util.getString(
"SessionServiceImpl.keepaliveFailed", info.getSessionId())); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_SECURITY,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40007, info.getSessionId()));
closeSession(info.getSessionId());
} else if (sessionExpirationTimeLimit > 0 && currentTime -
info.getCreatedTime() > sessionExpirationTimeLimit) {
- LogManager.logInfo(LogConstants.CTX_SECURITY, RuntimePlugin.Util.getString(
"SessionServiceImpl.expireSession", info.getSessionId())); //$NON-NLS-1$
+
LogManager.logInfo(LogConstants.CTX_SECURITY,RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40008,
info.getSessionId()));
closeSession(info.getSessionId());
}
} catch (Exception e) {
@@ -130,7 +130,7 @@
try {
dqp.terminateSession(info.getSessionId());
} catch (Exception e) {
- LogManager.logWarning(LogConstants.CTX_SECURITY,e,"Exception
terminitating session"); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_SECURITY,e,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40018));
}
}
}
@@ -307,12 +307,12 @@
@Override
public boolean terminateSession(String terminatedSessionID, String adminSessionID) {
Object[] params = {adminSessionID, terminatedSessionID};
- LogManager.logInfo(LogConstants.CTX_SECURITY, RuntimePlugin.Util.getString(
"SessionServiceImpl.terminateSession", params)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_SECURITY,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40009, params));
try {
closeSession(terminatedSessionID);
return true;
} catch (InvalidSessionException e) {
- LogManager.logWarning(LogConstants.CTX_SECURITY,e,RuntimePlugin.Util.getString("SessionServiceImpl.invalid_session",
new Object[] {e.getMessage()})); //$NON-NLS-1$
+ LogManager.logWarning(LogConstants.CTX_SECURITY,e,RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40019,
new Object[] {e.getMessage()}));
return false;
}
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2012-01-10 17:28:44 UTC
(rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2012-01-11 19:18:32 UTC
(rev 3785)
@@ -134,7 +134,7 @@
this.serviceTicket = context.acceptSecContext(this.serviceTicket, 0,
this.serviceTicket.length);
return new GSSResult(context, serviceTicket);
} catch (GSSException e) {
- LogManager.logError(LogConstants.CTX_SECURITY, e, "Kerberos context login
failed"); //$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_SECURITY, e,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40014));
}
return null;
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -578,9 +578,9 @@
try {
engine = config.getServerSSLEngine();
} catch (IOException e) {
- LogManager.logError(LogConstants.CTX_ODBC, e,
RuntimePlugin.Util.getString("PgBackendProtocol.ssl_error"));
+ LogManager.logError(LogConstants.CTX_ODBC, e,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40016));
} catch (GeneralSecurityException e) {
- LogManager.logError(LogConstants.CTX_ODBC, e,
RuntimePlugin.Util.getString("PgBackendProtocol.ssl_error"));
+ LogManager.logError(LogConstants.CTX_ODBC, e,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40016));
}
ChannelBuffer buffer = ctx.getChannel().getConfig().getBufferFactory().getBuffer(1);
if (engine == null) {
@@ -596,11 +596,11 @@
if (t instanceof SQLException) {
//we are just re-logging an exception raised by the engine
if (LogManager.isMessageToBeRecorded(LogConstants.CTX_ODBC, MessageLevel.DETAIL)) {
- LogManager.logWarning(LogConstants.CTX_ODBC, t, "Error occurred");
//$NON-NLS-1$ //$NON-NLS-2$
+ LogManager.logWarning(LogConstants.CTX_ODBC, t,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40020)); //$NON-NLS-1$ //$NON-NLS-2$
}
} else {
//should be in the odbc layer
- LogManager.logError(LogConstants.CTX_ODBC, t,
RuntimePlugin.Util.getString("PgBackendProtocol.unexpected_error"));
//$NON-NLS-1$
+ LogManager.logError(LogConstants.CTX_ODBC, t,
RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40015));
}
SQLException e = TeiidSQLException.create(t);
startMessage('E');
Modified: trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java 2012-01-10
17:28:44 UTC (rev 3784)
+++ trunk/runtime/src/main/java/org/teiid/transport/ServerWorkItem.java 2012-01-11
19:18:32 UTC (rev 3785)
@@ -148,7 +148,7 @@
} else if (e instanceof AdminProcessingException) {
logProcessingException(e, context);
} else {
- LogManager.logError(context, e,
RuntimePlugin.Util.getString("ServerWorkItem.Received_exception_processing_request",
this.socketClientInstance.getWorkContext().getSessionId())); //$NON-NLS-1$
+ LogManager.logError(context, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40017,
this.socketClientInstance.getWorkContext().getSessionId()));
}
return new ExceptionHolder(e);
@@ -161,6 +161,6 @@
}
StackTraceElement elem = cause.getStackTrace()[0];
LogManager.logDetail(context, e, "Processing exception for session",
this.socketClientInstance.getWorkContext().getSessionId()); //$NON-NLS-1$
- LogManager.logWarning(context,
RuntimePlugin.Util.getString("ServerWorkItem.processing_error", e.getMessage(),
this.socketClientInstance.getWorkContext().getSessionId(), e.getClass().getName(), elem));
//$NON-NLS-1$
+ LogManager.logWarning(context, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40011,
e.getMessage(), this.socketClientInstance.getWorkContext().getSessionId(),
e.getClass().getName(), elem));
}
}
\ No newline at end of file
Modified: trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties
===================================================================
--- trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2012-01-10 17:28:44
UTC (rev 3784)
+++ trunk/runtime/src/main/resources/org/teiid/runtime/i18n.properties 2012-01-11 19:18:32
UTC (rev 3785)
@@ -30,18 +30,18 @@
VDBService.VDB_does_not_exist._3=Invalid VDB version \"{0}\" - must be a
positive integer.
# session service
-SessionServiceImpl.invalid_session=The specified session ID "{0}" is invalid.
It cannot be found in the userbase.
+TEIID40019=The specified session ID "{0}" is invalid. It cannot be found in the
userbase.
SessionServiceImpl.reached_max_sessions = The server has reached the maximum number of
sessions of {0} as defined by the property "session-max-limit". If more
sessions are required, modify this property value in the "standalone-teiid.xml"
file.
-SessionServiceImpl.expireSession = Expiring session {0}
-SessionServiceImpl.keepaliveFailed = Keepalive failed for session {0}
+TEIID40008 = Expiring session {0}
+TEIID40007 = Keepalive failed for session {0}
SessionServiceImpl.The_username_0_and/or_password_are_incorrect=The username
"{0}" and/or password and/or payload token could not be authenticated by any
membership domain.
-SessionServiceImpl.terminateSession = Admin [{0}] is terminating this session: {1}.
+TEIID40009 = Admin [{0}] is terminating this session: {1}.
no_passthrough_identity_found = Passthrough authentication failed. No authentication
information found.
-ServerWorkItem.Received_exception_processing_request=Unexpected exception for session
{0}
-ServerWorkItem.processing_error=Processing exception ''{0}'' for session
{1}. Exception type {2} thrown from {3}. Enable more detailed logging to see the entire
stacktrace.
+TEIID40017=Unexpected exception for session {0}
+TEIID40011=Processing exception ''{0}'' for session {1}. Exception type
{2} thrown from {3}. Enable more detailed logging to see the entire stacktrace.
ServerWorkItem.Component_Not_Found=Only {0} connections are allowed on this port.
Component not found: {1}
SocketTransport.1=Bound to address {0} listening on port {1}
@@ -49,29 +49,30 @@
SocketClientInstance.invalid_sessionkey=Invalid session key used during handshake
SSLAwareChannelHandler.channel_closed=Channel closed
-invlaid_vdb_file=Invalid VDB file deployment failed {0}
-redeploying_vdb=Re-deploying VDB {0}
-validity_errors_in_vdb=VDB has validity errors; failed to deploy - {0}
-vdb_save_failed=Failed to save metadata for VDB {0}
+
+TEIID40003=VDB {0}.{1} is set to "active"
+TEIID40006=VDB {0}.{1} is set to "inactive"
+validity_errors_in_vdb={0} VDB has validity errors; failed to deploy - {1}
+
vdb_delete_failed=Failed to delete the cached metadata files due to:
-vdb_deployed=VDB "{0}" deployed in {1} state.
-vdb_undeployed=VDB "{0}" undeployed.
+
+
system_vdb_load_error=System.vdb needs to be loaded before any other VDBs.
fail_to_deploy="{0}" Can not be active because model "{1}" is not
fully configured.
-failed_to_retrive_metadata={0}.{1} is now "incomplete", because model
"{2}" can not retrieve metadata. Please fix any errors and re-deploy relevant
DataSources and/or the VDB.
-nosources_to_retrive_metadata={0}.{1} is now "incomplete", because model
"{2}" can not retrieve metadata. Please deploy the necessary DataSources.
-invalid_metadata_file=Invalid metadata file found at {0}; delete this file and restart
server.
+
+
+
udf_model_not_found=User Defined Function (UDF) model "{0}" not found in the
VDB
duplicate_vdb=VDB with given name and version already exists! {0}.{1}
system_vdb_not_found=System.vdb not found in classpath
invalid_udf_file=No "path" information found to load the FUNCTION model {0};
FUNCTION model must have path information.
-failed_matadata_load=Failed to load metadata for VDB {0}.{1}
+
vdb_not_found=VDB {0}.{1} not found deployed.
-translator_not_found=For {0}.{1} VDB, Translator "{2}" not found.
+TEIID40005=For {0}.{1} VDB, Translator "{2}" not found.
recursive_delegation=For {0}.{1} VDB, recursive delegation {2} found.
-datasource_not_found=For {0}.{1} VDB, Data Source "{2}" not found.
+TEIID40012=For {0}.{1} VDB, Data Source "{2}" not found.
datasource_replaced=For {0}.{1} VDB, Data Source "{2}" replaced with
"{3}"
-vdb_activated={0}.{1} status has been changed to active
+TEIID40003={0}.{1} status has been changed 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
@@ -79,26 +80,30 @@
translator_removed=Teiid translator "{0}" removed.
no_set_method=No {0} method found for translator property {1}
required_property_not_exists=Required property "{0}" has no value. Deployment
is incomplete.
-undefined_translator_props=The provided translator property values {0} were not used.
Please check the properties that are expected by translator {1}.
+TEIID40001=The provided translator property values {0} were not used. Please check the
properties that are expected by translator {1}.
name_not_found=Translator property "name" not defined for the deployment
"{0}"
translator_type_not_found=The parent translator defined not found in configuration
"{0}"
-failed_to_load_odbc_metadata=Failed to load the ODBC metadata repository.
+TEIID40002=Failed to load the ODBC metadata repository.
bad_binding=Binding on a statement, that has not been prepared:{0}
not_bound=No bound statement found with name {0}
no_stmt_found=No prepared statement found with name {0}
error_closing_stmt=Error closing portal statement {0}
model_metadata_loading=VDB {0}.{1} model {2} metadata is currently being loaded. Start
Time: {3}
-metadata_loaded=VDB {0}.{1} model {2} metadata is currently being loaded.
+
ambigious_name=Ambiguous VDB name specified. Only single occurrence of the "."
is allowed in the VDB name. Also, when version based vdb name is specified, then a
separate "version" connection option is not allowed:{0}.{1}
lo_not_supported=LO functions are not supported
SSLConfiguration.no_anonymous=The anonymous cipher suite TLS_DH_anon_WITH_AES_128_CBC_SHA
is not available. Please change the transport to be non-SSL or use non-anonymous SSL.
-replication_failed=Could not replicate object {0}
-PgBackendProtocol.ssl_error=Could not initialize ODBC SSL. non-SSL connections will
still be allowed.
-PgBackendProtocol.unexpected_error=Unexpected error occurred
+
+TEIID40016=Could not initialize ODBC SSL. non-SSL connections will still be allowed.
+TEIID40015=Unexpected error occurred
wrong_logon_type_jaas = Wrong logon method is being used. Server is not set up for JAAS
based authentication. Correct your client's 'AuthenticationType' property.
wrong_logon_type_krb5 = Wrong logon method is being used. Server is not set up for
Kerberos based authentication. Correct your client's 'AuthenticationType'
property.
krb5_login_failed=Kerberos context login failed
no_security_domains=No security domain configured for Kerberos authentication. Can not
authenticate.
krb5_user_not_found=GSS authentication is in use, however authenticated user not found in
the context to proceed.
auth_type=Authentication Type set to {0} for security-domains {1}
+replication_failed=replication failed to {0}
+TEIID40014=Kerberos context login failed
+TEIID40018=Exception terminitating session
+TEIID40020=Error occurred
\ No newline at end of file
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2012-01-10 17:28:44 UTC (rev 3784)
+++ trunk/test-integration/common/pom.xml 2012-01-11 19:18:32 UTC (rev 3785)
@@ -22,7 +22,7 @@
</dependency>
<dependency>
- <artifactId>teiid-cache-jbosscache</artifactId>
+ <artifactId>teiid-jboss-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
</dependency>
<dependency>