Java 类org.apache.camel.impl.DefaultEndpoint 实例源码

项目:incubator-batchee    文件:TestComponent.java   
@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;
        }
    };
}
项目:Camel    文件:HazelcastInstanceConsumer.java   
public HazelcastInstanceConsumer(HazelcastInstance hazelcastInstance, DefaultEndpoint endpoint, Processor processor) {
    super(endpoint, processor);

    hazelcastInstance.getCluster().addMembershipListener(new HazelcastMembershipListener());
}