CVS update: talon/src/java/talon

From: cvs@openprivacy.org
Date: Sat Feb 24 2001 - 21:31:19 PST

  • Next message: cvs@openprivacy.org: "CVS update: talon/src/java/talon/tests"

    Date: Saturday February 24, 19101 @ 21:31
    Author: burton
    CVSWEB Options: -------------------

    Main CVSWeb: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi

    View this module: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon

    -----------------------------------

    Update of /usr/local/cvs/public/talon/src/java/talon
    In directory giga:/tmp/cvs-serv23466/src/java/talon

    Modified Files:
            BaseComponent.java Component.java
    Log Message:
    added new method to Component. This is necessary to uniquely identify an object within the system. This will probably be used within Sierra so that an RCE can be targeted specifically.

    *****************************************************************
    File: talon/src/java/talon/BaseComponent.java

    CVSWEB Options: -------------------

    CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/BaseComponent.java?annotate=1.4

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/BaseComponent.java?rev=1.4&content-type=text/x-cvsweb-markup

    CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/BaseComponent.java.diff?r1=1.4&r2=1.3

    -----------------------------------

    Index: talon/src/java/talon/BaseComponent.java
    diff -u talon/src/java/talon/BaseComponent.java:1.3 talon/src/java/talon/BaseComponent.java:1.4
    --- talon/src/java/talon/BaseComponent.java:1.3 Thu Jan 25 11:05:17 2001
    +++ talon/src/java/talon/BaseComponent.java Sat Feb 24 21:31:19 2001
    @@ -10,25 +10,28 @@
     package talon;
     
     import java.util.*;
    +import java.net.*;
     
     import talon.interfaces.*;
     import talon.implementations.*;
    +import talon.util.net.*;
     
     /**
      *
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
      */
     public abstract class BaseComponent implements Component {
     
     
         private ComponentHandle handle = null;
    -
    + private URI componentReference = null;
    +
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public ComponentHandle getComponentHandle() {
             return this.handle;
    @@ -37,7 +40,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public void setComponentHandle( ComponentHandle handle ) {
             this.handle = handle;
    @@ -45,8 +48,43 @@
     
         /**
          * @see Component
    + * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
    + */
    + public URI getComponentReference() {
    +
    + //determine this URI if it isn't set.
    + if ( componentReference == null ) {
    +
    + String host = null;
    +
    +
    + try {
    +
    + InetAddress address = InetAddress.getLocalHost();
    +
    + try {
    + host = address.getHostName();
    + } catch ( SecurityException e ) {
    + address.getAddress();
    + }
    +
    + } catch ( UnknownHostException uhe ) {
    + host = "localhost";
    + }
    +
    + componentReference = new URI( "talon://" + host + "/component/" + getClass().getName() + "/hashcode/" + hashCode() );
    + }
    +
    + return componentReference;
    +
    + }
    +
    +
    + /**
    + * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public Logger getLogger() {
             try {
    @@ -65,7 +103,7 @@
          * Default impl of toString() just dumps handle info...
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public String toString() {
             return this.getComponentHandle().toString();

    *****************************************************************
    File: talon/src/java/talon/Component.java

    CVSWEB Options: -------------------

    CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Component.java?annotate=1.4

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Component.java?rev=1.4&content-type=text/x-cvsweb-markup

    CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Component.java.diff?r1=1.4&r2=1.3

    -----------------------------------

    Index: talon/src/java/talon/Component.java
    diff -u talon/src/java/talon/Component.java:1.3 talon/src/java/talon/Component.java:1.4
    --- talon/src/java/talon/Component.java:1.3 Thu Jan 25 11:05:17 2001
    +++ talon/src/java/talon/Component.java Sat Feb 24 21:31:19 2001
    @@ -13,13 +13,14 @@
     import java.util.*;
     
     import talon.interfaces.*;
    +import talon.util.net.*;
     //import talon.implementations.*;
     
     /**
      *
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
      */
     public interface Component {
     
    @@ -28,7 +29,7 @@
          * Called when this object is initialized.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public void init() throws TalonException;
     
    @@ -37,15 +38,36 @@
          * Get the handle for this component.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public ComponentHandle getComponentHandle();
     
         /**
    + * <p>
    + * Get a UNIQUE reference for this object. The general goal for this
    + * method is that within a given connected component system (even a P2P
    + * system) each object can be refered to in a unique manner.
    + *
    + * <p>
    + * The reference may be used to get refer to an object with a runtime
    + * system. Depending on its lifetime (demand, singleton, etc) it may have
    + * been garbage collected so you can not be sure that it will still be
    + * around.
    + *
    + * <p>
    + * Should return a URI like talon://HOST/component/ID
    + *
    + * @see Object#hashCode
    + * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
    + */
    + public URI getComponentReference();
    +
    + /**
          * Set the handle for this component.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public void setComponentHandle( ComponentHandle handle );
     
    @@ -53,7 +75,7 @@
          * Get the Talon default log stream for this component.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.3 2001/01/25 19:05:17 burton Exp $
    + * @version $Id: Component.java,v 1.4 2001/02/25 05:31:19 burton Exp $
          */
         public Logger getLogger();
         



    This archive was generated by hypermail 2b30 : Sat Feb 24 2001 - 21:31:20 PST