public class BroadleafSystemEvent extends BroadleafApplicationEvent
A BroadleafApplicationEvent used so that we can communicate with the ScheduledJobsAndEvents module without having a dependency on it. By publishing a Spring Event with this detail, the ScheduledJobsAndEvents module will listen for this event and create a corresponding com.broadleafcommerce.jobsevents.domain.SystemEvent to be consumed.
To send an event, inject the ApplicationContext and publish the event:
@Autowired
private ApplicationContext appCtx;
...
appCtx.publishEvent(new BroadleafSystemEvent("CONSUMER_TYPE", BroadleafEventScopeType.VM, BroadleafEventWorkerType.SITE, true);
ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent),
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
BroadleafSystemEvent.BroadleafEventScopeType
Constant for how the event should be consumed
|
static class |
BroadleafSystemEvent.BroadleafEventWorkerType
Which type of worker is qualified to handle the event
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,BroadleafSystemEventDetail> |
detailMap |
protected BroadleafSystemEvent.BroadleafEventScopeType |
scopeType |
protected String |
type |
protected boolean |
universal |
protected BroadleafSystemEvent.BroadleafEventWorkerType |
workerType |
contextsource| Constructor and Description |
|---|
BroadleafSystemEvent(String type,
BroadleafSystemEvent.BroadleafEventScopeType scopeType,
BroadleafSystemEvent.BroadleafEventWorkerType workerType,
boolean universal) |
BroadleafSystemEvent(String type,
Map<String,BroadleafSystemEventDetail> detailMap,
BroadleafSystemEvent.BroadleafEventScopeType scopeType,
BroadleafSystemEvent.BroadleafEventWorkerType workerType,
boolean universal) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,BroadleafSystemEventDetail> |
getDetailMap() |
BroadleafSystemEvent.BroadleafEventScopeType |
getScopeType() |
String |
getType() |
BroadleafSystemEvent.BroadleafEventWorkerType |
getWorkerType() |
boolean |
isUniversal()
If this event is constructed the exact same way with the exact same data, we can gain
a performance increase by combining multiple events into 1.
|
void |
setDetailMap(Map<String,BroadleafSystemEventDetail> detailMap) |
void |
setScopeType(BroadleafSystemEvent.BroadleafEventScopeType scopeType) |
void |
setType(String type) |
void |
setUniversal(boolean universal) |
void |
setWorkerType(BroadleafSystemEvent.BroadleafEventWorkerType workerType) |
getConextgetSource, toStringprotected Map<String,BroadleafSystemEventDetail> detailMap
protected String type
protected BroadleafSystemEvent.BroadleafEventScopeType scopeType
protected BroadleafSystemEvent.BroadleafEventWorkerType workerType
protected boolean universal
public BroadleafSystemEvent(String type, Map<String,BroadleafSystemEventDetail> detailMap, BroadleafSystemEvent.BroadleafEventScopeType scopeType, BroadleafSystemEvent.BroadleafEventWorkerType workerType, boolean universal)
type - should match the com.broadleafcommerce.jobsevents.service.SystemEventConsumer#getTypedetailMap - details passed to the event consumerscopeType - how the event should be consumedworkerType - what type of workers should consume ituniversal - used for a performance optimization when sending multiple events at the same time, usually truepublic BroadleafSystemEvent(String type, BroadleafSystemEvent.BroadleafEventScopeType scopeType, BroadleafSystemEvent.BroadleafEventWorkerType workerType, boolean universal)
public Map<String,BroadleafSystemEventDetail> getDetailMap()
public void setDetailMap(Map<String,BroadleafSystemEventDetail> detailMap)
public String getType()
public void setType(String type)
public BroadleafSystemEvent.BroadleafEventScopeType getScopeType()
public void setScopeType(BroadleafSystemEvent.BroadleafEventScopeType scopeType)
public BroadleafSystemEvent.BroadleafEventWorkerType getWorkerType()
public void setWorkerType(BroadleafSystemEvent.BroadleafEventWorkerType workerType)
public boolean isUniversal()
public void setUniversal(boolean universal)
Copyright © 2019. All rights reserved.