You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2003/03/01 12:03:59 UTC
cvs commit: avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver RMIHelloWorldClient.java RMIHelloWorldServerImpl.java
donaldp 2003/03/01 03:03:58
Modified: demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver
AltrmiHelloWorldServerTester.java
demo/src/java/org/apache/avalon/apps/demos/helloworldserver
HelloWorldHandler.java HelloWorldServerImpl.java
demo/src/java/org/apache/avalon/apps/demos/lifecycledemo
LifecycleDemo1.java LifecycleDemo1Impl.java
LifecycleDemo2Impl.java
demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver
RMIHelloWorldClient.java
RMIHelloWorldServerImpl.java
Log:
Optimize imports and run styler
Revision Changes Path
1.10 +7 -7 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerTester.java
Index: AltrmiHelloWorldServerTester.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerTester.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AltrmiHelloWorldServerTester.java 17 Feb 2003 22:37:58 -0000 1.9
+++ AltrmiHelloWorldServerTester.java 1 Mar 2003 11:03:58 -0000 1.10
@@ -7,10 +7,10 @@
*/
package org.apache.avalon.apps.demos.altrmihelloworldserver;
-import org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer;
import org.apache.altrmi.client.HostContext;
import org.apache.altrmi.client.impl.ServerSideClassFactory;
import org.apache.altrmi.client.impl.socket.SocketObjectStreamHostContext;
+import org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer;
/**
* @author <a href="mailto:Paul_Hammant@yahoo.com">Paul Hammant</a>
@@ -21,13 +21,13 @@
public static void main( String[] args ) throws Exception
{
String newGreeting = "Howdie Partner";
- if (args.length != 0)
+ if( args.length != 0 )
{
- newGreeting = args[0];
+ newGreeting = args[ 0 ];
}
HostContext arhc = new SocketObjectStreamHostContext( "127.0.0.1", 8666 );
- ServerSideClassFactory af = new ServerSideClassFactory( );
+ ServerSideClassFactory af = new ServerSideClassFactory();
af.setHostContext( arhc );
final HelloWorldServer hws =
(HelloWorldServer)af.lookup( "helloworld" );
@@ -35,9 +35,9 @@
hws.setGreeting( newGreeting );
String greeting2 = hws.getGreeting();
System.out.println( "The greeting on the HelloWorldServer block has been changed from '"
- + greeting1 + "' to '" + greeting2
- + "'. Point your browser to http://localhost:7666 to see it." );
+ + greeting1 + "' to '" + greeting2
+ + "'. Point your browser to http://localhost:7666 to see it." );
af.close();
- System.out.println("Hello!");
+ System.out.println( "Hello!" );
}
}
1.8 +1 -1 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldHandler.java
Index: HelloWorldHandler.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- HelloWorldHandler.java 31 Aug 2002 17:46:56 -0000 1.7
+++ HelloWorldHandler.java 1 Mar 2003 11:03:58 -0000 1.8
@@ -96,7 +96,7 @@
// A test of shutting down a block & app programatically.
if( c_counter >= 10 )
{
- System.out.println("Testing Auto-Shutdown after 10 requests..");
+ System.out.println( "Testing Auto-Shutdown after 10 requests.." );
m_context.requestShutdown();
}
}
1.15 +1 -1 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldServerImpl.java
Index: HelloWorldServerImpl.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/HelloWorldServerImpl.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- HelloWorldServerImpl.java 3 Jan 2003 00:21:49 -0000 1.14
+++ HelloWorldServerImpl.java 1 Mar 2003 11:03:58 -0000 1.15
@@ -82,7 +82,7 @@
{
throw new ConfigurationException( "Malformed bind parameter", unhe );
}
- //String test = configuration.getChild("test").getValue();
+ //String test = configuration.getChild("test").getValue();
}
/**
1.2 +2 -3 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo1.java
Index: LifecycleDemo1.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LifecycleDemo1.java 27 Oct 2002 11:41:03 -0000 1.1
+++ LifecycleDemo1.java 1 Mar 2003 11:03:58 -0000 1.2
@@ -11,8 +11,7 @@
* @author Paul Hammant <Pa...@yahoo.com>
* @version 1.0
*/
-public interface LifecycleDemo1 {
-
+public interface LifecycleDemo1
+{
int myServiceMethod();
-
}
1.2 +25 -25 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo1Impl.java
Index: LifecycleDemo1Impl.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo1Impl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LifecycleDemo1Impl.java 27 Oct 2002 11:41:03 -0000 1.1
+++ LifecycleDemo1Impl.java 1 Mar 2003 11:03:58 -0000 1.2
@@ -7,20 +7,20 @@
*/
package org.apache.avalon.apps.demos.lifecycledemo;
+import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.activity.Startable;
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.context.Contextualizable;
+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.context.ContextException;
-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.framework.context.Contextualizable;
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.logger.Logger;
-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.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
/**
* A demo of the lifecycle methods. Mount the SAR fle contaning there blocks in Phoenix, go
@@ -33,8 +33,8 @@
* @version 1.0
*/
public class LifecycleDemo1Impl implements LogEnabled, Startable, Initializable, Contextualizable,
- Serviceable, Configurable, Disposable, LifecycleDemo1 {
-
+ Serviceable, Configurable, Disposable, LifecycleDemo1
+{
/**
* The method from our service interface -> LifecycleDemo1
@@ -42,15 +42,15 @@
*/
public int myServiceMethod()
{
- System.out.println("LifecycleDemo1Impl.myServiceMethod() called.");
+ System.out.println( "LifecycleDemo1Impl.myServiceMethod() called." );
System.out.flush();
return 123;
}
public LifecycleDemo1Impl()
{
- System.out.println("LifecycleDemo1Impl.constructor() called. "
- + "(You should never do too much in here)");
+ System.out.println( "LifecycleDemo1Impl.constructor() called. "
+ + "(You should never do too much in here)" );
System.out.flush();
}
@@ -61,9 +61,9 @@
* Enable Logging
* @param logger The logger to use
*/
- public void enableLogging(Logger logger)
+ public void enableLogging( Logger logger )
{
- System.out.println("LifecycleDemo1Impl.enableLogging() called.");
+ System.out.println( "LifecycleDemo1Impl.enableLogging() called." );
System.out.flush();
}
@@ -73,7 +73,7 @@
*/
public void start() throws Exception
{
- System.out.println("LifecycleDemo1Impl.start() called.");
+ System.out.println( "LifecycleDemo1Impl.start() called." );
System.out.flush();
}
@@ -83,7 +83,7 @@
*/
public void stop() throws Exception
{
- System.out.println("LifecycleDemo1Impl.stop() called.");
+ System.out.println( "LifecycleDemo1Impl.stop() called." );
System.out.flush();
}
@@ -93,7 +93,7 @@
*/
public void initialize() throws Exception
{
- System.out.println("LifecycleDemo1Impl.initialize() called.");
+ System.out.println( "LifecycleDemo1Impl.initialize() called." );
System.out.flush();
}
@@ -101,9 +101,9 @@
* Contextualize
* @throws ContextException If a problem
*/
- public void contextualize(Context context) throws ContextException
+ public void contextualize( Context context ) throws ContextException
{
- System.out.println("LifecycleDemo1Impl.contextualize() called (things like base directory passed in here).");
+ System.out.println( "LifecycleDemo1Impl.contextualize() called (things like base directory passed in here)." );
System.out.flush();
}
@@ -112,9 +112,9 @@
* @param serviceManager
* @throws ServiceException
*/
- public void service(ServiceManager serviceManager) throws ServiceException
+ public void service( ServiceManager serviceManager ) throws ServiceException
{
- System.out.println("LifecycleDemo1Impl.service() called (lookup on other services possible now).");
+ System.out.println( "LifecycleDemo1Impl.service() called (lookup on other services possible now)." );
System.out.flush();
}
@@ -122,9 +122,9 @@
* Configure
* @throws ConfigurationException If a problem
*/
- public void configure(Configuration configuration) throws ConfigurationException
+ public void configure( Configuration configuration ) throws ConfigurationException
{
- System.out.println("LifecycleDemo1Impl.configure() called (configuration from config.xml passed here).");
+ System.out.println( "LifecycleDemo1Impl.configure() called (configuration from config.xml passed here)." );
System.out.flush();
}
@@ -133,7 +133,7 @@
*/
public void dispose()
{
- System.out.println("LifecycleDemo1Impl.dispose() Called");
+ System.out.println( "LifecycleDemo1Impl.dispose() Called" );
System.out.flush();
}
1.2 +29 -28 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo2Impl.java
Index: LifecycleDemo2Impl.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/lifecycledemo/LifecycleDemo2Impl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LifecycleDemo2Impl.java 27 Oct 2002 11:41:03 -0000 1.1
+++ LifecycleDemo2Impl.java 1 Mar 2003 11:03:58 -0000 1.2
@@ -7,20 +7,20 @@
*/
package org.apache.avalon.apps.demos.lifecycledemo;
+import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.activity.Startable;
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.context.Contextualizable;
+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.context.ContextException;
-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.framework.context.Contextualizable;
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.logger.Logger;
-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.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
/**
* A demo of the lifecycle methods. Mount the SAR fle contaning there blocks in Phoenix, go
@@ -32,14 +32,15 @@
* @version 1.0
*/
public class LifecycleDemo2Impl implements LogEnabled, Startable, Initializable, Contextualizable,
- Serviceable, Configurable, Disposable {
+ Serviceable, Configurable, Disposable
+{
private LifecycleDemo1 m_lifecycleDemo1;
public LifecycleDemo2Impl()
{
- System.out.println("LifecycleDemo2Impl.constructor() called. "
- + "(You should never do too much in here)");
+ System.out.println( "LifecycleDemo2Impl.constructor() called. "
+ + "(You should never do too much in here)" );
System.out.flush();
}
@@ -50,9 +51,9 @@
* Enable Logging
* @param logger The logger to use
*/
- public void enableLogging(Logger logger)
+ public void enableLogging( Logger logger )
{
- System.out.println("LifecycleDemo2Impl.enableLogging() called.");
+ System.out.println( "LifecycleDemo2Impl.enableLogging() called." );
System.out.flush();
}
@@ -62,7 +63,7 @@
*/
public void start() throws Exception
{
- System.out.println("LifecycleDemo2Impl.start() called.");
+ System.out.println( "LifecycleDemo2Impl.start() called." );
System.out.flush();
}
@@ -72,7 +73,7 @@
*/
public void stop() throws Exception
{
- System.out.println("LifecycleDemo2Impl.stop() called.");
+ System.out.println( "LifecycleDemo2Impl.stop() called." );
System.out.flush();
}
@@ -82,11 +83,11 @@
*/
public void initialize() throws Exception
{
- System.out.println("LifecycleDemo2Impl.initialize() called.");
+ System.out.println( "LifecycleDemo2Impl.initialize() called." );
System.out.flush();
- System.out.println("LifecycleDemo2Impl.initialize(), LifecycleDemo1.myServiceMethod() "
- + "method called result = " + m_lifecycleDemo1.myServiceMethod());
+ System.out.println( "LifecycleDemo2Impl.initialize(), LifecycleDemo1.myServiceMethod() "
+ + "method called result = " + m_lifecycleDemo1.myServiceMethod() );
System.out.flush();
}
@@ -95,9 +96,9 @@
* Contextualize
* @throws ContextException If a problem
*/
- public void contextualize(Context context) throws ContextException
+ public void contextualize( Context context ) throws ContextException
{
- System.out.println("LifecycleDemo2Impl.contextualize() called (things like base directory passed in here).");
+ System.out.println( "LifecycleDemo2Impl.contextualize() called (things like base directory passed in here)." );
System.out.flush();
}
@@ -108,22 +109,22 @@
* @param serviceManager
* @throws ServiceException
*/
- public void service(ServiceManager serviceManager) throws ServiceException
+ public void service( ServiceManager serviceManager ) throws ServiceException
{
- System.out.println("LifecycleDemo2Impl.service() called "
- + "(lookup on other services possible now).");
- System.out.println("LifecycleDemo2Impl.service(), LifecycleDemo1 service looked up");
+ System.out.println( "LifecycleDemo2Impl.service() called "
+ + "(lookup on other services possible now)." );
+ System.out.println( "LifecycleDemo2Impl.service(), LifecycleDemo1 service looked up" );
m_lifecycleDemo1 = (LifecycleDemo1)
- serviceManager.lookup(LifecycleDemo1.class.getName());
+ serviceManager.lookup( LifecycleDemo1.class.getName() );
}
/**
* Configure
* @throws ConfigurationException If a problem
*/
- public void configure(Configuration configuration) throws ConfigurationException
+ public void configure( Configuration configuration ) throws ConfigurationException
{
- System.out.println("LifecycleDemo2Impl.configure() called (configuration from config.xml passed here).");
+ System.out.println( "LifecycleDemo2Impl.configure() called (configuration from config.xml passed here)." );
System.out.flush();
}
@@ -132,7 +133,7 @@
*/
public void dispose()
{
- System.out.println("LifecycleDemo2Impl.dispose() Called");
+ System.out.println( "LifecycleDemo2Impl.dispose() Called" );
System.out.flush();
}
1.4 +3 -2 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldClient.java
Index: RMIHelloWorldClient.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldClient.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RMIHelloWorldClient.java 8 Jul 2002 00:23:04 -0000 1.3
+++ RMIHelloWorldClient.java 1 Mar 2003 11:03:58 -0000 1.4
@@ -21,8 +21,9 @@
public static void main( final String[] args )
throws Exception
{
- if (args.length != 3) {
- System.err.println("Usage: "+RMIHelloWorldClient.class.getName()+" <host> <port> <text>");
+ if( args.length != 3 )
+ {
+ System.err.println( "Usage: " + RMIHelloWorldClient.class.getName() + " <host> <port> <text>" );
return;
}
final String host = args[ 0 ];
1.6 +7 -7 avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldServerImpl.java
Index: RMIHelloWorldServerImpl.java
===================================================================
RCS file: /home/cvs/avalon-apps/demo/src/java/org/apache/avalon/apps/demos/rmihelloworldserver/RMIHelloWorldServerImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- RMIHelloWorldServerImpl.java 22 May 2002 20:09:50 -0000 1.5
+++ RMIHelloWorldServerImpl.java 1 Mar 2003 11:03:58 -0000 1.6
@@ -8,15 +8,15 @@
package org.apache.avalon.apps.demos.rmihelloworldserver;
import java.rmi.RemoteException;
-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.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.cornerstone.services.rmification.RMIfication;
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.cornerstone.services.rmification.RMIfication;
+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;
/**
* @phoenix:block
@@ -32,7 +32,7 @@
private String m_publicationName;
/**
- *
+ *
* @phoenix:dependency name="org.apache.avalon.cornerstone.services.rmification.RMIfication"
*
*/
@@ -60,7 +60,7 @@
{
m_rmification.unpublish( m_publicationName );
}
- catch ( final Exception e )
+ catch( final Exception e )
{
getLogger().error( "Fail to unpublish service", e );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org