avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo MultihostSevakTest.java SevakTest.java
Date Fri, 11 Apr 2003 00:29:46 GMT
donaldp     2003/04/10 17:29:46

  Modified:    sevak/src/demo/java/org/apache/avalon/apps/sevak/demo
                        MultihostSevakTest.java SevakTest.java
  Log:
  Styled and optimized imports
  
  Revision  Changes    Path
  1.3       +25 -21    avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/MultihostSevakTest.java
  
  Index: MultihostSevakTest.java
  ===================================================================
  RCS file: /home/cvs/avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/MultihostSevakTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MultihostSevakTest.java	30 Sep 2002 22:03:12 -0000	1.2
  +++ MultihostSevakTest.java	11 Apr 2003 00:29:46 -0000	1.3
  @@ -1,21 +1,20 @@
   package org.apache.avalon.apps.sevak.demo;
   
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.ContextException;
  -import org.apache.avalon.framework.service.Serviceable;
  -import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.ServiceException;
  +import java.io.File;
  +import org.apache.avalon.apps.sevak.MultihostSevak;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  -import org.apache.avalon.framework.activity.Initializable;
  -import org.apache.avalon.apps.sevak.MultihostSevak;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.phoenix.BlockContext;
   
  -import java.io.File;
  -
   /**
    * @phoenix:block
    *
  @@ -25,18 +24,20 @@
    * @version 1.0
    */
   public class MultihostSevakTest extends AbstractLogEnabled
  -        implements Contextualizable, Serviceable, Configurable, Initializable {
  -
  +    implements Contextualizable, Serviceable, Configurable, Initializable
  +{
       private BlockContext m_context;
       private Configuration m_configuration;
       private MultihostSevak m_mulihostSevak;
   
  -    public void contextualize( Context context ) throws ContextException {
  +    public void contextualize( Context context ) throws ContextException
  +    {
           getLogger().info( "MultihostSevakTest.contextualize" );
  -        m_context = (BlockContext) context;
  +        m_context = (BlockContext)context;
       }
   
  -    public void configure( Configuration configuration ) throws ConfigurationException
{
  +    public void configure( Configuration configuration ) throws ConfigurationException
  +    {
           getLogger().info( "MultihostSevakTest.configure" );
           m_configuration = configuration;
       }
  @@ -45,21 +46,24 @@
        * @see org.apache.avalon.framework.service.Serviceable
        * @phoenix:dependency name="org.apache.avalon.apps.sevak.MultihostSevak"
        */
  -    public void service( ServiceManager serviceManager ) throws ServiceException {
  +    public void service( ServiceManager serviceManager ) throws ServiceException
  +    {
           getLogger().info( "MultihostSevakTest.service" );
  -        m_mulihostSevak = (MultihostSevak) serviceManager.lookup( MultihostSevak.ROLE );
  +        m_mulihostSevak = (MultihostSevak)serviceManager.lookup( MultihostSevak.ROLE );
       }
   
  -    public void initialize() throws Exception {
  +    public void initialize() throws Exception
  +    {
           getLogger().info( "MultihostSevakTest.initialize" );
           Configuration[] contexts = m_configuration.getChildren( "Context" );
  -        for( int i = 0; i < contexts.length; i++ ) {
  +        for( int i = 0; i < contexts.length; i++ )
  +        {
               String ctx = contexts[ i ].getAttribute( "docBase" );
               String ctxPath = contexts[ i ].getAttribute( "path" );
               ctxPath = ctxPath.replace( '/', File.separatorChar );
               ctxPath = ctxPath.replace( '\\', File.separatorChar );
               String ctxFullPath = m_context.getBaseDirectory().getAbsolutePath() + File.separatorChar
+ "SAR-INF"
  -                     + File.separatorChar + "lib" + File.separatorChar + ctxPath;
  +                + File.separatorChar + "lib" + File.separatorChar + ctxPath;
               //System.out.println("Ctx = " + ctx + ", path = " + ctxFullPath);
               m_mulihostSevak.deploy( "localhost", ctx, new File( ctxFullPath ) );
           }
  
  
  
  1.8       +17 -14    avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/SevakTest.java
  
  Index: SevakTest.java
  ===================================================================
  RCS file: /home/cvs/avalon-apps/sevak/src/demo/java/org/apache/avalon/apps/sevak/demo/SevakTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SevakTest.java	22 Mar 2003 12:53:12 -0000	1.7
  +++ SevakTest.java	11 Apr 2003 00:29:46 -0000	1.8
  @@ -55,7 +55,7 @@
   package org.apache.avalon.apps.sevak.demo;
   
   import java.io.File;
  -//avalon imports
  +import org.apache.avalon.apps.sevak.Sevak;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -67,8 +67,6 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.avalon.phoenix.BlockContext;
  -//sevak imports
  -import org.apache.avalon.apps.sevak.Sevak;
   
   /**
    * @phoenix:block
  @@ -79,19 +77,22 @@
    * @version 1.0
    */
   public class SevakTest
  -        extends AbstractLogEnabled
  -        implements Contextualizable, Serviceable, Configurable, Initializable {
  +    extends AbstractLogEnabled
  +    implements Contextualizable, Serviceable, Configurable, Initializable
  +{
       private BlockContext m_context;
       private Configuration m_configuration;
       private Sevak m_sevak;
   
  -    public void contextualize( final Context context ) {
  +    public void contextualize( final Context context )
  +    {
           getLogger().info( "SevakTest.contextualize()" );
  -        m_context = (BlockContext) context;
  +        m_context = (BlockContext)context;
       }
   
       public void configure( final Configuration configuration )
  -            throws ConfigurationException {
  +        throws ConfigurationException
  +    {
   
           m_configuration = configuration;
   
  @@ -102,27 +103,29 @@
        * @phoenix:dependency name="org.apache.avalon.apps.sevak.Sevak"
        */
       public void service( final ServiceManager serviceManager )
  -            throws ServiceException {
  +        throws ServiceException
  +    {
           getLogger().info( "SevakTest.service()" );
  -        m_sevak = (Sevak) serviceManager.lookup( Sevak.class.getName() );
  +        m_sevak = (Sevak)serviceManager.lookup( Sevak.class.getName() );
       }
   
       public void initialize()
  -            throws Exception {
  +        throws Exception
  +    {
           getLogger().info( "SevakTest.initialize()" );
           Configuration[] contexts = m_configuration.getChildren( "Context" );
  -        for( int i = 0; i < contexts.length; i++ ) {
  +        for( int i = 0; i < contexts.length; i++ )
  +        {
               String ctx = contexts[ i ].getAttribute( "docBase" );
               String ctxPath = contexts[ i ].getAttribute( "path" );
               ctxPath = ctxPath.replace( '/', File.separatorChar );
               ctxPath = ctxPath.replace( '\\', File.separatorChar );
               String ctxFullPath = m_context.getBaseDirectory().getAbsolutePath()
  -                    + File.separatorChar + ctxPath;
  +                + File.separatorChar + ctxPath;
               //System.out.println("Deploying " + ctx + " " + ctxFullPath);
               m_sevak.deploy( ctx, new File( ctxFullPath ) );
           }
   
       }
  -
   
   }
  
  
  

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


Mime
View raw message