Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2106 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro activation/test/src/test/net/dpml/activation/impl/test composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl composition/spi/src/main/net/dpml/composition/provider

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT dpml.net
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2106 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro activation/test/src/test/net/dpml/activation/impl/test composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl composition/spi/src/main/net/dpml/composition/provider
  • Date: Mon, 21 Mar 2005 13:46:10 -0500

Author: mcconnell AT dpml.net
Date: Mon Mar 21 13:46:10 2005
New Revision: 2106

Removed:

development/main/metro/activation/test/src/test/net/dpml/activation/impl/test/CodeSecurityDisabledTestCase.java

development/main/metro/activation/test/src/test/net/dpml/activation/impl/test/CodeSecurityEnabledTestCase.java

development/main/metro/composition/api/src/main/net/dpml/composition/data/PermissionDirective.java

development/main/metro/composition/api/src/main/net/dpml/composition/data/SecurityProfile.java

development/main/metro/composition/impl/src/main/net/dpml/composition/data/builder/XMLSecurityProfileBuilder.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultSecurityModel.java

development/main/metro/composition/spi/src/main/net/dpml/composition/provider/SecurityModel.java
Modified:

development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/ApplianceInvocationHandler.java

development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultAppliance.java

development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultComponentFactory.java

development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/ApplianceInvocationHandler.java

development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultAppliance.java

development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultComponentFactory.java

development/main/metro/composition/api/src/main/net/dpml/composition/model/DeploymentModel.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultComponentModel.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultCompositionController.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDeploymentModel.java

development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultModelFactory.java

development/main/metro/composition/spi/src/main/net/dpml/composition/provider/ModelFactory.java
Log:
remove content dealing with security permissions because its incomplete and
at the end of the day we would do it differently

Modified:
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/ApplianceInvocationHandler.java
==============================================================================
---
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/ApplianceInvocationHandler.java
(original)
+++
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/ApplianceInvocationHandler.java
Mon Mar 21 13:46:10 2005
@@ -54,7 +54,6 @@
private final DefaultAppliance m_appliance;
private final Logger m_logger;
private final ComponentModel m_model;
- private final boolean m_secure;

//-------------------------------------------------------------------
// immutable state
@@ -74,7 +73,7 @@
* @param logger the assigned logging channel
*/
ApplianceInvocationHandler(
- DefaultAppliance appliance, Logger logger, boolean secure )
+ DefaultAppliance appliance, Logger logger )
throws NullArgumentException
{
assertNotNull( appliance, "appliance" );
@@ -82,7 +81,6 @@

m_appliance = appliance;
m_logger = logger;
- m_secure = secure;
m_model = m_appliance.getComponentModel();
}

@@ -120,25 +118,7 @@
try
{
final Object instance = getInstance();
-
- if( m_secure )
- {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- return method.invoke( instance, args );
- }
- },
- m_model.getAccessControlContext()
- );
- }
- else
- {
- return method.invoke( instance, args );
- }
+ return method.invoke( instance, args );
}
catch( Throwable e )
{

Modified:
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultAppliance.java
==============================================================================
---
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultAppliance.java
(original)
+++
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultAppliance.java
Mon Mar 21 13:46:10 2005
@@ -59,8 +59,6 @@

private long m_delay = 0;

- private final boolean m_secure;
-
//-------------------------------------------------------------------
// constructor
//-------------------------------------------------------------------
@@ -71,7 +69,6 @@
super( model );
m_model = model;
m_lifestyle = lifestyle;
- m_secure = model.isCodeSecurityEnabled();
}

//-------------------------------------------------------------------
@@ -181,7 +178,7 @@
ComponentModel model = getComponentModel();
Logger logger = model.getLogger().getChildLogger( "proxy" );
ApplianceInvocationHandler handler =
- new ApplianceInvocationHandler( this, logger, m_secure );
+ new ApplianceInvocationHandler( this, logger );

try
{

Modified:
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultComponentFactory.java
==============================================================================
---
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultComponentFactory.java
(original)
+++
development/main/metro/activation/providers/avalon/src/main/net/dpml/activation/avalon/DefaultComponentFactory.java
Mon Mar 21 13:46:10 2005
@@ -88,14 +88,6 @@
public DefaultComponentFactory( ComponentModel model )
{
m_model = model;
-
- if( model.isCodeSecurityEnabled() )
- {
- final String error =
- "Code security is not supported under the avalon runtime.";
- throw new IllegalArgumentException( error );
- }
-
m_logger = model.getLogger().getChildLogger( "lifecycle" );
}


Modified:
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/ApplianceInvocationHandler.java
==============================================================================
---
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/ApplianceInvocationHandler.java
(original)
+++
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/ApplianceInvocationHandler.java
Mon Mar 21 13:46:10 2005
@@ -23,10 +23,6 @@
import java.lang.reflect.UndeclaredThrowableException;
import java.lang.reflect.Method;

-import java.security.PrivilegedActionException;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
import net.dpml.activation.ApplianceException;
import net.dpml.activation.TransientApplianceException;

@@ -55,7 +51,6 @@
private final DefaultAppliance m_appliance;
private final Logger m_logger;
private final ComponentModel m_model;
- private final boolean m_secure;

//-------------------------------------------------------------------
// immutable state
@@ -75,7 +70,7 @@
* @param logger the assigned logging channel
*/
ApplianceInvocationHandler(
- DefaultAppliance appliance, Logger logger, boolean secure )
+ DefaultAppliance appliance, Logger logger )
throws NullArgumentException
{
assertNotNull( appliance, "appliance" );
@@ -83,7 +78,6 @@

m_appliance = appliance;
m_logger = logger;
- m_secure = secure;
m_model = m_appliance.getComponentModel();
}

@@ -116,25 +110,7 @@
try
{
final Object instance = getInstance();
-
- if( m_secure )
- {
- return AccessController.doPrivileged
- (
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- return method.invoke( instance, args );
- }
- },
- m_model.getAccessControlContext()
- );
- }
- else
- {
- return method.invoke( instance, args );
- }
+ return method.invoke( instance, args );
}
catch( Throwable e )
{
@@ -220,14 +196,6 @@
return new ApplianceException( error, e );
e = cause;
}
- else if( e instanceof PrivilegedActionException )
- {
- Throwable cause =
- ((PrivilegedActionException) e).getException();
- if( cause == null )
- return new ApplianceException( error, e );
- e = cause;
- }
else
{
break;

Modified:
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultAppliance.java
==============================================================================
---
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultAppliance.java
(original)
+++
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultAppliance.java
Mon Mar 21 13:46:10 2005
@@ -59,8 +59,6 @@

private long m_delay = 0;

- private final boolean m_secure;
-
//-------------------------------------------------------------------
// constructor
//-------------------------------------------------------------------
@@ -71,7 +69,6 @@
super( model );
m_model = model;
m_lifestyle = lifestyle;
- m_secure = model.isCodeSecurityEnabled();
}

//-------------------------------------------------------------------
@@ -187,7 +184,7 @@
ComponentModel model = getComponentModel();
Logger logger = model.getLogger().getChildLogger( "proxy" );
ApplianceInvocationHandler handler =
- new ApplianceInvocationHandler( this, logger, m_secure );
+ new ApplianceInvocationHandler( this, logger );

try
{

Modified:
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultComponentFactory.java
==============================================================================
---
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultComponentFactory.java
(original)
+++
development/main/metro/activation/providers/metro/src/main/net/dpml/activation/metro/DefaultComponentFactory.java
Mon Mar 21 13:46:10 2005
@@ -19,9 +19,6 @@
package net.dpml.activation.metro;

import java.lang.reflect.Constructor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
import java.util.Map;

import net.dpml.activation.ComponentFactory;
@@ -96,8 +93,6 @@

private final Logger m_logger;

- private final boolean m_secure;
-
//-------------------------------------------------------------------
// constructor
//-------------------------------------------------------------------
@@ -110,7 +105,6 @@
{
m_model = model;

- m_secure = model.isCodeSecurityEnabled();
m_logger = model.getLogger().getChildLogger( "lifecycle" );
}

@@ -181,23 +175,7 @@
getLogger().debug( "applying shutdown" );
try
{
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Startable)instance).stop();
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.stop( instance );
- }
+ ContainerUtil.stop( instance );
}
catch( Throwable e )
{
@@ -215,23 +193,7 @@
getLogger().debug( "applying disposal" );
try
{
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Disposable)instance).dispose();
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.dispose( instance );
- }
+ ContainerUtil.dispose( instance );
}
catch( Throwable e )
{
@@ -282,111 +244,31 @@
if( instance instanceof LogEnabled )
{
getLogger().debug( "applying logger" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedAction()
- {
- public Object run()
- {
- ((LogEnabled)instance).enableLogging( logger );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.enableLogging( instance, logger );
- }
+ ContainerUtil.enableLogging( instance, logger );
}

if( instance instanceof Contextualizable )
{
getLogger().debug( "applying context" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Contextualizable)instance).contextualize(
(Context) context );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.contextualize( instance, (Context) context
);
- }
+ ContainerUtil.contextualize( instance, (Context) context );
}

if( instance instanceof Serviceable )
{
getLogger().debug( "applying service manager" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Serviceable)instance).service( manager );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.service( instance, manager );
- }
+ ContainerUtil.service( instance, manager );
}

if( instance instanceof Configurable )
{
getLogger().debug( "applying configuration" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Configurable)instance).configure( config );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.configure( instance, config );
- }
+ ContainerUtil.configure( instance, config );
}

if( instance instanceof Parameterizable )
{
getLogger().debug( "applying parameters" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Parameterizable)instance).parameterize(
params );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.parameterize( instance, params );
- }
+ ContainerUtil.parameterize( instance, params );
}

//
@@ -402,67 +284,19 @@
if( instance instanceof Initializable )
{
getLogger().debug( "applying initialization" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Initializable)instance).initialize();
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.initialize( instance );
- }
+ ContainerUtil.initialize( instance );
}

if( Startable.class.isAssignableFrom( clazz ) )
{
getLogger().debug( "applying startup" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Startable)instance).start();
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.start( instance );
- }
+ ContainerUtil.start( instance );
getLogger().debug( "component startup completed" );
}
else if( Executable.class.isAssignableFrom( clazz ) )
{
getLogger().debug( "applying execution" );
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Executable)instance).execute();
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.execute( instance );
- }
+ ContainerUtil.execute( instance );
getLogger().debug( "component execution completed" );
}
}
@@ -702,22 +536,7 @@
+ n + " arguments." );
}

- if( m_secure )
- {
- return AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- return constructor.newInstance( args );
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- return constructor.newInstance( args );
- }
+ return constructor.newInstance( args );
}
catch( Throwable e )
{
@@ -871,24 +690,7 @@
{
try
{
- if( m_secure )
- {
- AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- ((Contextualizable)instance).contextualize(
- (Context) context );
- return null;
- }
- },
- m_model.getAccessControlContext() );
- }
- else
- {
- ContainerUtil.contextualize( instance, (Context)
context );
- }
+ ContainerUtil.contextualize( instance, (Context) context
);
}
catch( Throwable e )
{

Modified:
development/main/metro/composition/api/src/main/net/dpml/composition/model/DeploymentModel.java
==============================================================================
---
development/main/metro/composition/api/src/main/net/dpml/composition/model/DeploymentModel.java
(original)
+++
development/main/metro/composition/api/src/main/net/dpml/composition/model/DeploymentModel.java
Mon Mar 21 13:46:10 2005
@@ -18,14 +18,13 @@

package net.dpml.composition.model;

-import java.security.AccessControlContext;
-
import net.dpml.composition.data.Mode;

import net.dpml.meta.info.DependencyDescriptor;
import net.dpml.meta.info.ServiceDescriptor;
import net.dpml.meta.info.StageDescriptor;
import net.dpml.meta.info.ReferenceDescriptor;
+
import net.dpml.logging.Logger;
import net.dpml.logging.data.CategoriesDirective;

@@ -84,17 +83,11 @@
*/
void setCategories( CategoriesDirective categories );

- /**
- * Return the access control context.
- * @return the access control context
- */
- AccessControlContext getAccessControlContext();
-
/**
* Return the default deployment timeout value declared in the
* kernel configuration. The implementation looks for a value
* assigned under the property key "urn:composition:deployment.timeout"
- * and defaults to 1000 msec if undefined.
+ * and defaults to 6000 msec if undefined.
*
* @return the default deployment timeout value
*/
@@ -133,12 +126,6 @@
*/
boolean isaCandidate( ReferenceDescriptor reference );

- /**
- * Return the enabled status of the code security policy.
- * @return the code security enabled status
- */
- boolean isCodeSecurityEnabled();
-
//-----------------------------------------------------------
// composite assembly
//-----------------------------------------------------------

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultComponentModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultComponentModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultComponentModel.java
Mon Mar 21 13:46:10 2005
@@ -41,7 +41,6 @@
import net.dpml.composition.model.StageModel;

import net.dpml.composition.provider.ComponentContext;
-import net.dpml.composition.provider.SecurityModel;

import net.dpml.composition.util.XercesSchemaValidator;

@@ -138,10 +137,9 @@
* @param context
* the deployment context
*/
- public DefaultComponentModel( ComponentContext context,
- SecurityModel security ) throws ModelException
+ public DefaultComponentModel( ComponentContext context ) throws
ModelException
{
- super( context, security );
+ super( context );

m_context = context;


Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultCompositionController.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultCompositionController.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultCompositionController.java
Mon Mar 21 13:46:10 2005
@@ -23,7 +23,6 @@

import net.dpml.composition.model.ContainmentModel;
import net.dpml.composition.model.ModelException;
-import net.dpml.composition.provider.SecurityModel ;
import net.dpml.composition.provider.ContainmentContext;
import net.dpml.composition.provider.CompositionException;
import net.dpml.composition.provider.CompositionRuntimeException;
@@ -87,10 +86,10 @@
//--------------------------------------------------------------

public DefaultCompositionController(
- final CompositionContext composition, final ContainmentContext
context, final SecurityModel security )
+ final CompositionContext composition, final ContainmentContext context
)
throws ModelException
{
- super( context, security );
+ super( context );

m_composition = composition;
m_state = new State( this );
@@ -248,6 +247,7 @@
}

//private class State implements Runnable, Disposable
+
private class State implements Disposable
{
private int m_state = INITIALIZING;

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultContainmentModel.java
Mon Mar 21 13:46:10 2005
@@ -32,7 +32,6 @@
import java.util.List;

import net.dpml.composition.data.BlockCompositionDirective;
-//import net.dpml.composition.data.BlockIncludeDirective;
import net.dpml.composition.data.ComponentProfile;
import net.dpml.composition.data.ContainmentProfile;
import net.dpml.composition.data.DeploymentProfile;
@@ -63,7 +62,6 @@
import net.dpml.composition.provider.ComponentContext;
import net.dpml.composition.provider.ContainmentContext;
import net.dpml.composition.provider.ModelFactory;
-import net.dpml.composition.provider.SecurityModel;

import net.dpml.configuration.Configuration;
import net.dpml.configuration.impl.DefaultConfigurationBuilder;
@@ -146,11 +144,10 @@
* the structural association of this containment model
* within a parent scope
*/
- public DefaultContainmentModel(
- final ContainmentContext context, final SecurityModel security )
+ public DefaultContainmentModel( final ContainmentContext context )
throws ModelException
{
- super( context, security );
+ super( context );

m_context = context;


Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDeploymentModel.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDeploymentModel.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultDeploymentModel.java
Mon Mar 21 13:46:10 2005
@@ -18,17 +18,12 @@

package net.dpml.composition.model.impl;

-import java.security.AccessControlContext;
-import java.security.Permissions;
-import java.security.ProtectionDomain;
-
import net.dpml.composition.data.Mode;

import net.dpml.composition.model.Commissionable;
import net.dpml.composition.model.DeploymentModel;

import net.dpml.composition.provider.DeploymentContext;
-import net.dpml.composition.provider.SecurityModel;

import net.dpml.i18n.ResourceManager;
import net.dpml.i18n.Resources;
@@ -64,10 +59,6 @@

private final DeploymentContext m_context;

- private final SecurityModel m_security;
-
- private final AccessControlContext m_access;
-
//--------------------------------------------------------------
// muttable state
//--------------------------------------------------------------
@@ -87,32 +78,20 @@
* name and a partition.
*
* @param context the deployment context
- * @exception NullArgumentException if either the context argument or the
security
- * argument is null.
+ * @exception NullArgumentException if the context argument is null.
*/
- public DefaultDeploymentModel( DeploymentContext context, SecurityModel
security )
+ public DefaultDeploymentModel( DeploymentContext context )
throws NullArgumentException
{
if( null == context )
{
throw new NullArgumentException( "context" );
}
- if( null == security )
- {
- throw new NullArgumentException( "security" );
- }

m_context = context;
- m_security = security;

m_logger = m_context.getLogger();
m_categories = m_context.getProfile().getCategories();
-
- Permissions permissions = security.getPermissions();
- ProtectionDomain domain =
- new ProtectionDomain( null, permissions );
- ProtectionDomain[] domains = new ProtectionDomain[]{ domain };
- m_access = new AccessControlContext( domains );
}

//--------------------------------------------------------------
@@ -247,33 +226,6 @@
return m_logger;
}

- /**
- * Return the assigned permissions.
- * @return the permissions
- */
- public Permissions getPermissions()
- {
- return m_security.getPermissions();
- }
-
- /**
- * Return the access control context.
- * @return the access control context
- */
- public AccessControlContext getAccessControlContext()
- {
- return m_access;
- }
-
- /**
- * Return the enabled status of the code security policy.
- * @return the code security enabled status
- */
- public boolean isCodeSecurityEnabled()
- {
- return m_security.isEnabled();
- }
-
//--------------------------------------------------------------
// implementation
//--------------------------------------------------------------

Modified:
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultModelFactory.java
==============================================================================
---
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultModelFactory.java
(original)
+++
development/main/metro/composition/impl/src/main/net/dpml/composition/model/impl/DefaultModelFactory.java
Mon Mar 21 13:46:10 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 Stephen J. McConnell.
+ * Copyright 2004-2005 Stephen J. McConnell.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,11 +32,9 @@

import net.dpml.composition.data.ClasspathDirective;
import net.dpml.composition.data.ContainmentProfile;
-import net.dpml.composition.data.SecurityProfile;

import net.dpml.composition.data.builder.ContainmentProfileBuilder;
import net.dpml.composition.data.builder.XMLContainmentProfileCreator;
-import net.dpml.composition.data.builder.XMLSecurityProfileBuilder;

import net.dpml.composition.model.ClassLoaderModel;
import net.dpml.composition.model.ComponentModel;
@@ -52,7 +50,6 @@
import net.dpml.composition.provider.ContainmentContext;
import net.dpml.composition.provider.ModelFactory;
import net.dpml.composition.provider.Runtime;
-import net.dpml.composition.provider.SecurityModel;

import net.dpml.configuration.Configuration;

@@ -95,14 +92,8 @@
private static final Resources REZ =
ResourceManager.getPackageResources( DefaultModelFactory.class );

- private static final SecurityModel NULL_SECURITY =
- new DefaultSecurityModel();
-
private static final String DEFAULT_PROFILE_NAME = "default";

- private static final XMLSecurityProfileBuilder SECURITY_BUILDER =
- new XMLSecurityProfileBuilder();
-
private static final String AVALON_API =
"artifact:jar:avalon-framework/avalon-framework-api#4.2.0";
private static final String AVALON_LIFECYCLE_API =
@@ -117,17 +108,6 @@
private final Logger m_logger;

/**
- * A map of security models keyed by profile name.
- */
- private final Map m_security = new Hashtable();
-
- /**
- * A table of protection domain instances keyed by code source.
- * (not used yet)
- */
- private final Map m_grants = new HashMap();
-
- /**
* The runtime system used by this model factory.
*/
private final Runtime m_runtime;
@@ -142,11 +122,6 @@
*/
private final ContainmentModel m_root;

- /**
- * A table of permissions instances keyed by code source.
- */
- private Map m_permissions = new Hashtable();
-
//-------------------------------------------------------------------
// constructor
//-------------------------------------------------------------------
@@ -176,65 +151,6 @@
m_context = context;

m_logger = context.getSystemContext().getLogger();
- Configuration config = getKernelConfiguration( kernel );
- Configuration secConfig = config.getChild( "security" );
- SecurityProfile[] profiles = getSecurityProfiles( secConfig );
-
- //
- // register the security profiles
- //
-
- if( context.isCodeSecurityEnabled() )
- {
- for( int i=0; i<profiles.length; i++ )
- {
- SecurityProfile profile = profiles[i];
- final String name = profile.getName();
- if( m_logger.isDebugEnabled() )
- {
- m_logger.debug(
- "adding security profile [" + name + "]." );
- }
- try
- {
- SecurityModel model = new DefaultSecurityModel( profile,
true );
- m_security.put( profile.getName(), model );
- }
- catch( Throwable e )
- {
- final String error =
- "Cannot include initial security model [" + name +
"].";
- throw new ModelRuntimeException( error, e );
- }
- }
-
- //
- // check that we have a default security profile
- //
-
- if( null == m_security.get( DEFAULT_PROFILE_NAME ) )
- {
- final String error =
- "Security enabled without a \""
- + DEFAULT_PROFILE_NAME
- + "\" profile.";
- throw new IllegalStateException( error );
- }
-
- //
- // check that the initial set of grant bindings actually
- // refer to known security profiles
- //
-
- Set entries = m_grants.entrySet();
- Iterator iterator = entries.iterator();
- while( iterator.hasNext() )
- {
- Map.Entry entry = (Map.Entry) iterator.next();
- final String profile = (String) entry.getValue();
- getNamedSecurityModel( profile );
- }
- }

m_runtime = createRuntime( context.getSystemContext(), uri );

@@ -242,6 +158,7 @@
// create the root container
//

+ Configuration config = getKernelConfiguration( kernel );
getLogger().debug( "building root containment profile" );
Configuration container = config.getChild( "container" );
getLogger().debug( "building root containment model" );
@@ -284,21 +201,6 @@
}
}

- private SecurityProfile[] getSecurityProfiles( Configuration config )
throws CompositionException
- {
- try
- {
- return SECURITY_BUILDER.createSecurityProfiles( config );
- }
- catch( Throwable e )
- {
- final String error =
- "Unable to construct security profiles.";
- throw new CompositionException( error, e );
- }
- }
-
-
//-------------------------------------------------------------------
// ModelFactory
//-------------------------------------------------------------------
@@ -326,8 +228,7 @@
throws ModelException
{
final String path = context.getQualifiedName();
- SecurityModel security = getAssignedSecurityModel( path );
- return new DefaultComponentModel( context, security );
+ return new DefaultComponentModel( context );
}

/**
@@ -441,14 +342,13 @@
throws ModelException
{
final String path = context.getQualifiedName();
- SecurityModel security = getAssignedSecurityModel( path );
if( root )
{
- return new DefaultCompositionController( m_context, context,
security );
+ return new DefaultCompositionController( m_context, context );
}
else
{
- return new DefaultContainmentModel( context, security );
+ return new DefaultContainmentModel( context );
}
}

@@ -514,74 +414,6 @@
}

/**
- * Return the security profile matching the supplied deployment
- * path. The implementation will return the default security profile
- * unless an explicit grant has been declared for the the supplied
- * path, and the grant referes to a known security profile.
- *
- * @param path the container or component path
- * @return the assigned security model
- */
- private SecurityModel getAssignedSecurityModel( final String path )
- {
- if( m_context.isCodeSecurityEnabled() )
- {
- final String profile = getAssignedProfileName( path );
- return getNamedSecurityModel( profile );
- }
- else
- {
- return NULL_SECURITY;
- }
- }
-
- /**
- * Return a named security profile.
- * @param name an existing security profile name
- * @return the security model
- * @exception IllegalArgumentException if the name is unknown
- */
- private SecurityModel getNamedSecurityModel( String name )
- {
- SecurityModel model =
- (SecurityModel) m_security.get( name );
- if( null != model )
- {
- return model;
- }
- else
- {
- final String error =
- "Unknown security profile [" + name + "].";
- throw new IllegalArgumentException( error );
- }
- }
-
- /**
- * Return the security profile name assigned to the supplied path.
- * If no assignment has been declared the default security profile
- * name will be returned.
- *
- * @return the security profile name for the path
- */
- private String getAssignedProfileName( String path )
- {
- final String profile = (String) m_grants.get( path );
- if( null != profile ) return profile;
- return DEFAULT_PROFILE_NAME;
- }
-
- /**
- * Return the default security model.
- *
- * @return the default security model
- */
- private SecurityModel getDefaultSecurityModel()
- {
- return (SecurityModel) m_security.get( DEFAULT_PROFILE_NAME );
- }
-
- /**
* Create the kernel configuration using a supplied url. If the supplied
* url is null the implementation will attempt to resolve a "/kernel.xml"
* resource within the deployment unit.

Modified:
development/main/metro/composition/spi/src/main/net/dpml/composition/provider/ModelFactory.java
==============================================================================
---
development/main/metro/composition/spi/src/main/net/dpml/composition/provider/ModelFactory.java
(original)
+++
development/main/metro/composition/spi/src/main/net/dpml/composition/provider/ModelFactory.java
Mon Mar 21 13:46:10 2005
@@ -31,36 +31,6 @@
public interface ModelFactory
{
/**
- * Creation of a new root containment model.
- *
- * @param url a url of a containment profile
- * @return the containment model
- * @exception ModelException if an error occurs during model establishment
- */
- //ContainmentModel createRootContainmentModel( URL url )
- // throws ModelException;
-
- /**
- * Creation of a new root containment model.
- *
- * @param profile a containment profile
- * @return the containment model
- * @exception ModelException if an error occurs during model establishment
- */
- //ContainmentModel createRootContainmentModel( ContainmentProfile
profile )
- // throws ModelException;
-
- /**
- * Creation of a new root containment model.
- *
- * @param configuration the root container configuration
- * @return the containment model
- * @exception ModelException if an error occurs during model establishment
- */
- //ContainmentModel createRootContainmentModel( Configuration config )
- // throws ModelException;
-
- /**
* Return the root containment model.
*
* @return the root containment model
@@ -77,7 +47,6 @@
ComponentModel createComponentModel( ComponentContext context )
throws ModelException;

-
/**
* Creation of a new nested containment model using a supplied
* containment context.



  • svn commit: r2106 - in development/main/metro: activation/providers/avalon/src/main/net/dpml/activation/avalon activation/providers/metro/src/main/net/dpml/activation/metro activation/test/src/test/net/dpml/activation/impl/test composition/api/src/main/net/dpml/composition/data composition/api/src/main/net/dpml/composition/model composition/impl/src/main/net/dpml/composition/data/builder composition/impl/src/main/net/dpml/composition/model/impl composition/spi/src/main/net/dpml/composition/provider, mcconnell, 03/21/2005

Archive powered by MHonArc 2.6.24.

Top of Page