@Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("cool", cool);
   jndi.bind("agg", new UseLatestAggregationStrategy());
   return jndi;
 }
Ejemplo n.º 2
0
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndiRegistry = super.createRegistry();
   jndiRegistry.bind("instanceCookieHandler", new InstanceCookieHandler());
   jndiRegistry.bind("exchangeCookieHandler", new ExchangeCookieHandler());
   return jndiRegistry;
 }
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = new JndiRegistry(createJndiContext());

    registry.bind(
        "A",
        new Processor() {
          public void process(Exchange exchange) throws Exception {
            log.info("A headers " + exchange.getIn().getHeaders());
          }
        });

    registry.bind(
        "B",
        new Processor() {
          public void process(Exchange exchange) throws Exception {
            log.info("B headers " + exchange.getIn().getHeaders());

            if ("ExchangeTimedOutException".equals(exchange.getIn().getBody(String.class))) {
              throw new ExchangeTimedOutException(exchange, 1);
            } else if ("Exception".equals(exchange.getIn().getBody(String.class))) {
              throw new Exception();
            }
          }
        });

    registry.bind(
        "C",
        new Processor() {
          public void process(Exchange exchange) throws Exception {
            log.info("C headers " + exchange.getIn().getHeaders());
          }
        });

    return registry;
  }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("foo", new MyFooBean());
   jndi.bind("bar", new MyBarBean());
   return jndi;
 }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("myCustomDecoder", MyCustomCodec.createMyCustomDecoder());
   jndi.bind("myCustomDecoder2", MyCustomCodec.createMyCustomDecoder2());
   jndi.bind("myCustomEncoder", MyCustomCodec.createMyCustomEncoder());
   return jndi;
 }
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();

    HL7MLLPCodec codec = new HL7MLLPCodec();
    codec.setCharset("iso-8859-1");

    jndi.bind("hl7codec", codec);

    return jndi;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = new JndiRegistry(createJndiContext());

    // Wire the inner context & dispatchStrategy to the outer camelContext where the routebox is
    // declared
    registry.bind("ctx", createInnerContext());
    registry.bind("strategy", new SimpleRouteDispatchStrategy());
    return registry;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    redisTemplate = new RedisTemplate();
    redisTemplate.setConnectionFactory(CONNECTION_FACTORY);
    redisTemplate.afterPropertiesSet();

    registry.bind("redisTemplate", redisTemplate);
    return registry;
  }
  private CamelContext createInnerContext() throws Exception {
    // Create a camel context to be encapsulated by the routebox
    JndiRegistry innerRegistry = new JndiRegistry(createJndiContext());
    BookCatalog catalogBean = new BookCatalog();
    innerRegistry.bind("library", catalogBean);

    CamelContext innerContext = new DefaultCamelContext(innerRegistry);
    innerContext.addRoutes(new SimpleRouteBuilder());

    return innerContext;
  }
Ejemplo n.º 10
0
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    StringEncoder stringEncoder = new StringEncoder();

    StringDecoder stringDecoder = new StringDecoder();

    registry.bind("encoder", stringEncoder);
    registry.bind("decoder", stringDecoder);
    return registry;
  }
Ejemplo n.º 11
0
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();

    Properties prop = new Properties();
    prop.setProperty("port", "" + getPort());
    jndi.bind("prop", prop);

    if (isHttps()) {
      addSslContextParametersToRegistry(jndi);
    }

    return jndi;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();

    // this is the database we create with some initial data for our unit test
    db =
        new EmbeddedDatabaseBuilder()
            .setType(EmbeddedDatabaseType.DERBY)
            .addScript("sql/createAndPopulateDatabase.sql")
            .build();

    jndi.bind("dataSource", db);

    return jndi;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    final JndiRegistry reg = super.createRegistry();

    txMgr = new FcrepoTransactionManager();
    txMgr.setBaseUrl(FcrepoTestUtils.getFcrepoBaseUrl());
    reg.bind("txManager", txMgr);

    final SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
    txPolicy.setTransactionManager(txMgr);
    txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
    reg.bind("required", txPolicy);

    return reg;
  }
Ejemplo n.º 14
0
  protected void addSslContextParametersToRegistry(JndiRegistry registry) {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").toString());
    ksp.setPassword(KEY_STORE_PASSWORD);

    KeyManagersParameters kmp = new KeyManagersParameters();
    kmp.setKeyPassword(KEY_STORE_PASSWORD);
    kmp.setKeyStore(ksp);

    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);

    // NOTE: Needed since the client uses a loose trust configuration when no ssl context
    // is provided.  We turn on WANT client-auth to prefer using authentication
    SSLContextServerParameters scsp = new SSLContextServerParameters();
    scsp.setClientAuthentication(ClientAuthentication.WANT.name());

    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setKeyManagers(kmp);
    sslContextParameters.setTrustManagers(tmp);
    sslContextParameters.setServerParameters(scsp);
    // use SSLv3 to avoid issue with (eg disable TLS)
    // Caused by: javax.net.ssl.SSLException: bad record MAC
    sslContextParameters.setSecureSocketProtocol("SSLv3");

    registry.bind("sslContextParameters", sslContextParameters);
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();

    Properties cool = new Properties();
    cool.put("cool.end", "mock:end");
    cool.put("cool.result", "mock:result");
    cool.put("start", "direct:start");
    jndi.bind("myCoolProperties", cool);

    Properties bar = new Properties();
    bar.put("bar.end", "mock:bar");
    bar.put("dude", "direct:bar");
    jndi.bind("coolBar", bar);

    return jndi;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {

    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource(this.getClass().getClassLoader().getResource("keystore.jks").toString());
    ksp.setPassword("changeit");

    KeyManagersParameters kmp = new KeyManagersParameters();
    kmp.setKeyPassword("changeit");
    kmp.setKeyStore(ksp);

    TrustManagersParameters tmp = new TrustManagersParameters();
    tmp.setKeyStore(ksp);

    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setKeyManagers(kmp);
    sslContextParameters.setTrustManagers(tmp);

    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
  }
  @Override
  protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();

    // lets create our black box as a camel context and a set of routes
    DefaultCamelContext blackBox = new DefaultCamelContext(registry);
    blackBox.setName("blackBox");
    blackBox.addRoutes(
        new RouteBuilder() {
          @Override
          public void configure() throws Exception {
            // receive purchase orders, lets process it in some way then
            // send an invoice to our invoice endpoint
            from("direct:purchaseOrder")
                .setHeader("received")
                .constant("true")
                .to("direct:invoice");
          }
        });
    blackBox.start();

    registry.bind("accounts", blackBox);
    return registry;
  }
Ejemplo n.º 18
0
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("drinkRouter", driverRouter);
   jndi.bind("orderSplitter", new OrderSplitter());
   jndi.bind("barista", new Barista());
   jndi.bind("waiter", waiter);
   jndi.bind("aggregatorStrategy", new CafeAggregationStrategy());
   return jndi;
 }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("myProp", myProp);
   return jndi;
 }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("dummy-test", new DummyRestConsumerFactory());
   return jndi;
 }
Ejemplo n.º 21
0
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("myCodec", new MyCodec());
   return jndi;
 }
Ejemplo n.º 22
0
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("generator", new MyFileNameGenerator());
   return jndi;
 }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("orderService", new OrderService());
   return jndi;
 }
 @Override
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("myRetryBean", new MyRetryBean());
   return jndi;
 }
 protected JndiRegistry createRegistry() throws Exception {
   JndiRegistry jndi = super.createRegistry();
   jndi.bind("error", new GenerateError());
   return jndi;
 }