Skip to content

Commit

Permalink
Fix for PortletEventCoordinationHelper instantiation (#2847)
Browse files Browse the repository at this point in the history
* Fix for PortletEventCoordinationHelper instantiation

Autowired all fields. Added a qualifier for Ehcache. Removed constructor
and reference.

* Removed setters in favor of autowired fields.
  • Loading branch information
Naenyn authored Sep 9, 2024
1 parent 56ebc5e commit 5dc1323
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ public void setPortletEntityRegistry(IPortletEntityRegistry portletEntityRegistr
this.portletEntityRegistry = portletEntityRegistry;
}

protected final PortletEventCoordinationHelper portletEventCoordinationHelper =
new PortletEventCoordinationHelper(
this.xmlUtilities,
this.portletContextService,
this.portletWindowRegistry,
this.supportedEventCache,
this.portletDefinitionRegistry);
protected PortletEventCoordinationHelper portletEventCoordinationHelper;

@Autowired
public void setPortletEventCoordinationHelper(
PortletEventCoordinationHelper portletEventCoordinationHelper) {
this.portletEventCoordinationHelper = portletEventCoordinationHelper;
}

/**
* Returns a request scoped PortletEventQueue used to track events to process and events to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,22 @@
import org.apereo.portal.portlet.registry.IPortletWindowRegistry;
import org.apereo.portal.utils.Tuple;
import org.apereo.portal.xml.XmlUtilities;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class PortletEventCoordinationHelper {
public static final String GLOBAL_EVENT__CONTAINER_OPTION = "org.apereo.portal.globalEvent";
private XmlUtilities xmlUtilities;
private PortletContextService portletContextService;
private IPortletWindowRegistry portletWindowRegistry;
private Ehcache supportedEventCache;
@Autowired private XmlUtilities xmlUtilities;
@Autowired private PortletContextService portletContextService;
@Autowired private IPortletWindowRegistry portletWindowRegistry;

public PortletEventCoordinationHelper(
XmlUtilities xmlUtilities,
PortletContextService portletContextService,
IPortletWindowRegistry portletWindowRegistry,
Ehcache supportedEventCache,
IPortletDefinitionRegistry portletDefinitionRegistry) {
this.xmlUtilities = xmlUtilities;
this.portletContextService = portletContextService;
this.portletWindowRegistry = portletWindowRegistry;
this.supportedEventCache = supportedEventCache;
this.portletDefinitionRegistry = portletDefinitionRegistry;
}
@Autowired
@Qualifier("org.apereo.portal.portlet.rendering.SupportedEventCache")
private Ehcache supportedEventCache;

private IPortletDefinitionRegistry portletDefinitionRegistry;
@Autowired private IPortletDefinitionRegistry portletDefinitionRegistry;

protected Event unmarshall(IPortletWindow portletWindow, Event event) {
// TODO make two types of Event impls, one for marshalled data and one for unmarshalled data
Expand Down

0 comments on commit 5dc1323

Please sign in to comment.