当前位置: 首页>>代码示例>>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;未经允许,请勿转载。