Java Code Examples for org.apache.camel.spi.Registry#lookupByNameAndType()

The following examples show how to use org.apache.camel.spi.Registry#lookupByNameAndType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MicroProfileHealthResource.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
@Path("/checks/failing/{enabled}")
@GET
public void toggleFailingHealthCheck(@PathParam("enabled") boolean enabled) {
    Registry registry = camelContext.getRegistry();
    FailingHealthCheck failingHealthCheck = registry.lookupByNameAndType(FailingHealthCheck.class.getSimpleName(),
            FailingHealthCheck.class);
    failingHealthCheck.getConfiguration().setEnabled(enabled);
}
 
Example 2
Source File: OrderDAO.java    From camelinaction2 with Apache License 2.0 5 votes vote down vote up
public void insertOrder(InputOrder order, Registry registry) {
    DataSource ds = registry.lookupByNameAndType("myDataSource", DataSource.class);
    JdbcTemplate jdbc = new JdbcTemplate(ds);

    Object[] args = new Object[] { order.getCustomerId(), order.getRefNo(), order.getPartId(), order.getAmount()};
    jdbc.update("insert into riders_order (customer_id, ref_no, part_id, amount) values (?, ?, ?, ?)", args);
}
 
Example 3
Source File: OrderDAO.java    From camelinaction with Apache License 2.0 5 votes vote down vote up
public void insertOrder(InputOrder order, Registry registry) {
    DataSource ds = registry.lookupByNameAndType("myDataSource", DataSource.class);
    JdbcTemplate jdbc = new JdbcTemplate(ds);

    Object[] args = new Object[] { order.getCustomerId(), order.getRefNo(), order.getPartId(), order.getAmount()};
    jdbc.update("insert into riders_order (customer_id, ref_no, part_id, amount) values (?, ?, ?, ?)", args);
}