JBoss Identity SVN: r1125 - in authz/gatein/authz-plugin/trunk: service and 11 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 12:09:30 -0400 (Sat, 05 Jun 2010)
New Revision: 1125
Added:
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/SecurityService.java
authz/gatein/authz-plugin/trunk/tools/
authz/gatein/authz-plugin/trunk/tools/pom.xml
authz/gatein/authz-plugin/trunk/tools/src/
authz/gatein/authz-plugin/trunk/tools/src/main/
authz/gatein/authz-plugin/trunk/tools/src/main/java/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/tools/
authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/tools/ContainerBuilder.java
Removed:
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java
Modified:
authz/gatein/authz-plugin/trunk/.classpath
authz/gatein/authz-plugin/trunk/pom.xml
authz/gatein/authz-plugin/trunk/service/pom.xml
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
Log:
Tools component for kernel bootstrapping and other common utilities
Modified: authz/gatein/authz-plugin/trunk/.classpath
===================================================================
--- authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 15:25:52 UTC (rev 1124)
+++ authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 16:09:30 UTC (rev 1125)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="service/src/main/java"/>
<classpathentry kind="src" path="service/src/test/java"/>
+ <classpathentry kind="src" path="tools/src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
Modified: authz/gatein/authz-plugin/trunk/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 15:25:52 UTC (rev 1124)
+++ authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 16:09:30 UTC (rev 1125)
@@ -10,6 +10,7 @@
<modules>
<module>service</module>
+ <module>tools</module>
</modules>
<properties>
Modified: authz/gatein/authz-plugin/trunk/service/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/pom.xml 2010-06-05 15:25:52 UTC (rev 1124)
+++ authz/gatein/authz-plugin/trunk/service/pom.xml 2010-06-05 16:09:30 UTC (rev 1125)
@@ -16,6 +16,12 @@
<dependencies>
<dependency>
+ <groupId>org.jboss.gatein.authz.tools</groupId>
+ <artifactId>tools</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
</dependency>
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/SecurityService.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/SecurityService.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/SecurityService.java 2010-06-05 16:09:30 UTC (rev 1125)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.service;
+
+import java.net.URL;
+
+import org.exoplatform.container.PortalContainer;
+import org.jboss.gatein.authz.tools.ContainerBuilder;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class SecurityService
+{
+ public SecurityService()
+ {
+
+ }
+
+ public void start()
+ {
+ //TODO: log message using GateIn Logging Framework
+ URL rootURL = getClass().getResource("/conf/gatein-authz-configuration.xml");
+ URL portalURL = getClass().getResource("/conf/portal/gatein-authz-configuration.xml");
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+ }
+
+ public void stop()
+ {
+
+ }
+
+ public PortalContainer getContainer()
+ {
+ return PortalContainer.getInstance();
+ }
+}
Deleted: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java 2010-06-05 15:25:52 UTC (rev 1124)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java 2010-06-05 16:09:30 UTC (rev 1125)
@@ -1,258 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.gatein.authz.service;
-
-import junit.framework.AssertionFailedError;
-import org.exoplatform.commons.utils.PropertyManager;
-import org.exoplatform.commons.utils.Tools;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.container.RootContainer;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * <p>An helper for building a root container and a portal container. I have done several attempt to make easily
- * and safe root/portal container boot for unit test. This one is my best attempt so far.</p>
- *
- * <p>Note that the portal container are booted in the order they are declared first.</p>
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class ContainerBuilder
-{
-
- /** A hack used during the boot of a portal container. */
- private final ThreadLocal<String> bootedPortalName = new ThreadLocal<String>();
-
- /** . */
- private ClassLoader loader;
-
- /** . */
- private List<URL> configURLs;
-
- /** . */
- private LinkedHashMap<String, List<URL>> portalConfigURLs;
-
- /** . */
- private Set<String> profiles;
-
- public ContainerBuilder()
- {
- this.loader = Thread.currentThread().getContextClassLoader();
- this.configURLs = new ArrayList<URL>();
- this.portalConfigURLs = new LinkedHashMap<String, List<URL>>();
- }
-
- public ContainerBuilder withRoot(String configPath)
- {
- configURLs.addAll(urls(configPath));
- return this;
- }
-
- public ContainerBuilder withRoot(URL configURL)
- {
- configURLs.add(configURL);
- return this;
- }
-
- public ContainerBuilder withPortal(String configPath)
- {
- return withPortal("portal", configPath);
- }
-
- public ContainerBuilder withPortal(String portalName, String configPath)
- {
- for (URL configURL : urls(configPath))
- {
- withPortal(portalName, configURL);
- }
- return this;
- }
-
- public ContainerBuilder withPortal(URL configURL)
- {
- return withPortal("portal", configURL);
- }
-
- public ContainerBuilder withPortal(String portalName, URL configURL)
- {
- List<URL> urls = portalConfigURLs.get(portalName);
- if (urls == null)
- {
- urls = new ArrayList<URL>();
- portalConfigURLs.put(portalName, urls);
- }
- urls.add(configURL);
- return this;
- }
-
- public ContainerBuilder withLoader(ClassLoader loader)
- {
- this.loader = loader;
- return this;
- }
-
-
- private List<URL> urls(String path)
- {
- try
- {
- return Collections.list(loader.getResources(path));
- }
- catch (IOException e)
- {
- AssertionFailedError err = new AssertionFailedError();
- err.initCause(e);
- throw err;
- }
- }
-
- public RootContainer build()
- {
- try
- {
- return _build();
- }
- catch (Exception e)
- {
- AssertionFailedError err = new AssertionFailedError();
- err.initCause(e);
- throw err;
- }
- }
-
- private RootContainer _build() throws Exception
- {
- //
- if (configURLs.size() == 0)
- {
- throw new IllegalStateException("Must provide at least one URL for building the root container");
- }
-
- // Must clear the top container first otherwise it's not going to work well
- // it's a big ugly but I don't want to change anything in the ExoContainerContext class for now
- // and this is for unit testing
- Field topContainerField = ExoContainerContext.class.getDeclaredField("topContainer");
- topContainerField.setAccessible(true);
- topContainerField.set(null, null);
-
- // Same remark than above
- Field singletonField = RootContainer.class.getDeclaredField("singleton_");
- singletonField.setAccessible(true);
- singletonField.set(null, null);
-
- // Setup profiles
- if (profiles == null)
- {
- PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "");
- }
- else
- {
- StringBuilder builder = new StringBuilder();
- for (Iterator<String> i = profiles.iterator();i.hasNext();)
- {
- builder.append(i.next());
- if (i.hasNext())
- {
- builder.append(',');
- }
- }
- PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, builder.toString());
- }
-
- //
- ClassLoader rootCL = new ClassLoader(loader)
- {
- @Override
- public Enumeration<URL> getResources(String name) throws IOException
- {
- if ("conf/configuration.xml".equals(name))
- {
- return Collections.enumeration(configURLs);
- }
- else if ("conf/portal/configuration.xml".equals(name))
- {
- String portalName = bootedPortalName.get();
- return Collections.enumeration(portalConfigURLs.get(portalName));
- }
- else if ("conf/portal/test-configuration.xml".equals(name))
- {
- return Collections.enumeration(Collections.<URL>emptyList());
- }
- else
- {
- return super.getResources(name);
- }
- }
- };
-
- //
- ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
-
- // Boot root container
- RootContainer root;
- try
- {
- Thread.currentThread().setContextClassLoader(rootCL);
-
- //
- root = RootContainer.getInstance();
-
- //
- for (String portalName : portalConfigURLs.keySet())
- {
- try
- {
- bootedPortalName.set(portalName);
- root.getPortalContainer(portalName);
- }
- finally
- {
- bootedPortalName.set(null);
- }
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(oldCL);
- }
-
- //
- return root;
- }
-
- public static RootContainer bootstrap(URL configurationURL, String... profiles)
- {
- ContainerBuilder builder = new ContainerBuilder();
- builder.withRoot(configurationURL);
- return builder.build();
- }
-}
Modified: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java 2010-06-05 15:25:52 UTC (rev 1124)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java 2010-06-05 16:09:30 UTC (rev 1125)
@@ -22,21 +22,22 @@
******************************************************************************/
package org.jboss.gatein.authz.service;
-import java.net.URL;
+import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.PortalContainer;
import org.jboss.security.authz.policy.server.event.LocalEventBus;
import org.jboss.security.authz.policy.server.tools.HibernateService;
import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import org.jboss.gatein.authz.service.SecurityService;
import org.jboss.gatein.authz.service.PolicyServerComponent;
import org.jboss.gatein.authz.service.decision.PolicyDecisionPointComponent;
import org.jboss.gatein.authz.service.event.LocalEventBusComponent;
import org.jboss.gatein.authz.service.plugin.DroolsRuleManagerComponent;
import org.jboss.gatein.authz.service.provisioning.RelationalDBPolicyStoreComponent;
import org.jboss.gatein.authz.service.tools.HibernateServiceComponent;
-import org.jboss.security.authz.policy.server.PolicyServer;
import junit.framework.TestCase;
@@ -45,14 +46,26 @@
*
*/
public class TestKernelStartup extends TestCase
-{
+{
+ private SecurityService securityService;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ this.securityService = new SecurityService();
+ this.securityService.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ this.securityService.stop();
+ }
+
+
public void testStartup() throws Exception
- {
- URL rootURL = getClass().getResource("/conf/gatein-authz-configuration.xml");
- URL portalURL = getClass().getResource("/conf/portal/gatein-authz-configuration.xml");
- new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
-
- PortalContainer portal = PortalContainer.getInstance();
+ {
+ PortalContainer portal = this.securityService.getContainer();
//Integrating the EventBus service
LocalEventBusComponent eventBusComponent = (LocalEventBusComponent)portal.getComponentInstanceOfType(LocalEventBusComponent.class);
Added: authz/gatein/authz-plugin/trunk/tools/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/tools/pom.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/tools/pom.xml 2010-06-05 16:09:30 UTC (rev 1125)
@@ -0,0 +1,53 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.gatein.authz</groupId>
+ <artifactId>gatein-authz-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.gatein.authz.tools</groupId>
+ <artifactId>tools</artifactId>
+ <name>tools</name>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/tools/ContainerBuilder.java
===================================================================
--- authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/tools/ContainerBuilder.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/tools/src/main/java/org/jboss/gatein/authz/tools/ContainerBuilder.java 2010-06-05 16:09:30 UTC (rev 1125)
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.gatein.authz.tools;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.commons.utils.Tools;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.RootContainer;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>An helper for building a root container and a portal container. I have done several attempt to make easily
+ * and safe root/portal container boot for unit test. This one is my best attempt so far.</p>
+ *
+ * <p>Note that the portal container are booted in the order they are declared first.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ContainerBuilder
+{
+
+ /** A hack used during the boot of a portal container. */
+ private final ThreadLocal<String> bootedPortalName = new ThreadLocal<String>();
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private List<URL> configURLs;
+
+ /** . */
+ private LinkedHashMap<String, List<URL>> portalConfigURLs;
+
+ /** . */
+ private Set<String> profiles;
+
+ public ContainerBuilder()
+ {
+ this.loader = Thread.currentThread().getContextClassLoader();
+ this.configURLs = new ArrayList<URL>();
+ this.portalConfigURLs = new LinkedHashMap<String, List<URL>>();
+ }
+
+ public ContainerBuilder withRoot(String configPath)
+ {
+ configURLs.addAll(urls(configPath));
+ return this;
+ }
+
+ public ContainerBuilder withRoot(URL configURL)
+ {
+ configURLs.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withPortal(String configPath)
+ {
+ return withPortal("portal", configPath);
+ }
+
+ public ContainerBuilder withPortal(String portalName, String configPath)
+ {
+ for (URL configURL : urls(configPath))
+ {
+ withPortal(portalName, configURL);
+ }
+ return this;
+ }
+
+ public ContainerBuilder withPortal(URL configURL)
+ {
+ return withPortal("portal", configURL);
+ }
+
+ public ContainerBuilder withPortal(String portalName, URL configURL)
+ {
+ List<URL> urls = portalConfigURLs.get(portalName);
+ if (urls == null)
+ {
+ urls = new ArrayList<URL>();
+ portalConfigURLs.put(portalName, urls);
+ }
+ urls.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ return this;
+ }
+
+
+ private List<URL> urls(String path)
+ {
+ try
+ {
+ return Collections.list(loader.getResources(path));
+ }
+ catch (IOException e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ public RootContainer build()
+ {
+ try
+ {
+ return _build();
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ private RootContainer _build() throws Exception
+ {
+ //
+ if (configURLs.size() == 0)
+ {
+ throw new IllegalStateException("Must provide at least one URL for building the root container");
+ }
+
+ // Must clear the top container first otherwise it's not going to work well
+ // it's a big ugly but I don't want to change anything in the ExoContainerContext class for now
+ // and this is for unit testing
+ Field topContainerField = ExoContainerContext.class.getDeclaredField("topContainer");
+ topContainerField.setAccessible(true);
+ topContainerField.set(null, null);
+
+ // Same remark than above
+ Field singletonField = RootContainer.class.getDeclaredField("singleton_");
+ singletonField.setAccessible(true);
+ singletonField.set(null, null);
+
+ // Setup profiles
+ if (profiles == null)
+ {
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "");
+ }
+ else
+ {
+ StringBuilder builder = new StringBuilder();
+ for (Iterator<String> i = profiles.iterator();i.hasNext();)
+ {
+ builder.append(i.next());
+ if (i.hasNext())
+ {
+ builder.append(',');
+ }
+ }
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, builder.toString());
+ }
+
+ //
+ ClassLoader rootCL = new ClassLoader(loader)
+ {
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException
+ {
+ if ("conf/configuration.xml".equals(name))
+ {
+ return Collections.enumeration(configURLs);
+ }
+ else if ("conf/portal/configuration.xml".equals(name))
+ {
+ String portalName = bootedPortalName.get();
+ return Collections.enumeration(portalConfigURLs.get(portalName));
+ }
+ else if ("conf/portal/test-configuration.xml".equals(name))
+ {
+ return Collections.enumeration(Collections.<URL>emptyList());
+ }
+ else
+ {
+ return super.getResources(name);
+ }
+ }
+ };
+
+ //
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+
+ // Boot root container
+ RootContainer root;
+ try
+ {
+ Thread.currentThread().setContextClassLoader(rootCL);
+
+ //
+ root = RootContainer.getInstance();
+
+ //
+ for (String portalName : portalConfigURLs.keySet())
+ {
+ try
+ {
+ bootedPortalName.set(portalName);
+ root.getPortalContainer(portalName);
+ }
+ finally
+ {
+ bootedPortalName.set(null);
+ }
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+
+ //
+ return root;
+ }
+
+ public static RootContainer bootstrap(URL configurationURL, String... profiles)
+ {
+ ContainerBuilder builder = new ContainerBuilder();
+ builder.withRoot(configurationURL);
+ return builder.build();
+ }
+}
13 years, 11 months
JBoss Identity SVN: r1123 - in authz/gatein/authz-plugin/trunk/service/src: main/resources and 3 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 11:17:59 -0400 (Sat, 05 Jun 2010)
New Revision: 1123
Added:
authz/gatein/authz-plugin/trunk/service/src/main/resources/
authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/
authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/portal/
authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/portal/gatein-authz-configuration.xml
Removed:
authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/
Log:
refactoring
Added: authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/gatein-authz-configuration.xml 2010-06-05 15:17:59 UTC (rev 1123)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.jboss.gatein.authz.service.event.LocalEventBusComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/EventBus</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.tools.HibernateServiceComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/HibernateService</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.provisioning.RelationalDBPolicyStoreComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyStore</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.plugin.DroolsRuleManagerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/DroolsRuleManager</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.decision.PolicyDecisionPointComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyDecisionPoint</value>
+ </value-param>
+ <value-param>
+ <name>debug</name>
+ <value>true</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.service.PolicyServerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyServer</value>
+ </value-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/portal/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/portal/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/resources/conf/portal/gatein-authz-configuration.xml 2010-06-05 15:17:59 UTC (rev 1123)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+</configuration>
\ No newline at end of file
13 years, 11 months
JBoss Identity SVN: r1122 - in authz/gatein/authz-plugin/trunk/service: src/main/java/org/jboss/gatein/authz and 9 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 11:12:46 -0400 (Sat, 05 Jun 2010)
New Revision: 1122
Added:
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/PolicyServerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/decision/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/event/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/plugin/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/provisioning/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/tools/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/
Removed:
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/
Modified:
authz/gatein/authz-plugin/trunk/service/pom.xml
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/decision/PolicyDecisionPointComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/event/LocalEventBusComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/plugin/DroolsRuleManagerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/provisioning/RelationalDBPolicyStoreComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/tools/HibernateServiceComponent.java
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/MyComponent.java
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
Log:
refactoring
Modified: authz/gatein/authz-plugin/trunk/service/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/pom.xml 2010-06-05 15:00:09 UTC (rev 1121)
+++ authz/gatein/authz-plugin/trunk/service/pom.xml 2010-06-05 15:12:46 UTC (rev 1122)
@@ -8,7 +8,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>org.jboss.gatein.authz.core</groupId>
+ <groupId>org.jboss.gatein.authz.service</groupId>
<artifactId>service</artifactId>
<name>service</name>
<packaging>jar</packaging>
Deleted: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java 2010-06-05 15:00:09 UTC (rev 1121)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -1,83 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2010, 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.gatein.authz.core.server;
-
-import org.exoplatform.container.xml.InitParams;
-import org.picocontainer.Startable;
-
-import org.jboss.security.authz.policy.server.PolicyServer;
-
-import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
-import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
-import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
-import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
-import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class PolicyServerComponent implements Startable
-{
- private final InitParams params;
- private PolicyServer policyServer;
-
- public PolicyServerComponent(InitParams params,PolicyDecisionPointComponent pdpComponent,
- LocalEventBusComponent eventBusComponent,
- DroolsRuleManagerComponent ruleManagerComponent,
- RelationalDBPolicyStoreComponent storageComponent,
- HibernateServiceComponent hibernateServiceComponent)
- {
- this.params = params;
-
- this.policyServer = new PolicyServer();
-
- this.policyServer.setPolicyDecisionPoint(pdpComponent.getPDP());
- this.policyServer.setEventBus(eventBusComponent.getEventBus());
- this.policyServer.setRuleManager(ruleManagerComponent.getDroolsRuleManager());
- this.policyServer.setPolicyStore(storageComponent.getRelationalDBPolicyStore());
- this.policyServer.setHibernateService(hibernateServiceComponent.getHibernateService());
- }
-
- @Override
- public void start()
- {
- this.policyServer.start();
- }
-
- @Override
- public void stop()
- {
- this.policyServer.stop();
- }
-
- public String getName()
- {
- return this.params.getValueParam("name").getValue();
- }
- //--------------------------------------------------------------------------------------------------------------------------------------------------------
- public PolicyServer getPolicyServer()
- {
- return this.policyServer;
- }
-}
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/PolicyServerComponent.java (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java)
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/PolicyServerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/PolicyServerComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.service;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import org.jboss.gatein.authz.service.decision.PolicyDecisionPointComponent;
+import org.jboss.gatein.authz.service.event.LocalEventBusComponent;
+import org.jboss.gatein.authz.service.plugin.DroolsRuleManagerComponent;
+import org.jboss.gatein.authz.service.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.gatein.authz.service.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PolicyServerComponent implements Startable
+{
+ private final InitParams params;
+ private PolicyServer policyServer;
+
+ public PolicyServerComponent(InitParams params,PolicyDecisionPointComponent pdpComponent,
+ LocalEventBusComponent eventBusComponent,
+ DroolsRuleManagerComponent ruleManagerComponent,
+ RelationalDBPolicyStoreComponent storageComponent,
+ HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+
+ this.policyServer = new PolicyServer();
+
+ this.policyServer.setPolicyDecisionPoint(pdpComponent.getPDP());
+ this.policyServer.setEventBus(eventBusComponent.getEventBus());
+ this.policyServer.setRuleManager(ruleManagerComponent.getDroolsRuleManager());
+ this.policyServer.setPolicyStore(storageComponent.getRelationalDBPolicyStore());
+ this.policyServer.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.policyServer.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.policyServer.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PolicyServer getPolicyServer()
+ {
+ return this.policyServer;
+ }
+}
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/decision (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision)
Modified: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/decision/PolicyDecisionPointComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/decision/PolicyDecisionPointComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,7 +20,7 @@
* 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.gatein.authz.core.server.decision;
+package org.jboss.gatein.authz.service.decision;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.Startable;
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/event (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event)
Modified: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/event/LocalEventBusComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/event/LocalEventBusComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,7 +20,7 @@
* 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.gatein.authz.core.server.event;
+package org.jboss.gatein.authz.service.event;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.Startable;
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/plugin (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin)
Modified: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/plugin/DroolsRuleManagerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/plugin/DroolsRuleManagerComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,13 +20,13 @@
* 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.gatein.authz.core.server.plugin;
+package org.jboss.gatein.authz.service.plugin;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.Startable;
import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
-import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+import org.jboss.gatein.authz.service.tools.HibernateServiceComponent;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/provisioning (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning)
Modified: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/provisioning/RelationalDBPolicyStoreComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/provisioning/RelationalDBPolicyStoreComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,13 +20,13 @@
* 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.gatein.authz.core.server.provisioning;
+package org.jboss.gatein.authz.service.provisioning;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.Startable;
import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
-import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+import org.jboss.gatein.authz.service.tools.HibernateServiceComponent;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Copied: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/tools (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools)
Modified: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/tools/HibernateServiceComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/service/tools/HibernateServiceComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,7 +20,7 @@
* 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.gatein.authz.core.server.tools;
+package org.jboss.gatein.authz.service.tools;
import org.exoplatform.container.xml.InitParams;
import org.picocontainer.Startable;
Copied: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service (from rev 1119, authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core)
Modified: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/ContainerBuilder.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -16,7 +16,7 @@
* 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.gatein.authz.core;
+package org.jboss.gatein.authz.service;
import junit.framework.AssertionFailedError;
import org.exoplatform.commons.utils.PropertyManager;
Modified: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/MyComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/MyComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/MyComponent.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,7 +20,7 @@
* 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.gatein.authz.core;
+package org.jboss.gatein.authz.service;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
Modified: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java 2010-06-05 14:58:25 UTC (rev 1119)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/service/TestKernelStartup.java 2010-06-05 15:12:46 UTC (rev 1122)
@@ -20,22 +20,22 @@
* 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.gatein.authz.core;
+package org.jboss.gatein.authz.service;
import java.net.URL;
import org.exoplatform.container.PortalContainer;
-import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
import org.jboss.security.authz.policy.server.event.LocalEventBus;
-import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
import org.jboss.security.authz.policy.server.tools.HibernateService;
-import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
-import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
-import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
-import org.jboss.gatein.authz.core.server.PolicyServerComponent;
+import org.jboss.gatein.authz.service.PolicyServerComponent;
+import org.jboss.gatein.authz.service.decision.PolicyDecisionPointComponent;
+import org.jboss.gatein.authz.service.event.LocalEventBusComponent;
+import org.jboss.gatein.authz.service.plugin.DroolsRuleManagerComponent;
+import org.jboss.gatein.authz.service.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.gatein.authz.service.tools.HibernateServiceComponent;
import org.jboss.security.authz.policy.server.PolicyServer;
import junit.framework.TestCase;
13 years, 11 months
JBoss Identity SVN: r1120 - authz/gatein/authz-plugin/trunk/service.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 10:59:24 -0400 (Sat, 05 Jun 2010)
New Revision: 1120
Modified:
authz/gatein/authz-plugin/trunk/service/
Log:
svn:ignore
Property changes on: authz/gatein/authz-plugin/trunk/service
___________________________________________________________________
Name: svn:ignore
+ target
13 years, 11 months
JBoss Identity SVN: r1119 - in authz/gatein/authz-plugin/trunk: service and 24 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 10:58:25 -0400 (Sat, 05 Jun 2010)
New Revision: 1119
Added:
authz/gatein/authz-plugin/trunk/service/
authz/gatein/authz-plugin/trunk/service/pom.xml
authz/gatein/authz-plugin/trunk/service/src/
authz/gatein/authz-plugin/trunk/service/src/main/
authz/gatein/authz-plugin/trunk/service/src/main/java/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/
authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java
authz/gatein/authz-plugin/trunk/service/src/test/
authz/gatein/authz-plugin/trunk/service/src/test/java/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/MyComponent.java
authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java
authz/gatein/authz-plugin/trunk/service/src/test/resources/
authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/
authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/portal/
authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/portal/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/service/src/test/resources/hibernate.cfg.xml
authz/gatein/authz-plugin/trunk/service/src/test/resources/log4j.properties
Modified:
authz/gatein/authz-plugin/trunk/.classpath
authz/gatein/authz-plugin/trunk/pom.xml
Log:
refactoring
Modified: authz/gatein/authz-plugin/trunk/.classpath
===================================================================
--- authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 14:39:38 UTC (rev 1118)
+++ authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 14:58:25 UTC (rev 1119)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="core/src/main/java"/>
- <classpathentry kind="src" path="core/src/test/java"/>
+ <classpathentry kind="src" path="service/src/main/java"/>
+ <classpathentry kind="src" path="service/src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
Modified: authz/gatein/authz-plugin/trunk/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 14:39:38 UTC (rev 1118)
+++ authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 14:58:25 UTC (rev 1119)
@@ -9,7 +9,7 @@
<description>Authz Plugin for GateIn Portal</description>
<modules>
- <module>core</module>
+ <module>service</module>
</modules>
<properties>
Added: authz/gatein/authz-plugin/trunk/service/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/pom.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/pom.xml 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.gatein.authz</groupId>
+ <artifactId>gatein-authz-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.gatein.authz.core</groupId>
+ <artifactId>service</artifactId>
+ <name>service</name>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+
+ <!-- authz -->
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>policy-server</artifactId>
+ </dependency>
+
+ <!-- Hibernate Dependency -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!-- Drools -->
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
+import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
+import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
+import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PolicyServerComponent implements Startable
+{
+ private final InitParams params;
+ private PolicyServer policyServer;
+
+ public PolicyServerComponent(InitParams params,PolicyDecisionPointComponent pdpComponent,
+ LocalEventBusComponent eventBusComponent,
+ DroolsRuleManagerComponent ruleManagerComponent,
+ RelationalDBPolicyStoreComponent storageComponent,
+ HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+
+ this.policyServer = new PolicyServer();
+
+ this.policyServer.setPolicyDecisionPoint(pdpComponent.getPDP());
+ this.policyServer.setEventBus(eventBusComponent.getEventBus());
+ this.policyServer.setRuleManager(ruleManagerComponent.getDroolsRuleManager());
+ this.policyServer.setPolicyStore(storageComponent.getRelationalDBPolicyStore());
+ this.policyServer.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.policyServer.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.policyServer.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PolicyServer getPolicyServer()
+ {
+ return this.policyServer;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.decision;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PolicyDecisionPointComponent implements Startable
+{
+ private final InitParams params;
+ private PolicyDecisionPoint pdp;
+
+ public PolicyDecisionPointComponent(InitParams params)
+ {
+ this.params = params;
+ this.pdp = new PolicyDecisionPoint();
+ this.pdp.setDebug(Boolean.parseBoolean(this.params.getValueParam("debug").getValue()));
+ }
+
+ @Override
+ public void start()
+ {
+ this.pdp.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.pdp.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PolicyDecisionPoint getPDP()
+ {
+ return this.pdp;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.event;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.event.LocalEventBus;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LocalEventBusComponent implements Startable
+{
+ private final InitParams params;
+ private LocalEventBus eventBus;
+
+ public LocalEventBusComponent(InitParams params)
+ {
+ this.params = params;
+ this.eventBus = new LocalEventBus();
+ }
+
+ @Override
+ public void start()
+ {
+ this.eventBus.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.eventBus.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public LocalEventBus getEventBus()
+ {
+ return this.eventBus;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.plugin;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class DroolsRuleManagerComponent implements Startable
+{
+ private final InitParams params;
+ private DroolsRuleManager droolsRuleManager;
+
+ public DroolsRuleManagerComponent(InitParams params,HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+ this.droolsRuleManager = new DroolsRuleManager();
+ this.droolsRuleManager.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.droolsRuleManager.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.droolsRuleManager.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public DroolsRuleManager getDroolsRuleManager()
+ {
+ return this.droolsRuleManager;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.provisioning;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class RelationalDBPolicyStoreComponent implements Startable
+{
+ private final InitParams params;
+ private RelationalDBPolicyStore relationDBPolicyStore;
+
+ public RelationalDBPolicyStoreComponent(InitParams params,HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+ this.relationDBPolicyStore = new RelationalDBPolicyStore();
+ this.relationDBPolicyStore.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.relationDBPolicyStore.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.relationDBPolicyStore.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public RelationalDBPolicyStore getRelationalDBPolicyStore()
+ {
+ return this.relationDBPolicyStore;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.tools;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.tools.HibernateService;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class HibernateServiceComponent implements Startable
+{
+ private final InitParams params;
+ private HibernateService hibernateService;
+
+ public HibernateServiceComponent(InitParams params)
+ {
+ this.params = params;
+ this.hibernateService = new HibernateService();
+ }
+
+ @Override
+ public void start()
+ {
+ this.hibernateService.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.hibernateService.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public HibernateService getHibernateService()
+ {
+ return this.hibernateService;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.gatein.authz.core;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.commons.utils.Tools;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.RootContainer;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>An helper for building a root container and a portal container. I have done several attempt to make easily
+ * and safe root/portal container boot for unit test. This one is my best attempt so far.</p>
+ *
+ * <p>Note that the portal container are booted in the order they are declared first.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ContainerBuilder
+{
+
+ /** A hack used during the boot of a portal container. */
+ private final ThreadLocal<String> bootedPortalName = new ThreadLocal<String>();
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private List<URL> configURLs;
+
+ /** . */
+ private LinkedHashMap<String, List<URL>> portalConfigURLs;
+
+ /** . */
+ private Set<String> profiles;
+
+ public ContainerBuilder()
+ {
+ this.loader = Thread.currentThread().getContextClassLoader();
+ this.configURLs = new ArrayList<URL>();
+ this.portalConfigURLs = new LinkedHashMap<String, List<URL>>();
+ }
+
+ public ContainerBuilder withRoot(String configPath)
+ {
+ configURLs.addAll(urls(configPath));
+ return this;
+ }
+
+ public ContainerBuilder withRoot(URL configURL)
+ {
+ configURLs.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withPortal(String configPath)
+ {
+ return withPortal("portal", configPath);
+ }
+
+ public ContainerBuilder withPortal(String portalName, String configPath)
+ {
+ for (URL configURL : urls(configPath))
+ {
+ withPortal(portalName, configURL);
+ }
+ return this;
+ }
+
+ public ContainerBuilder withPortal(URL configURL)
+ {
+ return withPortal("portal", configURL);
+ }
+
+ public ContainerBuilder withPortal(String portalName, URL configURL)
+ {
+ List<URL> urls = portalConfigURLs.get(portalName);
+ if (urls == null)
+ {
+ urls = new ArrayList<URL>();
+ portalConfigURLs.put(portalName, urls);
+ }
+ urls.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ return this;
+ }
+
+
+ private List<URL> urls(String path)
+ {
+ try
+ {
+ return Collections.list(loader.getResources(path));
+ }
+ catch (IOException e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ public RootContainer build()
+ {
+ try
+ {
+ return _build();
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ private RootContainer _build() throws Exception
+ {
+ //
+ if (configURLs.size() == 0)
+ {
+ throw new IllegalStateException("Must provide at least one URL for building the root container");
+ }
+
+ // Must clear the top container first otherwise it's not going to work well
+ // it's a big ugly but I don't want to change anything in the ExoContainerContext class for now
+ // and this is for unit testing
+ Field topContainerField = ExoContainerContext.class.getDeclaredField("topContainer");
+ topContainerField.setAccessible(true);
+ topContainerField.set(null, null);
+
+ // Same remark than above
+ Field singletonField = RootContainer.class.getDeclaredField("singleton_");
+ singletonField.setAccessible(true);
+ singletonField.set(null, null);
+
+ // Setup profiles
+ if (profiles == null)
+ {
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "");
+ }
+ else
+ {
+ StringBuilder builder = new StringBuilder();
+ for (Iterator<String> i = profiles.iterator();i.hasNext();)
+ {
+ builder.append(i.next());
+ if (i.hasNext())
+ {
+ builder.append(',');
+ }
+ }
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, builder.toString());
+ }
+
+ //
+ ClassLoader rootCL = new ClassLoader(loader)
+ {
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException
+ {
+ if ("conf/configuration.xml".equals(name))
+ {
+ return Collections.enumeration(configURLs);
+ }
+ else if ("conf/portal/configuration.xml".equals(name))
+ {
+ String portalName = bootedPortalName.get();
+ return Collections.enumeration(portalConfigURLs.get(portalName));
+ }
+ else if ("conf/portal/test-configuration.xml".equals(name))
+ {
+ return Collections.enumeration(Collections.<URL>emptyList());
+ }
+ else
+ {
+ return super.getResources(name);
+ }
+ }
+ };
+
+ //
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+
+ // Boot root container
+ RootContainer root;
+ try
+ {
+ Thread.currentThread().setContextClassLoader(rootCL);
+
+ //
+ root = RootContainer.getInstance();
+
+ //
+ for (String portalName : portalConfigURLs.keySet())
+ {
+ try
+ {
+ bootedPortalName.set(portalName);
+ root.getPortalContainer(portalName);
+ }
+ finally
+ {
+ bootedPortalName.set(null);
+ }
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+
+ //
+ return root;
+ }
+
+ public static RootContainer bootstrap(URL configurationURL, String... profiles)
+ {
+ ContainerBuilder builder = new ContainerBuilder();
+ builder.withRoot(configurationURL);
+ return builder.build();
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/MyComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/MyComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/MyComponent.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class MyComponent
+{
+ private final InitParams params;
+
+ public MyComponent(InitParams params)
+ {
+ this.params = params;
+ }
+
+ public String getValue(String name)
+ {
+ final ValueParam vp = params.getValueParam(name);
+ return vp == null ? null : vp.getValue();
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core;
+
+import java.net.URL;
+
+import org.exoplatform.container.PortalContainer;
+import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
+import org.jboss.security.authz.policy.server.event.LocalEventBus;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+import org.jboss.security.authz.policy.server.tools.HibernateService;
+import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
+import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
+import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
+import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
+import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+import org.jboss.gatein.authz.core.server.PolicyServerComponent;
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class TestKernelStartup extends TestCase
+{
+ public void testStartup() throws Exception
+ {
+ URL rootURL = getClass().getResource("/conf/gatein-authz-configuration.xml");
+ URL portalURL = getClass().getResource("/conf/portal/gatein-authz-configuration.xml");
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+
+ PortalContainer portal = PortalContainer.getInstance();
+
+ //Integrating the EventBus service
+ LocalEventBusComponent eventBusComponent = (LocalEventBusComponent)portal.getComponentInstanceOfType(LocalEventBusComponent.class);
+ assertNotNull(eventBusComponent);
+ LocalEventBus eventBus = eventBusComponent.getEventBus();
+ assertNotNull(eventBus);
+ assertEquals(eventBusComponent.getName(),"/policy-server/EventBus");
+
+ //Integrating the Hibernate Service
+ HibernateServiceComponent hibernateServiceComponent = (HibernateServiceComponent)portal.getComponentInstanceOfType(
+ HibernateServiceComponent.class);
+ assertNotNull(hibernateServiceComponent);
+ HibernateService hibernateService = hibernateServiceComponent.getHibernateService();
+ assertNotNull(hibernateService);
+ assertEquals(hibernateServiceComponent.getName(),"/policy-server/HibernateService");
+
+ //Integrating the RelationalDBPolicy Store
+ RelationalDBPolicyStoreComponent dbComponent = (RelationalDBPolicyStoreComponent)portal.getComponentInstanceOfType(
+ RelationalDBPolicyStoreComponent.class);
+ assertNotNull(dbComponent);
+ RelationalDBPolicyStore store = dbComponent.getRelationalDBPolicyStore();
+ assertNotNull(store);
+ assertEquals(dbComponent.getName(),"/policy-server/PolicyStore");
+
+ //Integrating DroolsRuleManager
+ DroolsRuleManagerComponent rmComponent = (DroolsRuleManagerComponent)portal.getComponentInstanceOfType(
+ DroolsRuleManagerComponent.class);
+ assertNotNull(rmComponent);
+ DroolsRuleManager ruleManager = rmComponent.getDroolsRuleManager();
+ assertNotNull(ruleManager);
+ assertEquals(rmComponent.getName(),"/policy-server/DroolsRuleManager");
+
+ //Integrating Policy Decision Point
+ PolicyDecisionPointComponent pdpComponent = (PolicyDecisionPointComponent)portal.getComponentInstanceOfType(PolicyDecisionPointComponent.class);
+ assertNotNull(pdpComponent);
+ PolicyDecisionPoint pdp = pdpComponent.getPDP();
+ assertNotNull(pdp);
+ assertEquals(pdpComponent.getName(),"/policy-server/PolicyDecisionPoint");
+ assertTrue(pdp.isDebug());
+
+ //Integrating the PolicyServer
+ PolicyServerComponent policyServerComponent = (PolicyServerComponent)portal.getComponentInstanceOfType(PolicyServerComponent.class);
+ assertNotNull(policyServerComponent);
+ PolicyServer policyServer = policyServerComponent.getPolicyServer();
+ assertNotNull(policyServer);
+ assertEquals(policyServerComponent.getName(),"/policy-server/PolicyServer");
+ }
+}
Added: authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/gatein-authz-configuration.xml 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.jboss.gatein.authz.core.server.event.LocalEventBusComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/EventBus</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/HibernateService</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyStore</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/DroolsRuleManager</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyDecisionPoint</value>
+ </value-param>
+ <value-param>
+ <name>debug</name>
+ <value>true</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.PolicyServerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyServer</value>
+ </value-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/portal/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/portal/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/resources/conf/portal/gatein-authz-configuration.xml 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+</configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/service/src/test/resources/hibernate.cfg.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/resources/hibernate.cfg.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/resources/hibernate.cfg.xml 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,59 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- Database connection settings -->
+ <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="connection.url">jdbc:hsqldb:file:target/testdb</property>
+ <property name="connection.username">sa</property>
+ <property name="connection.password"></property>
+
+ <!-- JDBC connection pool (use the built-in) -->
+ <property name="connection.pool_size">1</property>
+
+ <!-- SQL dialect -->
+ <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
+
+ <!-- Enable Hibernate's automatic session context management -->
+ <property name="current_session_context_class">thread</property>
+
+ <!-- Disable the second-level cache -->
+ <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
+
+ <!-- Echo all executed SQL to stdout -->
+ <property name="show_sql">true</property>
+
+ <!--
+ Drop and re-create the database schema on startup
+ -->
+ <property name="hbm2ddl.auto">create</property>
+
+ <mapping resource="policy.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/service/src/test/resources/log4j.properties
===================================================================
--- authz/gatein/authz-plugin/trunk/service/src/test/resources/log4j.properties (rev 0)
+++ authz/gatein/authz-plugin/trunk/service/src/test/resources/log4j.properties 2010-06-05 14:58:25 UTC (rev 1119)
@@ -0,0 +1,8 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
13 years, 11 months
JBoss Identity SVN: r1118 - in authz/gatein/authz-plugin/trunk: core and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 10:39:38 -0400 (Sat, 05 Jun 2010)
New Revision: 1118
Modified:
authz/gatein/authz-plugin/trunk/
authz/gatein/authz-plugin/trunk/core/
Log:
svn:ignore
Property changes on: authz/gatein/authz-plugin/trunk
___________________________________________________________________
Name: svn:ignore
+ eclipse-bin
Property changes on: authz/gatein/authz-plugin/trunk/core
___________________________________________________________________
Name: svn:ignore
+ target
13 years, 11 months
JBoss Identity SVN: r1116 - in authz/gatein/authz-plugin: trunk and 39 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2010-06-05 10:35:30 -0400 (Sat, 05 Jun 2010)
New Revision: 1116
Added:
authz/gatein/authz-plugin/trunk/
authz/gatein/authz-plugin/trunk/.classpath
authz/gatein/authz-plugin/trunk/.project
authz/gatein/authz-plugin/trunk/.settings/
authz/gatein/authz-plugin/trunk/.settings/org.maven.ide.eclipse.prefs
authz/gatein/authz-plugin/trunk/core/
authz/gatein/authz-plugin/trunk/core/pom.xml
authz/gatein/authz-plugin/trunk/core/src/
authz/gatein/authz-plugin/trunk/core/src/main/
authz/gatein/authz-plugin/trunk/core/src/main/java/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/decision/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/event/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/plugin/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/provisioning/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/tools/
authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java
authz/gatein/authz-plugin/trunk/core/src/test/
authz/gatein/authz-plugin/trunk/core/src/test/java/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/MyComponent.java
authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java
authz/gatein/authz-plugin/trunk/core/src/test/resources/
authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/
authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/portal/
authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/portal/gatein-authz-configuration.xml
authz/gatein/authz-plugin/trunk/core/src/test/resources/hibernate.cfg.xml
authz/gatein/authz-plugin/trunk/core/src/test/resources/log4j.properties
authz/gatein/authz-plugin/trunk/eclipse-bin/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder$1.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/MyComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/TestKernelStartup.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/PolicyServerComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/decision/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/event/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/plugin/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/provisioning/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.class
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/tools/
authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.class
authz/gatein/authz-plugin/trunk/pom.xml
Log:
backup
Added: authz/gatein/authz-plugin/trunk/.classpath
===================================================================
--- authz/gatein/authz-plugin/trunk/.classpath (rev 0)
+++ authz/gatein/authz-plugin/trunk/.classpath 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="core/src/main/java"/>
+ <classpathentry kind="src" path="core/src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="output" path="eclipse-bin/classes"/>
+</classpath>
Added: authz/gatein/authz-plugin/trunk/.project
===================================================================
--- authz/gatein/authz-plugin/trunk/.project (rev 0)
+++ authz/gatein/authz-plugin/trunk/.project 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gatein-authz-plugin</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: authz/gatein/authz-plugin/trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- authz/gatein/authz-plugin/trunk/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ authz/gatein/authz-plugin/trunk/.settings/org.maven.ide.eclipse.prefs 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,9 @@
+#Sun May 09 15:47:13 CDT 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=true
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: authz/gatein/authz-plugin/trunk/core/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/core/pom.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/pom.xml 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,87 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.gatein.authz</groupId>
+ <artifactId>gatein-authz-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.gatein.authz.core</groupId>
+ <artifactId>core</artifactId>
+ <name>core</name>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ </dependency>
+
+ <!-- authz -->
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>policy-server</artifactId>
+ </dependency>
+
+ <!-- Hibernate Dependency -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+
+ <!-- Drools -->
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/PolicyServerComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
+import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
+import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
+import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PolicyServerComponent implements Startable
+{
+ private final InitParams params;
+ private PolicyServer policyServer;
+
+ public PolicyServerComponent(InitParams params,PolicyDecisionPointComponent pdpComponent,
+ LocalEventBusComponent eventBusComponent,
+ DroolsRuleManagerComponent ruleManagerComponent,
+ RelationalDBPolicyStoreComponent storageComponent,
+ HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+
+ this.policyServer = new PolicyServer();
+
+ this.policyServer.setPolicyDecisionPoint(pdpComponent.getPDP());
+ this.policyServer.setEventBus(eventBusComponent.getEventBus());
+ this.policyServer.setRuleManager(ruleManagerComponent.getDroolsRuleManager());
+ this.policyServer.setPolicyStore(storageComponent.getRelationalDBPolicyStore());
+ this.policyServer.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.policyServer.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.policyServer.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PolicyServer getPolicyServer()
+ {
+ return this.policyServer;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.decision;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PolicyDecisionPointComponent implements Startable
+{
+ private final InitParams params;
+ private PolicyDecisionPoint pdp;
+
+ public PolicyDecisionPointComponent(InitParams params)
+ {
+ this.params = params;
+ this.pdp = new PolicyDecisionPoint();
+ this.pdp.setDebug(Boolean.parseBoolean(this.params.getValueParam("debug").getValue()));
+ }
+
+ @Override
+ public void start()
+ {
+ this.pdp.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.pdp.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PolicyDecisionPoint getPDP()
+ {
+ return this.pdp;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.event;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.event.LocalEventBus;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class LocalEventBusComponent implements Startable
+{
+ private final InitParams params;
+ private LocalEventBus eventBus;
+
+ public LocalEventBusComponent(InitParams params)
+ {
+ this.params = params;
+ this.eventBus = new LocalEventBus();
+ }
+
+ @Override
+ public void start()
+ {
+ this.eventBus.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.eventBus.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public LocalEventBus getEventBus()
+ {
+ return this.eventBus;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.plugin;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class DroolsRuleManagerComponent implements Startable
+{
+ private final InitParams params;
+ private DroolsRuleManager droolsRuleManager;
+
+ public DroolsRuleManagerComponent(InitParams params,HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+ this.droolsRuleManager = new DroolsRuleManager();
+ this.droolsRuleManager.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.droolsRuleManager.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.droolsRuleManager.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public DroolsRuleManager getDroolsRuleManager()
+ {
+ return this.droolsRuleManager;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.provisioning;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class RelationalDBPolicyStoreComponent implements Startable
+{
+ private final InitParams params;
+ private RelationalDBPolicyStore relationDBPolicyStore;
+
+ public RelationalDBPolicyStoreComponent(InitParams params,HibernateServiceComponent hibernateServiceComponent)
+ {
+ this.params = params;
+ this.relationDBPolicyStore = new RelationalDBPolicyStore();
+ this.relationDBPolicyStore.setHibernateService(hibernateServiceComponent.getHibernateService());
+ }
+
+ @Override
+ public void start()
+ {
+ this.relationDBPolicyStore.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.relationDBPolicyStore.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public RelationalDBPolicyStore getRelationalDBPolicyStore()
+ {
+ return this.relationDBPolicyStore;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/main/java/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core.server.tools;
+
+import org.exoplatform.container.xml.InitParams;
+import org.picocontainer.Startable;
+
+import org.jboss.security.authz.policy.server.tools.HibernateService;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class HibernateServiceComponent implements Startable
+{
+ private final InitParams params;
+ private HibernateService hibernateService;
+
+ public HibernateServiceComponent(InitParams params)
+ {
+ this.params = params;
+ this.hibernateService = new HibernateService();
+ }
+
+ @Override
+ public void start()
+ {
+ this.hibernateService.start();
+ }
+
+ @Override
+ public void stop()
+ {
+ this.hibernateService.stop();
+ }
+
+ public String getName()
+ {
+ return this.params.getValueParam("name").getValue();
+ }
+ //--------------------------------------------------------------------------------------------------------------------------------------------------------
+ public HibernateService getHibernateService()
+ {
+ return this.hibernateService;
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/ContainerBuilder.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.gatein.authz.core;
+
+import junit.framework.AssertionFailedError;
+import org.exoplatform.commons.utils.PropertyManager;
+import org.exoplatform.commons.utils.Tools;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.RootContainer;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>An helper for building a root container and a portal container. I have done several attempt to make easily
+ * and safe root/portal container boot for unit test. This one is my best attempt so far.</p>
+ *
+ * <p>Note that the portal container are booted in the order they are declared first.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ContainerBuilder
+{
+
+ /** A hack used during the boot of a portal container. */
+ private final ThreadLocal<String> bootedPortalName = new ThreadLocal<String>();
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private List<URL> configURLs;
+
+ /** . */
+ private LinkedHashMap<String, List<URL>> portalConfigURLs;
+
+ /** . */
+ private Set<String> profiles;
+
+ public ContainerBuilder()
+ {
+ this.loader = Thread.currentThread().getContextClassLoader();
+ this.configURLs = new ArrayList<URL>();
+ this.portalConfigURLs = new LinkedHashMap<String, List<URL>>();
+ }
+
+ public ContainerBuilder withRoot(String configPath)
+ {
+ configURLs.addAll(urls(configPath));
+ return this;
+ }
+
+ public ContainerBuilder withRoot(URL configURL)
+ {
+ configURLs.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withPortal(String configPath)
+ {
+ return withPortal("portal", configPath);
+ }
+
+ public ContainerBuilder withPortal(String portalName, String configPath)
+ {
+ for (URL configURL : urls(configPath))
+ {
+ withPortal(portalName, configURL);
+ }
+ return this;
+ }
+
+ public ContainerBuilder withPortal(URL configURL)
+ {
+ return withPortal("portal", configURL);
+ }
+
+ public ContainerBuilder withPortal(String portalName, URL configURL)
+ {
+ List<URL> urls = portalConfigURLs.get(portalName);
+ if (urls == null)
+ {
+ urls = new ArrayList<URL>();
+ portalConfigURLs.put(portalName, urls);
+ }
+ urls.add(configURL);
+ return this;
+ }
+
+ public ContainerBuilder withLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ return this;
+ }
+
+
+ private List<URL> urls(String path)
+ {
+ try
+ {
+ return Collections.list(loader.getResources(path));
+ }
+ catch (IOException e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ public RootContainer build()
+ {
+ try
+ {
+ return _build();
+ }
+ catch (Exception e)
+ {
+ AssertionFailedError err = new AssertionFailedError();
+ err.initCause(e);
+ throw err;
+ }
+ }
+
+ private RootContainer _build() throws Exception
+ {
+ //
+ if (configURLs.size() == 0)
+ {
+ throw new IllegalStateException("Must provide at least one URL for building the root container");
+ }
+
+ // Must clear the top container first otherwise it's not going to work well
+ // it's a big ugly but I don't want to change anything in the ExoContainerContext class for now
+ // and this is for unit testing
+ Field topContainerField = ExoContainerContext.class.getDeclaredField("topContainer");
+ topContainerField.setAccessible(true);
+ topContainerField.set(null, null);
+
+ // Same remark than above
+ Field singletonField = RootContainer.class.getDeclaredField("singleton_");
+ singletonField.setAccessible(true);
+ singletonField.set(null, null);
+
+ // Setup profiles
+ if (profiles == null)
+ {
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, "");
+ }
+ else
+ {
+ StringBuilder builder = new StringBuilder();
+ for (Iterator<String> i = profiles.iterator();i.hasNext();)
+ {
+ builder.append(i.next());
+ if (i.hasNext())
+ {
+ builder.append(',');
+ }
+ }
+ PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, builder.toString());
+ }
+
+ //
+ ClassLoader rootCL = new ClassLoader(loader)
+ {
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException
+ {
+ if ("conf/configuration.xml".equals(name))
+ {
+ return Collections.enumeration(configURLs);
+ }
+ else if ("conf/portal/configuration.xml".equals(name))
+ {
+ String portalName = bootedPortalName.get();
+ return Collections.enumeration(portalConfigURLs.get(portalName));
+ }
+ else if ("conf/portal/test-configuration.xml".equals(name))
+ {
+ return Collections.enumeration(Collections.<URL>emptyList());
+ }
+ else
+ {
+ return super.getResources(name);
+ }
+ }
+ };
+
+ //
+ ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
+
+ // Boot root container
+ RootContainer root;
+ try
+ {
+ Thread.currentThread().setContextClassLoader(rootCL);
+
+ //
+ root = RootContainer.getInstance();
+
+ //
+ for (String portalName : portalConfigURLs.keySet())
+ {
+ try
+ {
+ bootedPortalName.set(portalName);
+ root.getPortalContainer(portalName);
+ }
+ finally
+ {
+ bootedPortalName.set(null);
+ }
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCL);
+ }
+
+ //
+ return root;
+ }
+
+ public static RootContainer bootstrap(URL configurationURL, String... profiles)
+ {
+ ContainerBuilder builder = new ContainerBuilder();
+ builder.withRoot(configurationURL);
+ return builder.build();
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/MyComponent.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/MyComponent.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/MyComponent.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class MyComponent
+{
+ private final InitParams params;
+
+ public MyComponent(InitParams params)
+ {
+ this.params = params;
+ }
+
+ public String getValue(String name)
+ {
+ final ValueParam vp = params.getValueParam(name);
+ return vp == null ? null : vp.getValue();
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/java/org/jboss/gatein/authz/core/TestKernelStartup.java 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2010, 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.gatein.authz.core;
+
+import java.net.URL;
+
+import org.exoplatform.container.PortalContainer;
+import org.jboss.gatein.authz.core.server.event.LocalEventBusComponent;
+import org.jboss.security.authz.policy.server.event.LocalEventBus;
+import org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent;
+import org.jboss.security.authz.policy.server.tools.HibernateService;
+import org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent;
+import org.jboss.security.authz.policy.server.provisioning.RelationalDBPolicyStore;
+import org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent;
+import org.jboss.security.authz.policy.server.plugin.DroolsRuleManager;
+import org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent;
+import org.jboss.security.authz.policy.server.decision.PolicyDecisionPoint;
+import org.jboss.gatein.authz.core.server.PolicyServerComponent;
+import org.jboss.security.authz.policy.server.PolicyServer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class TestKernelStartup extends TestCase
+{
+ public void testStartup() throws Exception
+ {
+ URL rootURL = getClass().getResource("/conf/gatein-authz-configuration.xml");
+ URL portalURL = getClass().getResource("/conf/portal/gatein-authz-configuration.xml");
+ new ContainerBuilder().withRoot(rootURL).withPortal(portalURL).build();
+
+ PortalContainer portal = PortalContainer.getInstance();
+
+ //Integrating the EventBus service
+ LocalEventBusComponent eventBusComponent = (LocalEventBusComponent)portal.getComponentInstanceOfType(LocalEventBusComponent.class);
+ assertNotNull(eventBusComponent);
+ LocalEventBus eventBus = eventBusComponent.getEventBus();
+ assertNotNull(eventBus);
+ assertEquals(eventBusComponent.getName(),"/policy-server/EventBus");
+
+ //Integrating the Hibernate Service
+ HibernateServiceComponent hibernateServiceComponent = (HibernateServiceComponent)portal.getComponentInstanceOfType(
+ HibernateServiceComponent.class);
+ assertNotNull(hibernateServiceComponent);
+ HibernateService hibernateService = hibernateServiceComponent.getHibernateService();
+ assertNotNull(hibernateService);
+ assertEquals(hibernateServiceComponent.getName(),"/policy-server/HibernateService");
+
+ //Integrating the RelationalDBPolicy Store
+ RelationalDBPolicyStoreComponent dbComponent = (RelationalDBPolicyStoreComponent)portal.getComponentInstanceOfType(
+ RelationalDBPolicyStoreComponent.class);
+ assertNotNull(dbComponent);
+ RelationalDBPolicyStore store = dbComponent.getRelationalDBPolicyStore();
+ assertNotNull(store);
+ assertEquals(dbComponent.getName(),"/policy-server/PolicyStore");
+
+ //Integrating DroolsRuleManager
+ DroolsRuleManagerComponent rmComponent = (DroolsRuleManagerComponent)portal.getComponentInstanceOfType(
+ DroolsRuleManagerComponent.class);
+ assertNotNull(rmComponent);
+ DroolsRuleManager ruleManager = rmComponent.getDroolsRuleManager();
+ assertNotNull(ruleManager);
+ assertEquals(rmComponent.getName(),"/policy-server/DroolsRuleManager");
+
+ //Integrating Policy Decision Point
+ PolicyDecisionPointComponent pdpComponent = (PolicyDecisionPointComponent)portal.getComponentInstanceOfType(PolicyDecisionPointComponent.class);
+ assertNotNull(pdpComponent);
+ PolicyDecisionPoint pdp = pdpComponent.getPDP();
+ assertNotNull(pdp);
+ assertEquals(pdpComponent.getName(),"/policy-server/PolicyDecisionPoint");
+ assertTrue(pdp.isDebug());
+
+ //Integrating the PolicyServer
+ PolicyServerComponent policyServerComponent = (PolicyServerComponent)portal.getComponentInstanceOfType(PolicyServerComponent.class);
+ assertNotNull(policyServerComponent);
+ PolicyServer policyServer = policyServerComponent.getPolicyServer();
+ assertNotNull(policyServer);
+ assertEquals(policyServerComponent.getName(),"/policy-server/PolicyServer");
+ }
+}
Added: authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/gatein-authz-configuration.xml 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.jboss.gatein.authz.core.server.event.LocalEventBusComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/EventBus</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.tools.HibernateServiceComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/HibernateService</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.provisioning.RelationalDBPolicyStoreComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyStore</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.plugin.DroolsRuleManagerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/DroolsRuleManager</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.decision.PolicyDecisionPointComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyDecisionPoint</value>
+ </value-param>
+ <value-param>
+ <name>debug</name>
+ <value>true</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.jboss.gatein.authz.core.server.PolicyServerComponent</type>
+ <init-params>
+ <value-param>
+ <name>name</name>
+ <value>/policy-server/PolicyServer</value>
+ </value-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/portal/gatein-authz-configuration.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/portal/gatein-authz-configuration.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/resources/conf/portal/gatein-authz-configuration.xml 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+</configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/core/src/test/resources/hibernate.cfg.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/resources/hibernate.cfg.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/resources/hibernate.cfg.xml 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,59 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- Database connection settings -->
+ <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="connection.url">jdbc:hsqldb:file:target/testdb</property>
+ <property name="connection.username">sa</property>
+ <property name="connection.password"></property>
+
+ <!-- JDBC connection pool (use the built-in) -->
+ <property name="connection.pool_size">1</property>
+
+ <!-- SQL dialect -->
+ <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
+
+ <!-- Enable Hibernate's automatic session context management -->
+ <property name="current_session_context_class">thread</property>
+
+ <!-- Disable the second-level cache -->
+ <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
+
+ <!-- Echo all executed SQL to stdout -->
+ <property name="show_sql">true</property>
+
+ <!--
+ Drop and re-create the database schema on startup
+ -->
+ <property name="hbm2ddl.auto">create</property>
+
+ <mapping resource="policy.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Added: authz/gatein/authz-plugin/trunk/core/src/test/resources/log4j.properties
===================================================================
--- authz/gatein/authz-plugin/trunk/core/src/test/resources/log4j.properties (rev 0)
+++ authz/gatein/authz-plugin/trunk/core/src/test/resources/log4j.properties 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,8 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=INFO
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder$1.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/ContainerBuilder.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/MyComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/MyComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/TestKernelStartup.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/TestKernelStartup.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/PolicyServerComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/PolicyServerComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/decision/PolicyDecisionPointComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/event/LocalEventBusComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/plugin/DroolsRuleManagerComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/provisioning/RelationalDBPolicyStoreComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.class
===================================================================
(Binary files differ)
Property changes on: authz/gatein/authz-plugin/trunk/eclipse-bin/classes/org/jboss/gatein/authz/core/server/tools/HibernateServiceComponent.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: authz/gatein/authz-plugin/trunk/pom.xml
===================================================================
--- authz/gatein/authz-plugin/trunk/pom.xml (rev 0)
+++ authz/gatein/authz-plugin/trunk/pom.xml 2010-06-05 14:35:30 UTC (rev 1116)
@@ -0,0 +1,179 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.gatein.authz</groupId>
+ <artifactId>gatein-authz-plugin</artifactId>
+ <packaging>pom</packaging>
+ <name>gatein-authz-plugin</name>
+ <version>1.0-SNAPSHOT</version>
+ <description>Authz Plugin for GateIn Portal</description>
+
+ <modules>
+ <module>core</module>
+ </modules>
+
+ <properties>
+ <org.exoplatform.kernel.version>2.2.1-GA</org.exoplatform.kernel.version>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+
+ <!--
+ <dependency> <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId> <version>1.2.14</version>
+ </dependency>
+ -->
+
+ <!-- GateIn Kernel dependencies -->
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.command</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <!-- authz dependencies -->
+ <dependency>
+ <groupId>org.jboss.security.authz</groupId>
+ <artifactId>policy-server</artifactId>
+ <version>trunk-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Hibernate Dependency -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ </dependency>
+
+ <!-- Drools -->
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <version>4.0.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ <version>4.0.7</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.mvel</groupId>
+ <artifactId>mvel</artifactId>
+ <version>1.3.1-java1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ <version>3.0</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <!--
+ <dependency> <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId> </dependency>
+ -->
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
13 years, 11 months