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


Java ApplicationEvent.getSource方法代碼示例

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


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

示例1: onApplicationEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
@Override
public void onApplicationEvent(ApplicationEvent event) {
	// Once the context has been refreshed, we tell other interested beans
	// about the existence of this content store
	// (e.g. for monitoring purposes)
	if (event instanceof ContextRefreshedEvent && event.getSource() == this.applicationContext) {
		ApplicationContext context = ((ContextRefreshedEvent) event).getApplicationContext();
		context.publishEvent(new ContentStoreCreatedEvent(this, Collections.<String, Serializable>emptyMap()));
	}
}
 
開發者ID:jeci-sarl,項目名稱:alfresco-object-storage-connectors,代碼行數:11,代碼來源:ObjectStorageContentStore.java

示例2: onApplicationEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
public void onApplicationEvent(ApplicationEvent event)
{
    // Once the context has been refreshed, we tell other interested beans about the existence of this content store
    // (e.g. for monitoring purposes)
    if (event instanceof ContextRefreshedEvent && event.getSource() == this.applicationContext)
    {
        publishEvent(((ContextRefreshedEvent) event).getApplicationContext(), Collections.<String, Serializable> emptyMap());
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:10,代碼來源:FileContentStore.java

示例3: multicastEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
@Override
public void multicastEvent(ApplicationEvent event)
{
    if (event instanceof ContextRefreshedEvent && event.getSource() == this.appContext)
    {
        this.isApplicationStarted = true;
        for (ApplicationEvent queuedEvent : this.queuedEvents)
        {
            multicastEventInternal(queuedEvent);
        }
        this.queuedEvents.clear();
        multicastEventInternal(event);
    }
    else if (event instanceof ContextClosedEvent && event.getSource() == this.appContext)
    {
        this.isApplicationStarted = false;
        multicastEventInternal(event);
    }
    else if (this.isApplicationStarted)
    {
        multicastEventInternal(event);
    }
    else
    {
        this.queuedEvents.add(event);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:28,代碼來源:SafeApplicationEventMulticaster.java

示例4: onApplicationEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
@Override
public void onApplicationEvent(ApplicationEvent event) {
    if (event instanceof AbstractAuthenticationFailureEvent) {
        if (event.getSource() instanceof AbstractAuthenticationToken) {
            AbstractAuthenticationToken token = (AbstractAuthenticationToken) event.getSource();
            Object details = token.getDetails();
            if (details instanceof WebAuthenticationDetails) {
                LOG.info("Login failed from [" + ((WebAuthenticationDetails) details).getRemoteAddress() + "]");
            }
        }
    }

}
 
開發者ID:airsonic,項目名稱:airsonic,代碼行數:14,代碼來源:LoginFailureListener.java

示例5: onApplicationEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public void onApplicationEvent(ApplicationEvent event)
{
    if (this.autoStart && event instanceof ContextRefreshedEvent && event.getSource() == this.parent)
    {
        this.lock.writeLock().lock();
        try
        {
            start(false, false);
        }
        catch (Exception e)
        {
            // Let's log and swallow auto-start exceptions so that they are non-fatal. This means that the system
            // can hopefully be brought up to a level where its configuration can be edited and corrected
            logger.error("Error auto-starting subsystem", e);
        }
        finally
        {
            this.lock.writeLock().unlock();
        }
    }
    else if (event instanceof PropertyBackedBeanStartedEvent)
    {
        this.lock.writeLock().lock();
        try
        {
            // If we aren't started, reinitialize so that we pick up state changes from the database
            switch (this.runtimeState)
            {
            case PENDING_BROADCAST_START:
            case STOPPED:
                destroy(false);
                // fall through
            case UNINITIALIZED:
                start(false, false);                
            }
        }
        finally
        {
            this.lock.writeLock().unlock();                
        }
    }
    else if (event instanceof PropertyBackedBeanStoppedEvent)
    {
        this.lock.writeLock().lock();
        try
        {
            // Completely destroy the state so that it will have to be reinitialized should the bean be put back in
            // to use by this node
            destroy(false);
        }
        finally
        {
            this.lock.writeLock().unlock();
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:60,代碼來源:AbstractPropertyBackedBean.java

示例6: onApplicationEvent

import org.springframework.context.ApplicationEvent; //導入方法依賴的package包/類
@Override
public void onApplicationEvent(ApplicationEvent event) {
	if (event.getSource() == this.source) {
		onApplicationEventInternal(event);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:SourceFilteringListener.java


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