Examples of ConfigBuilder


Examples of com.github.jsr330.spi.config.builder.ConfigBuilder

   
    /**
     * Gets the {@link TypeConfig} by parsing the XML file. The correct sequence is ensured by the corresponding XSD file.
     */
    public TypeConfig getConfig(final ClassLoader loader) throws IOException, SAXException {
        final ConfigBuilder builder = new ConfigBuilder();
        XMLReader sax;
       
        if (source != null) {
            try {
                sax = XMLReaderFactory.createXMLReader();
                sax.setContentHandler(new ConfigHandler(loader, builder));
                sax.parse(new InputSource(source));
               
                return builder.build();
            } finally {
                try {
                    source.close();
                } catch (IOException exception) {
                    LOGGER.debug("error while closing reader.", exception);
View Full Code Here

Examples of com.github.jsr330.spi.config.builder.ConfigBuilder

     * Gets the type configs out of the json source.
     * A wrong sequence will lead to a {@link BinderException}.
     */
    public TypeConfig getConfig(ClassLoader loader) throws JsonProcessingException, IOException {
        JsonNode node;
        ConfigBuilder builder = new ConfigBuilder();
       
        if (source != null) {
            try {
                node = mapper.readTree(source);
                if (node.isArray()) {
                    for (int i = 0; i < node.size(); i++) {
                        parseConfig(loader, builder.get(), node.get(i));
                    }
                    return builder.build();
                }
            } finally {
                try {
                    source.close();
                } catch (IOException exception) {
View Full Code Here

Examples of com.hazelcast.config.ConfigBuilder

    /* (non-Javadoc)
     * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
     */
    public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
        // Gets/creates the hazelcast instance
        ConfigBuilder config = buildConfiguration();
        setHazelcast(Hazelcast.newHazelcastInstance(config.build()));
    }
View Full Code Here

Examples of de.mhus.lib.config.ConfigBuilder

    derTeschd(c, true);
  }
 
  public void testClone() throws Exception {
   
    ConfigBuilder builder = new ConfigBuilder();
   
    String xml = "<start test1='wow' test2='alf'><sub test1='wow1' test2='alf1'/><sub test1='wow2' test2='alf2'/><sub test1='wow3' test2='alf3'/></start>";
    Document doc = MXml.loadXml(xml);
   
    XmlConfig src = new XmlConfig(doc.getDocumentElement());

    HashConfig tar1 = new HashConfig();
    JsonConfig tar2 = new JsonConfig();
    XmlConfig  tar3 = new XmlConfig();
   
    builder.cloneConfig(src, tar1);
    builder.cloneConfig(src, tar2);
    builder.cloneConfig(src, tar3);
   
    derTeschd(src, true);
    derTeschd(tar1, true);
    derTeschd(tar2, true);
    derTeschd(tar3, true);
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.keysDAO = new KeysDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        new KeysDAORedisImpl(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructor_NullPool() {
        final Config config = new ConfigBuilder().build();
        new KeysDAORedisImpl(config, null);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

    public void testCall() {
        final Collection<String> queues = Arrays.asList("foo", "bar");
        final Map<String,Class<?>> jobTypes = new LinkedHashMap<String,Class<?>>(1);
        jobTypes.put("test", TestAction.class);
        final MapBasedJobFactory jobFactory = new MapBasedJobFactory(jobTypes);
        final WorkerImplFactory factory = new WorkerImplFactory(new ConfigBuilder().build(), queues, jobFactory);
        final WorkerImpl worker = factory.call();
        Assert.assertNotNull(worker);
        Assert.assertEquals(queues.size(), worker.getQueues().size());
        Assert.assertTrue(queues.containsAll(worker.getQueues()));
        Assert.assertEquals(jobFactory, worker.getJobFactory());
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.workerInfoDAO = new WorkerInfoDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        new WorkerInfoDAORedisImpl(null, null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testConstructor_NullPool() {
        final Config config = new ConfigBuilder().build();
        new WorkerInfoDAORedisImpl(config, null);
    }
View Full Code Here

Examples of net.greghaines.jesque.ConfigBuilder

        this.mockCtx = new JUnit4Mockery();
        this.mockCtx.setImposteriser(ClassImposteriser.INSTANCE);
        this.mockCtx.setThreadingPolicy(new Synchroniser());
        this.pool = this.mockCtx.mock(Pool.class);
        this.jedis = this.mockCtx.mock(Jedis.class);
        this.qInfoDAO = new QueueInfoDAORedisImpl(new ConfigBuilder().build(), this.pool);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.