[jboss-dev-forums] [Design of POJO Server] - Re: JACC: Policy Configuration needs to be linked with child
scott.stark@jboss.org
do-not-reply at jboss.com
Thu Dec 7 14:48:12 EST 2006
I don't really follow the bean example. There are examples of deployers "creating" service beans by setting up the ServiceMetaData for the bean for the ServiceDeployer to pickup. This is just an expression of the bean in terms of its metadata, and includes things like dependencies:
| protected void deployWebModule(DeploymentUnit unit, WebMetaData metaData,
| AbstractWarDeployment deployment)
| throws Exception
| {
| log.debug("deployWebModule");
| try
| {
| ServiceMetaData webModule = new ServiceMetaData();
| String name = getObjectName(metaData);
| ObjectName objectName = new ObjectName(name);
| webModule.setObjectName(objectName);
| webModule.setCode(WebModule.class.getName());
| // WebModule(DeploymentUnit, AbstractWarDeployer, AbstractWarDeployment)
| ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
| constructor.setSignature(new String[] { DeploymentUnit.class.getName(),
| AbstractWarDeployer.class.getName(), AbstractWarDeployment.class.getName()});
| constructor.setParameters(new Object[] {unit, this, deployment});
| webModule.setConstructor(constructor);
|
| // Dependencies...Still have old jmx names here
| Collection<String> depends = metaData.getDependencies();
| List<ServiceDependencyMetaData> dependencies = new ArrayList<ServiceDependencyMetaData>();
| for(String iDependOn : depends)
| {
| ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
| sdmd.setIDependOn(iDependOn);
| }
| webModule.setDependencies(dependencies);
|
| // TODO could create multiple components for the deployment
| unit.addAttachment(ServiceMetaData.class, webModule);
| }
| catch (Exception e)
| {
| throw DeploymentException.rethrowAsDeploymentException("Error creating rar deployment " + unit.getName(), e);
| }
|
| }
|
The jacc policy for the deployment could be a kernel bean or service bean. I think what we need is a JaccPolicy instance that manages the lifecycle of all the policy configurations, and a security deployer manages the metadata for this. The first security metadata in a deployment triggers the security deployer to create the JaccPolicy service/kernel bean metadata, and then the jacc policy configuration metadata for components is associated with the JaccPolicy by injection for example.
The component deployers need to have a dependency on the JaccPolicy so that the policy lifecycle is triggered before the components are fully started.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992055#3992055
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992055
More information about the jboss-dev-forums
mailing list