本文整理汇总了Java中org.easyrec.plugin.container.PluginRegistry类的典型用法代码示例。如果您正苦于以下问题:Java PluginRegistry类的具体用法?Java PluginRegistry怎么用?Java PluginRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PluginRegistry类属于org.easyrec.plugin.container包,在下文中一共展示了PluginRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unmarshalConfiguration
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private static GeneratorConfiguration unmarshalConfiguration(String pluginIdAndVersion, String configurationString,
PluginRegistry pluginRegistry) {
try {
Generator<?, ?> generator =
Preconditions.checkNotNull(pluginRegistry.getGenerators().get(PluginId.parsePluginId(
pluginIdAndVersion)));
StringReader xmlRepresentation = new StringReader(configurationString);
StreamSource streamSource = new StreamSource(xmlRepresentation);
JAXBContext jaxbContext =
JAXBContext.newInstance(generator.getConfigurationClass(),
GeneratorConfigurationConstants.CONF_MARSHAL_FAILED.getClass(),
GeneratorConfigurationConstants.CONF_UNMARSHAL_FAILED.getClass());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<? extends GeneratorConfiguration> jaxbElement =
unmarshaller.unmarshal(streamSource, generator.getConfigurationClass());
return jaxbElement.getValue();
} catch (Exception e) {
logger.warn("Unable to unmarshal configuration");
return GeneratorConfigurationConstants.CONF_UNMARSHAL_FAILED;
}
}
示例2: unmarshalStatistics
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private static GeneratorStatistics unmarshalStatistics(String pluginIdAndVersion, String statisticsString,
PluginRegistry pluginRegistry) {
try {
Generator<?, ?> generator = Preconditions.checkNotNull(
pluginRegistry.getGenerators().get(PluginId.parsePluginId(pluginIdAndVersion)));
StringReader xmlRepresentation = new StringReader(statisticsString);
StreamSource streamSource = new StreamSource(xmlRepresentation);
JAXBContext jaxbContext =
JAXBContext.newInstance(generator.getStatisticsClass(),
StatisticsConstants.STATS_MARSHAL_FAILED.getClass(),
StatisticsConstants.STATS_FORCED_END.getClass(),
StatisticsConstants.STATS_UNMARSHAL_FAILED.getClass(),
StatisticsConstants.STATS_EXECUTION_FAILED.getClass());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<? extends GeneratorStatistics> jaxbElement =
unmarshaller.unmarshal(streamSource, generator.getStatisticsClass());
return jaxbElement.getValue();
} catch (Exception e) {
logger.warn("Unable to unmarshal configuration");
return StatisticsConstants.STATS_UNMARSHAL_FAILED;
}
}
示例3: storepluginsactive
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public ModelAndView storepluginsactive(HttpServletRequest request, HttpServletResponse httpServletResponse) {
String tenantId = ServletUtils.getSafeParameter(request, "tenantId", "");
String operatorId = ServletUtils.getSafeParameter(request, "operatorId", "");
String pluginsactive = ServletUtils.getSafeParameter(request, "pluginsactive", "");
ModelAndView mav = new ModelAndView("page");
mav.addObject("title", "easyrec :: administration");
mav.addObject("operatorId", operatorId);
mav.addObject("tenantId", tenantId);
if (Security.isDeveloper(request)) {
mav.setViewName("dev/page");
RemoteTenant r = remoteTenantDAO.get(operatorId, tenantId);
if (r != null) {
tenantService.updateConfigProperty(r.getId(), PluginRegistry.PLUGINS_ENABLED_PROP, pluginsactive);
r.setPlugins(pluginsactive);
remoteTenantDAO.updateTenantInCache(r);
}
return MessageBlock.createSingle(mav, MSG.OPERATION_SUCCESSFUL, STORE_PLUGINS_ACTIVE, MSG.SUCCESS);
} else {
return MessageBlock.createSingle(mav, MSG.NOT_SIGNED_IN, STORE_PLUGINS_ACTIVE, MSG.ERROR);
}
}
示例4: NamedConfigurationServiceImpl
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public NamedConfigurationServiceImpl(TypeMappingService typeMappingService, SourceTypeDAO sourceTypeDAO,
PluginRegistry pluginRegistry, NamedConfigurationDAO namedConfigurationDAO,
EasyRecSettings easyrecSettings, RemoteTenantDAO remoteTenantDAO,
RemoteTenantService remoteTenantService,
ShopRecommenderService shopRecommenderService,
GeneratorContainer generatorContainer,
JSONProfileServiceImpl jsonProfileService) {
this.typeMappingService = typeMappingService;
this.sourceTypeDAO = sourceTypeDAO;
this.pluginRegistry = pluginRegistry;
this.namedConfigurationDAO = namedConfigurationDAO;
this.easyrecSettings = easyrecSettings;
this.remoteTenantDAO = remoteTenantDAO;
this.remoteTenantService = remoteTenantService;
this.shopRecommenderService = shopRecommenderService;
this.generatorContainer = generatorContainer;
this.jsonProfileService = jsonProfileService;
}
示例5: unmarshalConfiguration
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private static GeneratorConfiguration unmarshalConfiguration(String pluginIdAndVersion, String configurationString,
PluginRegistry pluginRegistry) {
try {
Generator<?, ?> generator =
Preconditions.checkNotNull(pluginRegistry.getGenerators().get(PluginId.parsePluginId(
pluginIdAndVersion)));
StringReader xmlRepresentation = new StringReader(configurationString);
StreamSource streamSource = new StreamSource(xmlRepresentation);
JAXBContext jaxbContext =
JAXBContext.newInstance(generator.getConfigurationClass(),
GeneratorConfigurationConstants.CONF_MARSHAL_FAILED.getClass(),
GeneratorConfigurationConstants.CONF_UNMARSHAL_FAILED.getClass());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<? extends GeneratorConfiguration> jaxbElement =
unmarshaller.unmarshal(streamSource, generator.getConfigurationClass());
return jaxbElement.getValue();
} catch (Exception e) {
logger.warn("Unable to unmarshal configuration", e);
return GeneratorConfigurationConstants.CONF_UNMARSHAL_FAILED;
}
}
示例6: unmarshalStatistics
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private static GeneratorStatistics unmarshalStatistics(String pluginIdAndVersion, String statisticsString,
PluginRegistry pluginRegistry) {
try {
Generator<?, ?> generator = Preconditions.checkNotNull(
pluginRegistry.getGenerators().get(PluginId.parsePluginId(pluginIdAndVersion)));
StringReader xmlRepresentation = new StringReader(statisticsString);
StreamSource streamSource = new StreamSource(xmlRepresentation);
JAXBContext jaxbContext =
JAXBContext.newInstance(generator.getStatisticsClass(),
StatisticsConstants.STATS_MARSHAL_FAILED.getClass(),
StatisticsConstants.STATS_FORCED_END.getClass(),
StatisticsConstants.STATS_UNMARSHAL_FAILED.getClass(),
StatisticsConstants.STATS_EXECUTION_FAILED.getClass());
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<? extends GeneratorStatistics> jaxbElement =
unmarshaller.unmarshal(streamSource, generator.getStatisticsClass());
return jaxbElement.getValue();
} catch (Exception e) {
logger.warn("Unable to unmarshal configuration", e);
return StatisticsConstants.STATS_UNMARSHAL_FAILED;
}
}
示例7: NamedConfigurationServiceImpl
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public NamedConfigurationServiceImpl(TypeMappingService typeMappingService, SourceTypeDAO sourceTypeDAO,
PluginRegistry pluginRegistry, NamedConfigurationDAO namedConfigurationDAO,
EasyRecSettings easyrecSettings, RemoteTenantDAO remoteTenantDAO,
RemoteTenantService remoteTenantService,
ShopRecommenderService shopRecommenderService,
GeneratorContainer generatorContainer) {
this.typeMappingService = typeMappingService;
this.sourceTypeDAO = sourceTypeDAO;
this.pluginRegistry = pluginRegistry;
this.namedConfigurationDAO = namedConfigurationDAO;
this.easyrecSettings = easyrecSettings;
this.remoteTenantDAO = remoteTenantDAO;
this.remoteTenantService = remoteTenantService;
this.shopRecommenderService = shopRecommenderService;
this.generatorContainer = generatorContainer;
}
示例8: GeneratorContainer
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public GeneratorContainer(AssocTypeDAO assocTypeDAO, NamedConfigurationDAO namedConfigurationDAO,
LogEntryDAO logEntryDAO, PluginRegistry registry) {
this.assocTypeDAO = assocTypeDAO;
this.namedConfigurationDAO = namedConfigurationDAO;
this.logEntryDAO = logEntryDAO;
this.registry = registry;
}
示例9: initialize
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private void initialize() {
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
this.tenantService = context.getBean("tenantService", TenantService.class);
this.remoteTenantDAO = context.getBean("remoteTenantDAO", RemoteTenantDAO.class);
this.remoteTenantService = context.getBean("remoteTenantService", RemoteTenantService.class);
this.shopRecommenderService = context.getBean("shopRecommenderService", ShopRecommenderService.class);
this.easyrecSettings = context.getBean("easyrecSettings", EasyRecSettings.class);
this.pluginRegistry = context.getBean("pluginRegistry", PluginRegistry.class);
this.generatorContainer = context.getBean("generatorContainer", GeneratorContainer.class);
this.logEntryDAO = context.getBean("logEntryDAO", LogEntryDAO.class);
initialized = true;
}
示例10: EasyRec
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public EasyRec(OperatorDAO operatorDAO, RemoteTenantDAO remoteTenantDAO,
ShopRecommenderService shopRecommenderService, TenantService tenantService,
TypeMappingService typeMappingService, ItemDAO itemDAO, RemoteAssocService remoteAssocService,
IDMappingDAO idMappingDAO,
//added by FK on 2012-12-18 for enabling profile data in recommendations
ProfileService profileService,
ClusterService clusterService,
EasyRecSettings easyrecSettings,
PluginRegistry pluginRegistry,
GeneratorContainer generatorContainer,
String dateFormatString,
ObjectMapper objectMapper,
LogEntryDAO logEntryDAO,
BackTrackingDAO backTrackingDAO) {
this.operatorDAO = operatorDAO;
this.remoteTenantDAO = remoteTenantDAO;
this.shopRecommenderService = shopRecommenderService;
this.tenantService = tenantService;
this.typeMappingService = typeMappingService;
this.itemDAO = itemDAO;
this.remoteAssocService = remoteAssocService;
this.dateFormat = dateFormatString;
this.profileService = profileService;
this.idMappingDAO = idMappingDAO;
this.clusterService = clusterService;
this.easyrecSettings = easyrecSettings;
this.pluginRegistry = pluginRegistry;
this.generatorContainer = generatorContainer;
this.objectMapper = objectMapper;
this.logEntryDAO = logEntryDAO;
this.backTrackingDAO = backTrackingDAO;
}
示例11: initialize
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private void initialize() {
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
this.tenantService = context.getBean("tenantService", TenantService.class);
this.remoteTenantDAO = context.getBean("remoteTenantDAO", RemoteTenantDAO.class);
this.remoteTenantService = context.getBean("remoteTenantService", RemoteTenantService.class);
this.shopRecommenderService = context.getBean("shopRecommenderService", ShopRecommenderService.class);
this.easyrecSettings = context.getBean("easyrecSettings", EasyRecSettings.class);
this.pluginRegistry = context.getBean("pluginRegistry", PluginRegistry.class);
this.generatorContainer = context.getBean("generatorContainer", GeneratorContainer.class);
initialized = true;
}
示例12: getPluginRegistry
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public PluginRegistry getPluginRegistry() {
return pluginRegistry;
}
示例13: setPluginRegistry
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public void setPluginRegistry(PluginRegistry pluginRegistry) {
this.pluginRegistry = pluginRegistry;
}
示例14: NamedConfigurationDAOMysqlImpl
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
public NamedConfigurationDAOMysqlImpl(DataSource dataSource, SqlScriptService sqlScriptService,
PluginRegistry pluginRegistry) {
super(sqlScriptService);
setDataSource(dataSource);
createConfiguration = new SqlUpdate(dataSource,
"INSERT INTO plugin_configuration(tenantId, assocTypeId, pluginId, pluginVersion, name, " +
"configuration, active) VALUES(?, ?, ?, ?, ?, ?, ?)",
new int[]{Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.BLOB,
Types.BIT}, 1);
createConfiguration.compile();
updateConfigurationActive = new SqlUpdate(dataSource,
"UPDATE plugin_configuration SET name = ?, configuration = ?, active = b'1' " +
"WHERE tenantId = ? AND assocTypeId = ? AND pluginId = ? AND pluginVersion = ? AND name = ?",
new int[]{Types.VARCHAR, Types.BLOB, Types.INTEGER, Types.INTEGER, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR}, 1);
updateConfigurationActive.compile();
updateConfigurationInactive = new SqlUpdate(dataSource,
"UPDATE plugin_configuration SET name = ?, configuration = ? " +
"WHERE tenantId = ? AND assocTypeId = ? AND pluginId = ? AND pluginVersion = ? AND name = ?",
new int[]{Types.VARCHAR, Types.BLOB, Types.INTEGER, Types.INTEGER, Types.VARCHAR,
Types.VARCHAR, Types.VARCHAR}, 1);
updateConfigurationInactive.compile();
updateAllInactive = new SqlUpdate(dataSource,
"UPDATE plugin_configuration SET active = b'0' WHERE tenantId = ? AND assocTypeId = ?",
new int[]{Types.INTEGER, Types.INTEGER});
updateSetInactiveByPluginId = new SqlUpdate(dataSource,
"UPDATE plugin_configuration SET active = b'0' WHERE pluginId = ? AND pluginVersion = ?",
new int[]{Types.VARCHAR, Types.VARCHAR});
deleteConfiguration = new SqlUpdate(dataSource,
"DELETE FROM plugin_configuration WHERE tenantId = ? AND assocTypeId = ? AND pluginId = ? AND " +
"pluginVersion = ? AND name = ? AND active = b'0'",
new int[]{Types.INTEGER, Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR}, 1);
deleteConfiguration.compile();
readConfiguration = new NamedConfigurationMappingStatement(dataSource,
"SELECT * FROM plugin_configuration WHERE tenantId = ? AND assocTypeId = ? AND pluginId = ? AND " +
"pluginVersion = ? AND name = ?", pluginRegistry);
readConfiguration.declareParameter(new SqlParameter("tenantId", Types.INTEGER));
readConfiguration.declareParameter(new SqlParameter("assocTypeId", Types.INTEGER));
readConfiguration.declareParameter(new SqlParameter("pluginId", Types.VARCHAR));
readConfiguration.declareParameter(new SqlParameter("pluginVersion", Types.VARCHAR));
readConfiguration.declareParameter(new SqlParameter("name", Types.VARCHAR));
readConfiguration.compile();
readConfigurations = new NamedConfigurationMappingStatement(dataSource,
"SELECT * FROM plugin_configuration WHERE tenantId = ? AND assocTypeId = ? AND pluginId = ? AND " +
"pluginVersion = ?", pluginRegistry);
readConfigurations.declareParameter(new SqlParameter("tenantId", Types.INTEGER));
readConfigurations.declareParameter(new SqlParameter("assocTypeId", Types.INTEGER));
readConfigurations.declareParameter(new SqlParameter("pluginId", Types.VARCHAR));
readConfigurations.declareParameter(new SqlParameter("pluginVersion", Types.VARCHAR));
readConfigurations.compile();
readActiveConfiguration = new NamedConfigurationMappingStatement(dataSource,
"SELECT * FROM plugin_configuration WHERE tenantId = ? AND assocTypeId = ? AND active = b'1'",
pluginRegistry);
readActiveConfiguration.declareParameter(new SqlParameter("tenantId", Types.INTEGER));
readActiveConfiguration.declareParameter(new SqlParameter("assocTypeId", Types.INTEGER));
readActiveConfiguration.compile();
readActiveConfigurations = new NamedConfigurationMappingStatement(dataSource,
"SELECT * FROM plugin_configuration WHERE tenantId = ? AND active = b'1' ORDER BY assocTypeId ASC",
pluginRegistry);
readActiveConfigurations.declareParameter(new SqlParameter("tenantId", Types.INTEGER));
readActiveConfigurations.compile();
}
示例15: NamedConfigurationMappingStatement
import org.easyrec.plugin.container.PluginRegistry; //导入依赖的package包/类
private NamedConfigurationMappingStatement(DataSource ds, String sql,
PluginRegistry pluginRegistry) {
super(ds, sql);
this.pluginRegistry = pluginRegistry;
}