geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r159005 [9/9] - in geronimo/trunk/modules: assembly/src/plan/ interop/ interop/src/idl/ interop/src/java/org/apache/geronimo/interop/ interop/src/java/org/apache/geronimo/interop/CosNaming/iiop_stubs/ interop/src/java/org/apache/geronimo/interop/adapter/ interop/src/java/org/apache/geronimo/interop/client/ interop/src/java/org/apache/geronimo/interop/generator/ interop/src/java/org/apache/geronimo/interop/naming/ interop/src/java/org/apache/geronimo/interop/properties/ interop/src/java/org/apache/geronimo/interop/repository/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/client/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/compiler/ interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ interop/src/java/org/apache/geronimo/interop/server/ interop/src/java/org/apache/geronimo/interop/util/
Date Fri, 25 Mar 2005 11:54:53 GMT
Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/MessageHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/MessageHandler.java?view=diff&r1=159004&r2=159005
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/MessageHandler.java
(original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/MessageHandler.java
Fri Mar 25 03:54:30 2005
@@ -19,116 +19,98 @@
 
 import java.net.InetAddress;
 import java.net.Socket;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.InputStream;
 
 import org.apache.geronimo.interop.GIOP.*;
 import org.apache.geronimo.interop.IOP.*;
 import org.apache.geronimo.interop.SystemException;
-import org.apache.geronimo.interop.adapter.Adapter;
+import org.apache.geronimo.interop.adapter.HomeAdapter;
 import org.apache.geronimo.interop.adapter.AdapterManager;
+import org.apache.geronimo.interop.adapter.Adapter;
 import org.apache.geronimo.interop.naming.NameService;
-import org.apache.geronimo.interop.properties.BooleanProperty;
-import org.apache.geronimo.interop.properties.SystemProperties;
-import org.apache.geronimo.interop.rmi.iiop.BadMagicException;
-import org.apache.geronimo.interop.rmi.iiop.CdrInputStream;
-import org.apache.geronimo.interop.rmi.iiop.CdrOutputStream;
-import org.apache.geronimo.interop.rmi.iiop.GiopMessage;
-import org.apache.geronimo.interop.rmi.iiop.ListenerInfo;
-import org.apache.geronimo.interop.rmi.iiop.UnsupportedProtocolVersionException;
-import org.apache.geronimo.interop.util.ExceptionUtil;
-import org.apache.geronimo.interop.util.ThreadContext;
+import org.apache.geronimo.interop.rmi.iiop.*;
 import org.apache.geronimo.interop.util.UTF8;
+import org.openejb.server.ServiceException;
 
+public class MessageHandler {
 
-public class MessageHandler extends Thread {
-    public static MessageHandler getInstance(ListenerInfo listenerInfo, Socket socket) {
-        MessageHandler object = new MessageHandler();
-        object.init(listenerInfo, socket);
-        return object;
+    private AdapterManager      adapterManager;
+    private boolean             simpleIDL;
+    private boolean             writeSystemExceptionStackTrace;
+    private NameService         nameService = NameService.getInstance();
+
+    public MessageHandler( AdapterManager adapterManager, boolean simpleIDL,
+                           boolean writeSystemExceptionStackTrace )
+    {
+        this.adapterManager = adapterManager;
+        this.simpleIDL = simpleIDL;
+        this.writeSystemExceptionStackTrace = writeSystemExceptionStackTrace;
     }
 
-    // -----------------------------------------------------------------------
-    // properties
-    // -----------------------------------------------------------------------
-
-
-    public static final BooleanProperty simpleIDLProperty =
-            new BooleanProperty(SystemProperties.class, "org.apache.geronimo.interop.simpleIDL");
-
-    public static BooleanProperty writeSystemExceptionStackTraceProperty =
-            new BooleanProperty(SystemProperties.class, "org.apache.geronimo.interop.rmi.iiop.writeSystemExceptionStackTrace")
-            .defaultValue(true);
-
-    // -----------------------------------------------------------------------
-    // private data
-    // -----------------------------------------------------------------------
-
-    private static final boolean SIMPLE_IDL = simpleIDLProperty.getBoolean();
-
-    private static boolean _writeSystemExceptionStackTrace = writeSystemExceptionStackTraceProperty.getBoolean();
-
-    private static RequestHandler[] _handlers = new RequestHandler[128];
-
-    private NameService _nameService;
-    private ListenerInfo _listenerInfo;
-    private java.net.Socket _socket;
-    private java.io.InputStream _socketIn;
-    private java.io.OutputStream _socketOut;
-    private String _clientHostName;
-    private String _clientHostAddress;
-    private String _clientInfo;
-    private org.apache.geronimo.interop.rmi.iiop.ObjectInputStream _objectInput;
-    private org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream _objectOutput;
-    private org.apache.geronimo.interop.rmi.iiop.ObjectInputStream _simpleInput;
-    private org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream _simpleOutput;
-
-    // -----------------------------------------------------------------------
-    // public methods
-    // -----------------------------------------------------------------------
+    public void service(Socket socket) throws ServiceException, IOException {
 
-    public static void registerHandler(char keyType, RequestHandler handler) {
-        _handlers[keyType] = handler;
-    }
+        InputStream in;
+        OutputStream out;
+
+        String clientHostName;
+        String clientHostAddress;
+        String clientInfo;
+
+        in = socket.getInputStream();
+        out = socket.getOutputStream();
+
+        InetAddress addr = socket.getInetAddress();
+        clientHostName = addr.getHostName();
+        clientHostAddress = addr.getHostAddress();
+        clientInfo = clientHostName;
+
+        if (!clientHostAddress.equals(clientHostName)) {
+            clientInfo += " (" + clientHostAddress + ")";
+        }
 
-    public void run() {
-        ThreadContext.setDefaultRmiHost(_listenerInfo.host);
-        ThreadContext.setDefaultRmiPort(_listenerInfo.port);
         boolean firstMessage = true;
         CdrInputStream input = CdrInputStream.getInstance();
         CdrOutputStream output = CdrOutputStream.getInstance();
         CdrOutputStream results = CdrOutputStream.getInstance();
+
         for (; ;) {
             boolean sendResponse = true;
             GiopMessage inputMessage;
+
             try {
-                inputMessage = input.receive_message(_socketIn, _clientInfo);
+                inputMessage = input.receive_message( in, clientInfo );
                 firstMessage = false;
             } catch (BadMagicException ex) {
                 if (firstMessage) {
-                    warnBadMagic(_clientInfo, ex);
+                    warnBadMagic(clientInfo, ex);
                 } else {
-                    warnBadMagicBadSize(_clientInfo, ex);
+                    warnBadMagicBadSize(clientInfo, ex);
                 }
-                closeSocket();
+                closeStreams( in, out );
                 return;
             } catch (UnsupportedProtocolVersionException ex) {
-                warnGiopVersion(_clientInfo, ex);
-                closeSocket();
+                warnGiopVersion( clientInfo, ex);
+                closeStreams( in, out );
                 return;
             } catch (Exception ex) {
                 if (input.getOffset() > 0) {
                     ex.printStackTrace();
-                    warnReceiveFailed(_clientInfo, ex);
+                    warnReceiveFailed( clientInfo, ex);
                 }
                 // Otherwise client shutdown was not in the middle of a
                 // request, i.e. probably 'normal' and unworthy of a
                 // log message.
-                closeSocket();
+                closeStreams( in, out );
                 return;
             }
+
             output.setGiopVersion(input.getGiopVersion());
+
             switch (inputMessage.type) {
                 case MsgType_1_1._Request:
-                    processRequest(input, output, results, inputMessage.request);
+                    processRequest(input, output, results, inputMessage.request, clientInfo);
                     if ((inputMessage.request.response_flags & 1) == 0) {
                         sendResponse = false; // oneway request
                     }
@@ -139,63 +121,37 @@
                 default:
                     throw new SystemException("TODO: message type = " + inputMessage.type);
             }
+
             if (sendResponse) {
                 try {
-                    output.send_message(_socketOut, _clientInfo);
+                    output.send_message( out, clientInfo );
                 } catch (Exception ex) {
-                    warnSendFailed(_clientInfo, ex);
-                    closeSocket();
+                    warnSendFailed(clientInfo, ex);
+                    closeStreams( in, out );
                     return;
                 }
             }
+
             input.reset();
             output.reset();
             results.reset();
         }
     }
 
-    // -----------------------------------------------------------------------
-    // protected methods
-    // -----------------------------------------------------------------------
-
-    protected void init(ListenerInfo listenerInfo, Socket socket) {
-        setDaemon(true);
-        _nameService = NameService.getInstance();
-        _listenerInfo = listenerInfo;
-        _socket = socket;
+    protected void closeStreams( InputStream in, OutputStream out ) {
         try {
-            _socketIn = _socket.getInputStream();
-            _socketOut = _socket.getOutputStream();
-            InetAddress addr = _socket.getInetAddress();
-            _clientHostName = addr.getHostName();
-            _clientHostAddress = addr.getHostAddress();
-            _clientInfo = _clientHostName;
-            if (!_clientHostAddress.equals(_clientHostName)) {
-                _clientInfo += " (" + _clientHostAddress + ")";
-            }
-        } catch (Throwable ex) {
-            closeSocket();
-            throw ExceptionUtil.rethrow(ex);
-        }
-    }
-
-    protected void closeSocket() {
-        try {
-            if (_socketIn != null) {
-                _socketIn.close();
+            if (in != null) {
+                in.close();
             }
         } catch (Exception ignore) {
         }
+
         try {
-            if (_socketOut != null) {
-                _socketOut.close();
+            if (out != null) {
+                out.close();
             }
         } catch (Exception ignore) {
         }
-        try {
-            _socket.close();
-        } catch (Exception ignore) {
-        }
     }
 
     protected byte[] getObjectKey(TargetAddress target) {
@@ -210,25 +166,23 @@
         }
     }
 
-    protected void processRequest(CdrInputStream parameters, CdrOutputStream output, CdrOutputStream
results, RequestHeader_1_2 request) {
+    protected void processRequest(CdrInputStream parameters,
+                                  CdrOutputStream output,
+                                  CdrOutputStream results,
+                                  RequestHeader_1_2 request,
+                                  String clientInfo
+                                  ) {
         byte[] objectKey = getObjectKey(request.target);
         int keyLength = objectKey.length;
         int keyType = keyLength == 0 ? 0 : objectKey[0];
-        if (keyType >= 'A' && keyType <= 'Z') {
-            RequestHandler handler = _handlers[keyType];
-            if (handler != null) {
-                handler.processRequest(objectKey, request.operation, parameters, output);
-                return;
-            }
-        }
 
         ReplyHeader_1_2 reply = new ReplyHeader_1_2();
         reply.request_id = request.request_id;
 
-        org.apache.geronimo.interop.rmi.iiop.ObjectInputStream objectIn;
-        org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream objectOut;
+        ObjectInputStream objectIn;
+        ObjectOutputStream objectOut;
 
-        if (SIMPLE_IDL || keyType == 'N' || keyType == 'J') {
+        if (simpleIDL || keyType == 'N' || keyType == 'J') {
             // Name Service and JMS use simple IDL interoperability.
             objectIn = org.apache.geronimo.interop.rmi.iiop.SimpleObjectInputStream.getInstance(parameters);
             objectOut = org.apache.geronimo.interop.rmi.iiop.SimpleObjectOutputStream.getInstance(results);
@@ -255,82 +209,38 @@
                 objectName = UTF8.toString(objectKey);
             }
 
-            /*
-            if (objectName.startsWith("EJB~"))
-            {
-                // Compact encoding of component class names,
-                // saves 11 bytes per request.
-                objectName = "ejb.components." + objectName.substring(4);
-            }
-            */
-
             processServiceContext(request);
 
-            /*
             Object object;
             try
             {
-                object = null; //_nameService.lookup(objectName);
+                object = nameService.lookup(objectName);
             }
             catch (javax.naming.NameNotFoundException notFound)
             {
-                warnLookupFailed(_clientInfo, notFound);
+                warnLookupFailed(clientInfo, notFound);
                 throw new org.omg.CORBA.OBJECT_NOT_EXIST(objectName);
             }
 
-            if (object instanceof RemoteInterface)
+            Adapter adapter = (Adapter)object;
+            if (adapter != null)
             {
-                RemoteInterface skeleton = ((RemoteInterface)object).$getSkeleton();
-                skeleton.$invoke(request.operation, objectKey, objectIn, objectOut);
-                if (objectOut.hasException())
-                {
-                    reply.reply_status = ReplyStatusType_1_2.USER_EXCEPTION;
-                }
-                else
-                {
-                    reply.reply_status = ReplyStatusType_1_2.NO_EXCEPTION;
-                }
-                output.write_reply(reply, results);
-            }
-            else
-            {
-                warnInvokeFailedNoRemoteInterface(_clientInfo, object, object.getClass());
-                throw new org.omg.CORBA.OBJECT_NOT_EXIST(objectName);
-            }
-            */
-
-            Object object;
-            try {
-                object = _nameService.lookup(objectName);
-            } catch (javax.naming.NameNotFoundException notFound) {
-                object = AdapterManager.getInstance().getAdapter(objectName);
-
-                if (object == null) {
-                    warnLookupFailed(_clientInfo, notFound);
-                    throw new org.omg.CORBA.OBJECT_NOT_EXIST(objectName);
-                }
-            }
-
-//            Adapter a = AdapterManager.getInstance().getAdapter(objectName);
-//            if (a != null)
-            if (object != null && object instanceof Adapter) {
-                Adapter a = (Adapter) object;
-                //RemoteInterface skeleton = a.getRemoteInterface();
-                a.invoke(request.operation, objectKey, objectIn, objectOut);
+                adapter.invoke(request.operation, objectKey, objectIn, objectOut);
 
                 if (objectOut.hasException()) {
                     reply.reply_status = ReplyStatusType_1_2.USER_EXCEPTION;
                 } else {
                     reply.reply_status = ReplyStatusType_1_2.NO_EXCEPTION;
                 }
+
                 output.write_reply(reply, results);
             } else {
                 throw new org.omg.CORBA.OBJECT_NOT_EXIST(objectName);
             }
         } catch (Exception ex) {
-            warnSystemException(_clientInfo, ex);
+            warnSystemException(clientInfo, ex);
             results = CdrOutputStream.getInstance(); // in case we already wrote to it
-            results.write_SystemException(ex, _writeSystemExceptionStackTrace);
+            results.write_SystemException(ex, writeSystemExceptionStackTrace);
             reply.reply_status = ReplyStatusType_1_2.SYSTEM_EXCEPTION;
             output.write_reply(reply, results);
         }
@@ -365,26 +275,9 @@
                 password = SecurityInfo.decode(context.context_data);
             }
             */
-            // Otherwise OK to ignore unknown tags.
-        }
 
-        // Default security info.
-        /*
-        if (username == null)
-        {
-            username = User.GUEST;
-        }
-        if (password == null)
-        {
-            password = "";
+            // TODO: Is the ServiceContext a CSIv2 Security Context?
         }
-
-        // Check if the password is correct.
-        User user = User.getInstance(username);
-        user.login(password); // may throw SecurityException
-        User.setCurrent(user);
-        SimpleSubject.setCurrent(new SimpleSubject(username, password));
-        */
     }
 
     // log methods

Added: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/RmiIiopServerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/RmiIiopServerGBean.java?view=auto&rev=159005
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/RmiIiopServerGBean.java
(added)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/RmiIiopServerGBean.java
Fri Mar 25 03:54:30 2005
@@ -0,0 +1,157 @@
+/**
+ *
+ *  Copyright 2004-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.apache.geronimo.interop.rmi.iiop.server;
+
+import org.apache.geronimo.gbean.*;
+import org.apache.geronimo.interop.adapter.AdapterManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.openejb.server.SocketService;
+import org.openejb.server.ServerService;
+import org.openejb.server.ServiceException;
+
+import java.util.*;
+import java.net.Socket;
+import java.io.IOException;
+
+public class RmiIiopServerGBean implements ServerService {
+
+    private final Log log = LogFactory.getLog(RmiIiopServerGBean.class);
+
+    private MessageHandler          msgHandler;
+    private ArrayList               args = new ArrayList();
+    private Properties              props = new Properties();
+    private boolean                 simpleIDL = false;
+    private boolean                 writeSystemExceptionStackTrace = false;
+    private AdapterManager          adapterManager;
+
+    public RmiIiopServerGBean(AdapterManager adapterManager, ArrayList args, Properties props,
+                              boolean simpleIDL, boolean writeSystemExceptionStackTrace )
{
+        this.adapterManager = adapterManager;
+        this.args = args;
+        this.props = props;
+        this.simpleIDL = simpleIDL;
+        this.writeSystemExceptionStackTrace = writeSystemExceptionStackTrace;
+        this.msgHandler = new MessageHandler( this.adapterManager, this.simpleIDL,
+                                              this.writeSystemExceptionStackTrace );
+
+    }
+
+    public RmiIiopServerGBean() throws Exception {
+        this.adapterManager = null;
+        this.args = null;
+        this.props = null;
+        this.simpleIDL = false;
+        this.writeSystemExceptionStackTrace = false;
+        this.msgHandler = null;
+    }
+
+    public void service(Socket socket) throws ServiceException, IOException {
+        log.debug( "RmiIiopServerGBean.service(): socket = " + socket );
+        msgHandler.service(socket);
+    }
+
+    public void init(Properties properties) throws Exception
+    {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void start() throws ServiceException {
+        log.debug( "RmiIiopServerGBean.start(): " );
+    }
+
+    public void stop() throws ServiceException {
+        log.debug( "RmiIiopServerGBean.stop(): " );
+    }
+
+    public String getName() {
+        return "rmiiiopd";
+    }
+
+    /*
+    public void setArgs( ArrayList args )
+    {
+        this.args = args;
+    }
+
+    public ArrayList getArgs() {
+        return args;
+    }
+
+    public void setProps( Properties props )
+    {
+        this.props = props;
+    }
+
+    public Properties getProps() {
+        return props;
+    }
+    */
+
+    /*
+     * The following methods are from ServerService...
+     * getPort() and getIP() ... Do we need them??
+     */
+
+    private int port;
+    private String ip;
+
+    public void setPort( int port )
+    {
+        log.debug( "RmiIiopServerGBean.setPort(): port = " + port );
+        this.port = port;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public void setIP( String ip )
+    {
+        log.debug( "RmiIiopServerGBean.setIP(): ip = " + ip );
+        this.ip = ip;
+    }
+
+    public String getIP() {
+        return "";
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(RmiIiopServerGBean.class);
+
+        infoFactory.addInterface(SocketService.class);
+
+        infoFactory.addAttribute("args", ArrayList.class, true);
+        infoFactory.addAttribute("props", Properties.class, true);
+        infoFactory.addAttribute("simpleIDL", boolean.class, true);
+        infoFactory.addAttribute("writeSystemExceptionStackTrace", boolean.class, true);
+        infoFactory.addReference("adapterManager", AdapterManager.class);
+
+        infoFactory.setConstructor(new String[]{"adapterManager", "args", "props", "simpleIDL",
"writeSystemExceptionStackTrace"});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ServerNamingContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ServerNamingContext.java?view=diff&r1=159004&r2=159005
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ServerNamingContext.java
(original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/server/ServerNamingContext.java
Fri Mar 25 03:54:30 2005
@@ -20,10 +20,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
-import org.apache.geronimo.interop.CosNaming.BindingIteratorHolder;
-import org.apache.geronimo.interop.CosNaming.BindingListHolder;
-import org.apache.geronimo.interop.CosNaming.NameComponent;
-import org.apache.geronimo.interop.CosNaming.NamingContext;
+import org.apache.geronimo.interop.CosNaming.*;
 import org.apache.geronimo.interop.CosNaming.NamingContextExtPackage.InvalidAddress;
 import org.apache.geronimo.interop.CosNaming.NamingContextPackage.AlreadyBound;
 import org.apache.geronimo.interop.CosNaming.NamingContextPackage.CannotProceed;
@@ -33,41 +30,22 @@
 import org.apache.geronimo.interop.adapter.Adapter;
 import org.apache.geronimo.interop.naming.NameService;
 import org.apache.geronimo.interop.naming.NameServiceLog;
-import org.apache.geronimo.interop.rmi.iiop.RemoteInterface;
+import org.apache.geronimo.interop.rmi.iiop.CorbaObject;
 
+public class ServerNamingContext extends CorbaObject implements NamingContextExt {
 
-public class ServerNamingContext implements org.apache.geronimo.interop.rmi.iiop.NameServiceOperations
{
-    
-    protected static ServerNamingContext _snc = null;
+    private NameService                     nameService;
+    protected static ServerNamingContext    snc = null;
 
-    public static ServerNamingContext getInstance() {
-        if (_snc == null) {
-            synchronized (ServerNamingContext.class) {
-                _snc = new ServerNamingContext();
-                _snc.init();
-            }
-        }
-
-        return _snc;
+    public ServerNamingContext()
+    {
+        nameService = NameService.getInstance();
     }
 
-    // -----------------------------------------------------------------------
-    // private data
-    // -----------------------------------------------------------------------
-
-    private NameService _nameService;
-
-    private volatile int _cycle;
-
-    // -----------------------------------------------------------------------
-    // public methods from interface NamingContextExtOperations
-    // -----------------------------------------------------------------------
-
     public org.omg.CORBA.Object resolve_str(String name) throws NotFound, CannotProceed,
InvalidName {
         return lookup(name, null);
     }
 
-
     public String to_string(NameComponent[] n) throws InvalidName {
         throw NoImplement();
     }
@@ -80,10 +58,6 @@
         throw NoImplement();
     }
 
-    // -----------------------------------------------------------------------
-    // public methods from interface NamingContextOperations
-    // -----------------------------------------------------------------------
-
     public org.omg.CORBA.Object resolve(NameComponent[] name) throws NotFound, CannotProceed,
InvalidName {
         return lookup(toString(name), name);
     }
@@ -124,51 +98,15 @@
         return new org.omg.CORBA.NO_IMPLEMENT();
     }
 
-    // -----------------------------------------------------------------------
-    // public methods from interface NameServiceOperations (Sybase proprietary)
-    // -----------------------------------------------------------------------
-
-    public String resolve_host(String host) {
-        System.out.println("ServerNamingContext.resolve_host(): TODO host = " + host);
-
-        //String resolvedHost = ClusterPartition.getInstance(host).resolveHost();
-        //return "cycle=" + Math.max(1, ++_cycle) + ";" + resolvedHost;
-        
-        // Cycle prefix for round-robin load balancing.
-        // Any weighted balancing is applied by client.
-
-        return host;
-    }
-
-    // -----------------------------------------------------------------------
-    // protected methods
-    // -----------------------------------------------------------------------
-
-    protected void init() {
-        _nameService = NameService.getInstance();
-    }
-
     protected org.omg.CORBA.Object lookup(String nameString, NameComponent[] name) throws
NotFound {
         try {
-            Object object = _nameService.lookup(nameString);
-
-            /*
-            if (object instanceof RemoteInterface)
-            {
-                RemoteInterface remote = (RemoteInterface)object;
-                return remote.$getObjectRef();
-            }
-            else
-            {
-                NameServiceLog.getInstance().warnObjectHasNoRemoteInterface(nameString, object.getClass().getName());
-                throw new NotFound(NotFoundReason.not_object, name);
-            }
-            */
+            Object object = nameService.lookup(nameString);
 
             if (object instanceof Adapter) {
                 Adapter a = (Adapter) object;
-                RemoteInterface remote = a.getRemoteInterface();
-                return remote.$getObjectRef();
+                //RemoteInterface remote = a.getRemoteInterface();
+                //return remote.$getObjectRef();
+                return a.getObjectRef();
             } else {
                 NameServiceLog.getInstance().warnObjectHasNoRemoteInterface(nameString, object.getClass().getName());
                 throw new NotFound(NotFoundReason.not_object, name);

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/JavaClass.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/JavaClass.java?view=diff&r1=159004&r2=159005
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/JavaClass.java
(original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/JavaClass.java
Fri Mar 25 03:54:30 2005
@@ -26,9 +26,6 @@
 
 
 public abstract class JavaClass {
-    // -----------------------------------------------------------------------
-    // properties
-    // -----------------------------------------------------------------------
 
     public static final StringProperty classDirProperty =
             new StringProperty(SystemProperties.class, "org.apache.geronimo.interop.classDir")
@@ -48,21 +45,10 @@
                           + File.pathSeparator
                           + FileUtil.pretty(SystemProperties.getHome() + "/genfiles/java/src"));
 
-    // -----------------------------------------------------------------------
-    // private data
-    // -----------------------------------------------------------------------
-
     private static String _classDir = classDirProperty.getString();
-
     private static List _classPath = ListUtil.getPathList(classPathProperty.getString());
-
     private static String _sourceDir = sourceDirProperty.getString();
-
     private static List _sourcePath = ListUtil.getPathList(sourcePathProperty.getString());
-
-    // -----------------------------------------------------------------------
-    // public methods
-    // -----------------------------------------------------------------------
 
     public static String addPackageSuffix(String className, String suffix) {
         String jp = getPackagePrefix(className);

Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/SystemUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/SystemUtil.java?view=diff&r1=159004&r2=159005
==============================================================================
--- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/SystemUtil.java
(original)
+++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/util/SystemUtil.java
Fri Mar 25 03:54:30 2005
@@ -54,6 +54,11 @@
         return _isJDK14;
     }
 
+    public static String getVmVersion()
+    {
+        return _vmVersion;
+    }
+
     public static boolean isWindows() {
         return java.io.File.separatorChar == '\\';
     }



Mime
View raw message