portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jy...@apache.org
Subject cvs commit: jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/connection BaseConnectionManager.java
Date Tue, 16 Mar 2004 02:03:17 GMT
jyang       2004/03/15 18:03:17

  Modified:    cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory
                        BasePersistentObjectFactory.java
                        BasePersistentObjectCollectionFactory.java
                        BasePersistenceFactory.java
               cornerstone/src/java/org/apache/cornerstone/framework/persistence/connection
                        BaseConnectionManager.java
  Log:
  use mini implementation manager of Cornerstone
  PR:
  Obtained from:
  Submitted by:	
  Reviewed by:	
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.4       +4 -2      jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistentObjectFactory.java
  
  Index: BasePersistentObjectFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistentObjectFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasePersistentObjectFactory.java	8 Mar 2004 00:59:37 -0000	1.3
  +++ BasePersistentObjectFactory.java	16 Mar 2004 02:03:17 -0000	1.4
  @@ -29,6 +29,7 @@
   import org.apache.cornerstone.framework.api.context.IContext;
   import org.apache.cornerstone.framework.api.factory.CreationException;
   import org.apache.cornerstone.framework.api.factory.IFactory;
  +import org.apache.cornerstone.framework.api.implementation.IImplementationManager;
   import org.apache.cornerstone.framework.api.implementation.ImplementationException;
   import org.apache.cornerstone.framework.api.persistence.factory.IPersistentObjectFactory;
   import org.apache.cornerstone.framework.api.persistence.factory.PersistenceException;
  @@ -293,7 +294,8 @@
       {
           try
           {
  -            IFactory factory = (IFactory) Cornerstone.getImplementationManager().createImplementation(IFactory.class,
factoryParentName);
  +        	IImplementationManager implementationManager = (IImplementationManager) Cornerstone.getImplementation(IImplementationManager.class);
  +            IFactory factory = (IFactory) implementationManager.createImplementation(IFactory.class,
factoryParentName);
               if (parameterProperties == null || parameterProperties.size() == 0)
               {    
                   return factory.createInstance();
  
  
  
  1.4       +6 -3      jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistentObjectCollectionFactory.java
  
  Index: BasePersistentObjectCollectionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistentObjectCollectionFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasePersistentObjectCollectionFactory.java	8 Mar 2004 00:59:37 -0000	1.3
  +++ BasePersistentObjectCollectionFactory.java	16 Mar 2004 02:03:17 -0000	1.4
  @@ -24,6 +24,7 @@
   import org.apache.cornerstone.framework.api.context.IContext;
   import org.apache.cornerstone.framework.api.factory.CreationException;
   import org.apache.cornerstone.framework.api.factory.IFactory;
  +import org.apache.cornerstone.framework.api.implementation.IImplementationManager;
   import org.apache.cornerstone.framework.api.implementation.ImplementationException;
   import org.apache.cornerstone.framework.api.persistence.factory.IPersistenceFactory;
   import org.apache.cornerstone.framework.api.persistence.factory.IPersistentObjectFactory;
  @@ -218,7 +219,8 @@
               	throw new PersistenceException("config '" + CONFIG_ELEMENT_PARENT_NAME + "'
missing");
               try
   			{
  -				_elementFactory = (IPersistentObjectFactory) Cornerstone.getImplementationManager().createImplementation(
  +            	IImplementationManager implementationManager = (IImplementationManager) Cornerstone.getImplementation(IImplementationManager.class);
  +				_elementFactory = (IPersistentObjectFactory) implementationManager.createImplementation(
   					IFactory.class,
   					elementParentName
   				);
  @@ -256,7 +258,8 @@
                       throw new CreationException("expected format of '" + CONFIG_COLLECTION_PARENT_NAME
+ "' is <interfaceName>/<variantName>");
                   String interfaceName = configCollectionParentName.substring(0, slash);
                   String variantName = configCollectionParentName.substring(slash + 1);
  -            	return Cornerstone.getImplementationManager().createImplementation(interfaceName,
variantName);
  +                IImplementationManager implementationManager = (IImplementationManager)
Cornerstone.getImplementation(IImplementationManager.class);
  +            	return implementationManager.createImplementation(interfaceName, variantName);
               }
   
               throw new CreationException(
  
  
  
  1.4       +4 -2      jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistenceFactory.java
  
  Index: BasePersistenceFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/factory/BasePersistenceFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasePersistenceFactory.java	8 Mar 2004 00:59:37 -0000	1.3
  +++ BasePersistenceFactory.java	16 Mar 2004 02:03:17 -0000	1.4
  @@ -27,6 +27,7 @@
   import org.apache.cornerstone.framework.api.persistence.connection.IConnectionManager;
   import org.apache.cornerstone.framework.api.persistence.factory.IPersistenceFactory;
   import org.apache.cornerstone.framework.api.persistence.factory.PersistenceException;
  +import org.apache.cornerstone.framework.api.singleton.ISingletonManager;
   import org.apache.cornerstone.framework.bean.helper.BeanHelper;
   import org.apache.cornerstone.framework.constant.Constant;
   import org.apache.cornerstone.framework.factory.ioc.InversionOfControlFactory;
  @@ -57,7 +58,8 @@
   			Exception e = new PersistenceException("config property '" + CONFIG_CONNECTION_MANAGER_INSTANCE_CLASS_NAME
+ "' missing");
   			_Logger.error("", e);
   		}
  -		_connectionManager = (IConnectionManager) Cornerstone.getSingletonManager().getSingleton(connectionManagerClassName);
  +		ISingletonManager singletonManager = (ISingletonManager) Cornerstone.getImplementation(ISingletonManager.class);
  +		_connectionManager = (IConnectionManager) singletonManager.getSingleton(connectionManagerClassName);
   
   		_dataSourceName = getConfigProperty(CONFIG_DATA_SOURCE_NAME);
   		if (_dataSourceName == null)
  
  
  
  1.4       +5 -2      jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/connection/BaseConnectionManager.java
  
  Index: BaseConnectionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/cornerstone/src/java/org/apache/cornerstone/framework/persistence/connection/BaseConnectionManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BaseConnectionManager.java	8 Mar 2004 00:59:05 -0000	1.3
  +++ BaseConnectionManager.java	16 Mar 2004 02:03:17 -0000	1.4
  @@ -19,6 +19,8 @@
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.SQLException;
  +
  +import org.apache.cornerstone.framework.api.implementation.IImplementationManager;
   import org.apache.cornerstone.framework.api.implementation.ImplementationException;
   import org.apache.cornerstone.framework.api.persistence.connection.ConnectionException;
   import org.apache.cornerstone.framework.api.persistence.connection.IConnectionManager;
  @@ -64,7 +66,8 @@
       {
       	try
   		{
  -			IDataSource dataSource = (IDataSource) Cornerstone.getImplementationManager().createImplementation(IDataSource.class,
dataSourceName);
  +    		IImplementationManager implementationManager = (IImplementationManager) Cornerstone.getImplementation(IImplementationManager.class);
  +			IDataSource dataSource = (IDataSource) implementationManager.createImplementation(IDataSource.class,
dataSourceName);
               String driverClassName = dataSource.getDriverClassName();
               Class.forName(driverClassName);
               String url = dataSource.getConnectionUrl();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message