本文整理匯總了Java中io.ebean.plugin.SpiServer類的典型用法代碼示例。如果您正苦於以下問題:Java SpiServer類的具體用法?Java SpiServer怎麽用?Java SpiServer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SpiServer類屬於io.ebean.plugin包,在下文中一共展示了SpiServer類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createMappingJson
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
@Test
public void createMappingJson() throws Exception {
// we don't need the docstore active to run this test
System.setProperty("ebean.docstore.active","false");
EIndexMappingsBuilder mappingsBuilder = new EIndexMappingsBuilder(new JsonFactory());
SpiServer server = Ebean.getDefaultServer().getPluginApi();
BeanType<Country> countryType = server.getBeanType(Country.class);
String mappingJson = mappingsBuilder.createMappingJson(countryType);
assertEquals(mappingJson, "{\n" +
" \"mappings\" : {\n" +
" \"country\" : {\n" +
" \"properties\" : {\n" +
" \"name\": { \"type\": \"text\" }\n" +
" }\n" +
" }\n" +
" }\n" +
"}");
}
示例2: ElasticUpdateProcessor
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
public ElasticUpdateProcessor(SpiServer server, IndexQueueWriter queueWriter, JsonFactory jsonFactory,
Object defaultObjectMapper, IndexMessageSender messageSender, int defaultBatchSize) {
this.server = server;
this.queueWriter = queueWriter;
this.defaultBatchSize = defaultBatchSize;
this.bulkSender = new BulkSender(jsonFactory, JsonConfig.Include.NON_EMPTY, defaultObjectMapper, messageSender);
}
示例3: EIndexService
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
public EIndexService(SpiServer server, JsonFactory jsonFactory, IndexMessageSender sender) {
this.server = server;
this.jsonFactory = jsonFactory;
this.sender = sender;
this.config = server.getServerConfig().getDocStoreConfig();
this.mappingsBuilder = new EIndexMappingsBuilder(jsonFactory);
this.generateMapping = config.isGenerateMapping();
this.dropCreateIndexes = config.isDropCreate();
this.createIndexes = config.isCreate() || dropCreateIndexes;
}
示例4: EQueryService
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
public EQueryService(SpiServer server, JsonFactory jsonFactory, IndexMessageSender messageSender) {
this.server = server;
this.jsonContext = server.json();
this.send = new EQuerySend(jsonFactory, messageSender);
this.elasticJsonContext = new ElasticJsonContext(jsonContext);
}
示例5: ElasticDocumentStore
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
ElasticDocumentStore(SpiServer server, ElasticUpdateProcessor updateProcessor, IndexMessageSender sender, JsonFactory jsonFactory) {
this.server = server;
this.updateProcessor = updateProcessor;
this.queryService = new EQueryService(server, jsonFactory, sender);
this.indexService = new EIndexService(server, jsonFactory, sender);
}
示例6: process
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
public static <T> long process(SpiServer server, BeanType<T> desc, UpdateGroup group, BulkUpdate txn) throws IOException {
return new ProcessGroup<>(server, desc, group, txn).processGroup();
}
示例7: ProcessGroup
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
private ProcessGroup(SpiServer server, BeanType<T> desc, UpdateGroup group, BulkUpdate txn) {
this.server = server;
this.desc = desc;
this.group = group;
this.txn = txn;
}
示例8: create
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
@Override
public DocStoreIntegration create(SpiServer server) {
ServerConfig serverConfig = server.getServerConfig();
Object objectMapper = serverConfig.getObjectMapper();
DocStoreConfig docStoreConfig = serverConfig.getDocStoreConfig();
JsonFactory jsonFactory = new JsonFactory();
IndexQueueWriter indexQueueWriter = new BaseIndexQueueWriter(server, "eb_elastic_queue");
IndexMessageSender messageSender = new BaseHttpMessageSender(docStoreConfig);
ElasticUpdateProcessor updateProcessor = new ElasticUpdateProcessor(server, indexQueueWriter, jsonFactory, objectMapper, messageSender, docStoreConfig.getBulkBatchSize());
ElasticDocumentStore docStore = new ElasticDocumentStore(server, updateProcessor, messageSender, jsonFactory);
return new Components(updateProcessor, docStore);
}
示例9: getPluginApi
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
@Override
public SpiServer getPluginApi() {
return null;
}
示例10: getPluginApi
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
@Override
public SpiServer getPluginApi() {
methodCalls.add(MethodCall.of("getPluginApi"));
return delegate.getPluginApi();
}
示例11: configure
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
@Override
public void configure(SpiServer server) {
}
示例12: createDdlWriter
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
/**
* <p>createDdlWriter.</p>
*
* @return a {@link ameba.db.ebean.migration.PlatformDdlWriter} object.
*/
protected PlatformDdlWriter createDdlWriter() {
return new PlatformDdlWriter(scriptInfo, (SpiServer) server);
}
示例13: PlatformDdlWriter
import io.ebean.plugin.SpiServer; //導入依賴的package包/類
/**
* <p>Constructor for PlatformDdlWriter.</p>
*
* @param scriptInfo a {@link ameba.db.migration.models.ScriptInfo} object.
* @param server a {@link io.ebean.plugin.SpiServer} object.
*/
public PlatformDdlWriter(ScriptInfo scriptInfo, SpiServer server) {
this.scriptInfo = scriptInfo;
this.server = server;
this.platformDdl = PlatformDdlBuilder.create(server.getDatabasePlatform());
}