You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2015/01/25 09:25:35 UTC

[2/3] directory-kerberos git commit: Removed rmi related

Removed rmi related


Project: http://git-wip-us.apache.org/repos/asf/directory-kerberos/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerberos/commit/8b7fb1b2
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerberos/tree/8b7fb1b2
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerberos/diff/8b7fb1b2

Branch: refs/heads/cleanssl
Commit: 8b7fb1b2145acde003bb6e4714e24ae2042846f6
Parents: 1fc92e6
Author: Drankye <dr...@gmail.com>
Authored: Sun Jan 25 16:02:41 2015 +0800
Committer: Drankye <dr...@gmail.com>
Committed: Sun Jan 25 16:02:41 2015 +0800

----------------------------------------------------------------------
 .../org/apache/commons/ssl/rmi/DateRMI.java     |  69 -------
 .../org/apache/commons/ssl/rmi/IntegerRMI.java  |  69 -------
 .../org/apache/commons/ssl/rmi/RemoteDate.java  |  46 -----
 .../apache/commons/ssl/rmi/RemoteInteger.java   |  45 -----
 .../java/org/apache/commons/ssl/rmi/Test.java   | 200 -------------------
 5 files changed, 429 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/8b7fb1b2/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/DateRMI.java
----------------------------------------------------------------------
diff --git a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/DateRMI.java b/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/DateRMI.java
deleted file mode 100644
index d6248b9..0000000
--- a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/DateRMI.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * $HeadURL: http://juliusdavies.ca/svn/not-yet-commons-ssl/tags/commons-ssl-0.3.16/src/java/org/apache/commons/ssl/rmi/DateRMI.java $
- * $Revision: 121 $
- * $Date: 2007-11-13 21:26:57 -0800 (Tue, 13 Nov 2007) $
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.commons.ssl.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.Date;
-
-/**
- * @author Credit Union Central of British Columbia
- * @author <a href="http://www.cucbc.com/">www.cucbc.com</a>
- * @author <a href="mailto:juliusdavies@cucbc.com">juliusdavies@cucbc.com</a>
- * @since 22-Feb-2007
- */
-public class DateRMI extends UnicastRemoteObject
-    implements Remote, Serializable, RemoteDate {
-    private Date d;
-
-    public DateRMI() throws RemoteException {
-        super();
-        this.d = new Date();
-    }
-
-    public Date getDate() throws RemoteException {
-        return d;
-    }
-
-    public boolean equals(Object o) {
-        RemoteDate rd = (RemoteDate) o;
-        try {
-            return d.equals(rd.getDate());
-        }
-        catch (RemoteException re) {
-            return false;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/8b7fb1b2/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/IntegerRMI.java
----------------------------------------------------------------------
diff --git a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/IntegerRMI.java b/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/IntegerRMI.java
deleted file mode 100644
index a9c1237..0000000
--- a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/IntegerRMI.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * $HeadURL: http://juliusdavies.ca/svn/not-yet-commons-ssl/tags/commons-ssl-0.3.16/src/java/org/apache/commons/ssl/rmi/IntegerRMI.java $
- * $Revision: 121 $
- * $Date: 2007-11-13 21:26:57 -0800 (Tue, 13 Nov 2007) $
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.commons.ssl.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- * @author Credit Union Central of British Columbia
- * @author <a href="http://www.cucbc.com/">www.cucbc.com</a>
- * @author <a href="mailto:juliusdavies@cucbc.com">juliusdavies@cucbc.com</a>
- * @since 22-Feb-2007
- */
-public class IntegerRMI extends UnicastRemoteObject
-    implements Remote, Serializable, RemoteInteger {
-    private int i;
-
-    public IntegerRMI() throws RemoteException {
-        super();
-        this.i = (int) Math.round(Math.random() * 1000000.0);
-    }
-
-    public int getInt() throws RemoteException {
-        return i;
-    }
-
-    public boolean equals(Object o) {
-        RemoteInteger ri = (RemoteInteger) o;
-        try {
-            return i == ri.getInt();
-        }
-        catch (RemoteException re) {
-            return false;
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/8b7fb1b2/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteDate.java
----------------------------------------------------------------------
diff --git a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteDate.java b/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteDate.java
deleted file mode 100644
index 07bfaf8..0000000
--- a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteDate.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $HeadURL: http://juliusdavies.ca/svn/not-yet-commons-ssl/tags/commons-ssl-0.3.16/src/java/org/apache/commons/ssl/rmi/RemoteDate.java $
- * $Revision: 121 $
- * $Date: 2007-11-13 21:26:57 -0800 (Tue, 13 Nov 2007) $
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.commons.ssl.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.util.Date;
-
-/**
- * @author Credit Union Central of British Columbia
- * @author <a href="http://www.cucbc.com/">www.cucbc.com</a>
- * @author <a href="mailto:juliusdavies@cucbc.com">juliusdavies@cucbc.com</a>
- * @since 22-Feb-2007
- */
-public interface RemoteDate extends Remote {
-    public Date getDate() throws RemoteException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/8b7fb1b2/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteInteger.java
----------------------------------------------------------------------
diff --git a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteInteger.java b/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteInteger.java
deleted file mode 100644
index 8a0e5f7..0000000
--- a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/RemoteInteger.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * $HeadURL: http://juliusdavies.ca/svn/not-yet-commons-ssl/tags/commons-ssl-0.3.16/src/java/org/apache/commons/ssl/rmi/RemoteInteger.java $
- * $Revision: 121 $
- * $Date: 2007-11-13 21:26:57 -0800 (Tue, 13 Nov 2007) $
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.commons.ssl.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * @author Credit Union Central of British Columbia
- * @author <a href="http://www.cucbc.com/">www.cucbc.com</a>
- * @author <a href="mailto:juliusdavies@cucbc.com">juliusdavies@cucbc.com</a>
- * @since 22-Feb-2007
- */
-public interface RemoteInteger extends Remote {
-    public int getInt() throws RemoteException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/8b7fb1b2/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/Test.java
----------------------------------------------------------------------
diff --git a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/Test.java b/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/Test.java
deleted file mode 100644
index ba81efc..0000000
--- a/3rdparty/not-yet-commons-ssl/src/main/java/org/apache/commons/ssl/rmi/Test.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * $HeadURL: http://juliusdavies.ca/svn/not-yet-commons-ssl/tags/commons-ssl-0.3.16/src/java/org/apache/commons/ssl/rmi/Test.java $
- * $Revision: 121 $
- * $Date: 2007-11-13 21:26:57 -0800 (Tue, 13 Nov 2007) $
- *
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.commons.ssl.rmi;
-
-import org.apache.commons.ssl.LogWrapper;
-import org.apache.commons.ssl.RMISocketFactoryImpl;
-
-import java.net.MalformedURLException;
-import java.rmi.Naming;
-import java.rmi.NotBoundException;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.server.RMISocketFactory;
-
-/**
- * @author Credit Union Central of British Columbia
- * @author <a href="http://www.cucbc.com/">www.cucbc.com</a>
- * @author <a href="mailto:juliusdavies@cucbc.com">juliusdavies@cucbc.com</a>
- * @since 22-Feb-2007
- */
-public class Test {
-    private final static LogWrapper log = LogWrapper.getLogger(Test.class);
-    private final static String TEST_DATE_NAME = "/org.apache.commons.ssl.rmi.testdate";
-    private final static String TEST_INT_NAME = "/org.apache.commons.ssl.rmi.testint";
-    protected final static int PORT;
-    protected final static String URL;
-
-    private static boolean rmiRunning = false;
-
-    static {
-        int port = 1099;
-        String host = "127.0.0.1";
-        PORT = port;
-        // e.g. "rmi://localhost:1099/"
-        URL = "rmi://" + host + ":" + port;
-    }
-
-    /**
-     * <p/>
-     * JNDI/RMI lookup wrapper.  Appends "java:" if we expect
-     * binding/lookup to occur in the same JVM.  Otherwise, appends "rmi:".
-     * </p>
-     *
-     * @param ref String reference.
-     * @return Object  Object previously bound with String reference.
-     * @throws java.rmi.RemoteException       rmi problem
-     * @throws java.rmi.NotBoundException     rmi problem
-     * @throws java.net.MalformedURLException rmi problem
-     */
-    public static Object lookup(String ref)
-        throws RemoteException, NotBoundException, MalformedURLException {
-        return Naming.lookup(URL + ref);
-    }
-
-    /**
-     * <p/>
-     * JNDI/RMI rebind wrapper for the UCS.  Appends "java:" if we expect
-     * binding/lookup to occur in the same JVM.  Otherwise, append "rmi:".
-     * </p><p>
-     * Also attempts to start a naming server on the localhost if one is
-     * not already running.  Currently we use RMI.
-     * </p>
-     *
-     * @param ref String reference to bind with.
-     * @param obj Object to bind.
-     * @throws java.rmi.RemoteException       rmi problem
-     * @throws java.net.MalformedURLException rmi problem
-     */
-    public static void rebind(String ref, Remote obj)
-        throws RemoteException, MalformedURLException {
-        requireNameServer();
-        String realRef = URL + ref;
-        Naming.rebind(realRef, obj);
-        try {
-            Object o = lookup(ref);
-            log.debug("Bound " + o.getClass().getName() + " to [" + realRef + "]");
-        }
-        catch (NotBoundException nbe) {
-            log.debug("Error binding " + obj.getClass().getName() + " to [" + realRef + "]");
-        }
-    }
-
-    private static void rebindTest() throws Exception {
-        Remote remoteTest = new DateRMI();
-        Naming.rebind(URL + TEST_DATE_NAME, remoteTest);
-        Object o = Naming.lookup(URL + TEST_DATE_NAME);
-        if (!remoteTest.equals(o)) {
-            throw new RuntimeException("rmi: Test failed. Lookup != Rebind");
-        }
-    }
-
-    /**
-     * <p/>
-     * Attempts to start a naming server on the localhost if one is not
-     * already running.
-     * </p>
-     */
-    private synchronized static void requireNameServer() {
-        if (rmiRunning) {
-            // We've already established that the name server is running.
-            return;
-        }
-        try {
-            // If this rebind works, then the naming server is running.
-            rebindTest();
-            rmiRunning = true;
-        }
-        catch (Exception e) {
-            Test.tryToStartNameServer();
-            try {
-                // Okay, we've started our naming server.  Now we must perform a
-                // quick test to see that it's actually doing something.
-                rebindTest();
-                log.debug(Test.class.getName() + " successfully started.");
-                rmiRunning = true;
-                return;
-            }
-            catch (Exception e2) {
-                e2.printStackTrace();
-                log.error(e2.getMessage(), e2);
-            }
-
-            String msg = Test.class.getName() + " cannot start.";
-            log.error(msg);
-            throw new RuntimeException(msg);
-        }
-    }
-
-    public static void tryToStartNameServer() {
-        String className = Test.class.getName();
-        log.debug(className + " probably not running.   Trying to start one.");
-        try {
-            LocateRegistry.createRegistry(PORT);
-            log.debug("registry on " + PORT + " started!");
-        }
-        catch (Exception problem) {
-            // bah - no luck
-            problem.printStackTrace();
-            log.warn(problem, problem);
-        }
-    }
-
-
-    public static void main(String[] args) throws Exception {
-        System.setProperty(RMISocketFactoryImpl.RMI_HOSTNAME_KEY, "localhost");
-        RMISocketFactoryImpl impl = new RMISocketFactoryImpl();
-        RMISocketFactory.setSocketFactory(impl);
-
-        if (args.length > 0) {
-
-        } else {
-            Test.requireNameServer();
-            Test.rebindTest();
-
-            IntegerRMI remoteInt = new IntegerRMI();
-            Test.rebind(TEST_INT_NAME, remoteInt);
-        }
-
-        Object o = Test.lookup(TEST_DATE_NAME);
-        RemoteDate rd = (RemoteDate) o;
-        System.out.println("The remote-date is: " + rd.getDate());
-
-        o = Test.lookup(TEST_INT_NAME);
-        RemoteInteger ri = (RemoteInteger) o;
-        System.out.println("The remote-int  is: " + ri.getInt());
-
-    }
-
-
-}