當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationEventPublisher.publishEvent方法代碼示例

本文整理匯總了Java中org.springframework.context.ApplicationEventPublisher.publishEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationEventPublisher.publishEvent方法的具體用法?Java ApplicationEventPublisher.publishEvent怎麽用?Java ApplicationEventPublisher.publishEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.context.ApplicationEventPublisher的用法示例。


在下文中一共展示了ApplicationEventPublisher.publishEvent方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: BatchProcessor

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Instantiates a new batch processor.
 * 
 * @param processName
 *            the process name
 * @param retryingTransactionHelper
 *            the retrying transaction helper
 * @param workProvider
 *            the object providing the work packets
 * @param workerThreads
 *            the number of worker threads
 * @param batchSize
 *            the number of entries we process at a time in a transaction
 * @param applicationEventPublisher
 *            the application event publisher (may be <tt>null</tt>)
 * @param logger
 *            the logger to use (may be <tt>null</tt>)
 * @param loggingInterval
 *            the number of entries to process before reporting progress
 *            
 * @since 3.4 
 */
public BatchProcessor(
        String processName,
        RetryingTransactionHelper retryingTransactionHelper,
        BatchProcessWorkProvider<T> workProvider,
        int workerThreads, int batchSize,
        ApplicationEventPublisher applicationEventPublisher,
        Log logger,
        int loggingInterval)
{
    this.threadFactory = new TraceableThreadFactory();
    this.threadFactory.setNamePrefix(processName);
    this.threadFactory.setThreadDaemon(true);
    
    this.processName = processName;
    this.retryingTransactionHelper = retryingTransactionHelper;
    this.workProvider = workProvider;
    this.workerThreads = workerThreads;
    this.batchSize = batchSize;
    if (logger == null)
    {
        this.logger = LogFactory.getLog(this.getClass());
    }
    else
    {
        this.logger = logger;
    }
    this.loggingInterval = loggingInterval;
    
    // Let the (enterprise) monitoring side know of our presence
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher.publishEvent(new BatchMonitorEvent(this));
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:57,代碼來源:BatchProcessor.java

示例2: sell

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
public void sell(ApplicationEventPublisher publisher) {
    sold = true;
    CarSold event = new CarSold(vin);
    publisher.publishEvent(event);
}
 
開發者ID:mkopylec,項目名稱:project-manager,代碼行數:6,代碼來源:Car.java

示例3: publishConnectedEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttClientConnectedEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param serverUri the Server URI the MQTT Client is connected to
 * @param subscribedTopics the Topic Filters the MQTT Client is subscribed to
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishConnectedEvent(String clientId, String serverUri, String[] subscribedTopics,
    ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher.publishEvent(
            new MqttClientConnectedEvent(clientId, serverUri, subscribedTopics, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:23,代碼來源:MqttClientEventPublisher.java

示例4: publishConnectionFailureEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttClientConnectionFailureEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param autoReconnect whether the MQTT Client will automatically reconnect
 * @param throwable the originating {@link Throwable}
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishConnectionFailureEvent(String clientId, boolean autoReconnect,
    Throwable throwable, ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher.publishEvent(
            new MqttClientConnectionFailureEvent(clientId, autoReconnect, throwable, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:23,代碼來源:MqttClientEventPublisher.java

示例5: publishConnectionLostEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttClientConnectionLostEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param autoReconnect whether the MQTT Client will automatically reconnect
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishConnectionLostEvent(String clientId, boolean autoReconnect,
    ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher
            .publishEvent(new MqttClientConnectionLostEvent(clientId, autoReconnect, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:22,代碼來源:MqttClientEventPublisher.java

示例6: publishDisconnectedEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttClientDisconnectedEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishDisconnectedEvent(String clientId,
    ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher
            .publishEvent(new MqttClientDisconnectedEvent(clientId, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:21,代碼來源:MqttClientEventPublisher.java

示例7: publishMessageDeliveredEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttMessageDeliveredEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param messageIdentifier the Message Identifier
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishMessageDeliveredEvent(String clientId, int messageIdentifier,
    ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher
            .publishEvent(new MqttMessageDeliveredEvent(clientId, messageIdentifier, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:22,代碼來源:MqttClientEventPublisher.java

示例8: publishMessagePublishedEvent

import org.springframework.context.ApplicationEventPublisher; //導入方法依賴的package包/類
/**
 * Publishes a {@link MqttMessagePublishedEvent} message to the
 * {@link ApplicationEventPublisher}.
 * <p>
 * If the {@link ApplicationEventPublisher} instance is null, no event message will be
 * published.
 * 
 * @param clientId the Client ID value
 * @param messageIdentifier the Message Identifier
 * @param correlationId the Correlation ID
 * @param applicationEventPublisher the {@link ApplicationEventPublisher} value
 * @param source the source that sent this event
 */
public void publishMessagePublishedEvent(String clientId, int messageIdentifier,
    String correlationId, ApplicationEventPublisher applicationEventPublisher, Object source)
{
    if (applicationEventPublisher != null)
    {
        applicationEventPublisher.publishEvent(
            new MqttMessagePublishedEvent(clientId, messageIdentifier, correlationId, source));
    }
}
 
開發者ID:christophersmith,項目名稱:summer-mqtt,代碼行數:23,代碼來源:MqttClientEventPublisher.java


注:本文中的org.springframework.context.ApplicationEventPublisher.publishEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。