From: cvs@openprivacy.orgCVS update: talon/src/java/talon
Date: Wednesday February 7, 19101 @ 1:59
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-serv11350/src/java/talon
Modified Files:
ComponentFactory.java ComponentHandle.java Initializer.java
Added Files:
HandleManager.java
Log Message:
...
*****************************************************************
File: talon/src/java/talon/HandleManager.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/HandleManager.java?annotate=1.1
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/HandleManager.java?rev=1.1&content-type=text/x-cvsweb-markup
-----------------------------------
*****************************************************************
File: talon/src/java/talon/ComponentFactory.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/ComponentFactory.java?annotate=1.4
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/ComponentFactory.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/ComponentFactory.java.diff?r1=1.4&r2=1.3
-----------------------------------
Index: talon/src/java/talon/ComponentFactory.java
diff -u talon/src/java/talon/ComponentFactory.java:1.3 talon/src/java/talon/ComponentFactory.java:1.4
--- talon/src/java/talon/ComponentFactory.java:1.3 Thu Jan 25 11:05:17 2001
+++ talon/src/java/talon/ComponentFactory.java Wed Feb 7 01:59:33 2001
@@ -17,7 +17,7 @@
* Create instances of components and manage their lifetimes.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentFactory.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentFactory.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public class ComponentFactory {
@@ -61,7 +61,7 @@
* Static initializer...
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentFactory.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentFactory.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
static {
@@ -75,7 +75,7 @@
* Given a ComponentHandle get a Component
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentFactory.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentFactory.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public static Component getInstance( ComponentHandle handle )
throws TalonException {
@@ -95,7 +95,7 @@
if ( comp == null ) {
//we have to create it!
- comp = (Component)Class.forName( handle.getImplementationClassname() ).newInstance();
+ comp = (Component)Class.forName( handle.getImplementation() ).newInstance();
comp.setComponentHandle( handle );
comp.init();
@@ -113,7 +113,7 @@
* Put a singleton to the Factory.
* FIXME: Should this throw an Exception if this object is already present?
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentFactory.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentFactory.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
static void putSingleton( ComponentHandle handle, Component comp ) {
singletons.put( handle, comp );
*****************************************************************
File: talon/src/java/talon/ComponentHandle.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/ComponentHandle.java?annotate=1.4
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/ComponentHandle.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/ComponentHandle.java.diff?r1=1.4&r2=1.3
-----------------------------------
Index: talon/src/java/talon/ComponentHandle.java
diff -u talon/src/java/talon/ComponentHandle.java:1.3 talon/src/java/talon/ComponentHandle.java:1.4
--- talon/src/java/talon/ComponentHandle.java:1.3 Thu Jan 25 11:05:17 2001
+++ talon/src/java/talon/ComponentHandle.java Wed Feb 7 01:59:33 2001
@@ -15,18 +15,24 @@
import talon.implementations.*;
/**
- *
+ * Object which is used to find components within the system.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public class ComponentHandle {
-
- private String interfaceClassname = null;
-
- private String implementationClassname = null;
+ public static final String DEPLOY_PROPERTY_INTERFACE = "_interface";
+ public static final String DEPLOY_PROPERTY_IMPLEMENTATION = "_implementation";
+ public static final String DEPLOY_PROPERTY_LIFETIME = "_lifetime";
+ public static final String DEPLOY_PROPERTY_NAME = "_name";
+
+ private String _interface = null;
+
+ private String _implementation = null;
+ private String _lifetime = null;
+
private PropertyManager initProperties = new SimplePropertyManager();
/**
@@ -36,17 +42,25 @@
* URI. Default is none.
*/
private String name = null;
-
+
/**
+ * Create a basic ComponentHandle
+ *
+ * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
+ */
+ public ComponentHandle() {}
+
+ /**
* ComponentHandle with just an interface. The classname to instantiate is
* pulled from the Talon properties.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
- public ComponentHandle( String interfaceClassname ) {
+ public ComponentHandle( String _interface ) {
- this.interfaceClassname = interfaceClassname;
+ this._interface = _interface;
}
@@ -54,13 +68,13 @@
* The interface and classname.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
- public ComponentHandle( String interfaceClassname,
- String implementationClassname ) {
+ public ComponentHandle( String _interface,
+ String _implementation ) {
- this( interfaceClassname );
- this.implementationClassname = implementationClassname;
+ this( _interface );
+ this._implementation = _implementation;
}
@@ -69,13 +83,13 @@
* The interface and classname. You may specify a PropertyManager here.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
- public ComponentHandle( String interfaceClassname,
- String implementationClassname,
+ public ComponentHandle( String _interface,
+ String _classname,
PropertyManager initProperties ) {
- this( interfaceClassname, implementationClassname );
+ this( _interface, _classname );
this.initProperties = initProperties;
}
@@ -84,49 +98,49 @@
* Also set the name.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public ComponentHandle( String name,
- String interfaceClassname,
- String implementationClassname,
+ String _interface,
+ String _classname,
PropertyManager initProperties ) {
- this( interfaceClassname, implementationClassname, initProperties );
+ this( _interface, _classname, initProperties );
this.setName( name );
}
/**
- * Get the value of interfaceClassname.
- * @return value of interfaceClassname.
+ * Get the value of _interface.
+ * @return value of _interface.
*/
- public String getInterfaceClassname() {
- return interfaceClassname;
+ public String getInterface() {
+ return _interface;
}
/**
- * Set the value of interfaceClassname.
- * @param v Value to assign to interfaceClassname.
+ * Set the value of _interface.
+ * @param v Value to assign to _interface.
*/
- public void setInterfaceClassname(String s) {
- this.interfaceClassname = s;
+ public void setInterface( String _interface ) {
+ this._interface = _interface;
}
-
+
/**
- * Get the value of implementationClassname.
- * @return value of implementationClassname.
+ * Get the value of _classname.
+ * @return value of _classname.
*/
- public String getImplementationClassname() {
- return implementationClassname;
+ public String getImplementation() {
+ return this._implementation;
}
/**
- * Set the value of implementationClassname.
- * @param v Value to assign to implementationClassname.
+ * Set the value of _classname.
+ * @param v Value to assign to _classname.
*/
- public void setImplementationClassname(String s) {
- this.implementationClassname = s;
+ public void setImplementation( String _implementation ) {
+ this._implementation = _implementation;
}
/**
@@ -143,10 +157,34 @@
this.name = name;
}
+ /**
+ *
+ *
+ * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
+ */
+ public String getLifetime() {
+ return this._lifetime;
+ }
+
+
+ /**
+ *
+ *
+ * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
+ */
+ public void setLifetime( String _lifetime ) {
+ this._lifetime = _lifetime;
+ }
+
+
+
+
/**
* @see Component
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public PropertyManager getInitProperties() {
return this.initProperties;
@@ -156,10 +194,10 @@
* Dump Handle information..
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: ComponentHandle.java,v 1.3 2001/01/25 19:05:17 burton Exp $
+ * @version $Id: ComponentHandle.java,v 1.4 2001/02/07 09:59:33 burton Exp $
*/
public String toString() {
- return name + ":" + this.getInterfaceClassname() + " -> " + this.getImplementationClassname();
+ return this.getName() + ":" + this.getInterface() + " -> " + this.getImplementation();
}
}
*****************************************************************
File: talon/src/java/talon/Initializer.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Initializer.java?annotate=1.2
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Initializer.java?rev=1.2&content-type=text/x-cvsweb-markup
CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/Initializer.java.diff?r1=1.2&r2=1.1
-----------------------------------
Index: talon/src/java/talon/Initializer.java
diff -u talon/src/java/talon/Initializer.java:1.1 talon/src/java/talon/Initializer.java:1.2
--- talon/src/java/talon/Initializer.java:1.1 Thu Jan 25 11:05:54 2001
+++ talon/src/java/talon/Initializer.java Wed Feb 7 01:59:33 2001
@@ -12,11 +12,13 @@
import talon.interfaces.*;
import talon.implementations.*;
+import java.util.*;
+
/**
* Handles intializing Talon and performing all startup procedures.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: Initializer.java,v 1.1 2001/01/25 19:05:54 burton Exp $
+ * @version $Id: Initializer.java,v 1.2 2001/02/07 09:59:33 burton Exp $
*/
public class Initializer {
@@ -41,7 +43,7 @@
* Initialize Talon if necessary.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: Initializer.java,v 1.1 2001/01/25 19:05:54 burton Exp $
+ * @version $Id: Initializer.java,v 1.2 2001/02/07 09:59:33 burton Exp $
*/
public static void init() {
@@ -74,6 +76,34 @@
logger.message( pm.toString() );
logger.message( logger.toString() );
+
+ //loop through all possible components... adding handles for them.
+
+ logger.message( "Creating handles for all deployed components..." );
+
+ int i = 0;
+
+ while ( true ) {
+
+ Hashtable ht = pm.getGroup( "talon.component." + i );
+
+ if ( ht == null ) {
+ break;
+ }
+
+ //create the component handle
+ ComponentHandle handle = new ComponentHandle();
+ handle.setName( (String)ht.get( ComponentHandle.DEPLOY_PROPERTY_NAME ));
+ handle.setInterface( (String)ht.get( ComponentHandle.DEPLOY_PROPERTY_INTERFACE ) );
+ handle.setImplementation( (String)ht.get( ComponentHandle.DEPLOY_PROPERTY_IMPLEMENTATION ) );
+ handle.setLifetime( (String)ht.get( ComponentHandle.DEPLOY_PROPERTY_LIFETIME ) );
+
+ logger.message( handle.toString() );
+
+ ++i;
+ }
+
+
} catch ( Throwable t ) {
t.printStackTrace();
@@ -87,7 +117,7 @@
* Return true if Talon is initialized.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: Initializer.java,v 1.1 2001/01/25 19:05:54 burton Exp $
+ * @version $Id: Initializer.java,v 1.2 2001/02/07 09:59:33 burton Exp $
*/
public static boolean isInitialized() {
return initialized;
@@ -97,7 +127,7 @@
* Return true if Talon is working.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: Initializer.java,v 1.1 2001/01/25 19:05:54 burton Exp $
+ * @version $Id: Initializer.java,v 1.2 2001/02/07 09:59:33 burton Exp $
*/
public static boolean isWorking() {
return working;
@@ -107,7 +137,7 @@
* Return true if Talon should be initialized.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: Initializer.java,v 1.1 2001/01/25 19:05:54 burton Exp $
+ * @version $Id: Initializer.java,v 1.2 2001/02/07 09:59:33 burton Exp $
*/
public static boolean shouldInitialize() {
return isWorking() == false && isInitialized() == false;
This archive was generated by hypermail 2b30 : Wed Feb 07 2001 - 02:00:05 PST