本文整理匯總了Java中org.apache.camel.impl.DefaultEndpoint類的典型用法代碼示例。如果您正苦於以下問題:Java DefaultEndpoint類的具體用法?Java DefaultEndpoint怎麽用?Java DefaultEndpoint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DefaultEndpoint類屬於org.apache.camel.impl包,在下文中一共展示了DefaultEndpoint類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createEndpoint
import org.apache.camel.impl.DefaultEndpoint; //導入依賴的package包/類
@Override
protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception {
final String value = String.class.cast(parameters.remove("value"));
return new DefaultEndpoint() {
@Override
protected String createEndpointUri() {
return uri;
}
@Override
public Producer createProducer() throws Exception {
return new DefaultProducer(this) {
@Override
public void process(final Exchange exchange) throws Exception {
exchange.getIn().setBody(exchange.getIn().getBody(String.class) + value);
}
};
}
@Override
public Consumer createConsumer(final Processor processor) throws Exception {
throw new UnsupportedOperationException();
}
@Override
public boolean isSingleton() {
return true;
}
};
}
示例2: HazelcastInstanceConsumer
import org.apache.camel.impl.DefaultEndpoint; //導入依賴的package包/類
public HazelcastInstanceConsumer(HazelcastInstance hazelcastInstance, DefaultEndpoint endpoint, Processor processor) {
super(endpoint, processor);
hazelcastInstance.getCluster().addMembershipListener(new HazelcastMembershipListener());
}