You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/01/20 04:57:11 UTC

cvs commit: avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/appliance/grant/components AnotherTestComponent.java AnotherTestService.java

niclas      2004/01/19 19:57:11

  Modified:    merlin/activation/impl/src/test/conf secure.xml
  Added:       merlin/activation/impl/src/test/org/apache/avalon/activation/appliance/grant/components
                        AnotherTestComponent.java AnotherTestService.java
  Log:
  SYncing with Steve to find problem.
  
  Revision  Changes    Path
  1.3       +27 -22    avalon/merlin/activation/impl/src/test/conf/secure.xml
  
  Index: secure.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/test/conf/secure.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- secure.xml	20 Jan 2004 00:10:29 -0000	1.2
  +++ secure.xml	20 Jan 2004 03:57:10 -0000	1.3
  @@ -5,30 +5,35 @@
   
   <container name="root">
   
  -   <classloader>
  +  <classloader>
  +    <classpath>
  +      <fileset dir="."/>
  +      <repository>
  +        <resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
  +      </repository>
  +    </classpath>
  +    <grant>
  +      <permission class="java.util.PropertyPermission" name="java.*" >
  +        <action>read</action>
  +      </permission>
  +      <permission class="java.util.PropertyPermission" name="org.apache.*" >
  +        <action>read</action>
  +        <action>write</action>
  +      </permission>
  +      <permission class="java.lang.RuntimePermission" name="getClassLoader" />
  +    </grant>
  +  </classloader>
   
  -     <classpath>
  -       <fileset dir="."/>
  -       <repository>
  -         <resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
  -       </repository>
  -     </classpath>
  -
  -     <grant>
  -       <permission class="java.util.PropertyPermission" name="java.*" >
  -         <action>read</action>
  -       </permission>
  -       <permission class="java.util.PropertyPermission" name="org.apache.*" >
  -         <action>read</action>
  -         <action>write</action>
  -       </permission>
  -       <permission class="java.lang.RuntimePermission" name="getClassLoader" />
  -     </grant>
  -
  -   </classloader>
  -
  -   <component name="test"
  +  <container name="Component1" >
  +    <component name="test"
          class="org.apache.avalon.activation.appliance.grant.components.TestComponent"
          activation="startup"/>
  +  </container>
   
  +  <container name="Component2" >
  +    <component name="anothertest"
  +       class="org.apache.avalon.activation.appliance.grant.components.AnotherTestComponent"
  +       activation="startup">
  +    </component>
  +  </container>
   </container>
  
  
  
  1.1                  avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/appliance/grant/components/AnotherTestComponent.java
  
  Index: AnotherTestComponent.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.avalon.activation.appliance.grant.components;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.service.Serviceable;
  import org.apache.avalon.framework.service.ServiceException;
  import org.apache.avalon.framework.service.ServiceManager;
  
  /**
   * This is a component that can be tested relative a set of 
   * assigned permissions.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @avalon.component name="anothertest" lifestyle="singleton"
   * @avalon.service type="org.apache.avalon.activation.appliance.grant.components.AnotherTestService"
   */
  public class AnotherTestComponent extends AbstractLogEnabled 
    implements AnotherTestService, Serviceable
  {
      private TestService m_TestService;
      
      /**
       * @avalon.dependency type="org.apache.avalon.activation.appliance.grant.components.TestService" key="TestService"
       **/
      public void service( ServiceManager man )
          throws ServiceException
      {
          m_TestService = (TestService) man.lookup( "org.apache.avalon.activation.appliance.grant.components.TestService" ); 
      }
      
      public String getJavaVersion()
      {
          return m_TestService.getJavaVersion();
      }
  
      public void setJavaVersion( String newVersion )
      {
          m_TestService.setJavaVersion( newVersion );
      }
  }
  
  
  
  1.1                  avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/appliance/grant/components/AnotherTestService.java
  
  Index: AnotherTestService.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation. All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *    "This product includes software developed by the
   *    Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software
   *    itself, if and wherever such third-party acknowledgments
   *    normally appear.
   *
   * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation. For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.avalon.activation.appliance.grant.components;
  
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.context.Context;
  
  /**
   * This is a component that can be tested relative a set of 
   * assigned permissions.
   *
   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
   * @avalon.component name="test" lifestyle="singleton"
   */
  public interface AnotherTestService
  {
      /** 
      * Returns the version of the Java Virtual Machine.
      **/
      String getJavaVersion();
  
      /** 
      * Sets the version of the Java Virtual Machine.
      **/
      void setJavaVersion( String newVer );
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org