Java 类org.apache.camel.Properties 实例源码

项目:openex-worker    文件:OpenexRouter.java   
@SuppressWarnings("unused")
public String forward(String body,
                      @Headers Map<String, Object> headers,
                      @Properties Map<String, Object> properties,
                      @Header(Exchange.SLIP_ENDPOINT) String previous) {

    if (previous == null) {
        Object routing = headers.get("router-header");
        return routing != null ? ("direct:" + routing) : null;
    }

    // no more so return null
    return null;
}
项目:Camel    文件:DynamicRouterConvertBodyToIssueTest.java   
public String slip(String body, @Properties Map<String, Object> properties) {
    log.info("slip " + properties.get("EXIT"));
    if (properties.get("EXIT") != null && properties.get("EXIT").equals("PLEASE")) {
        log.info("Exiting after " + MAX_ITERATIONS + " iterations");
        return null;
    } else {
        return "direct:while_body";
    }
}
项目:Camel    文件:DynamicRouterExchangePropertiesTest.java   
/**
 * Use this method to compute dynamic where we should route next.
 *
 * @param body the message body
 * @param properties the exchange properties where we can store state between invocations
 * @return endpoints to go, or <tt>null</tt> to indicate the end
 */
public String slip(String body, @Properties Map<String, Object> properties) {
    bodies.add(body);

    // get the state from the exchange properties and keep track how many times
    // we have been invoked
    int invoked = 0;
    Object current = properties.get("invoked");
    if (current != null) {
        invoked = Integer.valueOf(current.toString());
    }
    invoked++;
    // and store the state back on the properties
    properties.put("invoked", invoked);

    if (invoked == 1) {
        return "mock:a";
    } else if (invoked == 2) {
        return "mock:b,mock:c";
    } else if (invoked == 3) {
        return "direct:foo";
    } else if (invoked == 4) {
        return "mock:result";
    }

    // no more so return null
    return null;
}
项目:Camel    文件:BeanWithPropertiesAndHeadersAndBodyInjectionTest.java   
public void myMethod(@Properties Map<?, ?> foo, @Headers Map<?, ?> bar, @Body String body) {
    this.foo = foo;
    this.bar = bar;
    this.body = body;

    assertNotNull(toString());
}
项目:boundary-event-sdk    文件:ServiceCheckRouter.java   
public String routeServiceTest(
        @Header("serviceTestName") String serviceTestName,
        @Properties Map<String, Object> properties) {
    String endPoint = null;
    int invoked = 0;

    // property will be null on first call
    Object current = properties.get("invoked");
    if (current != null) {
        invoked = Integer.valueOf(current.toString());
    }

    if (invoked == 0) {

        switch (serviceTestName) {
        case "ping":
            endPoint = "seda:ping-check";
            break;
        case "port":
            endPoint = "seda:port-check";
            break;
        default:
            assert false;
        }
    }
    invoked++;
    properties.put("invoked", invoked);

    return endPoint;
}
项目:Camel    文件:BeanWithPropertiesAndHeadersInjectionTest.java   
public void myMethod(@Properties Map<?, ?> foo, @Headers Map<?, ?> bar) {
    this.foo = foo;
    this.bar = bar;
    LOG.info("myMethod() method called on " + this);
}
项目:cleverbus    文件:MessageService.java   
/**
 * Changes state of the message to {@link MsgStateEnum#OK}.
 * <p/>
 * If message is child message then method checks if all child messages of the parent message aren't processed.
 *
 * @param msg the message
 * @param props the exchange properties [property name; property value]
 */
void setStateOk(@Header(MSG_HEADER) Message msg, @Properties Map<String, Object> props);
项目:cleverbus    文件:MessageService.java   
/**
 * Changes state of the message to {@link MsgStateEnum#PARTLY_FAILED}.
 *
 * @param msg the message
 * @param ex the exception
 * @param errCode the error code that can be explicitly defined if needed
 * @param customData the custom data
 * @param props the exchange properties [property name; property value]
 */
void setStatePartlyFailed(@Header(MSG_HEADER) Message msg,
                          Exception ex,
                          @Property(EXCEPTION_ERROR_CODE) @Nullable ErrorExtEnum errCode,
                          @Property(CUSTOM_DATA_PROP) @Nullable String customData,
                          @Properties Map<String, Object> props);
项目:cleverbus    文件:MessageService.java   
/**
 * Changes state of the message to {@link MsgStateEnum#FAILED}.
 * <p/>
 * If message is child message then parent message will be marked as failed too.
 *
 * @param msg the message
 * @param ex the exception
 * @param errCode the error code that can be explicitly defined if needed
 * @param customData the custom data
 * @param props the exchange properties [property name; property value]
 */
void setStateFailed(@Header(MSG_HEADER) Message msg,
                    Exception ex,
                    @Property(EXCEPTION_ERROR_CODE) @Nullable ErrorExtEnum errCode,
                    @Property(CUSTOM_DATA_PROP) @Nullable String customData,
                    @Properties Map<String, Object> props);