Brooklyn

brooklyn.event.feed
[Java] Class AttributePollHandler

java.lang.Object
  brooklyn.event.feed.AttributePollHandler
All Implemented Interfaces:
PollHandler

public class AttributePollHandler

Handler for when polling an entity's attribute. On each poll result the entity's attribute is set. Calls to onSuccess and onError will happen sequentially, but may be called from different threads each time. Note that no guarantees of a synchronized block exist, so additional synchronization would be required for the Java memory model's "happens before" relationship.

Authors:
aled


Field Summary
static Logger log

 
Constructor Summary
AttributePollHandler(FeedConfig config, EntityLocal entity, AbstractFeed feed)

 
Method Summary
protected boolean hasErrorHandler()

void onError(java.lang.Exception error)

void onSuccess(java.lang.Object val)

protected java.lang.Object transformError(java.lang.Exception error)

Does post-processing on a poll error, to convert it to the attribute's new value.

protected java.lang.Object transformValue(java.lang.Object val)

Does post-processing on the result of the actual poll, to convert it to the attribute's new value.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

log

public static final Logger log


 
Constructor Detail

AttributePollHandler

public AttributePollHandler(FeedConfig config, EntityLocal entity, AbstractFeed feed)


 
Method Detail

hasErrorHandler

protected boolean hasErrorHandler()


onError

@Override
public void onError(java.lang.Exception error)


onSuccess

@Override
public void onSuccess(java.lang.Object val)


transformError

protected java.lang.Object transformError(java.lang.Exception error)
Does post-processing on a poll error, to convert it to the attribute's new value. Or returns PollConfig.UNSET if the post-processing indicates that the attribute should not be changed.


transformValue

protected java.lang.Object transformValue(java.lang.Object val)
Does post-processing on the result of the actual poll, to convert it to the attribute's new value. Or returns PollConfig.UNSET if the post-processing indicates that the attribute should not be changed.


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.