You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2002/08/31 19:46:56 UTC
cvs commit: jakarta-avalon-apps/demo/src/manifest AltrmiHelloWorldTest.mf
hammant 2002/08/31 10:46:56
Modified: demo build.xml
demo/src/conf avalon-altrmidemo-assembly.xml
avalon-altrmidemo-config.xml
demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver
AltrmiHelloWorldServerTester.java
demo/src/java/org/apache/avalon/apps/demos/helloworldserver
HelloWorldHandler.java
demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver
SOAPHelloWorldServerImpl.java
SOAPHelloWorldServerTester.java
demo/src/manifest AltrmiHelloWorldTest.mf
Removed: demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver
AltrmiHelloWorldServerImpl.java
Log:
AltRMI demo upgraded a little
Revision Changes Path
1.62 +5 -5 jakarta-avalon-apps/demo/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/build.xml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- build.xml 31 Aug 2002 06:34:51 -0000 1.61
+++ build.xml 31 Aug 2002 17:46:55 -0000 1.62
@@ -74,9 +74,9 @@
<!-- Compiles project -->
<target name="compile">
- <available classname="electric.registry.Registry"
+ <available classname="org.apache.avalon.cornerstone.blocks.soapification.glue.Glue"
classpathref="project.class.path"
- property="glue.present"/>
+ property="glue.soapification.present"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.dir}/genjava"/>
@@ -92,7 +92,7 @@
<classpath refid="project.class.path" />
<exclude name="org/apache/avalon/apps/demos/soaphelloworldserver/**.java"
- unless="glue.present" />
+ unless="glue.soapification.present" />
</javac>
@@ -300,7 +300,7 @@
</target>
- <target name="soapdemo-sar" depends="jars" if="glue.present">
+ <target name="soapdemo-sar" depends="jars" if="glue.soapification.present">
<sar sarfile="${build.lib}/avalon-soapdemo.sar"
config="${conf.dir}/avalon-gluedemo-config.xml"
@@ -385,7 +385,7 @@
</target>
<!-- Performs soap related unit tests -->
- <target name="check-soap" depends="compile" if="glue.present">
+ <target name="check-soap" depends="compile" if="glue.soapification.present">
<java classname="org.apache.avalon.apps.demos.soaphelloworldserver.SOAPHelloWorldServerTester">
<classpath refid="project.class.path" />
</java>
1.10 +0 -8 jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-assembly.xml
Index: avalon-altrmidemo-assembly.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-assembly.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- avalon-altrmidemo-assembly.xml 12 May 2002 06:09:09 -0000 1.9
+++ avalon-altrmidemo-assembly.xml 31 Aug 2002 17:46:56 -0000 1.10
@@ -51,12 +51,4 @@
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager" />
</block>
- <block class="org.apache.avalon.apps.demos.altrmihelloworldserver.AltrmiHelloWorldServerImpl"
- name="altrmihelloworldserver" >
- <provide name="helloworldserver"
- role="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer"/>
- <provide name="altrmi-publisher"
- role="org.apache.excalibur.altrmi.server.AltrmiPublisher" />
- </block>
-
</assembly>
1.7 +1 -5 jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-config.xml
Index: avalon-altrmidemo-config.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/src/conf/avalon-altrmidemo-config.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- avalon-altrmidemo-config.xml 13 Apr 2002 10:45:54 -0000 1.6
+++ avalon-altrmidemo-config.xml 31 Aug 2002 17:46:56 -0000 1.7
@@ -56,11 +56,7 @@
</altrmi-publisher>
<altrmi-authenticator>
- </altrmi-authenticator>
-
- <altrmihelloworldserver>
- <pub-name>helloworld</pub-name>
- </altrmihelloworldserver>
+ </altrmi-authenticator>
<altrmification-listener>
1.5 +16 -13 jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerTester.java
Index: AltrmiHelloWorldServerTester.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerTester.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AltrmiHelloWorldServerTester.java 14 May 2002 11:02:54 -0000 1.4
+++ AltrmiHelloWorldServerTester.java 31 Aug 2002 17:46:56 -0000 1.5
@@ -8,7 +8,6 @@
package org.apache.avalon.apps.demos.altrmihelloworldserver;
import org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer;
-import org.apache.excalibur.altrmi.client.AltrmiFactory;
import org.apache.excalibur.altrmi.client.AltrmiHostContext;
import org.apache.excalibur.altrmi.client.impl.ServerClassAltrmiFactory;
import org.apache.excalibur.altrmi.client.impl.socket.SocketObjectStreamHostContext;
@@ -21,19 +20,23 @@
{
public static void main( String[] args ) throws Exception
{
- try
+ String newGreeting = "Howdie Partner";
+ if (args.length != 0)
{
- AltrmiHostContext arhc = new SocketObjectStreamHostContext( "127.0.0.1", 8666 );
- ServerClassAltrmiFactory af = new ServerClassAltrmiFactory( false );
- af.setHostContext( arhc );
- final HelloWorldServer hws =
- (HelloWorldServer)af.lookup( "helloworld" );
- hws.setGreeting( "Howdie Partner" );
- System.out.println( "The greeting on the HelloWorldServer block has been changed to 'Howdie Partner'. Point your browser to http://localhost:7666 to see it." );
- }
- catch( final Throwable t )
- {
- t.printStackTrace();
+ newGreeting = args[0];
}
+
+ AltrmiHostContext arhc = new SocketObjectStreamHostContext( "127.0.0.1", 8666 );
+ ServerClassAltrmiFactory af = new ServerClassAltrmiFactory( false );
+ af.setHostContext( arhc );
+ final HelloWorldServer hws =
+ (HelloWorldServer)af.lookup( "helloworld" );
+ String greeting1 = hws.getGreeting();
+ 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." );
+ af.close();
}
}
1.7 +6 -2 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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HelloWorldHandler.java 31 Aug 2002 06:50:00 -0000 1.6
+++ HelloWorldHandler.java 31 Aug 2002 17:46:56 -0000 1.7
@@ -56,7 +56,7 @@
out.println( "<html><body><b>" + m_greeting + "!</b><br> Requests so far = " +
++c_counter + "<br>" );
out.println( "you are " + remoteHost + " at " + remoteIP + "<br>" );
- out.println( "<p>The application will shutdown after 5 requests" );
+ out.println( "<p>The application will shutdown after 10 requests" );
out.println( "</body></html>" );
socket.close();
@@ -91,8 +91,12 @@
}
getLogger().info( "Connection from " + remoteHost + " (" + remoteIP + ")" );
- if( c_counter > 4 )
+
+
+ // A test of shutting down a block & app programatically.
+ if( c_counter >= 10 )
{
+ System.out.println("Testing Auto-Shutdown after 10 requests..");
m_context.requestShutdown();
}
}
1.8 +15 -1 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SOAPHelloWorldServerImpl.java 31 Aug 2002 06:50:00 -0000 1.7
+++ SOAPHelloWorldServerImpl.java 31 Aug 2002 17:46:56 -0000 1.8
@@ -50,17 +50,29 @@
implements Serviceable, Configurable, Initializable
{
private HelloWorldServer m_helloWorldServer;
+
private SOAPification m_soapification;
+
private String m_publicationName;
+ /**
+ * Initialize as per Initializable interface
+ * @throws Exception if a problem during initialzation.
+ */
public void initialize() throws Exception
{
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" );
+
}
+ /**
+ * Configure as per Configurable interface
+ * @param configuration the configuration
+ * @throws ConfigurationException if a problem during configuration
+ */
public void configure( final Configuration configuration )
throws ConfigurationException
{
@@ -68,13 +80,15 @@
}
/**
+ *
* @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( "SOAPHelloWorldServerImpl.service()" );
m_helloWorldServer = (HelloWorldServer)serviceManager.lookup( HelloWorldServer.ROLE );
m_soapification = (SOAPification)serviceManager.lookup( SOAPification.ROLE );
1.3 +15 -13 jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver/SOAPHelloWorldServerTester.java
Index: SOAPHelloWorldServerTester.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/src/java/org/apache/avalon/apps/demos/soaphelloworldserver/SOAPHelloWorldServerTester.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SOAPHelloWorldServerTester.java 14 May 2002 11:02:55 -0000 1.2
+++ SOAPHelloWorldServerTester.java 31 Aug 2002 17:46:56 -0000 1.3
@@ -17,21 +17,23 @@
*/
public class SOAPHelloWorldServerTester
{
- public static void main( final String[] args )
+ public static void main( final String[] args ) throws RegistryException
{
- final String url = "http://127.0.0.1:7998/soap/helloworld.wsdl";
- HelloWorldServer hws = null;
- try
- {
- hws =
- (HelloWorldServer)Registry.bind( url, HelloWorldServer.class );
- }
- catch( final RegistryException re )
+
+ String newGreeting = "Howdie Partner";
+ if (args.length != 0)
{
- System.err.println( "Opps some Glue problem " + re.getMessage() );
- re.printStackTrace();
+ newGreeting = args[0];
}
- hws.setGreeting( "Howdie Partner" );
- System.out.println( "The greeting on the HelloWorldServer block has been changed. Point your browser to http://localhost:7999 to see it." );
+
+ final String url = "http://127.0.0.1:7998/soap/helloworld.wsdl";
+ HelloWorldServer hws = null;
+ hws = (HelloWorldServer) Registry.bind( url, HelloWorldServer.class );
+ String greeting1 = hws.getGreeting();
+ 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." );
}
}
1.2 +1 -0 jakarta-avalon-apps/demo/src/manifest/AltrmiHelloWorldTest.mf
Index: AltrmiHelloWorldTest.mf
===================================================================
RCS file: /home/cvs/jakarta-avalon-apps/demo/src/manifest/AltrmiHelloWorldTest.mf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AltrmiHelloWorldTest.mf 29 Mar 2002 23:30:22 -0000 1.1
+++ AltrmiHelloWorldTest.mf 31 Aug 2002 17:46:56 -0000 1.2
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
Main-Class: org.apache.avalon.apps.demos.altrmihelloworldserver.AltrmiHelloWorldServerTester
+Class-Path: excalibur-altrmi-common.jar excalibur-altrmi-client-interfaces.jar excalibur-altrmi-client-impl.jar
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>