public JetspeedPortletProxyInstance(String portletName, Portlet portlet, boolean autoSwitchEditDefaultsModeToEditMode, boolean autoSwitchConfigMode, String customConfigModePortletUniqueName, boolean autoSwitchPreviewMode, String customPreviewModePortletUniqueName) { super(portletName, (Portlet) PortletObjectProxy.createProxy(portlet, autoSwitchEditDefaultsModeToEditMode, autoSwitchConfigMode, customConfigModePortletUniqueName, autoSwitchPreviewMode, customPreviewModePortletUniqueName)); this.proxiedPortlet = portlet; }
public JetspeedPortletProxyInstance(String portletName, Portlet portlet, boolean autoSwitchEditDefaultsModeToEditMode, boolean autoSwitchConfigMode, String customConfigModePortletUniqueName) { super(portletName, (Portlet) PortletObjectProxy.createProxy(portlet, autoSwitchEditDefaultsModeToEditMode, autoSwitchConfigMode, customConfigModePortletUniqueName)); this.proxiedPortlet = portlet; }
@SuppressWarnings("unchecked") public static Object createProxy(Object proxiedObject, boolean autoSwitchEditDefaultsModeToEditMode, boolean autoSwitchConfigMode, String customConfigModePortletUniqueName, boolean autoSwitchPreviewMode, String customPreviewModePortletUniqueName) { HashSet<Class> interfaces = new HashSet<Class>(); interfaces.add(Portlet.class); Class current = proxiedObject.getClass(); while (current != null) { try { Class[] currentInterfaces = current.getInterfaces(); for (int i = 0; i < currentInterfaces.length; i++) { if (currentInterfaces[i] != Portlet.class) { interfaces.add(currentInterfaces[i]); } } current = current.getSuperclass(); } catch (Exception e) { current = null; } } Class proxiedClass = proxiedObject.getClass();