Java Code Examples for org.apache.brooklyn.api.entity.EntityLocal#getId()

The following examples show how to use org.apache.brooklyn.api.entity.EntityLocal#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RebindExceptionHandlerImpl.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@Override
public void onAddPolicyFailed(EntityLocal entity, Policy policy, Exception e) {
    Exceptions.propagateIfFatal(e);
    String errmsg = "problem adding policy "+policy.getId()+" ("+policy+") to entity "+entity.getId()+" ("+entity+")";
    
    switch (addPolicyFailureMode) {
    case FAIL_FAST:
        throw new IllegalStateException("Rebind: aborting due to "+errmsg, e);
    case FAIL_AT_END:
        addPolicyFailures.add(new IllegalStateException(errmsg, e));
        break;
    case CONTINUE:
        warn(errmsg+"; continuing", e);
        break;
    default:
        throw new IllegalStateException("Unexpected state '"+addPolicyFailureMode+"' for addPolicyFailureMode");
    }
}
 
Example 2
Source File: RebindExceptionHandlerImpl.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@Override
public void onAddEnricherFailed(EntityLocal entity, Enricher enricher, Exception e) {
    Exceptions.propagateIfFatal(e);
    String errmsg = "problem adding enricher "+enricher.getId()+" ("+enricher+") to entity "+entity.getId()+" ("+entity+")";

    switch (addPolicyFailureMode) {
    case FAIL_FAST:
        throw new IllegalStateException("Rebind: aborting due to "+errmsg, e);
    case FAIL_AT_END:
        addPolicyFailures.add(new IllegalStateException(errmsg, e));
        break;
    case CONTINUE:
        warn(errmsg+"; continuing", e);
        break;
    default:
        throw new IllegalStateException("Unexpected state '"+addPolicyFailureMode+"' for addPolicyFailureMode");
    }
}
 
Example 3
Source File: RebindExceptionHandlerImpl.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@Override
public void onAddFeedFailed(EntityLocal entity, Feed feed, Exception e) {
    Exceptions.propagateIfFatal(e);
    String errmsg = "problem adding feed "+feed.getId()+" ("+feed+") to entity "+entity.getId()+" ("+entity+")";

    switch (addPolicyFailureMode) {
    case FAIL_FAST:
        throw new IllegalStateException("Rebind: aborting due to "+errmsg, e);
    case FAIL_AT_END:
        addPolicyFailures.add(new IllegalStateException(errmsg, e));
        break;
    case CONTINUE:
        warn(errmsg+"; continuing", e);
        break;
    default:
        throw new IllegalStateException("Unexpected state '"+addPolicyFailureMode+"' for addPolicyFailureMode");
    }
}