Author: chris.laprun(a)jboss.com
Date: 2009-04-10 07:07:43 -0400 (Fri, 10 Apr 2009)
New Revision: 13203
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
Log:
- Moved read methods to CoordinationManager as it's more logical for them to be
there.
- CoordinationConfigurator now extends CoordinationManager.
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2009-04-10
11:04:35 UTC (rev 13202)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationConfigurator.java 2009-04-10
11:07:43 UTC (rev 13203)
@@ -1,24 +1,25 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
package org.jboss.portal.core.controller.coordination;
@@ -27,7 +28,6 @@
import org.jboss.portal.core.model.portal.Window;
import javax.xml.namespace.QName;
-import java.util.Collection;
import java.util.Map;
import java.util.Set;
@@ -36,7 +36,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version : 0.1 $
*/
-public interface CoordinationConfigurator
+public interface CoordinationConfigurator extends CoordinationManager
{
// Management
@@ -113,41 +113,6 @@
void removeEventWiringImplicitMode(PageContainer pageContainer) throws
IllegalCoordinationException;
/**
- * @param page
- * @param eventQName
- * @return all wirings defined for a given qname
- */
- Collection<EventWiringInfo> getEventWirings(Page page, QName eventQName);
-
- /**
- * @param page
- * @return all wirings defined in the scope of a given page
- */
- Collection<EventWiringInfo> getEventWirings(Page page);
-
- /**
- * Retrieves the event wiring found in the given page and identified with the
specified name
- *
- * @param page
- * @param name
- * @return
- * @throws IllegalCoordinationException
- */
- EventWiringInfo getEventWiring(Page page, String name) throws
IllegalCoordinationException;
-
- /**
- * @param window
- * @return all wirings where given window is a source
- */
- Collection<EventWiringInfo> getEventSourceWirings(Window window);
-
- /**
- * @param window
- * @return all wirings where given window is a destination
- */
- Collection<EventWiringInfo> getEventDestinationWirings(Window window);
-
- /**
* Defines shared parameter binding for a given collection of windows.
*
* @param name
@@ -188,26 +153,6 @@
void renameParameterBinding(Page page, String bindingName, String newName) throws
IllegalCoordinationException;
/**
- * @param page
- * @return window bindings define in the scope of a given page
- */
- Collection<? extends ParameterBindingInfo> getParameterBindings(Page page);
-
- /**
- * @param window
- * @return window bindings where given window is involved
- */
- Collection<? extends ParameterBindingInfo> getParameterBindings(Window window);
-
- /**
- * @param page
- * @param name
- * @return
- * @throws IllegalCoordinationException
- */
- ParameterBindingInfo getParameterBinding(Page page, String name) throws
IllegalCoordinationException;
-
- /**
* Set parameter binding implicit mode for a given page container. This will be
inherited recursively by all children
* page containers
*
@@ -276,23 +221,4 @@
*/
void renameAliasBinding(Page page, String bindingName, String newName) throws
IllegalCoordinationException;
- /**
- * @param page
- * @return collection of alias bindings connected to the given page
- */
- Collection<? extends AliasBindingInfo> getAliasBindings(Page page);
-
- /**
- * @param page
- * @param name
- * @return
- */
- AliasBindingInfo getAliasBinding(Page page, String name);
-
- /**
- * @param page
- * @param parameterQName
- * @return window bindings for a given parameter qname
- */
- Collection<? extends ParameterBindingInfo> getParameterBindings(Page page, QName
parameterQName);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java 2009-04-10
11:04:35 UTC (rev 13202)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/coordination/CoordinationManager.java 2009-04-10
11:07:43 UTC (rev 13203)
@@ -1,28 +1,30 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
package org.jboss.portal.core.controller.coordination;
import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
+import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PageContainer;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
@@ -77,4 +79,81 @@
* @return all binding names with a given window/name mapping
*/
Collection<String> getBindingNames(Window window, QName name);
+
+ /**
+ * @param page
+ * @param eventQName
+ * @return all wirings defined for a given qname
+ */
+ Collection<EventWiringInfo> getEventWirings(Page page, QName eventQName);
+
+ /**
+ * @param page
+ * @return all wirings defined in the scope of a given page
+ */
+ Collection<EventWiringInfo> getEventWirings(Page page);
+
+ /**
+ * Retrieves the event wiring found in the given page and identified with the
specified name
+ *
+ * @param page
+ * @param name
+ * @return
+ * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ *
+ */
+ EventWiringInfo getEventWiring(Page page, String name) throws
IllegalCoordinationException;
+
+ /**
+ * @param window
+ * @return all wirings where given window is a source
+ */
+ Collection<EventWiringInfo> getEventSourceWirings(Window window);
+
+ /**
+ * @param window
+ * @return all wirings where given window is a destination
+ */
+ Collection<EventWiringInfo> getEventDestinationWirings(Window window);
+
+ /**
+ * @param page
+ * @return window bindings define in the scope of a given page
+ */
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Page page);
+
+ /**
+ * @param window
+ * @return window bindings where given window is involved
+ */
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Window window);
+
+ /**
+ * @param page
+ * @param name
+ * @return
+ * @throws org.jboss.portal.core.controller.coordination.IllegalCoordinationException
+ *
+ */
+ ParameterBindingInfo getParameterBinding(Page page, String name) throws
IllegalCoordinationException;
+
+ /**
+ * @param page
+ * @return collection of alias bindings connected to the given page
+ */
+ Collection<? extends AliasBindingInfo> getAliasBindings(Page page);
+
+ /**
+ * @param page
+ * @param name
+ * @return
+ */
+ AliasBindingInfo getAliasBinding(Page page, String name);
+
+ /**
+ * @param page
+ * @param parameterQName
+ * @return window bindings for a given parameter qname
+ */
+ Collection<? extends ParameterBindingInfo> getParameterBindings(Page page, QName
parameterQName);
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2009-04-10
11:04:35 UTC (rev 13202)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/coordination/CoordinationService.java 2009-04-10
11:07:43 UTC (rev 13203)
@@ -1,31 +1,31 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
package org.jboss.portal.core.impl.coordination;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.core.controller.coordination.AliasBindingInfo;
import org.jboss.portal.core.controller.coordination.CoordinationConfigurator;
-import org.jboss.portal.core.controller.coordination.CoordinationManager;
import org.jboss.portal.core.controller.coordination.EventConverter;
import org.jboss.portal.core.controller.coordination.EventWiringInfo;
import org.jboss.portal.core.controller.coordination.IllegalCoordinationException;
@@ -57,7 +57,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version : 0.1 $
*/
-public class CoordinationService extends AbstractJBossService implements
CoordinationManager, CoordinationConfigurator
+public class CoordinationService extends AbstractJBossService implements
CoordinationConfigurator
{
private static final String EVENT_ROLE_SOURCE = "source";
private static final String EVENT_ROLE_DESTINATION = "destination";
@@ -163,7 +163,7 @@
for (Map.Entry<Window, QName> entry : info.getSources().entrySet())
{
if (entry.getKey().getName().equals(event.getWindowId()) &&
- entry.getValue().equals(event.getName()))
+ entry.getValue().equals(event.getName()))
{
for (Window window : info.getDestinations().keySet())
{
@@ -250,7 +250,7 @@
if (dw.contains(window))
{
throw new IllegalCoordinationException("The same window '" +
window.getName()
- + "' cannot be source and destination of the same explicit
wiring");
+ + "' cannot be source and destination of the same explicit
wiring");
}
}
@@ -377,7 +377,7 @@
if (role == null)
{
throw new IllegalCoordinationException("Couldn't find role
associated to event '" + name + "' in window "
- + window.getId());
+ + window.getId());
}
QName qname = QName.valueOf(eventName);