Advertisement
Guest User

TypeSafeEndpoints

a guest
Nov 16th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package camelinaction.typesafeProdCons;
  18.  
  19. import org.apache.camel.CamelContext;
  20. import org.apache.camel.builder.RouteBuilder;
  21. import org.apache.camel.impl.DefaultCamelContext;
  22.  
  23. public class TypeSafeEndpoints extends org.apache.camel.test.junit4.CamelTestSupport {
  24.  
  25. public static void main(String args[]) throws Exception {
  26. CamelContext context = new DefaultCamelContext();
  27.  
  28. context.addRoutes(new RouteBuilder() {
  29. public void configure() {
  30. from(new FileConsumerTemplate("data/inbox")
  31. .setNoop(true)
  32. .setRecursive(true)
  33. .get())
  34.  
  35. .log("going to copy file..")
  36. .to("file:data/outbox");
  37. }
  38. });
  39.  
  40. // start the route and let it do its work
  41. context.start();
  42. Thread.sleep(1000);
  43.  
  44. // stop the CamelContext
  45. context.stop();
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement