Author: sohil.shah(a)jboss.com
Date: 2009-07-12 13:28:57 -0400 (Sun, 12 Jul 2009)
New Revision: 13548
Added:
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/EmbeddedBootstrap.java
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/ServiceContainer.java
Removed:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/Agent.java
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/EmbeddedBootstrap.java
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/EmbeddedBootstrap.java
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/Server.java
Modified:
modules/authorization/trunk/agent/pom.xml
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/enforcement/LocalEnforcementPoint.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliedActions.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliesHierarchialPropagation.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestPolicyServer.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestEnforcementGenerator.java
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java
modules/authorization/trunk/common-api/pom.xml
modules/authorization/trunk/http-profile/pom.xml
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestHttpResource.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestParameterMatching.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestRoles.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestURLPattern.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/integration/TestEnterprisePolicyFinderModule.java
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/provisioning/TestHttpPolicyConfig.java
modules/authorization/trunk/policy-server/pom.xml
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/DroolsFunction.java
modules/authorization/trunk/portal-profile/pom.xml
Log:
testsuite refactoring
Modified: modules/authorization/trunk/agent/pom.xml
===================================================================
--- modules/authorization/trunk/agent/pom.xml 2009-07-11 19:55:21 UTC (rev 13547)
+++ modules/authorization/trunk/agent/pom.xml 2009-07-12 17:28:57 UTC (rev 13548)
@@ -28,12 +28,7 @@
<groupId>org.jboss.security.authz</groupId>
<artifactId>policy-server</artifactId>
<version>${project.version}</version>
- </dependency>
- <!-- jboss microcontainer -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
+ </dependency>
<!-- jboss xacml -->
<dependency>
<groupId>org.jboss.security</groupId>
Deleted:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/Agent.java
===================================================================
---
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/Agent.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/Agent.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -1,86 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.security.authz.agent;
-
-import java.net.URL;
-import java.util.Enumeration;
-
-import org.apache.log4j.Logger;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.dependency.spi.ControllerContext;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class Agent
-{
- private static Logger log = Logger.getLogger(Agent.class);
-
- private static Kernel kernel;
-
- public Agent()
- {
-
- }
-
- public static void bootstrap()
- {
- try
- {
- EmbeddedBootstrap bootstrap = new EmbeddedBootstrap();
- bootstrap.run();
-
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Enumeration e = cl.getResources("META-INF/jboss-beans.xml");
- while(e.hasMoreElements())
- {
- URL url = (URL)e.nextElement();
- bootstrap.deploy(url);
- }
-
- kernel = bootstrap.getKernel();
- }
- catch(Exception e)
- {
- log.error("org.jboss.security.authz.policy.server.Server", e);
- throw new RuntimeException(e);
- }
- }
-
- public static Object lookup(String serviceId)
- {
- Object service = null;
-
- KernelController kernelController = kernel.getController();
- ControllerContext controllerContext =
kernelController.getInstalledContext(serviceId);
- if(controllerContext != null)
- {
- service = controllerContext.getTarget();
- }
-
- return service;
- }
-}
Deleted:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/EmbeddedBootstrap.java
===================================================================
---
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/EmbeddedBootstrap.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/EmbeddedBootstrap.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -1,98 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.security.authz.agent;
-
-import java.net.URL;
-
-import org.apache.log4j.Logger;
-
-import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-final class EmbeddedBootstrap extends BasicBootstrap
-{
- private static Logger log = Logger.getLogger(EmbeddedBootstrap.class);
-
- protected BasicXMLDeployer deployer;
-
- public EmbeddedBootstrap() throws Exception
- {
- super();
- }
-
- public void bootstrap() throws Throwable
- {
- super.bootstrap();
- deployer = new BasicXMLDeployer(getKernel());
- Runtime.getRuntime().addShutdownHook(new Shutdown());
- }
-
- public void deploy(URL url)
- {
- try
- {
- // Workaround the fact that the BasicXMLDeployer does not handle
- // redeployment correctly
- if (deployer.getDeploymentNames().contains(url.toString()))
- {
- log.debug("Service is already deployed.");
- return;
- }
- deployer.deploy(url);
- }
- catch (Throwable t)
- {
- log.error(this, t);
- }
- }
-
- public void undeploy(URL url)
- {
- if (!deployer.getDeploymentNames().contains(url.toString()))
- {
- log.debug("Service is already undeployed.");
- return;
- }
- try
- {
- deployer.undeploy(url);
- }
- catch (Throwable t)
- {
- log.error(this, t);
- }
- }
-
- protected class Shutdown extends Thread
- {
- public void run()
- {
- log.info("Shutting down");
- deployer.shutdown();
- }
- }
-}
Modified:
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/enforcement/LocalEnforcementPoint.java
===================================================================
---
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/enforcement/LocalEnforcementPoint.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/main/java/org/jboss/security/authz/agent/enforcement/LocalEnforcementPoint.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -28,6 +28,7 @@
import org.jboss.security.authz.model.Subject;
import org.jboss.security.authz.model.Action;
import org.jboss.security.authz.model.Environment;
+import org.jboss.security.authz.model.Attribute;
import org.jboss.security.authz.agent.services.EnforcementStateGenerator;
import org.jboss.security.authz.policy.client.enforcement.Request;
@@ -109,7 +110,25 @@
{
if(securityContextObject instanceof Resource)
{
- request.addResource((Resource)securityContextObject);
+ //This is a bit rubbish. The XACML spec clearly allows multiple Resource elements
within a Policy Definition.
+ //But for some reason, the SUN XACML implementation only honors a single Resource
element. Regardless of this hack
+ //The end result will still be the same, and the Developer that uses this framework
remains unaffected
+ //Its weird that SUN system allows multiple Resources in policy provisioning, but
not in enforcement...That has to be a bug
+ //Anywhoooooooo......lets move on ;)
+
+ if(request.getResources() == null || request.getResources().isEmpty())
+ {
+ request.addResource((Resource)securityContextObject);
+ }
+ else
+ {
+ Resource currResource = (Resource)securityContextObject;
+ Resource local = request.getResources().iterator().next();
+ for(Attribute currAttr: currResource.getAttributes())
+ {
+ local.addAttribute(currAttr);
+ }
+ }
}
else if(securityContextObject instanceof Subject)
{
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestHierarchialPropagation.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -31,7 +31,7 @@
import org.jboss.security.authz.model.Resource;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
@@ -52,9 +52,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
public void tearDown() throws Exception
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliedActions.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliedActions.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliedActions.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -31,7 +31,7 @@
import org.jboss.security.authz.model.Resource;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
@@ -55,9 +55,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
public void tearDown() throws Exception
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliesHierarchialPropagation.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliesHierarchialPropagation.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestImpliesHierarchialPropagation.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -31,7 +31,7 @@
import org.jboss.security.authz.model.Resource;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
@@ -54,9 +54,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
public void tearDown() throws Exception
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestPolicyServer.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestPolicyServer.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/features/TestPolicyServer.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -27,7 +27,7 @@
import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
import org.jboss.security.authz.model.Policy;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -41,8 +41,8 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
public void tearDown() throws Exception
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestEnforcementGenerator.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestEnforcementGenerator.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestEnforcementGenerator.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -38,7 +38,7 @@
import org.jboss.security.authz.components.action.Manage;
import org.jboss.security.authz.components.resource.URIResource;
-import org.jboss.security.authz.agent.Agent;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -51,7 +51,7 @@
protected void setUp() throws Exception
{
- Agent.bootstrap();
+ ServiceContainer.bootstrap();
this.stateGenerator = new EnforcementStateGenerator();
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------------
Modified:
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java
===================================================================
---
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/agent/src/test/java/org/jboss/security/authz/agent/services/TestPolicyComposition.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -39,7 +39,7 @@
import org.jboss.security.authz.components.action.Manage;
import org.jboss.security.authz.components.resource.URIResource;
-import org.jboss.security.authz.agent.Agent;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.test.MockPolicy;
@@ -54,8 +54,8 @@
protected void setUp() throws Exception
{
- Agent.bootstrap();
- this.policyComposer = (PolicyComposer)Agent.lookup("/agent/PolicyComposer");
+ ServiceContainer.bootstrap();
+ this.policyComposer =
(PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
}
//---------------------------------------------------------------------------------------------------------------------------------------------------------------
public void testComposePermitIdentity() throws Exception
Modified: modules/authorization/trunk/common-api/pom.xml
===================================================================
--- modules/authorization/trunk/common-api/pom.xml 2009-07-11 19:55:21 UTC (rev 13547)
+++ modules/authorization/trunk/common-api/pom.xml 2009-07-12 17:28:57 UTC (rev 13548)
@@ -18,6 +18,11 @@
<dependency>
<groupId>org.jboss.security</groupId>
<artifactId>jboss-xacml</artifactId>
- </dependency>
+ </dependency>
+ <!-- jboss microcontainer -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
</dependencies>
</project>
Added:
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/EmbeddedBootstrap.java
===================================================================
---
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/EmbeddedBootstrap.java
(rev 0)
+++
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/EmbeddedBootstrap.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -0,0 +1,98 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.security.authz.bootstrap;
+
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+final class EmbeddedBootstrap extends BasicBootstrap
+{
+ private static Logger log = Logger.getLogger(EmbeddedBootstrap.class);
+
+ protected BasicXMLDeployer deployer;
+
+ public EmbeddedBootstrap() throws Exception
+ {
+ super();
+ }
+
+ public void bootstrap() throws Throwable
+ {
+ super.bootstrap();
+ deployer = new BasicXMLDeployer(getKernel());
+ Runtime.getRuntime().addShutdownHook(new Shutdown());
+ }
+
+ public void deploy(URL url)
+ {
+ try
+ {
+ // Workaround the fact that the BasicXMLDeployer does not handle
+ // redeployment correctly
+ if (deployer.getDeploymentNames().contains(url.toString()))
+ {
+ log.debug("Service is already deployed.");
+ return;
+ }
+ deployer.deploy(url);
+ }
+ catch (Throwable t)
+ {
+ log.error(this, t);
+ }
+ }
+
+ public void undeploy(URL url)
+ {
+ if (!deployer.getDeploymentNames().contains(url.toString()))
+ {
+ log.debug("Service is already undeployed.");
+ return;
+ }
+ try
+ {
+ deployer.undeploy(url);
+ }
+ catch (Throwable t)
+ {
+ log.error(this, t);
+ }
+ }
+
+ protected class Shutdown extends Thread
+ {
+ public void run()
+ {
+ log.info("Shutting down");
+ deployer.shutdown();
+ }
+ }
+}
Added:
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/ServiceContainer.java
===================================================================
---
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/ServiceContainer.java
(rev 0)
+++
modules/authorization/trunk/common-api/src/main/java/org/jboss/security/authz/bootstrap/ServiceContainer.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * 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. *
+ ******************************************************************************/
+package org.jboss.security.authz.bootstrap;
+
+import java.net.URL;
+import java.util.Enumeration;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.dependency.spi.ControllerContext;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public final class ServiceContainer
+{
+ private static Logger log = Logger.getLogger(ServiceContainer.class);
+
+ private static Kernel kernel;
+
+ public ServiceContainer()
+ {
+
+ }
+
+ public static void bootstrap()
+ {
+ try
+ {
+ EmbeddedBootstrap bootstrap = new EmbeddedBootstrap();
+ bootstrap.run();
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ Enumeration e = cl.getResources("META-INF/jboss-beans.xml");
+ while(e.hasMoreElements())
+ {
+ URL url = (URL)e.nextElement();
+ String urlName = url.toString();
+ bootstrap.deploy(url);
+ }
+
+ kernel = bootstrap.getKernel();
+ }
+ catch(Exception e)
+ {
+ log.error("org.jboss.security.authz.agent.Agent", e);
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static Object lookup(String serviceId)
+ {
+ Object service = null;
+
+ KernelController kernelController = kernel.getController();
+ ControllerContext controllerContext =
kernelController.getInstalledContext(serviceId);
+ if(controllerContext != null)
+ {
+ service = controllerContext.getTarget();
+ }
+
+ return service;
+ }
+}
Modified: modules/authorization/trunk/http-profile/pom.xml
===================================================================
--- modules/authorization/trunk/http-profile/pom.xml 2009-07-11 19:55:21 UTC (rev 13547)
+++ modules/authorization/trunk/http-profile/pom.xml 2009-07-12 17:28:57 UTC (rev 13548)
@@ -45,13 +45,13 @@
<groupId>org.jboss.security</groupId>
<artifactId>jboss-xacml</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
<!-- jboss microcontainer -->
<dependency>
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
<!-- Drools -->
<dependency>
<groupId>org.drools</groupId>
Modified:
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java
===================================================================
---
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/main/java/org/jboss/security/authz/http/enforcement/SecurityFilter.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -57,7 +57,7 @@
import org.jboss.security.authz.tools.GeneralTool;
import org.jboss.security.authz.model.Policy;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.policy.server.spi.PolicyConfig;
import org.jboss.security.authz.policy.server.PolicyServer;
@@ -89,9 +89,9 @@
try
{
//Start the Policy Server
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
if(this.enforcer == null || this.provisioner == null)
{
@@ -99,7 +99,7 @@
}
//TODO: remove this
- PolicyServer ps =
(PolicyServer)Server.lookup("/policy-server/PolicyServer");
+ PolicyServer ps =
(PolicyServer)ServiceContainer.lookup("/policy-server/PolicyServer");
ps.getPolicyDecisionPoint().setDebug(true);
//Parse the specified Policy and update the Policy Server
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestHttpResource.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestHttpResource.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestHttpResource.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -27,7 +27,7 @@
import org.apache.log4j.Logger;
-import org.jboss.security.authz.agent.Agent;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.services.CompositionContext;
import org.jboss.security.authz.agent.services.PolicyComposer;
@@ -50,8 +50,8 @@
protected void setUp() throws Exception
{
- Agent.bootstrap();
- this.policyComposer = (PolicyComposer)Agent.lookup("/agent/PolicyComposer");
+ ServiceContainer.bootstrap();
+ this.policyComposer =
(PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------
//TODO: migrate to the new developer framework
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestParameterMatching.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestParameterMatching.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestParameterMatching.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -28,14 +28,14 @@
import junit.framework.TestCase;
import org.jboss.security.authz.http.component.resource.HttpResource;
+import org.jboss.security.authz.components.subject.Roles;
import org.jboss.security.authz.http.component.action.Get;
-import org.jboss.security.authz.components.subject.Roles;
import org.jboss.security.authz.model.Effect;
import org.jboss.security.authz.model.Policy;
import org.jboss.security.authz.model.PolicyMetaData;
-import org.jboss.security.authz.agent.Agent;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
import org.jboss.security.authz.agent.enforcement.EnforcementContext;
import org.jboss.security.authz.agent.enforcement.EnforcementResponse;
@@ -57,11 +57,11 @@
public void setUp() throws Exception
{
- Agent.bootstrap();
+ ServiceContainer.bootstrap();
- this.policyComposer = (PolicyComposer)Agent.lookup("/agent/PolicyComposer");
- this.enforcer =
(PolicyEnforcementPoint)Agent.lookup("/agent/LocalEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Agent.lookup("/agent/LocalPolicyProvisioner");
+ this.policyComposer =
(PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/agent/LocalEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/agent/LocalPolicyProvisioner");
}
//TODO: migrate to the new developer framework
@@ -79,7 +79,7 @@
//Setup the Context for the Composition with these components
CompositionContext context = new CompositionContext();
context.setPolicyTarget(policyResource);
- context.addPolicyRule(Effect.PERMIT, new Get(), allowedRoles,
"allowExpression");
+ context.addPolicyRule(Effect.PERMIT, new Get(), allowedRoles,
"allowExpression");
//Store the policy into the Policy Server
PolicyMetaData policyMetaData = this.policyComposer.compose(context);
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestRoles.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestRoles.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestRoles.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -33,7 +33,7 @@
import org.jboss.security.authz.model.Policy;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import junit.framework.TestCase;
@@ -49,9 +49,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
//TODO: migrate to the new developer framework
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestURLPattern.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestURLPattern.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/components/TestURLPattern.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -36,7 +36,7 @@
import org.jboss.security.authz.model.Resource;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import junit.framework.TestCase;
@@ -52,9 +52,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
//TODO: migrate to the new developer framework
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/integration/TestEnterprisePolicyFinderModule.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/integration/TestEnterprisePolicyFinderModule.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/integration/TestEnterprisePolicyFinderModule.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -38,7 +38,7 @@
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
/**
@@ -53,9 +53,9 @@
public void setUp() throws Exception
{
- Server.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
+ ServiceContainer.bootstrap();
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
}
public void tearDown() throws Exception
Modified:
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/provisioning/TestHttpPolicyConfig.java
===================================================================
---
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/provisioning/TestHttpPolicyConfig.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/http-profile/src/test/java/org/jboss/security/authz/http/provisioning/TestHttpPolicyConfig.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -29,7 +29,7 @@
import org.apache.log4j.Logger;
-import org.jboss.security.authz.agent.Agent;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.authz.agent.enforcement.PolicyEnforcementPoint;
import org.jboss.security.authz.agent.provisioning.PolicyProvisioner;
import org.jboss.security.authz.agent.services.PolicyComposer;
@@ -42,7 +42,6 @@
import org.jboss.security.authz.tools.GeneralTool;
import org.jboss.security.authz.policy.client.enforcement.Request;
import org.jboss.security.authz.policy.client.enforcement.Response;
-import org.jboss.security.authz.policy.server.Server;
import org.jboss.security.authz.policy.server.spi.PolicyConfig;
/**
@@ -65,12 +64,11 @@
*/
protected void setUp() throws Exception
{
- Server.bootstrap();
- Agent.bootstrap();
+ ServiceContainer.bootstrap();
- this.enforcer =
(PolicyEnforcementPoint)Server.lookup("/enforcement/localEnforcementPoint");
- this.provisioner =
(PolicyProvisioner)Server.lookup("/provisioning/localProvisioner");
- this.policyComposer =
(PolicyComposer)Agent.lookup("/agent/PolicyComposer");
+ this.enforcer =
(PolicyEnforcementPoint)ServiceContainer.lookup("/enforcement/localEnforcementPoint");
+ this.provisioner =
(PolicyProvisioner)ServiceContainer.lookup("/provisioning/localProvisioner");
+ this.policyComposer =
(PolicyComposer)ServiceContainer.lookup("/agent/PolicyComposer");
}
//------------------------------------------------------------------------------------------------------------------------------------------------------
//TODO: migrate to the new developer framework
Modified: modules/authorization/trunk/policy-server/pom.xml
===================================================================
--- modules/authorization/trunk/policy-server/pom.xml 2009-07-11 19:55:21 UTC (rev 13547)
+++ modules/authorization/trunk/policy-server/pom.xml 2009-07-12 17:28:57 UTC (rev 13548)
@@ -30,13 +30,7 @@
<groupId>org.jboss.security</groupId>
<artifactId>jboss-xacml</artifactId>
</dependency>
-
- <!-- jboss microcontainer -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
-
+
<!-- Drools -->
<dependency>
<groupId>org.drools</groupId>
Deleted:
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/EmbeddedBootstrap.java
===================================================================
---
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/EmbeddedBootstrap.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/EmbeddedBootstrap.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -1,98 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.security.authz.policy.server;
-
-import java.net.URL;
-
-import org.apache.log4j.Logger;
-
-import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-final class EmbeddedBootstrap extends BasicBootstrap
-{
- private static Logger log = Logger.getLogger(EmbeddedBootstrap.class);
-
- protected BasicXMLDeployer deployer;
-
- public EmbeddedBootstrap() throws Exception
- {
- super();
- }
-
- public void bootstrap() throws Throwable
- {
- super.bootstrap();
- deployer = new BasicXMLDeployer(getKernel());
- Runtime.getRuntime().addShutdownHook(new Shutdown());
- }
-
- public void deploy(URL url)
- {
- try
- {
- // Workaround the fact that the BasicXMLDeployer does not handle
- // redeployment correctly
- if (deployer.getDeploymentNames().contains(url.toString()))
- {
- log.debug("Service is already deployed.");
- return;
- }
- deployer.deploy(url);
- }
- catch (Throwable t)
- {
- log.error(this, t);
- }
- }
-
- public void undeploy(URL url)
- {
- if (!deployer.getDeploymentNames().contains(url.toString()))
- {
- log.debug("Service is already undeployed.");
- return;
- }
- try
- {
- deployer.undeploy(url);
- }
- catch (Throwable t)
- {
- log.error(this, t);
- }
- }
-
- protected class Shutdown extends Thread
- {
- public void run()
- {
- log.info("Shutting down");
- deployer.shutdown();
- }
- }
-}
Deleted:
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/Server.java
===================================================================
---
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/Server.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/Server.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -1,81 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-package org.jboss.security.authz.policy.server;
-
-import java.net.URL;
-
-import org.apache.log4j.Logger;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.dependency.spi.ControllerContext;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public final class Server
-{
- private static Logger log = Logger.getLogger(Server.class);
-
- private static Kernel kernel;
-
- public Server()
- {
-
- }
-
- public static void bootstrap()
- {
- try
- {
- EmbeddedBootstrap bootstrap = new EmbeddedBootstrap();
- bootstrap.run();
-
- URL url =
Thread.currentThread().getContextClassLoader().getResource("META-INF/jboss-beans.xml");
-
- bootstrap.deploy(url);
-
- kernel = bootstrap.getKernel();
- }
- catch(Exception e)
- {
- log.error("org.jboss.security.authz.policy.server.Server", e);
- throw new RuntimeException(e);
- }
- }
-
- public static Object lookup(String serviceId)
- {
- Object service = null;
-
- KernelController kernelController = kernel.getController();
- ControllerContext controllerContext =
kernelController.getInstalledContext(serviceId);
- if(controllerContext != null)
- {
- service = controllerContext.getTarget();
- }
-
- return service;
- }
-}
Modified:
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/DroolsFunction.java
===================================================================
---
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/DroolsFunction.java 2009-07-11
19:55:21 UTC (rev 13547)
+++
modules/authorization/trunk/policy-server/src/main/java/org/jboss/security/authz/policy/server/plugin/DroolsFunction.java 2009-07-12
17:28:57 UTC (rev 13548)
@@ -35,7 +35,7 @@
import org.drools.WorkingMemory;
import org.drools.StatefulSession;
-import org.jboss.security.authz.policy.server.Server;
+import org.jboss.security.authz.bootstrap.ServiceContainer;
import org.jboss.security.xacml.interfaces.XACMLConstants;
import org.jboss.security.xacml.interfaces.XMLSchemaConstants;
@@ -120,7 +120,7 @@
log.debug("Firing Rule ="+reference.getVariableId());
//Establish a Stateful Drools Session
- DroolsRuleManager ruleManager =
(DroolsRuleManager)Server.lookup("/policy-server/DroolsRuleManager");
+ DroolsRuleManager ruleManager =
(DroolsRuleManager)ServiceContainer.lookup("/policy-server/DroolsRuleManager");
RuleBase ruleBase = ruleManager.getActiveRuleBase();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
@@ -154,6 +154,9 @@
}
catch(Exception e)
{
+ log.error(this, e);
+
+
List code = new ArrayList();
code.add(Status.STATUS_PROCESSING_ERROR);
Status status = new Status(code, e.toString()+": "+e.getMessage());
Modified: modules/authorization/trunk/portal-profile/pom.xml
===================================================================
--- modules/authorization/trunk/portal-profile/pom.xml 2009-07-11 19:55:21 UTC (rev
13547)
+++ modules/authorization/trunk/portal-profile/pom.xml 2009-07-12 17:28:57 UTC (rev
13548)
@@ -38,12 +38,7 @@
<artifactId>jboss-xacml</artifactId>
<scope>test</scope>
</dependency>
- <!-- jboss microcontainer -->
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- <scope>test</scope>
- </dependency>
+
<!-- Drools -->
<dependency>
<groupId>org.drools</groupId>