public class DroolsNorthbounder extends AbstractNorthbounder implements org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
protected static String |
NBI_NAME
The Constant NBI_NAME.
|
Constructor and Description |
---|
DroolsNorthbounder(org.springframework.context.ApplicationContext context,
DroolsNorthbounderConfigDao configDao,
EventProxy eventProxy,
String engineName)
Instantiates a new Drools northbounder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(NorthboundAlarm alarm)
The abstraction makes a call here to determine if the alarm should be placed on the queue of alarms to be sent northerly.
|
void |
afterPropertiesSet() |
void |
forwardAlarms(List<NorthboundAlarm> alarms)
Each implementation of the AbstractNorthbounder has a nice queue (Nagle's algorithmic) and the worker thread that processes the queue
calls this method to send alarms to the northern NMS.
|
protected DroolsNorthbounderConfig |
getConfig()
Gets the configuration.
|
org.kie.api.runtime.KieSession |
getKieSession()
Gets the kie session.
|
Collection<? extends Object> |
getKieSessionObjects()
Gets the kie session objects.
|
boolean |
isReady()
Used to determine if the northbounder is ready to accept alarms.
|
protected void |
onStop()
Override this to perform actions when stopping.
|
void |
sendEvent(Event event)
Send event.
|
createMapping, createSyncLostMessage, discard, getName, onAlarm, onPostStart, onPreStart, preserve, reloadConfig, run, setMaxBatchSize, setMaxPreservedAlarms, setNaglesDelay, setRetryInterval, start, stop
protected static final String NBI_NAME
public DroolsNorthbounder(org.springframework.context.ApplicationContext context, DroolsNorthbounderConfigDao configDao, EventProxy eventProxy, String engineName)
configDao
- the configuration DAOengineName
- the engine namepublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected void onStop()
AbstractNorthbounder
onStop
in class AbstractNorthbounder
public boolean accepts(NorthboundAlarm alarm)
accepts
in class AbstractNorthbounder
alarm
- the alarmpublic void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException
forwardAlarms
in class AbstractNorthbounder
alarms
- the alarmsNorthbounderException
- the northbounder exceptionpublic Collection<? extends Object> getKieSessionObjects()
public org.kie.api.runtime.KieSession getKieSession()
public void sendEvent(Event event)
event
- the eventprotected DroolsNorthbounderConfig getConfig()
public boolean isReady()
Northbounder
NorthboundAlarm
s.
This method is called once after northbounder is registered and started.
If the status were to change sometime after, the northbounder must re-register itself.isReady
in interface Northbounder
true
if the northbounder is ready to accept alarms, false
otherwise.Copyright © 2020. All rights reserved.