public Object execute() throws Exception { onDictionaryInit(); initMessages(); return (Object)null; } }, transactionService.isReadOnly(), false);
public void onEnableTenant() { init(); // will be called in context of tenant }
public void onDisableTenant() { destroy(); // will be called in context of tenant }
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception { CompiledModelsCache compiledModelsCache = new CompiledModelsCache(); compiledModelsCache.setDictionaryDAO(dictionaryDAO); compiledModelsCache.setTenantService(tenantService); compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry()); ThreadPoolExecutorFactoryBean threadPoolfactory = new ThreadPoolExecutorFactoryBean(); threadPoolfactory.afterPropertiesSet(); compiledModelsCache.setThreadPoolExecutor((ThreadPoolExecutor) threadPoolfactory.getObject()); dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache); dictionaryDAO.init(); }
public Void execute() throws Throwable { type.removeProperty(modelName + ":" + propertyQName.getLocalName()); CompiledModel compiledModel = model.compile(dictionaryDAO, namespaceDAO, true); modelValidator.validateModel(compiledModel); return null; } };
private CompiledModel getModelByUri(String uri) { for (CompiledModel model : getAllCustomM2Models(false)) { if (uri.equals(getModelNamespaceUriPrefix(model.getM2Model()).getFirst())) { return model; } } return null; }
@Override public ModelDefinition getCustomModelByUri(String namespaceUri) { ParameterCheck.mandatoryString("namespaceUri", namespaceUri); CompiledModel compiledModel = getModelByUri(namespaceUri); if (compiledModel != null) { return compiledModel.getModelDefinition(); } return null; }
@Override public CustomModelDefinition getCustomModel(String modelName) { ParameterCheck.mandatoryString("modelName", modelName); Pair<CompiledModel, Boolean> compiledModelPair = getCustomCompiledModel(modelName); CustomModelDefinition result = (compiledModelPair == null) ? null : new CustomModelDefinitionImpl( compiledModelPair.getFirst(), compiledModelPair.getSecond(), dictionaryService); return result; }
@Override public TypeDefinition getCustomType(QName name) { ParameterCheck.mandatory("name", name); CompiledModel compiledModel = getModelByUri(name.getNamespaceURI()); if (compiledModel != null) { return compiledModel.getType(name); } return null; }
@Override public Void doWork() throws Exception { dictionaryDAO.init(); return null; } }, "user1", "tenant1");
public void onDictionaryInit() { // Register the test model dictionaryDAO.putModel(model); }
@Override public ConstraintDefinition getCustomConstraint(QName name) { ParameterCheck.mandatory("name", name); CompiledModel compiledModel = getModelByUri(name.getNamespaceURI()); if (compiledModel != null) { return compiledModel.getConstraint(name); } return null; }
@Override public AspectDefinition getCustomAspect(QName name) { ParameterCheck.mandatory("name", name); CompiledModel compiledModel = getModelByUri(name.getNamespaceURI()); if (compiledModel != null) { return compiledModel.getAspect(name); } return null; }
private CompiledModel getModelByUri(String uri) { for (CompiledModel model : getAllCustomM2Models(false)) { if (uri.equals(getModelNamespaceUriPrefix(model.getM2Model()).getFirst())) { return model; } } return null; }
public Object execute() throws Exception { onDictionaryInit(); initMessages(); return (Object)null; } }, transactionService.isReadOnly(), false);
@Override public ModelDefinition getCustomModelByUri(String namespaceUri) { ParameterCheck.mandatoryString("namespaceUri", namespaceUri); CompiledModel compiledModel = getModelByUri(namespaceUri); if (compiledModel != null) { return compiledModel.getModelDefinition(); } return null; }
public void onEnableTenant() { init(); // will be called in context of tenant }
public void onDisableTenant() { destroy(); // will be called in context of tenant }
@Override public CustomModelDefinition getCustomModel(String modelName) { ParameterCheck.mandatoryString("modelName", modelName); Pair<CompiledModel, Boolean> compiledModelPair = getCustomCompiledModel(modelName); CustomModelDefinition result = (compiledModelPair == null) ? null : new CustomModelDefinitionImpl( compiledModelPair.getFirst(), compiledModelPair.getSecond(), dictionaryService); return result; }
@Override public TypeDefinition getCustomType(QName name) { ParameterCheck.mandatory("name", name); CompiledModel compiledModel = getModelByUri(name.getNamespaceURI()); if (compiledModel != null) { return compiledModel.getType(name); } return null; }