本文整理汇总了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());
}