donaldp     2002/08/30 23:50:00

  Modified:    demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver
                        AltrmiHelloWorldServerImpl.java
               demo/src/java/org/apache/avalon/apps/demos/helloworldserver
                        HelloWorldHandler.java HelloWorldServerImpl.java
               demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver
                        SOAPHelloWorldServerImpl.java
  Log:
  Remove those protected variables.
  
  Revision  Changes    Path
  1.9       +8 -19     
jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerImpl.java
  
  Index: AltrmiHelloWorldServerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AltrmiHelloWorldServerImpl.java   22 May 2002 20:09:50 -0000      1.8
  +++ AltrmiHelloWorldServerImpl.java   31 Aug 2002 06:50:00 -0000      1.9
  @@ -12,12 +12,10 @@
   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.context.Context;
   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 org.apache.excalibur.altrmi.server.AltrmiPublisher;
   
   /**
  @@ -46,44 +44,35 @@
       extends AbstractLogEnabled
       implements Serviceable, Configurable, Initializable
   {
  -    protected HelloWorldServer mHelloWorldServer;
  -    protected AltrmiPublisher mAltrmiPublisher;
  -    protected BlockContext m_context;
  -    protected String publicationName;
  +    private HelloWorldServer m_helloWorldServer;
  +    private AltrmiPublisher m_altrmiPublisher;
  +    private String m_publicationName;
   
       public void initialize() throws Exception
       {
  -
           // being phased out.
  -        //mAltrmiPublisher.publish(mHelloWorldServer, publicationName, 
HelloWorldServer.class);
  -        getLogger().info( "HelloWorldServer published as " + publicationName );
  +        m_altrmiPublisher.publish( m_helloWorldServer, m_publicationName, 
HelloWorldServer.class );
  +        getLogger().info( "HelloWorldServer published as " + m_publicationName );
           // This is only to help newbies.....
           System.out.println( "AltrmiHelloWorld server running.  Use 
avalon-altrmidemo-tester.jar to connect to and test it" );
       }
   
  -    public void contextualize( final Context context )
  -    {
  -        m_context = (BlockContext)context;
  -    }
  -
       public void configure( final Configuration configuration )
           throws ConfigurationException
       {
  -        publicationName = configuration.getChild( "pub-name" ).getValue();
  +        m_publicationName = configuration.getChild( "pub-name" ).getValue();
       }
   
       /**
  -     * 
        * @phoenix:dependency name="org.apache.excalibur.altrmi.server.AltrmiPublisher"
        * @phoenix:dependency 
name="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer"
  -     *
        */
       public void service( final ServiceManager serviceManager )
           throws ServiceException
       {
           getLogger().info( "SOAPHelloWorldServer.compose()" );
   
  -        mHelloWorldServer = (HelloWorldServer)serviceManager.lookup( 
HelloWorldServer.ROLE );
  -        mAltrmiPublisher = (AltrmiPublisher)serviceManager.lookup( 
AltrmiPublisher.class.getName() );
  +        m_helloWorldServer = (HelloWorldServer)serviceManager.lookup( 
HelloWorldServer.ROLE );
  +        m_altrmiPublisher = (AltrmiPublisher)serviceManager.lookup( 
AltrmiPublisher.class.getName() );
       }
   }
  
  
  
  1.6       +12 -9     
jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldHandler.java
  
  Index: HelloWorldHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldHandler.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HelloWorldHandler.java    31 Aug 2002 06:34:51 -0000      1.5
  +++ HelloWorldHandler.java    31 Aug 2002 06:50:00 -0000      1.6
  @@ -12,8 +12,8 @@
   import java.io.PrintWriter;
   import java.net.Socket;
   import java.net.SocketException;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.cornerstone.services.connection.ConnectionHandler;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.phoenix.BlockContext;
   
   /**
  @@ -22,16 +22,16 @@
    * @author Federico Barbieri <[EMAIL PROTECTED]>
    * @version 1.0
    */
  -public class HelloWorldHandler
  +final class HelloWorldHandler
       extends AbstractLogEnabled
       implements ConnectionHandler
   {
  -    private static int        c_counter;
  -    private String            m_greeting;
  -    private BlockContext      m_context;
  +    private static int c_counter;
  +    private String m_greeting;
  +    private BlockContext m_context;
   
  -    protected HelloWorldHandler( final String greeting,
  -                                 final BlockContext context )
  +    HelloWorldHandler( final String greeting,
  +                       final BlockContext context )
       {
           m_greeting = greeting;
           m_context = context;
  @@ -71,7 +71,7 @@
           }
           catch( final IOException ioe )
           {
  -            getLogger().debug( "Exception in HelloWorld handling socket to " + 
remoteHost ,
  +            getLogger().debug( "Exception in HelloWorld handling socket to " + 
remoteHost,
                                  ioe );
           }
           catch( final Exception e )
  @@ -80,7 +80,10 @@
           }
           finally
           {
  -            try { socket.close(); }
  +            try
  +            {
  +                socket.close();
  +            }
               catch( final IOException ioe )
               {
                   getLogger().error( "Exception closing socket ", ioe );
  
  
  
  1.12      +9 -9      
jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldServerImpl.java
  
  Index: HelloWorldServerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldServerImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HelloWorldServerImpl.java 31 Aug 2002 06:34:51 -0000      1.11
  +++ HelloWorldServerImpl.java 31 Aug 2002 06:50:00 -0000      1.12
  @@ -38,20 +38,20 @@
    * @author  Federico Barbieri <[EMAIL PROTECTED]>
    * @version 1.0
    */
  -public class HelloWorldServerImpl
  +public final class HelloWorldServerImpl
       extends AbstractLogEnabled
       implements HelloWorldServer, HelloWorldServerMBean, Contextualizable,
       Serviceable, Configurable, Initializable, Disposable,
       ConnectionHandlerFactory
   {
  -    protected SocketManager m_socketManager;
  -    protected ConnectionManager m_connectionManager;
  -    protected BlockContext m_context;
  -    protected String m_greeting = "Hello World";
  -    protected InetAddress m_bindTo;
  -    protected int m_port;
  -    protected String m_connectionName = "HelloWorldListener";
  -    protected ServerSocket m_serverSocket;
  +    private SocketManager m_socketManager;
  +    private ConnectionManager m_connectionManager;
  +    private BlockContext m_context;
  +    private String m_greeting = "Hello World";
  +    private InetAddress m_bindTo;
  +    private int m_port;
  +    private String m_connectionName = "HelloWorldListener";
  +    private ServerSocket m_serverSocket;
   
       public void setGreeting( final String greeting )
       {
  
  
  
  1.7       +21 -34    
jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver/SOAPHelloWorldServerImpl.java
  
  Index: SOAPHelloWorldServerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver/SOAPHelloWorldServerImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SOAPHelloWorldServerImpl.java     22 May 2002 20:09:50 -0000      1.6
  +++ SOAPHelloWorldServerImpl.java     31 Aug 2002 06:50:00 -0000      1.7
  @@ -7,24 +7,22 @@
    */
   package org.apache.avalon.apps.demos.soaphelloworldserver;
   
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.service.Serviceable;
  -import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer;
  +import org.apache.avalon.cornerstone.services.soapification.SOAPification;
  +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.framework.context.Context;
  -import org.apache.avalon.phoenix.BlockContext;
  -import org.apache.avalon.cornerstone.services.soapification.SOAPification;
  -import org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer;
  +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;
   
   /**
    * This demo Server applications shows the use of SOAP to publish the
    * HelloWorld block's API to clients over TCP/IP.
    *
  - * HelloWorld would normally mount as just a HTTP hack showing a HTML
  + * HelloWorld would normally mount as just a HTTP imit showing a HTML
    * HelloWorld message to suitably forgiving Browsers.  With the
    * addition of this block and suitably assembled, the HelloWorld
    * application is given more life.
  @@ -47,50 +45,39 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Paul Hammant</a>
    * @version 1.0
    */
  -public class SOAPHelloWorldServerImpl
  +public final class SOAPHelloWorldServerImpl
       extends AbstractLogEnabled
       implements Serviceable, Configurable, Initializable
   {
  -    protected HelloWorldServer    mHelloWorldServer;
  -
  -    protected SOAPification       mSOAPification;
  -
  -    protected BlockContext        m_context;
  -
  -    protected String publicationName;
  +    private HelloWorldServer m_helloWorldServer;
  +    private SOAPification m_soapification;
  +    private String m_publicationName;
   
  -    public void initialize() throws Exception {
  -        mSOAPification.publish(mHelloWorldServer, publicationName, 
HelloWorldServer.class);
  -        getLogger().info("HelloWorldServer published as " + publicationName);
  -        // This is only to help newbies.....
  -        System.out.println("SOAPHelloWorld WSDL server running.  Use 
SOAPHelloWorldTester to connect to URL listed above to test it");
  -
  -    }
  -
  -    public void contextualize( final Context context )
  +    public void initialize() throws Exception
       {
  -        m_context = (BlockContext)context;
  +        m_soapification.publish( m_helloWorldServer, m_publicationName, 
HelloWorldServer.class );
  +        getLogger().info( "HelloWorldServer published as " + m_publicationName );
  +        // This is only to help newbies.....
  +        System.out.println( "SOAPHelloWorld WSDL server running.  Use 
SOAPHelloWorldTester to connect to URL listed above to test it" );
       }
   
       public void configure( final Configuration configuration )
           throws ConfigurationException
       {
  -        publicationName = configuration.getChild("pub-name").getValue();
  +        m_publicationName = configuration.getChild( "pub-name" ).getValue();
       }
   
       /**
  -     * 
        * @phoenix:dependency 
name="org.apache.avalon.cornerstone.services.soapification.SOAPification"
        * @phoenix:dependency 
name="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer"
  -     *
        */
       public void service( final ServiceManager serviceManager )
           throws ServiceException
       {
  -        getLogger().info("SOAPHelloWorldServer.compose()");
  +        getLogger().info( "SOAPHelloWorldServer.compose()" );
   
  -        mHelloWorldServer = (HelloWorldServer)serviceManager.lookup( 
HelloWorldServer.ROLE );
  -        mSOAPification = (SOAPification)serviceManager.lookup( SOAPification.ROLE );
  +        m_helloWorldServer = (HelloWorldServer)serviceManager.lookup( 
HelloWorldServer.ROLE );
  +        m_soapification = (SOAPification)serviceManager.lookup( SOAPification.ROLE 
);
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to