Package com.impetus.kundera.loader

Examples of com.impetus.kundera.loader.ClientFactory


    public void test()
    {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory(persistenceUnit);
        ClientResolver.getClientFactory(persistenceUnit, null,
                ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance());
        ClientFactory clientFactory = ClientResolver.getClientFactory(persistenceUnit);
        Assert.assertNotNull(clientFactory);
        Assert.assertTrue(clientFactory.getClass().isAssignableFrom(CoreTestClientFactory.class));
    }
View Full Code Here


        Map<String, Object> externalProperties = KunderaCoreUtils.getExternalProperties(persistenceUnit,
                externalPropertyMap, persistenceUnits);
        if (getSchemaProperty(persistenceUnit, externalProperties) != null
                && !getSchemaProperty(persistenceUnit, externalProperties).isEmpty())
        {
            ClientFactory clientFactory = ClientResolver.getClientFactory(persistenceUnit);
            schemaManager = clientFactory != null ? clientFactory.getSchemaManager(externalProperties) : null;
        }
        return schemaManager;
    }
View Full Code Here

    @Test
    public void testConnection()
    {
        logger.info("On test connection");

        ClientFactory clientFactory = ClientResolver.getClientFactory(persistenceUnit);
        Assert.assertNotNull(clientFactory);
        Assert.assertEquals(Neo4JClientFactory.class, clientFactory.getClass());
        Field connectionField;
        try
        {
            String field_name = "connectionPoolOrConnection";
            connectionField = ((Neo4JClientFactory) clientFactory).getClass().getSuperclass()
View Full Code Here

     * @param pu
     * @return
     */
    ClientFactory getClientFactory(final String pu)
    {
        ClientFactory clientFactory = clientFactories.get(pu);
        if (clientFactory != null)
        {
            return clientFactory;
        }
        logger.error("Client Factory Not Configured For Specified Client Type : ");
View Full Code Here

            log.info("Loading client factory for persistence unit " + pu);

            Map<String, Object> puProperty = KunderaCoreUtils.getExternalProperties(pu, mapExternalProperties,
                    persistenceUnits);

            ClientFactory clientFactory = ClientResolver.getClientFactory(pu, puProperty, kunderaMetadata);
            clientFactories.put(pu, clientFactory);
        }

        // configuring schema before loading client factories because during
        // initilazation schema nedds to be created.
View Full Code Here

     *            the persistence unit
     * @return the client factory
     */
    public static ClientFactory getClientFactory(String persistenceUnit, Map<String, Object> puProperties,final KunderaMetadata kunderaMetadata)
    {
        ClientFactory clientFactory = instantiateClientFactory(persistenceUnit, puProperties, kunderaMetadata);
        clientFactories.put(persistenceUnit, clientFactory);
        return clientFactory;
    }
View Full Code Here

     * @return new instance of clientFactory
     */
    private static ClientFactory instantiateClientFactory(String persistenceUnit, Map<String, Object> puProperties,
            final KunderaMetadata kunderaMetadata)
    {
        ClientFactory clientFactory = null;
        logger.info("Initializing client factory for: " + persistenceUnit);
        PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(persistenceUnit);
        String kunderaClientFactory = puProperties != null ? (String) puProperties
                .get(PersistenceProperties.KUNDERA_CLIENT_FACTORY) : null;
View Full Code Here

        return clientFactory;
    }

    public static ClientFactory getClientFactory(String pu)
    {
        ClientFactory clientFactory = clientFactories.get(pu);
        if (clientFactory != null)
        {
            return clientFactory;
        }
        logger.error("Client Factory Not Configured For Specified Client Type : ");
View Full Code Here

        if (logger.isInfoEnabled())
        {
            logger.info("Returning client instance for persistence unit {}.", persistenceUnit);
        }

        ClientFactory clientFactory = ((EntityManagerFactoryImpl) getEntityManagerFactory())
                .getClientFactory(persistenceUnit);
        if (clientFactory != null)
        {
            return clientFactory.getClientInstance();
        }
        throw new ClientResolverException("No client configured for persistence unit " + persistenceUnit + ".");
    }
View Full Code Here

    @Test
    public void testConnection()
    {
        logger.info("On test connection");

        ClientFactory clientFactory = ClientResolver.getClientFactory(REDIS_PU);
        Assert.assertNotNull(clientFactory);
        Assert.assertEquals(RedisClientFactory.class, clientFactory.getClass());
        Field connectionField;
        try
        {
            String field_name = "connectionPoolOrConnection";
           
View Full Code Here

TOP

Related Classes of com.impetus.kundera.loader.ClientFactory

Copyright © 2018 www.massapicom. 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.