geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r292673 - in /geronimo/trunk/applications/magicGball: ./ src/java/org/acme/ src/plan/ src/resources/ejb/META-INF/wsdl/
Date Fri, 30 Sep 2005 08:03:22 GMT
Author: djencks
Date: Fri Sep 30 01:03:18 2005
New Revision: 292673

URL: http://svn.apache.org/viewcvs?rev=292673&view=rev
Log:
some progress towards corba-enabling magic gball

Added:
    geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallCallbackHandler.java
    geronimo/trunk/applications/magicGball/src/plan/
    geronimo/trunk/applications/magicGball/src/plan/magicgball-corba-plan.xml
Modified:
    geronimo/trunk/applications/magicGball/maven.xml
    geronimo/trunk/applications/magicGball/project.xml
    geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java
    geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl

Modified: geronimo/trunk/applications/magicGball/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/maven.xml?rev=292673&r1=292672&r2=292673&view=diff
==============================================================================
--- geronimo/trunk/applications/magicGball/maven.xml (original)
+++ geronimo/trunk/applications/magicGball/maven.xml Fri Sep 30 01:03:18 2005
@@ -5,7 +5,8 @@
 <project default="default"
     xmlns:j="jelly:core"
     xmlns:u="jelly:util"
-    xmlns:ant="jelly:ant">
+    xmlns:ant="jelly:ant"
+    xmlns:deploy="geronimo:deploy">
 
     <goal name="default" prereqs="ear"/>
     <goal name="build" prereqs="default"/>
@@ -22,12 +23,13 @@
         </ant:jar>
     </goal>
 
-     <goal name="client" prereqs="java:compile">
+    <goal name="client" prereqs="java:compile">
         <ant:jar destfile="target/${pom.artifactId}-client.jar">
             <fileset dir="target/classes">
                 <include name="**/*Client.class"/>
                 <include name="**/MagicGBall.class"/>
                 <include name="**/MagicGBallHome.class"/>
+                <include name="**/MagicGBallCallbackHandler.class"/>
             </fileset>
             <fileset dir="src/resources/client"/>
             <manifest>
@@ -48,6 +50,37 @@
     </goal>
 
     <goal name="site">
-            <ant:mkdir dir="target/docs"/>
+        <ant:mkdir dir="target/docs"/>
     </goal>
+
+    <goal name="startServer" prereqs="ear">
+        <j:set var="geronimo.server.corba.options" value="-Djavax.rmi.CORBA.UtilClass=org.openejb.corba.util.UtilDelegateImpl
-Dorg.openejb.corba.UtilDelegateClass=com.sun.corba.se.internal.POA.ShutdownUtilDelegate -Dorg.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton
-Dorg.omg.CORBA.ORBClass=org.openejb.corba.sunorb.OpenEJBORB -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject"/>
+        <deploy:unpackServer geronimoVersion="${geronimo_version}"/>
+        <deploy:startRemoteServer
+            geronimoTarget="${maven.build.dir}/geronimo-${geronimo_version}"
+            vmArgs="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
-Xmx512m -XX:MaxPermSize=128m ${geronimo.server.corba.options}"
+            />
+        <ant:echo message="Waiting for server at: ${maven.build.dir}/geronimo-${geronimo_version}"/>
+        <u:sleep millis="60000"/>
+        <deploy:waitForStarted
+            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+            username="system"
+            password="manager"
+            maxtries="125"
+            id="org/apache/geronimo/RuntimeDeployer"/>
+        <echo message="runtime deployer has started"/>
+        <u:sleep millis="7000"/>
+    </goal>
+    <goal name="deployApp">
+        <deploy:distribute
+            uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+            username="system"
+            password="manager"
+            module="${basedir}/target/magicGball.ear"
+            plan="${basedir}/src/plan/magicgball-corba-plan.xml"/>
+
+    </goal>
+
+    
+
 </project>

Modified: geronimo/trunk/applications/magicGball/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/project.xml?rev=292673&r1=292672&r2=292673&view=diff
==============================================================================
--- geronimo/trunk/applications/magicGball/project.xml (original)
+++ geronimo/trunk/applications/magicGball/project.xml Fri Sep 30 01:03:18 2005
@@ -20,6 +20,7 @@
 
 <project>
     <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
 
     <!-- ===================== -->
     <!-- Module Identification -->

Added: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallCallbackHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallCallbackHandler.java?rev=292673&view=auto
==============================================================================
--- geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallCallbackHandler.java
(added)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallCallbackHandler.java
Fri Sep 30 01:03:18 2005
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.acme;
+
+import java.io.IOException;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class MagicGBallCallbackHandler implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
+        for (int i = 0; i < callbacks.length; i++) {
+            Callback callback = callbacks[i];
+            if (callback instanceof NameCallback) {
+                ((NameCallback)callback).setName("system");
+            } else if (callback instanceof PasswordCallback) {
+                ((PasswordCallback)callback).setPassword("manager".toCharArray());
+            } else {
+                throw new UnsupportedCallbackException(callback);
+            }
+            System.out.println("CallbackHandler set user=system, password=manager");
+        }
+    }
+}

Modified: geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java?rev=292673&r1=292672&r2=292673&view=diff
==============================================================================
--- geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java (original)
+++ geronimo/trunk/applications/magicGball/src/java/org/acme/MagicGBallClient.java Fri Sep
30 01:03:18 2005
@@ -19,6 +19,7 @@
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
 
 /**
  * Run this app client from the command line and pass in a question as an argument.
@@ -37,10 +38,11 @@
             magicGBallClient.ask(args[i]);
         }
     }
-    
+
 	public void ask(String question) throws Exception {
         Context ctx = new InitialContext();
-        MagicGBallHome ejbHome = (MagicGBallHome) ctx.lookup("java:comp/env/mGball");
+        Object o = ctx.lookup("java:comp/env/mGball");
+        MagicGBallHome ejbHome = (MagicGBallHome) PortableRemoteObject.narrow(o, MagicGBallHome.class);
         MagicGBall mGball = ejbHome.create();
         String answer = mGball.ask(question);
 

Added: geronimo/trunk/applications/magicGball/src/plan/magicgball-corba-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/plan/magicgball-corba-plan.xml?rev=292673&view=auto
==============================================================================
--- geronimo/trunk/applications/magicGball/src/plan/magicgball-corba-plan.xml (added)
+++ geronimo/trunk/applications/magicGball/src/plan/magicgball-corba-plan.xml Fri Sep 30 01:03:18
2005
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
+    configId="org/apache/geronimo/MagicGBallCorba"
+    parentId="org/apache/geronimo/ServerCORBA">
+
+    <import>
+        <uri>org/apache/geronimo/Security</uri>
+    </import>
+
+    <module>
+        <ejb>magicGball-ejb.jar</ejb>
+        <openejb-jar
+            xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.0"
+            configId="MagicGBallEJB"
+            parentId="org/apache/geronimo/ServerCORBA">
+
+            <enterprise-beans>
+                <session>
+                    <ejb-name>MagicGBall</ejb-name>
+                    <jndi-name>MagicGBall</jndi-name>
+                    <tss-link>SSLClientPassword</tss-link>
+                </session>
+            </enterprise-beans>
+        </openejb-jar>
+    </module>
+
+    <module>
+        <web>magicGball.war</web>
+        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="MagicGBallWAR">
+            <context-priority-classloader>false</context-priority-classloader>
+        </web-app>
+    </module>
+
+    <module>
+        <java>magicGball-client.jar</java>
+        <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
+            configId="client"
+            clientConfigId="org/apache/geronimo/MagicGBallClient"
+            clientParentId="org/apache/geronimo/ClientCORBA">
+            <import>
+                <uri>org/apache/geronimo/ClientSecurity</uri>
+            </import>
+            <ejb-ref>
+                <ref-name>mGball</ref-name>
+                <ns-corbaloc>corbaloc::localhost:1050/NameService</ns-corbaloc>
+                <name>MagicGBall</name>
+                <css-link>SSLClientPassword</css-link>
+            </ejb-ref>
+            <realm-name>client-properties-realm</realm-name>
+            <callback-handler>org.acme.MagicGBallCallbackHandler</callback-handler>
+        </application-client>
+    </module>
+
+    <security>
+        <default-principal realm-name="geronimo-properties-realm">
+            <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
name="system"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="admin">
+                <realm realm-name="geronimo-properties-realm">
+                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
name="admin" designated-run-as="true"/>
+                </realm>
+            </role>
+        </role-mappings>
+    </security>
+
+</application>

Modified: geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl?rev=292673&r1=292672&r2=292673&view=diff
==============================================================================
--- geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
(original)
+++ geronimo/trunk/applications/magicGball/src/resources/ejb/META-INF/wsdl/MagicGBall.wsdl
Fri Sep 30 01:03:18 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <definitions name="MagicGBallDefinition" targetNamespace="http://acme.org/magicGball"
-    xmlns:test="http://acme.org/magicGball"
+    xmlns:mgb="http://acme.org/magicGball"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
@@ -27,10 +27,10 @@
         <operation name="echo">
             <soap:operation soapAction=""/>
             <input>
-                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://openejb.org/test-ejb-jar"/>
+                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://acme.org/magicGball"/>
             </input>
             <output>
-                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://openejb.org/test-ejb-jar"/>
+                <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="http://acme.org/magicGball"/>
             </output>
         </operation>
     </binding>



Mime
View raw message