This is called by the EJB container server code to write a
EJB method call preinvoke ends record to the trace log, if enabled.
7075
public static void tracePreInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        {
            StringBuffer sbuf = new StringBuffer();

            sbuf
                            .append(MthdPreInvokeExit_Type_Str).append(DataDelimiter)
                            .append(MthdPreInvokeExit_Type).append(DataDelimiter);

            writeDeployedSupportInfo(s, sbuf, wrapper, null);

            Tr.debug(tc, sbuf.toString());
        }
    }
1173844
private void _inferCaller()
  {
    _needToInferCaller = false;
    // Get the stack trace.
    StackTraceElement stack[] = (new Throwable()).getStackTrace();
    // First, search back to a method in the Logger class.
    int i = 0;

    while (i < stack.length)
    {
      StackTraceElement frame = stack[i];
      String cname = frame.getClassName();
      if (cname.equals(_JDK_LOG_CLASS) ||
          cname.equals(_MYFACES_LOG_CLASS))
      {
          break;
      }

      i++;
    }

    // Now search for the first frame before the "Logger" class.
    while (i < stack.length)
    {
      StackTraceElement frame = stack[i];
      String cname = frame.getClassName();

      if (cname.equals(_JDK_LOG_CLASS) ||
          cname.equals(_MYFACES_LOG_CLASS))
      {
        i++;
        continue;
      }

      String mname = frame.getMethodName();
      if ("log".equals(mname) ||
          "_log".equals(mname))
      {
        i++;
        continue;
      }

      // We've found the relevant frame.
      setSourceClassName(cname);
      setSourceMethodName(mname);
      return;

    }

    // Forcibly set both to null, so the LogRecord superclass
    // doesn't try to detect them on its own
    setSourceClassName(null);
    setSourceMethodName(null);
  }
1294437
public void afterCompletion(int status)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.entry(tc, "afterCompletion (" + status + ") : " + this);

        try
        {
            // inform the activator that the session has ended
            // so the beans can be passivated if necessary
            BeanO[] beanOs = getBeanOs();
            EJBKey[] ejbKeys = getEJBKeys(beanOs);
            if (beanOs != null) {
                for (int i = 0; i < beanOs.length; ++i) {
                    BeanO beanO = beanOs[i];
                    try {
                        ivContainer.activator.unitOfWorkEnd(this, beanO);
                    } catch (Throwable ex) {
                        FFDCFilter.processException(ex, CLASS_NAME + ".afterCompletion",
                                                    "214", this);
                        if (isTraceOn && tc.isEventEnabled()) // d144064
                            Tr.event(tc,
                                     "Exception thrown in afterCompletion()",
                                     new Object[] { beanO, ex });
                    }
                }
            }
            // inform the unit of controller the session has ended
            // so references that are no longer needed can be released
            ivContainer.uowCtrl.sessionEnded(ejbKeys);

            //d425046 Ensure ContainerAS not available now
            ContainerTx tx = ivContainer.getCurrentTx(false);
            if (tx != null)
            {
                tx.setContainerAS(null); // prevent activation strategy finding
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "removed ContainerAS during afterCompletion");
            }

        } catch (Throwable t) {
            FFDCFilter.processException(t, CLASS_NAME + ".afterCompletion", "219", this);
            if (isTraceOn && tc.isEventEnabled()) // d144064
                Tr.event(tc, "Exception during afterCompletion", t);
            throw new RuntimeException(t.toString());
        } finally {
            ivContainer.containerASCompleted(ivASKey);
        }

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.exit(tc, "afterCompletion");
    }
151607
@Around("execute() || testing()")
  public Object trace(ProceedingJoinPoint call) throws Throwable {
    if (call.getArgs().length == 0 || call.getArgs()[0] == null) {
      return call.proceed();
    }

    String sql = (String) call.getArgs()[0];
    String spanName = makeSpanName(call, sql);

    return Handler.proceed(call, tracer, spanName, sql);
  }
911499
public EnterpriseBean preInvoke(EJSWrapperBase wrapper,
                                    int methodId,
                                    EJSDeployedSupport s,
                                    Object[] args) throws RemoteException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        // Get the EJBMethodInfoImpl object for the methodId
        // assigned to this method by ejbdeploy tool.
        EJBMethodInfoImpl methodInfo = mapMethodInfo(s, wrapper, methodId, null);

        try {
            if (isTraceOn) {
                if (TEEJBInvocationInfo.isTraceEnabled())
                    TEEJBInvocationInfo.tracePreInvokeBegins(s, wrapper);

                if (tc.isEntryEnabled())
                    Tr.entry(tc, "EJBpreInvoke(" + methodId + ":" +
                                 methodInfo.getMethodName() + ")");
                // d191679 Begins
                if (tcClntInfo.isDebugEnabled())
                    Tr.debug(tcClntInfo, "preInvoke(" + methodInfo.getMethodName() + ")");
                // d191679 Ends
            }

            // If this is a stateless SessionBean create, run only the bare minimum of
            // collaborators and other processing. This path is encapsulated in a separate
            // method for now, to avoid lots of "if" statements within this method.
            Object bean = null; // Changed EnterpriseBean to Object       d366807.1
            if (methodInfo.isStatelessSessionBean && methodInfo.isHomeCreate) {
                bean = preInvokeForStatelessSessionCreate(wrapper, methodId, s, methodInfo, args); //LIDB2617.11
            } else {
                // Perform preinvoke processing that must occur prior
                // to activation of the EJB.
                bean = preInvokeActivate(wrapper, methodId, s, methodInfo);

                // Now perform preinvoke processing that must occur after
                // the EJB is activated.
                preInvokeAfterActivate(wrapper, bean, s, args);
            }

            // Normal path exit.
            if (isTraceOn) {
                if (tc.isEntryEnabled()) {
                    ContainerTx containerTx = s.currentTx;

                    Tr.exit(tc, "EJBpreInvoke(" + methodId + ":" +
                                methodInfo.getMethodName() + ") " +
                                " Invoking method '" + methodInfo.getMethodName() +
                                "' on bean '" + wrapper.getClass().getName() +
                                "(" + wrapper.beanId + ")" +
                                "', '" + containerTx + "', isGlobalTx=" +
                                (containerTx != null ? (containerTx.isTransactionGlobal() ? "true" : "false") : "Unknown"));
                }

                if (TEEJBInvocationInfo.isTraceEnabled())
                    TEEJBInvocationInfo.tracePreInvokeEnds(s, wrapper);
            }

            // No exceptions occured, so return the Enterprise bean
            // that was activated and/or loaded.
            return (EnterpriseBean) bean;
        } catch (Throwable t) {
            //FFDCFilter.processException( t, CLASS_NAME + ".preInvoke", "2558");
            preinvokeHandleException(t, wrapper, methodId, s, methodInfo);

            // This will never happen since the setUncheckException should
            // always throw an exception.  But we need this line to make
            // the compiler happy (it does know exception always thrown).
            return null;
        }
    }
58312
private void stopRecording(String line, DispatchCallback callback) {
    try {
      sqlLine.getRecordOutputFile().close();
    } catch (Exception e) {
      sqlLine.handleException(e);
    }

    sqlLine.output(sqlLine.loc("record-closed", sqlLine.getRecordOutputFile()));
    sqlLine.setRecordOutputFile(null);
    callback.setToSuccess();
  }
1251628
@Override
  public void recordProcessInstanceEnd(String processInstanceId, String deleteReason, String activityId) {

    if (isHistoryLevelAtLeast(HistoryLevel.ACTIVITY)) {
      HistoricProcessInstanceEntity historicProcessInstance = getHistoricProcessInstanceEntityManager().findById(processInstanceId);

      if (historicProcessInstance != null) {
        historicProcessInstance.markEnded(deleteReason);
        historicProcessInstance.setEndActivityId(activityId);
        
        // Fire event
        ActivitiEventDispatcher activitiEventDispatcher = getEventDispatcher();
        if (activitiEventDispatcher != null && activitiEventDispatcher.isEnabled()) {
          activitiEventDispatcher.dispatchEvent(
              ActivitiEventBuilder.createEntityEvent(ActivitiEventType.HISTORIC_PROCESS_INSTANCE_ENDED, historicProcessInstance));
        }
        
      }
    }
  }
868227
@Override
    public void postInvoke(int id, EJSDeployedSupport s) throws RemoteException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "postInvoke");
        }

        // Release lock acquired if container managed concurrency control.
        if (ivContainerManagedConcurrency && s.ivLockAcquired) {
            // Get the lock type to use for the method being invoked.
            EJBMethodInfoImpl mInfo = s.methodInfo;
            LockType lockType = mInfo.ivLockType;

            if (lockType == LockType.READ) {
                ivReadLock.unlock();

                if (isTraceOn && tc.isDebugEnabled()) {
                    Tr.debug(tc, "postInvoke released read lock: " + ivLock.toString());
                }
            } else {
                ivWriteLock.unlock();

                if (isTraceOn && tc.isDebugEnabled()) {
                    Tr.debug(tc, "postInvoke released write lock: " + ivLock.toString());
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "postInvoke");
        }
    }
352182
public void serverStopping() {

        final String methodName = "serverStopping";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(TRACE, methodName);
            SibTr.exit(TRACE, methodName);
        }
        _serverStopping = true;

    }
1030451
public void noteRequestCompletion(ServerStats stats, Object response, Throwable e, long responseTime, RetryHandler errorHandler) {
    	if (stats == null) {
    		return;
    	}
        try {
            recordStats(stats, responseTime);
            RetryHandler callErrorHandler = errorHandler == null ? getRetryHandler() : errorHandler;
            if (callErrorHandler != null && response != null) {
                stats.clearSuccessiveConnectionFailureCount();
            } else if (callErrorHandler != null && e != null) {
                if (callErrorHandler.isCircuitTrippingException(e)) {
                    stats.incrementSuccessiveConnectionFailureCount();                    
                    stats.addToFailureCount();
                } else {
                    stats.clearSuccessiveConnectionFailureCount();
                }
            }
        } catch (Exception ex) {
            logger.error("Error noting stats for client {}", clientName, ex);
        }            
    }
507149
public void checkpointEnd()
  {
    if (! _isWhileCheckpoint) {
      throw new IllegalStateException();
    }
    
    _isWhileCheckpoint = false;
    
    byte []headerBuffer = _headerBuffer;
    BitsUtil.writeInt16(headerBuffer, 0, CHECKPOINT_END);
    writeImpl(headerBuffer, 0, 2);
    
    flush();
    
    _lastCheckpointEnd = _index - _startAddress;
    
    writeTail(_os);
  }
247864
@Override
    public void close(VirtualConnection inVC, Exception e) {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isDebugEnabled()) {
            Tr.debug(tc, "close() called: " + this + " " + inVC);
        }

        boolean errorState = (null != e);
        if (errorState && bTrace && tc.isDebugEnabled()) {
            Tr.debug(tc, "close() in error state, " + e);
        }

        final HttpInboundServiceContextImpl sc = getHTTPContext();
        final HttpChannelConfig config = sc.getHttpConfig();
        // valid responses as well as error responses all go through here so
        // this is where we tell the factory that any large response is complete
        if (sc.containsLargeMessage()) {
            getChannel().getFactory().releaseLargeMessage();
        }

        // check to see if the message has been fully sent (unless we
        // are in an error state)

        if (!errorState && !sc.isMessageSent()) {
            try {
                VirtualConnection rc = sc.finishResponseMessage(null, this, false);
                // if the finish is done already, then continue with code below
                if (null == rc) {
                    if (bTrace && tc.isDebugEnabled()) {
                        Tr.debug(tc, "finishing response msg async");
                    }
                    return;
                }
            } catch (MessageSentException mse) {
                // no FFDC required, nothing to do here
                if (bTrace && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Error: message sent exception when flag doesn't agree");
                }
                // shouldn't get here so just close the socket
                getDeviceLink().close(inVC, mse);
                return;
            }
        }

        // if the incoming request body was never read, we must purge the body
        // off the socket before we can continue with the read for the next
        // request... assuming we're not in an error condition

        if (!errorState
            // 346196.2 -- if we stopped, then don't purge the body
            && getChannel().isRunning() && !sc.isIncomingMessageFullyRead()) {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Incoming request body never read.");
            }
            try {
                // 346196.4 - read/release one buffer at a time to avoid
                // unnecessary memory storage for large bodies
                VirtualConnection rc = sc.getRequestBodyBuffer(HttpIgnoreBodyCallback.getRef(), false);
                boolean reachedEnd = false;
                while (null != rc) {
                    WsByteBuffer buffer = sc.getRequestBodyBuffer();
                    if (null != buffer) {
                        buffer.release();
                        rc = sc.getRequestBodyBuffer(HttpIgnoreBodyCallback.getRef(), false);
                    } else {
                        // end of body found
                        reachedEnd = true;
                        break;
                    }
                }
                if (!reachedEnd) {
                    // wait for callback
                    if (bTrace && tc.isDebugEnabled()) {
                        Tr.debug(tc, "close() waiting for body purge callback");
                    }
                    return;
                }
            } catch (Exception purgeException) {
                // no FFDC required
                if (bTrace && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Exception purging request body: " + purgeException);
                }
                errorState = true;
            }
        }

        if (this.myInterface.getLink() instanceof H2HttpInboundLinkWrap) {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "we're H2, calling that close");
            }
            this.myInterface.getLink().close(inVC, e);

            return;
        }

        // If servlet upgrade processing is being used, then don't close the socket here
        if (inVC != null) {
            String upgraded = (String) (inVC.getStateMap().get(TransportConstants.UPGRADED_CONNECTION));
            if (upgraded != null) {
                if (!errorState && getChannel().isRunning() && (upgraded.compareToIgnoreCase("true") == 0)) {

                    if (bTrace && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Connection Not closed because Servlet Upgrade detected.");
                    }
                    return;
                }
            }
        }

        // now check to see if the connection should be kept open (unless
        // we are in an error state). Perform one last check against a channel
        // stop, close the socket if not running.

        if (!errorState && sc.isPersistent() && getChannel().isRunning()) {

            if (config.getDebugLog().isEnabled(DebugLog.Level.DEBUG)) {
                config.getDebugLog().log(DebugLog.Level.DEBUG, HttpMessages.MSG_READ_PERSISTENT, sc);
            }

            sc.resetStartTime();
            this.myTSC.getWriteInterface().setBuffers(null);

            // check the last buffer from the previous request as
            // there might be the start of another request on it (pipelining)

            if (sc.isReadDataAvailable()) {
                handlePipeLining();
                return;
            }
            // no pipelined data, clear the SC and setup for a JIT read
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Reading for another request...");
            }
            if (getChannel().getHttpConfig().runningOnZOS()) {
                // 342859 - add a marker indicating the first read of a subsequent
                // request is starting. This is used for WLM type management on z/OS
                // right now with request message priority handling and monitoring
                // of "in-system" times
                getVirtualConnection().getStateMap().put(HttpConstants.HTTPFirstRead, "true");
            }

            sc.clear();
            sc.setReadBuffer(null);
            sc.setupJITRead(config.getIncomingHdrBufferSize());

            // do a forced async read to free up the thread since there will
            // no doubt be a delay until the next request -- we've already
            // checked for pipelined ones
            this.myTSC.getReadInterface().read(1, HttpICLReadCallback.getRef(), true, config.getPersistTimeout());

        } else {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Closing connection");
            }

            //PI11176 Begin
            if (getChannel().getHttpConfig().shouldAttemptPurgeData()) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "attemptPurgeData true, purging the data before closing the connection");
                }
                try {
                    //Setup for a JIT read. This will allocate a buffer for X bytes if a buffer hasn't already been allocated
                    //If there is nothing to read the buffer is automatically released
                    sc.setupJITRead(10);
                    //Set the buffer to null at the TCP layer before continuing. We will be doing this after anyway, so want to do it ahead of time so we are starting with out buffer.
                    this.myTSC.getReadInterface().setBuffer(null);
                    boolean processing = true;

                    while (processing) {
                        //Do the read
                        long numBytesRead = this.myTSC.getReadInterface().read(0, 1);
                        //Get the buffer associated with the read, could return null
                        WsByteBuffer indivBuffer = this.myTSC.getReadInterface().getBuffer();
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "Bytes read : " + numBytesRead);
                        }
                        //Check if the bytesRead are 0. If so then we are done. If not then we have to process the data(which in this case means throw it out
                        if (numBytesRead <= 0) {
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                Tr.debug(tc, "No data read");
                            }
                            if (indivBuffer != null) {
                                //Means we read more than once to set the buffer to null and release it
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "No data read, releasing any buffer that was allocated");
                                }
                                this.myTSC.getReadInterface().setBuffer(null);
                                indivBuffer.release();
                            }
                            processing = false;
                        } else {
                            if (indivBuffer != null) {
                                //Clear the buffer because we read some data
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "Found a buffer after the read : " + indivBuffer);
                                }
                                indivBuffer.clear();
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "Cleared the buffer, going back to read again, " + indivBuffer);
                                }
                            } else {
                                //We are done since there was no buffer
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                    Tr.debug(tc, "No buffer found, assuming we are done");
                                }
                                processing = false;
                            }

                        }
                    }
                } catch (IOException purgeException) {
                    //Encountered an exception, if there is a buffer, just release and null out
                    WsByteBuffer indivBuffer = this.myTSC.getReadInterface().getBuffer();
                    if (indivBuffer != null) {
                        this.myTSC.getReadInterface().setBuffer(null);
                        indivBuffer.release();
                    }
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "IOException during purge : " + purgeException);
                    }
                }
            }
            //PI11176 End

            if (config.getDebugLog().isEnabled(DebugLog.Level.INFO)) {
                config.getDebugLog().log(DebugLog.Level.INFO, HttpMessages.MSG_CONN_CLOSING, sc);
            }

            if (this.myTSC != null) {
                TCPWriteRequestContext writeInterface = this.myTSC.getWriteInterface();
                if (writeInterface != null)
                    writeInterface.setBuffer(null);
                TCPReadRequestContext readInterface = this.myTSC.getReadInterface();
                if (readInterface != null)
                    readInterface.setBuffer(null);
            }
            if (this.filterExceptions) {
                getDeviceLink().close(inVC, null);
            } else {
                getDeviceLink().close(inVC, e);
            }
        }
    }
529144
public static void generateLog(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
		SQLiteDaoDefinition daoDefinition = method.getParent();

		// log is enabled
		if (daoDefinition.isLogEnabled()) {
			// generate log section - BEGIN
			methodBuilder.addComment("log section BEGIN");
			methodBuilder.beginControlFlow("if (_context.isLogEnabled())");

			methodBuilder.addCode("// log for insert -- BEGIN \n");

			JQLChecker checker = JQLChecker.getInstance();
			final One<Boolean> inWhere = new One<Boolean>(false);

			String sql = checker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {

				@Override
				public String onBindParameter(String bindParameterName, boolean inStatement) {
					if (inWhere.value0) {
						return "?";
					}

					return null;
				}

				@Override
				public void onWhereStatementBegin(Where_stmtContext ctx) {
					super.onWhereStatementBegin(ctx);

					inWhere.value0 = true;
				}

				@Override
				public void onWhereStatementEnd(Where_stmtContext ctx) {
					super.onWhereStatementEnd(ctx);

					inWhere.value0 = false;
				}
			});

			if (method.jql.containsSelectOperation) {
				// log
				// manage log
				methodBuilder.addCode("\n");
				methodBuilder.addStatement("$T.info($S)", Logger.class, sql);
			} else {
				sql = checker.replaceVariableStatements(method, sql, new JQLReplaceVariableStatementListenerImpl() {

					@Override
					public String onColumnNameSet(String statement) {
						return "%s";
					}

					@Override
					public String onColumnValueSet(String statement) {
						return "%s";
					}
				});

				methodBuilder.addStatement("$T _columnNameBuffer=new $T()", StringBuffer.class, StringBuffer.class);
				methodBuilder.addStatement("$T _columnValueBuffer=new $T()", StringBuffer.class, StringBuffer.class);
				methodBuilder.addStatement("String _columnSeparator=$S", "");

				SqlBuilderHelper.forEachColumnInContentValue(methodBuilder, method, "_contentValues.keys()", false, new OnColumnListener() {

					@Override
					public void onColumnCheck(MethodSpec.Builder methodBuilder, String columNameVariable) {
						methodBuilder.addStatement("_columnNameBuffer.append(_columnSeparator+$L)", columNameVariable);
						methodBuilder.addStatement("_columnValueBuffer.append(_columnSeparator+$S+$L)", ":", columNameVariable);
						methodBuilder.addStatement("_columnSeparator=$S", ", ");

					}
				});

				methodBuilder.addStatement("$T.info($S, _columnNameBuffer.toString(), _columnValueBuffer.toString())", Logger.class, sql);
			}
			generateLogForContentValues(method, methodBuilder);

			methodBuilder.addCode("// log for insert -- END \n\n");
			SqlBuilderHelper.generateLogForWhereParameters(method, methodBuilder);

			// generate log section - END
			methodBuilder.endControlFlow();
			methodBuilder.addComment("log section END");
		}
	}
529286
protected void threadEnd() {
        //
        // Note the 'afterCallbacks' list is not going to have a well-defined order, so it is of limited use.
        // We probably want to revisit this with some kind of priority/order based on ranking to make
        // it more useful.
        //
        // At the moment we treat the setting of the tran timeout separately, rather than as a IJobExecutionEndCallbackService,
        // to reflect the fact that this is provided by a required dependency.  If we were to want this to function in SE mode,
        // say, we might want to factor this too as an "extension" that is provided by another layer, and so incorporate this into a
        // more generic, extensible "after" processing.
        try {
            getBatchKernel().workUnitCompleted(this);
        } catch (Exception e) {
            // FFDC instrumentation
        }

        if (afterCallbacks != null) {
            for (IJobExecutionEndCallbackService callback : afterCallbacks) {
                try {
                    if (logger.isLoggable(Level.FINER)) {
                        logger.logp(Level.FINER, CLASSNAME, "threadEnd", "Calling after callback", callback);
                    }
                    callback.jobEnded(runtimeWorkUnitExecution);
                } catch (Throwable t) {
                    // FFDC instrumentation
                }
            }
        }

        try {
            tranMgr.setTransactionTimeout(0);
        } catch (SystemException e) {
            // FFDC instrumentation
        }
    }
1280904
private void processEndpointDeActivation()
    {
        final String methodName = "processEndpointDeActivation";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, new Object[] {});
        }

        String endpointName = null;
        if (_messageEndpointFactory instanceof MDBMessageEndpointFactory)
        {
            try {
                endpointName = ((MDBMessageEndpointFactory) _messageEndpointFactory).getMDBKey().toString();
            } catch (Exception e) {
                FFDCFilter.processException(e,
                                            "com.ibm.ws.sib.ra.inbound.impl.SibRaListener",
                                            "1059", this);
            }

            // Output a message that we are about to pause the endpoint
            SibTr.warning(TRACE, "MESSAGE_ENDPOINT_PAUSED_AUTONOMICALLY_CWSIV0902",
                          new Object[] { endpointName, _destinationAddress });

            // call bus sec action
            try
            {
                // Use reflection here as the class should not be loaded for the stand alone
                // RA (this method should not be driven by the standalone RA and calling it
                // may invoke the use of BusSecurityAction which is not bundled with the stand alone
                // RA.
                Class<?> busAction = Class.forName("com.ibm.ws.sib.ra.inbound.impl.SibRaBusSecurityAction");
                Method performBusSecurityAction = busAction.getDeclaredMethod("performBusSecurityAction",
                                                                              new Class[] { String.class, SIDestinationAddress.class });
                performBusSecurityAction.invoke(null, new Object[] { endpointName, _destinationAddress });
            } catch (Exception ex)
            {
                FFDCFilter.processException(ex, CLASS_NAME + "." + methodName, "1:1128:1.68");
                SibTr.error(TRACE, "INVOKE_MBEAN_EXCEPTION__CWSIV0903",
                            new Object[] { endpointName, _destinationAddress, ex });
            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }
    }
912087
void endOfRunDb()
    {
        DbConn cnx = null;

        try
        {
            cnx = Helpers.getNewDbSession();

            // Done: put inside history & remove instance from queue.
            History.create(cnx, this.ji, this.resultStatus, endDate);
            jqmlogger.trace("An History was just created for job instance " + this.ji.getId());
            cnx.runUpdate("ji_delete_by_id", this.ji.getId());
            cnx.commit();
        }
        catch (RuntimeException e)
        {
            endBlockDbFailureAnalysis(e);
        }
        finally
        {
            Helpers.closeQuietly(cnx);
        }
    }
656114
public void endCall(SipServletMessage message, boolean callerTerminating) throws IOException {
		if(callerTerminating) {
			fireEvent(
				(String) message.getSession().getAttribute("boothNumber"), 
				null, 
				"org.mobicents.slee.service.interopdemo.END_MEDIA", 
				message.getSession().getAttribute("callManagerRef"));
		} else {
			sipServletResponse.getSession().createRequest("BYE").send();
		}
	}