use of io.jmix.core.annotation.Internal in project jmix by jmix-framework.
the class CompositeComponent method enableEventListeners.
@Internal
protected void enableEventListeners() {
List<ApplicationListener> listeners = getUiEventListeners();
if (CollectionUtils.isNotEmpty(listeners)) {
AppUI ui = AppUI.getCurrent();
UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
for (ApplicationListener listener : uiEventListeners) {
multicaster.addApplicationListener(listener);
}
}
}
use of io.jmix.core.annotation.Internal in project jmix by jmix-framework.
the class CompositeComponent method disableEventListeners.
@Internal
protected void disableEventListeners() {
List<ApplicationListener> listeners = getUiEventListeners();
if (CollectionUtils.isNotEmpty(listeners)) {
AppUI ui = AppUI.getCurrent();
UiEventsMulticaster multicaster = ui.getUiEventsMulticaster();
for (ApplicationListener listener : uiEventListeners) {
multicaster.removeApplicationListener(listener);
}
}
}
use of io.jmix.core.annotation.Internal in project jmix by jmix-framework.
the class PersistenceImpl method dispose.
/**
* INTERNAL.
* Destroys the persistence configuration. Further use of this bean instance is impossible.
*/
@Internal
public void dispose() {
jpaEmf.close();
for (String store : stores.getAdditional()) {
EntityManagerFactory emf = (EntityManagerFactory) applicationContext.getBean("entityManagerFactory_" + store);
emf.close();
}
}
use of io.jmix.core.annotation.Internal in project jmix by jmix-framework.
the class FilterDelegateSettingsUtils method applyMaxResultsSettings.
/**
* INTERNAL API. Is used by {@link CubaFilterSettingsBinder}.
*
* @param delegate filter delegate bean
* @param maxResults max result to apply
*/
@Internal
public static void applyMaxResultsSettings(FilterDelegate delegate, int maxResults) {
if (delegate instanceof FilterDelegateImpl) {
Element componentElement = DocumentHelper.createDocument().addElement("component");
componentElement.addElement("maxResults").setText(String.valueOf(maxResults));
((FilterDelegateImpl) delegate).applyMaxResultsSettings(componentElement);
}
}
use of io.jmix.core.annotation.Internal in project jmix by jmix-framework.
the class EntityChangedEvent method getResolvableType.
/**
* INTERNAL.
*/
@Internal
@Override
public ResolvableType getResolvableType() {
Metadata metadata = AppBeans.get(Metadata.class);
ExtendedEntities extendedEntities = metadata.getExtendedEntities();
MetaClass metaClass = extendedEntities.getOriginalOrThisMetaClass(metadata.getClassNN(entityId.getEntityClass()));
MetaProperty pkProperty = metadata.getTools().getPrimaryKeyProperty(metaClass);
if (pkProperty == null) {
throw new IllegalStateException("Unable to send EntityChangedEvent for " + metaClass + " because it has no primary key");
}
return ResolvableType.forClassWithGenerics(getClass(), ResolvableType.forClass(metaClass.getJavaClass()), ResolvableType.forClass(pkProperty.getJavaType()));
}
Aggregations