CVS update: talon/src/java/talon

From: cvs@openprivacy.org
Date: Tue Mar 13 2001 - 01:53:07 PST

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

    Date: Tuesday March 13, 19101 @ 1:53
    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-serv32063/src/java/talon

    Modified Files:
            BaseComponent.java Component.java ReferenceFactory.java
    Log Message:
    incorrect interface guessing fixed....

    *****************************************************************
    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.9

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/BaseComponent.java?rev=1.9&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.9&r2=1.8

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

    Index: talon/src/java/talon/BaseComponent.java
    diff -u talon/src/java/talon/BaseComponent.java:1.8 talon/src/java/talon/BaseComponent.java:1.9
    --- talon/src/java/talon/BaseComponent.java:1.8 Mon Mar 12 23:37:40 2001
    +++ talon/src/java/talon/BaseComponent.java Tue Mar 13 01:53:07 2001
    @@ -21,7 +21,7 @@
      * develoeprs as a base for the Components they create.
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
      */
     public abstract class BaseComponent implements Component {
     
    @@ -41,7 +41,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public ComponentHandle getComponentHandle() {
             return this.handle;
    @@ -50,7 +50,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public void setComponentHandle( ComponentHandle handle ) {
             this.handle = handle;
    @@ -59,7 +59,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public URI getComponentReference() {
     
    @@ -78,7 +78,7 @@
          * the method in that class.
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public URI getTypeReference() {
     
    @@ -92,7 +92,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public Logger getLogger() {
             try {
    @@ -115,7 +115,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.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public String toString() {
             return this.getComponentHandle().toString();
    @@ -124,7 +124,7 @@
         /**
          * @see Component
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: BaseComponent.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: BaseComponent.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public Class[] getInterfaces() {
     
    @@ -137,13 +137,15 @@
                 Class current = getClass();
     
                 while ( current != null ) {
    -
    +
                     Class[] interfaces = current.getInterfaces();
                     
                     for ( int i = 0; i < interfaces.length; ++i ) {
     
                         if ( knownInterfaces.contains( interfaces[i] ) == false ){
    +
                             knownInterfaces.addElement( interfaces[i] );
    +
                         }
     
                     }
    @@ -157,20 +159,25 @@
                 //interfaces add them.
                 
                 //go over all knownInterfaces and remove any that don't apply.
    -
    +
                 for ( int i = 0; i < knownInterfaces.size(); ++i ) {
     
                     Class currentInterface = (Class)knownInterfaces.elementAt( i );
     
                     //remove the talon.Component interface... we don't need this.
    - if ( currentInterface.equals( talon.Component.class ) ) {
    + if ( currentInterface.equals( talon.Component.class ) ||
    + currentInterface.getName().equals( talon.Component.class.getName() ) ) {
    +
                         knownInterfaces.removeElement( currentInterface );
    +
                     }
     
                     //make sure this isn't just a random class like Serializable, etc.
                     //It must implement a Talon component.
    - if ( ! currentInterface.isAssignableFrom( Component.class ) ) {
    + if ( ! Component.class.isAssignableFrom( currentInterface ) ) {
    +
                         knownInterfaces.removeElement( currentInterface );
    +
                     }
                 
                 }

    *****************************************************************
    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.9

    CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Component.java?rev=1.9&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.9&r2=1.8

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

    Index: talon/src/java/talon/Component.java
    diff -u talon/src/java/talon/Component.java:1.8 talon/src/java/talon/Component.java:1.9
    --- talon/src/java/talon/Component.java:1.8 Mon Mar 12 23:37:40 2001
    +++ talon/src/java/talon/Component.java Tue Mar 13 01:53:07 2001
    @@ -21,25 +21,25 @@
      * as a first class Component with the system.
      *
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
      */
     public interface Component {
     
    -
         /**
    - * Called when this object is initialized.
    + * Called when this object is initialized. Generally a Component should
    + * perform no operations within a constructor (any constructor). In fact
    + * Talon relies on the fact that a constructor has not been called.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public void init() throws TalonException;
     
    -
         /**
          * Get the handle for this component.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public ComponentHandle getComponentHandle();
     
    @@ -59,7 +59,7 @@
          *
          * @see Object#hashCode
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public URI getComponentReference();
     
    @@ -74,7 +74,7 @@
          *
          * @see #getComponentReference
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public URI getTypeReference();
         
    @@ -82,7 +82,7 @@
          * Set the handle for this component.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public void setComponentHandle( ComponentHandle handle );
     
    @@ -92,7 +92,7 @@
          * switch logging implementations without needing a specific configuration.
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public Logger getLogger();
     
    @@ -103,10 +103,9 @@
          *
          * @see Class#getInterfaces
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: Component.java,v 1.8 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: Component.java,v 1.9 2001/03/13 09:53:07 burton Exp $
          */
         public Class[] getInterfaces();
    -
     
     }
     

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

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

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

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

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

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

    Index: talon/src/java/talon/ReferenceFactory.java
    diff -u talon/src/java/talon/ReferenceFactory.java:1.2 talon/src/java/talon/ReferenceFactory.java:1.3
    --- talon/src/java/talon/ReferenceFactory.java:1.2 Mon Mar 12 23:37:40 2001
    +++ talon/src/java/talon/ReferenceFactory.java Tue Mar 13 01:53:07 2001
    @@ -25,7 +25,7 @@
      * @see #Component.getTypeReference
      * @see #ComponentHandle.getTypeReference
      * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: ReferenceFactory.java,v 1.2 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: ReferenceFactory.java,v 1.3 2001/03/13 09:53:07 burton Exp $
      */
     public class ReferenceFactory {
     
    @@ -33,7 +33,7 @@
          *
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: ReferenceFactory.java,v 1.2 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: ReferenceFactory.java,v 1.3 2001/03/13 09:53:07 burton Exp $
          */
         public static URI getComponentReference( Component component ) {
     
    @@ -55,6 +55,8 @@
     
             String _implementation = component.getComponentHandle().getImplementation();
             String _interface = component.getComponentHandle().getInterface();
    +
    + //FIXME: rewrite this to use the calculated interfaces.
             
             return new URI( "talon://" + host + "/component/" + _implementation + "/interface/" + _interface + "/hashcode/" + component.hashCode() );
                 
    @@ -65,7 +67,7 @@
          *
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: ReferenceFactory.java,v 1.2 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: ReferenceFactory.java,v 1.3 2001/03/13 09:53:07 burton Exp $
          */
         public static URI getTypeReference( Component component ) {
     
    @@ -95,7 +97,7 @@
          *
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: ReferenceFactory.java,v 1.2 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: ReferenceFactory.java,v 1.3 2001/03/13 09:53:07 burton Exp $
          */
         public static URI getTypeReference( ComponentHandle handle ) {
     
    @@ -107,7 +109,7 @@
          *
          *
          * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
    - * @version $Id: ReferenceFactory.java,v 1.2 2001/03/13 07:37:40 burton Exp $
    + * @version $Id: ReferenceFactory.java,v 1.3 2001/03/13 09:53:07 burton Exp $
          */
         private static URI getTypeReference( ComponentHandle handle, String interfaceURIPart) {
     



    This archive was generated by hypermail 2b30 : Tue Mar 13 2001 - 01:53:08 PST