本文整理汇总了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());
}