本文整理汇总了Java中org.xwiki.observation.event.Event类的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Event类属于org.xwiki.observation.event包,在下文中一共展示了Event类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEvents
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public List<Event> getEvents() {
return Arrays.<Event>asList(
new ApplicationStartedEvent(),
new ApplicationStoppedEvent()
);
}
示例2: onEvent
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public void onEvent(Event event, Object o, Object o2) {
// don't do anything, just injecting the service.
if (event instanceof ApplicationStoppedEvent) {
service.stop();
}
}
示例3: FutureManager
import org.xwiki.observation.event.Event; //导入依赖的package包/类
/**
* @param name The name of this future manager. Used to register it as an Event Listener
* @param removalEvent The event that the future manger listens for. Causes the removal of a future from the
* manager.
*/
public FutureManager(String name, Event removalEvent)
{
this.name = name;
this.futures = new HashMap<>();
this.removalEvent = removalEvent;
}
示例4: onEvent
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public void onEvent(Event event, Object source, Object data)
{
XWikiDocument doc = (XWikiDocument) source;
String patientId = doc.getDocumentReference().getName();
List<PatientMatch> matchesForPatient = this.matchStorageManager.loadMatchesByReferencePatientId(patientId);
Session session = this.matchStorageManager.beginNotificationMarkingTransaction();
this.matchStorageManager.deleteMatches(session, matchesForPatient);
boolean successful = this.matchStorageManager.endNotificationMarkingTransaction(session);
if (!successful) {
this.logger.error("Error while deleting matches for patient ID ", patientId);
}
}
示例5: getEvents
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public List<Event> getEvents()
{
return Collections.<Event>singletonList(this.removalEvent);
}
示例6: onEvent
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public void onEvent(Event event, Object source, Object data)
{
this.futures.remove(((VCFEvent) event).getPatient().getId());
}
示例7: getEvents
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public List<Event> getEvents()
{
return Collections.<Event>singletonList(new ApplicationStartedEvent());
}
示例8: onEvent
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public void onEvent(Event event, Object source, Object data)
{
Configuration configuration = this.sessionFactory.getConfiguration();
configuration.addAnnotatedClass(DefaultPatientMatch.class);
}
示例9: onEvent
import org.xwiki.observation.event.Event; //导入依赖的package包/类
@Override
public void onEvent(Event event, Object source, Object data)
{
this.sessionFactory.getConfiguration().addAnnotatedClass(Connection.class);
}