Search in sources :

Example 1 with CopyException

use of org.apache.geode.CopyException in project geode by apache.

the class BaseCommand method execute.

@Override
public void execute(Message clientMessage, ServerConnection serverConnection) {
    // Read the request and update the statistics
    long start = DistributionStats.getStatTime();
    if (EntryLogger.isEnabled() && serverConnection != null) {
        EntryLogger.setSource(serverConnection.getMembershipID(), "c2s");
    }
    boolean shouldMasquerade = shouldMasqueradeForTx(clientMessage, serverConnection);
    try {
        if (shouldMasquerade) {
            InternalCache cache = serverConnection.getCache();
            InternalDistributedMember member = (InternalDistributedMember) serverConnection.getProxyID().getDistributedMember();
            TXManagerImpl txMgr = cache.getTxManager();
            TXStateProxy tx = null;
            try {
                tx = txMgr.masqueradeAs(clientMessage, member, false);
                cmdExecute(clientMessage, serverConnection, start);
                tx.updateProxyServer(txMgr.getMemberId());
            } finally {
                txMgr.unmasquerade(tx);
            }
        } else {
            cmdExecute(clientMessage, serverConnection, start);
        }
    } catch (TransactionException | CopyException | SerializationException | CacheWriterException | CacheLoaderException | GemFireSecurityException | PartitionOfflineException | MessageTooLargeException e) {
        handleExceptionNoDisconnect(clientMessage, serverConnection, e);
    } catch (EOFException eof) {
        BaseCommand.handleEOFException(clientMessage, serverConnection, eof);
    } catch (InterruptedIOException e) {
        // Solaris only
        BaseCommand.handleInterruptedIOException(serverConnection, e);
    } catch (IOException e) {
        BaseCommand.handleIOException(clientMessage, serverConnection, e);
    } catch (DistributedSystemDisconnectedException e) {
        BaseCommand.handleShutdownException(clientMessage, serverConnection, e);
    } catch (VirtualMachineError err) {
        SystemFailure.initiateFailure(err);
        // now, so don't let this thread continue.
        throw err;
    } catch (Throwable e) {
        BaseCommand.handleThrowable(clientMessage, serverConnection, e);
    } finally {
        EntryLogger.clearSource();
    }
}
Also used : InterruptedIOException(java.io.InterruptedIOException) CopyException(org.apache.geode.CopyException) DistributedSystemDisconnectedException(org.apache.geode.distributed.DistributedSystemDisconnectedException) TXManagerImpl(org.apache.geode.internal.cache.TXManagerImpl) SerializationException(org.apache.geode.SerializationException) InternalCache(org.apache.geode.internal.cache.InternalCache) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) GemFireSecurityException(org.apache.geode.security.GemFireSecurityException) TransactionException(org.apache.geode.cache.TransactionException) InternalDistributedMember(org.apache.geode.distributed.internal.membership.InternalDistributedMember) PartitionOfflineException(org.apache.geode.cache.persistence.PartitionOfflineException) TXStateProxy(org.apache.geode.internal.cache.TXStateProxy) CacheLoaderException(org.apache.geode.cache.CacheLoaderException) EOFException(java.io.EOFException) CacheWriterException(org.apache.geode.cache.CacheWriterException)

Aggregations

EOFException (java.io.EOFException)1 IOException (java.io.IOException)1 InterruptedIOException (java.io.InterruptedIOException)1 CopyException (org.apache.geode.CopyException)1 SerializationException (org.apache.geode.SerializationException)1 CacheLoaderException (org.apache.geode.cache.CacheLoaderException)1 CacheWriterException (org.apache.geode.cache.CacheWriterException)1 TransactionException (org.apache.geode.cache.TransactionException)1 PartitionOfflineException (org.apache.geode.cache.persistence.PartitionOfflineException)1 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)1 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)1 InternalCache (org.apache.geode.internal.cache.InternalCache)1 TXManagerImpl (org.apache.geode.internal.cache.TXManagerImpl)1 TXStateProxy (org.apache.geode.internal.cache.TXStateProxy)1 GemFireSecurityException (org.apache.geode.security.GemFireSecurityException)1