当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionListener.onException方法代码示例

本文整理汇总了Java中javax.jms.ExceptionListener.onException方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionListener.onException方法的具体用法?Java ExceptionListener.onException怎么用?Java ExceptionListener.onException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.jms.ExceptionListener的用法示例。


在下文中一共展示了ExceptionListener.onException方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invokeExceptionListener

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
/**
 * Invoke the registered JMS ExceptionListener, if any.
 * @param ex the exception that arose during JMS processing
 * @see #setExceptionListener
 */
protected void invokeExceptionListener(JMSException ex) {
	ExceptionListener exceptionListener = getExceptionListener();
	if (exceptionListener != null) {
		exceptionListener.onException(ex);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:12,代码来源:AbstractMessageListenerContainer.java

示例2: onException

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
@Override
public void onException(JMSException ex) {
	synchronized (connectionMonitor) {
		// Iterate over temporary copy in order to avoid ConcurrentModificationException,
		// since listener invocations may in turn trigger registration of listeners...
		for (ExceptionListener listener : new LinkedHashSet<ExceptionListener>(this.delegates)) {
			listener.onException(ex);
		}
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:SingleConnectionFactory.java

示例3: testJMSExceptionWhileCrawling

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
/**
 * Test that a Harvester will not die immediately a JMSException is received.
 */
public void testJMSExceptionWhileCrawling() throws Exception {
   if (!TestUtils.runningAs("CSR")) {
               return;
           }
    // Get the exception handler for the connection
    JMSConnection con = JMSConnectionFactory.getInstance();
    Field queueConnectionField = con.getClass().getSuperclass().getDeclaredField("myQConn");
    queueConnectionField.setAccessible(true);
    QueueConnection qc = (QueueConnection) queueConnectionField.get(con);
    ExceptionListener qel = qc.getExceptionListener();
    //Start a harvest
    Job j = TestInfo.getJob();
    DataModelTestCase.addHarvestDefinitionToDatabaseWithId(
            j.getOrigHarvestDefinitionID());
    JobDAO.getInstance().create(j);
    j.setStatus(JobStatus.SUBMITTED);
    JobDispatcher hDisp = new JobDispatcher(con, HarvestDefinitionDAO.getInstance(), JobDAO.getInstance());
    hDisp.doOneCrawl(j, "test", "test", "test", new HarvestChannel("test", false, true, ""), "unittesters",
            new ArrayList<MetadataEntry>());
    //Trigger the exception handler - should not try to exit
    qel.onException(new JMSException("Some exception"));
    // Wait for harvester to finish and try to exit
    synchronized(this) {
        wait();
    }
    // Should probably now do some tests on the state of the HCS to see
    // that it has finished harvesting but not tried to upload
}
 
开发者ID:netarchivesuite,项目名称:netarchivesuite-svngit-migration,代码行数:32,代码来源:IntegrityTestsHCSJMSException.java

示例4: onException

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
/**
 * @param ex
 */
public void onException(JMSException ex) {
    ExceptionListener l = this.exceptionListener;
    if (l != null) {
        l.onException(JmsExceptionSupport.create(ex));
    }
}
 
开发者ID:fusesource,项目名称:hawtjms,代码行数:10,代码来源:JmsConnection.java

示例5: onException

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
@Override
public void onException(JMSException ex) {
	for (ExceptionListener listener : this.delegates) {
		listener.onException(ex);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:ChainedExceptionListener.java

示例6: onException

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
public void onException(JMSException ex) {
	for (ExceptionListener listener : this.delegates) {
		listener.onException(ex);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:6,代码来源:ChainedExceptionListener.java

示例7: closed

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
public void closed(Connection conn)
{
    ConnectionException exc = exception;
    exception = null;

    if (exc == null)
    {
        return;
    }

    ConnectionClose close = exc.getClose();
    if (close == null)
    {
        _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));
        
        try
        {
            if (_conn.firePreFailover(false) && _conn.attemptReconnection())
            {
                _conn.failoverPrep();
                _conn.resubscribeSessions();
                _conn.fireFailoverComplete();
                return;
            }
        }
        catch (Exception e)
        {
            _logger.error("error during failover", e);
        }
        finally
        {
            _conn.getProtocolHandler().getFailoverLatch().countDown();
            _conn.getProtocolHandler().setFailoverLatch(null);
        }
    }

    ExceptionListener listener = _conn._exceptionListener;
    if (listener == null)
    {
        _logger.error("connection exception: " + conn, exc);
    }
    else
    {
        String code = null;
        if (close != null)
        {
            code = close.getReplyCode().toString();
        }

        JMSException ex = new JMSException(exc.getMessage(), code);
        ex.setLinkedException(exc);
        ex.initCause(exc);
        listener.onException(ex);
    }
}
 
开发者ID:wso2,项目名称:andes,代码行数:56,代码来源:AMQConnectionDelegate_0_10.java

示例8: onException

import javax.jms.ExceptionListener; //导入方法依赖的package包/类
public void onException(JMSException ex) {
    ExceptionListener listener = this.exceptionListener;
    if (listener != null) {
        listener.onException(JmsExceptionSupport.create(ex));
    }
}
 
开发者ID:apache,项目名称:qpid-jms,代码行数:7,代码来源:JmsConnection.java


注:本文中的javax.jms.ExceptionListener.onException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。