public ReInviteSender(ClientTransaction ctx) { this.ctx = ctx; if ( logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug("ReInviteSender::ReInviteSender: ctx = " + ctx ); logger.logStackTrace(); } }
public void terminate() { try { if ( logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug("ReInviteSender::terminate: ctx = " + ctx); } ctx.terminate(); Thread.currentThread().interrupt(); } catch (ObjectInUseException e) { logger.logError("unexpected error", e); } }
public void addEvent(EventWrapper eventWrapper) { if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG)) logger.logDebug("addEvent " + eventWrapper); // Add the event into the pending events list boolean added = pendingEvents.offer(eventWrapper); if (!added) logger.logWarning("reached queue capacity limit couldn't addEvent " + eventWrapper); }
public static void logError(String message, Exception ex) { if ((parserDebug || debug) && stackLogger != null ) { if ( stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) stackLogger.logError(message,ex); } }
public static void println(String s) { if ((parserDebug || debug )&& stackLogger != null ) if ( stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) stackLogger.logDebug(s + "\n"); } public static void printStackTrace(Exception ex) {
public void sendSwitchoverInstruction(SipLoadBalancer sipLoadBalancer, String fromJvmRoute, String toJvmRoute) { if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)) { logger.logInfo("switching over from " + fromJvmRoute + " to " + toJvmRoute); reg.switchover(fromJvmRoute, toJvmRoute); sipLoadBalancer.setDisplayWarning(true); if(logger.isLoggingEnabled(StackLogger.TRACE_INFO) && !sipLoadBalancer.isAvailable()) { logger.logInfo("Switchover: SIP Load Balancer Found! " + sipLoadBalancer); logger.logWarning("Cannot access the SIP load balancer RMI registry: " + e.getMessage() + "\nIf you need a cluster configuration make sure the SIP load balancer is running."); sipLoadBalancer.setDisplayWarning(false); sipLoadBalancer.setAvailable(false); if(sipLoadBalancer.isDisplayWarning()) { logger.logError("Cannot access the SIP load balancer RMI registry: " + e.getMessage() + "\nIf you need a cluster configuration make sure the SIP load balancer is running.", e); sipLoadBalancer.setDisplayWarning(false);
public void start(SipStackImpl sipStack, Properties configurationProperties) { sipStackImpl= sipStack; // don't need the properties so nothing to see here started.set(true); if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)) { logger.logInfo("the sip stack timer " + this.getClass().getName() + " has been started"); } }
public void stop() { started.set(false); logger.logStackTrace(StackLogger.TRACE_DEBUG); if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)) { logger.logInfo("the sip stack timer " + this.getClass().getName() + " has been stopped"); } }
boolean takeAckSem() { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug("[takeAckSem " + this + " sem=" + this.ackSem); } try { if (!this.ackSem.tryAcquire(2, TimeUnit.SECONDS)) { if (logger.isLoggingEnabled()) { logger.logError( "Cannot aquire ACK semaphore "); } if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug( "Semaphore previously acquired at " + this.stackTrace + " sem=" + this.ackSem); logger.logStackTrace(); } return false; } if (logger.isLoggingEnabled( StackLogger.TRACE_DEBUG)) { this.recordStackTrace(); } } catch (InterruptedException ex) { logger.logError("Cannot aquire ACK semaphore"); return false; } return true; }
private void deliverTransactionTerminatedEvent(TransactionTerminatedEvent sipEvent, EventWrapper eventWrapper, SipListener sipListener) { try { if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG)) { logger.logDebug( "About to deliver transactionTerminatedEvent"); logger.logDebug( "tx = " + sipEvent.getClientTransaction()); logger.logDebug( "tx = " + sipEvent.getServerTransaction()); } if (sipListener != null) sipListener.processTransactionTerminated(sipEvent); } catch (AbstractMethodError ame) { // JvB: for backwards compatibility, accept this if (logger.isLoggingEnabled()) logger.logWarning( "Unable to call sipListener.processTransactionTerminated"); } catch (Exception ex) { logger.logException(ex); } }
if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("Checking if " + node + " is reachable"); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace(node + " is reachable ? " + b); if(logger.isLoggingEnabled(StackLogger.TRACE_DEBUG)) { logger.logDebug("Adding custom info with key " + (String)entry.getKey() + " and value " + (String)entry.getValue()); logger.logError("IOException", e); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("Reachable SIP Node:[balancer=" + balancerAddr + "],[node info=" + rv + "]");
public static void printStackTrace(Exception ex) { if ((parserDebug || debug ) && stackLogger != null) { stackLogger.logError("Stack Trace",ex); } }
/** * Remove the dialog given its dialog id. This is used for dialog id * re-assignment only. * * @param dialogId * is the dialog Id to remove. */ public void removeDialog(String dialogId) { if (logger.isLoggingEnabled()) { logger.logWarning("Silently removing dialog from table"); } dialogTable.remove(dialogId); }
if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("Checking if " + node + " is reachable"); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace(node + " is reachable ? " + b); logger.logError("IOException", e); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("Reachable SIP Node:[balancer=" + balancerAddr + "],[node info=" + rv + "]");
public void setUseDirect(boolean useDirect) { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) logger.logTrace("Direct buffers are " + (useDirect ? "enabled" : "disabled")); this.useDirect = useDirect; } }
private void deliverDialogTerminatedEvent(DialogTerminatedEvent sipEvent, EventWrapper eventWrapper, SipListener sipListener) { try { if (sipListener != null) sipListener.processDialogTerminated(sipEvent); } catch (AbstractMethodError ame) { // JvB: for backwards compatibility, accept this if (logger.isLoggingEnabled()) logger.logWarning( "Unable to call sipListener.processDialogTerminated"); } catch (Exception ex) { logger.logException(ex); } } /**
public static void handleException(String emsg, StackLogger stackLogger) { stackLogger.logStackTrace(); stackLogger.logError("Unexepcted INTERNAL ERROR !!"); stackLogger.logFatalError(emsg); throw new RuntimeException(emsg); } }
/** * Get the current MBean Server. * * @return * @throws Exception */ public MBeanServer getMBeanServer() throws Exception { if (mbeanServer == null && !isMBeanServerNotAvailable) { try { mbeanServer = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0); } catch (Exception e) { logger.logStackTrace(StackLogger.TRACE_DEBUG); logger.logWarning("No Mbean Server available, so JMX statistics won't be available"); isMBeanServerNotAvailable = true; } } return mbeanServer; }
/** * Handle an unexpected exception. */ public static void handleException(Exception ex, StackLogger stackLogger) { System.err.println ("Unexpected internal error " + ex.getMessage()); stackLogger.logError("UNEXPECTED INTERNAL ERROR " + ex.getMessage()); ex.printStackTrace(); stackLogger.logException(ex); throw new RuntimeException("Unexpected internal error !! " + ex.getMessage(), ex); } /**