Acquire the lock required for the method being invoked.

@see com.ibm.ejs.container.BeanO#preInvoke(com.ibm.ejs.container.EJSDeployedSupport, com.ibm.ejs.container.ContainerTx)
558752
@Override
    public Object preInvoke(EJSDeployedSupport s, ContainerTx tx) throws RemoteException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "preInvoke : " + this);

        // If this is container managed concurrency control, then use
        // then get the lock specified by the lock type found in the
        // EJB method info object.
        s.ivLockAcquired = false; // d571981
        if (ivContainerManagedConcurrency) {
            // Get the lock type to use for the method being invoked.
            // and AccessTimeout value to use.
            EJBMethodInfoImpl mInfo = s.methodInfo;
            LockType lockType = mInfo.ivLockType;

            // Ensure we are not trying to upgrade from a READ to a WRITE lock. We
            // must throw an exception if trying to upgrade from READ to WRITE.
            if (lockType == LockType.WRITE && ivLock.isWriteLockedByCurrentThread() == false) {
                // Requesting write lock and write lock is not currently held by the
                // calling thread. So check whether calling thread holds any read locks.
                if (ivLock.getReadHoldCount() > 0) {
                    throw new IllegalLoopbackException("A loopback method call is not allowed to upgrade from a READ to a WRITE lock.");
                }
            }

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "preInvoke attempting to acquire a " + mInfo.ivLockType.name() + " lock. " + ivLock.toString());

            // PMI startLockTime for read and write locks  F743-9002
            long lockStartTime = 0;
            int lockStatType = 0;

            try {
                long timeout = mInfo.ivAccessTimeout;

                // For a persistent timeout callback that will wait a significant amount of
                // time for the lock, perform a quick lock attempt in an effort to detect a
                // deadlock that can occur between the singleton lock and the timer database
                // if there is a concurrent thread calling getTimers().             RTC126471
                if (s.isPersistentTimeoutGlobalTx &&
                    PersistentTimerSingletonDeadlockTimeout >= 0 &&
                    (timeout == -1 || timeout > PersistentTimerSingletonDeadlockTimeout)) {
                    if (lockType == LockType.READ) {
                        if (pmiBean != null) {
                            lockStatType = EJBPMICollaborator.READ_LOCK_TIME;
                            lockStartTime = pmiBean.initialTime(lockStatType);
                        }
                        s.ivLockAcquired = ivReadLock.tryLock(PersistentTimerSingletonDeadlockTimeout, TimeUnit.MILLISECONDS);
                    } else {
                        if (pmiBean != null) {
                            lockStatType = EJBPMICollaborator.WRITE_LOCK_TIME;
                            lockStartTime = pmiBean.initialTime(lockStatType);
                        }
                        s.ivLockAcquired = ivWriteLock.tryLock(PersistentTimerSingletonDeadlockTimeout, TimeUnit.MILLISECONDS);
                    }

                    if (s.ivLockAcquired) {
                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "preInvoke acquired a " + mInfo.ivLockType.name() + " lock. " + ivLock.toString());
                    } else {
                        // If the lock was not obtained and another thread is in getTimer,
                        // then a deadlock is very likely, so abort the timeout callback
                        // which will free up the database row lock.
                        if (ivInGetTimers.get() > 0) {
                            if (pmiBean != null) {
                                pmiBean.countCancelledLocks();
                            }
                            throw new ConcurrentAccessTimeoutException("preInvoke timed out in attempt to acquire a "
                                                                       + mInfo.ivLockType.name() + " lock for method signature = " + mInfo.getMethodSignature()
                                                                       + ".  Dead lock detected with timer database.");
                        }

                        // Otherwise, subtract the time waited, and proceed normally
                        if (timeout != -1) {
                            timeout = Math.max(0, timeout - PersistentTimerSingletonDeadlockTimeout);
                        }
                    }
                }

                // If the lock is not acquired, then either this is not for a persistent
                // timeout callback, or there is not a concurrent thread in getTimers(),
                // so just attempt to obtain a lock using the configured access timeout.
                if (!s.ivLockAcquired) {
                    if (timeout == -1) // -1 means wait forever     F743-21028.5
                    {
                        if (lockType == LockType.READ) {
                            if (pmiBean != null && lockStartTime == 0) // F743-9002
                            {
                                lockStatType = EJBPMICollaborator.READ_LOCK_TIME;
                                lockStartTime = pmiBean.initialTime(lockStatType);
                            }
                            ivReadLock.lock(); // d571981
                        } else {
                            if (pmiBean != null && lockStartTime == 0)// F743-9002
                            {
                                lockStatType = EJBPMICollaborator.WRITE_LOCK_TIME;
                                lockStartTime = pmiBean.initialTime(lockStatType);
                            }
                            ivWriteLock.lock(); // d571981
                        }

                        s.ivLockAcquired = true;
                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "preInvoke acquired a " + mInfo.ivLockType.name() + " lock. " + ivLock.toString());
                    } else {
                        if (lockType == LockType.READ) {
                            if (pmiBean != null && lockStartTime == 0) // F743-9002
                            {
                                lockStatType = EJBPMICollaborator.READ_LOCK_TIME;
                                lockStartTime = pmiBean.initialTime(lockStatType);
                            }
                            s.ivLockAcquired = ivReadLock.tryLock(timeout, TimeUnit.MILLISECONDS); // d571981
                        } else {
                            if (pmiBean != null && lockStartTime == 0) // F743-9002
                            {
                                lockStatType = EJBPMICollaborator.WRITE_LOCK_TIME;
                                lockStartTime = pmiBean.initialTime(lockStatType);
                            }
                            s.ivLockAcquired = ivWriteLock.tryLock(timeout, TimeUnit.MILLISECONDS); // d571981
                        }

                        if (s.ivLockAcquired) {
                            if (isTraceOn && tc.isDebugEnabled())
                                Tr.debug(tc, "preInvoke acquired a " + mInfo.ivLockType.name() + " lock. " + ivLock.toString());
                        } else {
                            if (pmiBean != null) // F743-9002
                            {
                                pmiBean.countCancelledLocks();
                            }

                            throw new ConcurrentAccessTimeoutException("preInvoke timed out in attempt to acquire a "
                                                                       + mInfo.ivLockType.name() + " lock for method signature = " + mInfo.getMethodSignature()
                                                                       + ".  Access timeout value = " + timeout + " milli-seconds");
                        }
                    }
                }
            } catch (InterruptedException e) {
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "InterruptedException prevented lock from being acquired.");

                if (pmiBean != null) // F743-9002
                {
                    pmiBean.countCancelledLocks();
                }

                throw ExceptionUtil.EJBException("InterruptedException prevented lock from being acquired.", e);
            } finally {
                // F743-9002
                // Calculate the time to obtain the lock and adjust the pmiCookie
                // used for methodRT PMI counter to exclude the lock time.
                if (pmiBean != null) {
                    // d648142.2
                    long lockDuration = pmiBean.finalTime(lockStatType, lockStartTime);
                    if (lockDuration > 0) {
                        s.pmiCookie += lockDuration; // d724734
                    }
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "preInvoke");

        return ivEjbInstance;
    }
1139689
@Override
    public void completeInitialization()
                    throws RemoteException
    {
        enterpriseBeanClass = beanMetaData.enterpriseBeanClass;
        localEJBObjectClass = beanMetaData.localImplClass;

        // If a PreDestroy callback exists, then a weak reference cache is used
        // to keep track of instances, so PreDestroy may be called when all
        // references are dropped, or the application is uninstalled. F743-34301.1
        if (beanMetaData.ivInterceptorMetaData != null &&
            beanMetaData.ivInterceptorMetaData.ivPreDestroyInterceptors != null)
        {
            ivWeakCache = WeakManagedBeanCache.instance();
        }
    }
302475
@Override
    public <T> T onPrepareImplBean(Class<T> cls, Container container) {
        T instance = null;

        instance = getBeanFromCDI(cls, container);
//        if (instance == null) {
//            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
//                Tr.debug(tc, "t is null from CDI , get app from rs for " + cls.getName());
//            }
//
//        }
        return instance;

    }
351572
@Override
   public void prefill()
   {
      if (isShutdown())
         return;

      if (poolConfiguration.isPrefill())
      {
         ManagedConnectionPool mcp = pools.get(getPrefillCredential());

         if (mcp == null)
         {
            // Trigger the initial-pool-size prefill by creating the ManagedConnectionPool
            getManagedConnectionPool(getPrefillCredential());
         }
         else
         {
            // Standard prefill request
            mcp.prefill();
         }
      }
   }
1207444
protected BeanO doActivation(EJBThreadData threadData, ContainerTx tx, BeanId beanId,
                                 boolean takeInvocationRef)
                    throws RemoteException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "doActivation",
                     new Object[] { tx, beanId,
                                   new Boolean(takeInvocationRef) });
        }

        BeanO bean = null;
        Throwable exception = null;
        MasterKey key = new MasterKey(beanId);
        boolean activate = false;
        boolean pushedCallbackBeanO = false;

        try {

            synchronized (locks.getLock(key)) {

                if ((bean = (BeanO) cache.find(key)) == null)
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "Bean not in cache");

                    bean = beanId.getHome().createBeanO(threadData, tx, beanId); // d630940
                    pushedCallbackBeanO = true;
                    cache.insert(key, bean);
                    bean.ivCacheKey = key; // d199233
                    activate = true;
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        Tr.debug(tc, "Found bean in cache");

                    // Set the found BeanO as the 'Callback' BeanO, as this is the
                    // BeanO that is becoming the active beanO for the thread.
                    // This will allow methods called by customer code (like Timer
                    // methods) to determine the state of the BeanO that is making
                    // the call.                                              d168509
                    threadData.pushCallbackBeanO(bean); // d630940
                    pushedCallbackBeanO = true;
                }
            }

            boolean pin = false;

            if (activate) {
                bean.activate(beanId, tx); // d114677
            }

            pin = bean.enlist(tx); // d114677

            if (takeInvocationRef && pin) {
                // We need to take an additional reference
                cache.pin(key);
            } else if (!takeInvocationRef && !pin) {
                // Need to drop reference taken by find or insert
                cache.unpin(key);
            }

        } catch (RemoteException e) {

            FFDCFilter.processException(e, CLASS_NAME + ".doActivation", "123", this);
            exception = e;
            throw e;

        } catch (RuntimeException e) {

            FFDCFilter.processException(e, CLASS_NAME + ".doActivation", "129", this);
            exception = e;
            throw e;

        } finally {

            if (exception != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "doActivation: exception raised", exception);
            }

            if (exception != null && bean != null)
            {
                if (pushedCallbackBeanO)
                {
                    threadData.popCallbackBeanO();
                }

                bean.destroy();

                if (activate) {
                    // Synchronize to insure that a temp pin obtained by getBean
                    // doesn't cause the remove to fail due to too many pins. PQ53065
                    synchronized (locks.getLock(key)) {
                        cache.remove(key, true);
                        bean.ivCacheKey = null; // d199233
                    }
                }
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(tc, "doActivation", bean);
        }

        return bean;
    }
585670
private void initBeforeList() {
        final List<ProcessAdvice> beforeRequestProcessAdvices = new ArrayList<>();

        final Method invokeHolder = getInvokeHolder();
        final Class<?> processorClass = invokeHolder.getDeclaringClass();

        // 1. process class advice
        if (null != processorClass && processorClass.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = processorClass.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }
        // 2. process method advice
        if (invokeHolder.isAnnotationPresent(Before.class)) {
            final Class<? extends ProcessAdvice>[] bcs = invokeHolder.getAnnotation(Before.class).value();
            for (int i = 0; i < bcs.length; i++) {
                final Class<? extends ProcessAdvice> bc = bcs[i];
                final ProcessAdvice beforeRequestProcessAdvice = BeanManager.getInstance().getReference(bc);
                beforeRequestProcessAdvices.add(beforeRequestProcessAdvice);
            }
        }

        this.beforeRequestProcessAdvices = beforeRequestProcessAdvices;
    }
564783
public void doInvocationCollaboratorsPreInvoke(IInvocationCollaborator[] webAppInvocationCollaborators,
            com.ibm.wsspi.webcontainer.metadata.WebComponentMetaData cmd) {

    }
469279
@SuppressWarnings("unchecked")
    @Override
    public <T> T beforeServiceInvoke(T serviceObject, boolean isSingleton,
                                     Object context) {
        if (isSingleton || context == null) {
            return serviceObject;
        }

        Map<Class<?>, ManagedObject<?>> newContext = (Map<Class<?>, ManagedObject<?>>) (context);
        if (newContext.isEmpty()) {
            return null;
        }

        Object newServiceObject = null;

        newServiceObject = getInstanceFromManagedObject(serviceObject, context);

        return (T) newServiceObject;

    }
912244
@Override
    public void postInvoke(WebSecurityContext webSecurityContext) throws AuthenticationException {
        AuthStatus status = null;
        if (webSecurityContext != null) {
            JaspiAuthContext jaspiContext = (JaspiAuthContext) webSecurityContext.getJaspiAuthContext();
            if (!jaspiContext.runSecureResponse()) {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "postInvoke", "skip secureResponse.");
                return;
            }
            MessageInfo msgInfo = (MessageInfo) jaspiContext.getMessageInfo();
            ServerAuthContext authContext = (ServerAuthContext) jaspiContext.getServerAuthContext();
            Subject serviceSubject = webSecurityContext.getReceivedSubject();
            try {
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "secureResponse with Jaspi",
                             new Object[] { "authContext=" + authContext, "serviceSubject=" + serviceSubject, msgInfo });

                status = authContext.secureResponse(msgInfo, serviceSubject);
                if (tc.isDebugEnabled())
                    Tr.debug(tc, "secureResponse status: " + status);

                // TODO Which reply or exception?
                if (AuthStatus.SEND_SUCCESS != status &&

                    AuthStatus.SEND_FAILURE != status &&

                    AuthStatus.SEND_CONTINUE != status) {

                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "secureResponse  AuthStatus=" + status);
                    String msg = "Unexpected AuthStatus received during secureResponse() status=" + status
                                 + ", MessageInfo=" + msgInfo + ", ServerAuthContext=" + authContext;
                    throw new AuthenticationException(msg);
                }
            } catch (AuthException e) {
                /*
                 * The runtime must perform whatever processing it requires to complete the processing of a request that failed after
                 * (or during) service invocation, and prior to communicating the invocation result to the client runtime. The runtime
                 * may send (without calling secureResponse) an appropriate response message of its choice. If a failure message is
                 * returned, it should indicate that the failure in request processing occurred after the service invocation.
                 */
                throw new AuthenticationException("JASPI authentication failed after invoking the requested target service.", e);
            }
        }
    }
391625
@Override
    EntityManager getEMInvocationInfo(boolean requireTx, LockModeType mode)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.entry(tc, "getEMInvocationInfo : " + requireTx + " : " + ((mode == null) ? "null" : mode));
        }

        if (requireTx || (mode != null && !LockModeType.NONE.equals(mode)))
        {
            throw new UnsupportedOperationException("This entity manager cannot perform operations that require a transactional context");
        }

        if (!ivEnlisted)
        {
            UOWCoordinator uowCoord = ivAbstractJPAComponent.getUOWCurrent().getUOWCoord();
            // Enlist in either the global tran or LTC
            if (uowCoord.isGlobal())
            {
                // Register invocation object to transaction manager for clean up
                registerEmInvocation(uowCoord, this); //d638095.2
            }
            else
            {
                // Register invocation object to LTC for clean up
                LocalTransactionCoordinator ltCoord = (LocalTransactionCoordinator) uowCoord;
                ltCoord.enlistSynchronization(this);
            }
            // Mark this em as enlisted for clean up
            ivEnlisted = true;
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "getEMInvocationInfo : " + ivEm);
        return ivEm;
    }
1145264
public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
        if (thisMethod == null) {
            BeanLogger.LOG.methodHandlerProcessingReturningBeanInstance(self.getClass());
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            return beanInstance.getInstance();
        }
        BeanLogger.LOG.methodHandlerProcessingCall(thisMethod, self.getClass());
        if (thisMethod.getDeclaringClass().equals(TargetInstanceProxy.class)) {
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            if (thisMethod.getName().equals("weld_getTargetInstance")) {
                return beanInstance.getInstance();
            } else if (thisMethod.getName().equals("weld_getTargetClass")) {
                return beanInstance.getInstanceType();
            } else {
                return null;
            }
        } else if (thisMethod.getName().equals("_initMH")) {
            BeanLogger.LOG.settingNewMethodHandler(args[0], self.getClass());
            return new ProxyMethodHandler(contextId, new TargetBeanInstance(args[0]), getBean());
        } else {
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            Object instance = beanInstance.getInstance();
            Object result = beanInstance.invoke(instance, thisMethod, args);
            // if the method returns this and the return type matches the proxy type, return the proxy instead
            // to prevent the bean instance escaping
            if (result != null && result == instance && (thisMethod.getReturnType().isAssignableFrom(self.getClass()))) {
                return self;
            }
            return result;
        }
    }
1245737
public Object invoke(MethodInvocation mi) throws Throwable {
		if (!Modifier.isPublic(mi.getMethod().getModifiers())) {
			return mi.proceed();
		}

		Method daoMethod = mi.getMethod();
		Object[] args = mi.getArguments();
		String appid = AOPUtils.getFirstArgOfString(args);

		Method superMethod = null;
		Indexed indexedAnno = null;
		Cached cachedAnno = null;

		try {
			superMethod = DAO.class.getMethod(daoMethod.getName(), daoMethod.getParameterTypes());
			indexedAnno = Config.isSearchEnabled() ? superMethod.getAnnotation(Indexed.class) : null;
			cachedAnno = Config.isCacheEnabled() ? superMethod.getAnnotation(Cached.class) : null;
			detectNestedInvocations(daoMethod);
		} catch (Exception e) {
			logger.error("Error in AOP layer!", e);
		}

		Set<IOListener> ioListeners = Para.getIOListeners();
		for (IOListener ioListener : ioListeners) {
			ioListener.onPreInvoke(superMethod, args);
			logger.debug("Executed {}.onPreInvoke().", ioListener.getClass().getName());
		}

		Object result = handleIndexing(indexedAnno, appid, daoMethod, args, mi);
		Object cachingResult = handleCaching(cachedAnno, appid, daoMethod, args, mi);

		// we have a read operation without any result but we get back objects from cache
		if (result == null && cachingResult != null) {
			result = cachingResult;
		}

		// both searching and caching are disabled - pass it through
		if (indexedAnno == null && cachedAnno == null) {
			result = invokeDAO(appid, daoMethod, mi);
		}

		for (IOListener ioListener : ioListeners) {
			ioListener.onPostInvoke(superMethod, result);
			logger.debug("Executed {}.onPostInvoke().", ioListener.getClass().getName());
		}

		return result;
	}
559278
public void eventLocked()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "eventLocked");

    // modify prefetching info
    synchronized (this)
    {
      RemoteDispatchableKey dkey = key.getRemoteDispatchableKey();
      RemoteQPConsumerKey ck = null;
      if (dkey instanceof RemoteQPConsumerKey)
        ck = (RemoteQPConsumerKey) dkey;

      if (ck != null)
      {
        ck.messageLocked(key);
        informedConsumerKeyThatLocked = true;
      }
    }

    // call superclass
    super.eventLocked();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "eventLocked");
  }
1090210
def acquire(self, blocking=True, timeout=None):
        
        logger.debug("Getting %r ...", self._name)

        if self._held:
            raise AlreadyAcquired("Already acquired from this Lock instance.")

        if not blocking and timeout is not None:
            raise TimeoutNotUsable("Timeout cannot be used if blocking=False")

        timeout = timeout if timeout is None else int(timeout)
        if timeout is not None and timeout <= 0:
            raise InvalidTimeout("Timeout (%d) cannot be less than or equal to 0" % timeout)

        if timeout and self._expire and timeout > self._expire:
            raise TimeoutTooLarge("Timeout (%d) cannot be greater than expire (%d)" % (timeout, self._expire))

        busy = True
        blpop_timeout = timeout or self._expire or 0
        timed_out = False
        while busy:
            busy = not self._client.set(self._name, self._id, nx=True, ex=self._expire)
            if busy:
                if timed_out:
                    return False
                elif blocking:
                    timed_out = not self._client.blpop(self._signal, blpop_timeout) and timeout
                else:
                    logger.debug("Failed to get %r.", self._name)
                    return False

        logger.debug("Got lock for %r.", self._name)
        if self._lock_renewal_interval is not None:
            self._start_lock_renewer()
        return True
671609
private void () {
        POJOJAXWSMethodInvoker tempInvoker = (POJOJAXWSMethodInvoker) server.getEndpoint().getService().getInvoker();
        Object instance = tempInvoker.getServiceObject();
        JaxWsInstanceManager jaxWsInstanceManager = jaxWsModuleMetaData.getJaxWsInstanceManager();

        try {
            jaxWsInstanceManager.destroyInstance(instance);
        } catch (InterceptException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "invoke POJO service PreDestroy fails:" + e.toString());
            }
        }

    }
340393
protected synchronized void invoke()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "invoke");
      try
      {
         // Pass details to implementor's conversation receive listener.
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBuffer(this, tc, data, 16, "data passed to dataReceived method");
         listener.dataReceived(data,
                               segmentType,
                               requestNumber,
                               priority,
                               allocatedFromPool,
                               partOfExchange,
                               conversation);
      }
      catch(Throwable t)
      {
         FFDCFilter.processException
            (t, "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ReceiveListenerDataReceivedInvocation", JFapChannelConstants.RLDATARECEIVEDINVOKE_INVOKE_01);
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown by dataReceived");
         if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, t);

         // User has thrown an exception from data received method.  Probably
         // the best way to deal with this is to invalidate their connection.
         // That'll learn 'em.
         connection.invalidate(true, t, "exception thrown by dataReceived - "+t.getLocalizedMessage());  // D224570

      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "invoke");
   }
226705
@Override
	public Object invoke(final Invocation invocation) throws Exception {
		if (invocation == null) throw new NullPointerException("invocation");

		MethodDescriptor<?, ?> method = invocation.getMethod();
		DataTypeDescriptor<?> resultd = (DataTypeDescriptor<?>) method.getResult();
		MessageDescriptor<? extends Message> excd = descriptor.getExc();

		RpcRequest request = protocol.getRequest(invocation);
		return session.send(request, resultd, excd);
	}