public DefaultTransactionFactory(@Inject RuntimeProperties properties, @Inject JdbcEventLogger jdbcEventLogger) { this.externalTransactions = properties.getBoolean(Constants.SERVER_EXTERNAL_TX_PROPERTY, false); this.jdbcEventLogger = jdbcEventLogger; }
public ObjectStore createObjectStore(DataRowStore dataRowCache) { boolean sync = runtimeProperties.getBoolean(Constants.SERVER_CONTEXTS_SYNC_PROPERTY, true); return sync ? new ObjectStore(dataRowCache, retainStrategy.createObjectMap()) : new NoSyncObjectStore(dataRowCache, retainStrategy.createObjectMap()); } }
@Override protected HttpClient initJettyHttpClient() { try { HttpClientTransportOverHTTP2 http2 = new HttpClientTransportOverHTTP2(new HTTP2Client()); boolean useALPN = runtimeProperties.getBoolean(ClientConstants.ROP_SERVICE_USE_ALPN_PROPERTY, false); http2.setUseALPN(useALPN); HttpClient httpClient = new HttpClient(http2, new SslContextFactory()); httpClient.start(); return httpClient; } catch (Exception e) { throw new CayenneRuntimeException("Exception while starting Jetty HttpClient over HTTP/2.", e); } }
/** * Creates new JdbcAdapter with a set of default parameters. */ public JdbcAdapter(@Inject RuntimeProperties runtimeProperties, @Inject(Constants.SERVER_DEFAULT_TYPES_LIST) List<ExtendedType> defaultExtendedTypes, @Inject(Constants.SERVER_USER_TYPES_LIST) List<ExtendedType> userExtendedTypes, @Inject(Constants.SERVER_TYPE_FACTORIES_LIST) List<ExtendedTypeFactory> extendedTypeFactories, @Inject(Constants.SERVER_RESOURCE_LOCATOR) ResourceLocator resourceLocator, @Inject ValueObjectTypeRegistry valueObjectTypeRegistry) { // init defaults this.setSupportsBatchUpdates(false); this.setSupportsUniqueConstraints(true); this.caseInsensitiveCollations = runtimeProperties.getBoolean(Constants.CI_PROPERTY, false); this.resourceLocator = resourceLocator; this.pkGenerator = createPkGenerator(); this.quotingStrategy = createQuotingStrategy(); this.ejbqlTranslatorFactory = createEJBQLTranslatorFactory(); this.typesHandler = TypesHandler.getHandler(findResource("/types.xml")); this.extendedTypes = new ExtendedTypeMap(); initExtendedTypes(defaultExtendedTypes, userExtendedTypes, extendedTypeFactories, valueObjectTypeRegistry); }