You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/02/06 23:54:05 UTC
cvs commit: cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation Web3RfcTransformer.java
joerg 2004/02/06 14:54:05
Modified: src/blocks/web3/java/org/apache/cocoon/components/web3
Web3DataSource.java
src/blocks/web3/java/org/apache/cocoon/components/web3/impl
Web3DataSourceSelectorImpl.java
Web3DataSourceImpl.java
src/blocks/web3/java/org/apache/cocoon/transformation
Web3RfcTransformer.java
Log:
Composable => Serviceable
Revision Changes Path
1.5 +4 -5 cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/Web3DataSource.java
Index: Web3DataSource.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/Web3DataSource.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Web3DataSource.java 10 Jul 2003 22:14:32 -0000 1.4
+++ Web3DataSource.java 6 Feb 2004 22:54:05 -0000 1.5
@@ -50,11 +50,10 @@
*/
package org.apache.cocoon.components.web3;
-import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
-import org.apache.avalon.framework.component.Composable;
+import org.apache.avalon.framework.service.Serviceable;
import java.lang.Exception;
@@ -65,8 +64,8 @@
* @since 2.1
* @version CVS $Id$
*/
-public interface Web3DataSource extends Component, Configurable,
- Initializable, Disposable, Composable {
+public interface Web3DataSource extends Configurable, Initializable, Disposable,
+ Serviceable {
String ROLE = "org.apache.cocoon.components.web3.Web3DataSource";
1.6 +16 -17 cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/Web3DataSourceSelectorImpl.java
Index: Web3DataSourceSelectorImpl.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/Web3DataSourceSelectorImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Web3DataSourceSelectorImpl.java 4 Aug 2003 03:19:22 -0000 1.5
+++ Web3DataSourceSelectorImpl.java 6 Feb 2004 22:54:05 -0000 1.6
@@ -53,12 +53,11 @@
import org.apache.cocoon.components.web3.Web3DataSource;
import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
+import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.avalon.framework.component.Composable;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.ComponentSelector;
-import org.apache.avalon.framework.component.ComponentException;
-import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -81,19 +80,19 @@
*/
public class Web3DataSourceSelectorImpl
extends AbstractLogEnabled
- implements ComponentSelector, Disposable, Composable, Configurable, ThreadSafe {
+ implements ServiceSelector, Disposable, Serviceable, Configurable, ThreadSafe {
- /** The component manager instance */
- protected ComponentManager manager = null;
+ /** The service manager instance */
+ protected ServiceManager manager = null;
protected Configuration configuration = null;
private static Hashtable pools = new Hashtable();
private static Mutex lock = new Mutex();
/**
- * Set the current <code>ComponentManager</code> instance used by this
- * <code>Composable</code>.
+ * Set the current <code>ServiceManager</code> instance used by this
+ * <code>Serviceable</code>.
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
}
@@ -108,11 +107,11 @@
}
}
- public boolean hasComponent(Object obj) {
+ public boolean isSelectable(Object obj) {
return Web3DataSourceSelectorImpl.pools.containsKey(obj);
}
- public Component select(Object obj) throws ComponentException {
+ public Object select(Object obj) throws ServiceException {
Web3DataSource pool = null;
try {
Web3DataSourceSelectorImpl.lock.acquire();
@@ -151,7 +150,7 @@
if (pool instanceof LogEnabled) {
((LogEnabled) pool).enableLogging(getLogger());
}
- pool.compose(this.manager);
+ pool.service(this.manager);
pool.configure(c);
pool.initialize();
Web3DataSourceSelectorImpl.pools.put(obj, pool);
@@ -159,7 +158,7 @@
}
} catch (Exception ex) {
getLogger().error(ex.getMessage(), ex);
- throw new ComponentException(null, ex.getMessage());
+ throw new ServiceException(null, ex.getMessage());
} finally {
Web3DataSourceSelectorImpl.lock.release();
}
@@ -167,7 +166,7 @@
return pool;
}
- public void release(Component component) {
+ public void release(Object object) {
}
/** Dispose properly of the pool */
1.5 +6 -6 cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/Web3DataSourceImpl.java
Index: Web3DataSourceImpl.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/Web3DataSourceImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Web3DataSourceImpl.java 10 Jul 2003 22:14:32 -0000 1.4
+++ Web3DataSourceImpl.java 6 Feb 2004 22:54:05 -0000 1.5
@@ -53,9 +53,9 @@
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.ComponentException;
import EDU.oswego.cs.dl.util.concurrent.Mutex;
@@ -84,10 +84,10 @@
protected int level = 0;
private static Mutex lock = new Mutex();
- protected ComponentManager manager;
+ protected ServiceManager manager;
- public void compose(ComponentManager componentManager) throws ComponentException {
- this.manager = componentManager;
+ public void service(ServiceManager manager) throws ServiceException {
+ this.manager = manager;
}
/** Configure backend component */
1.8 +23 -27 cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation/Web3RfcTransformer.java
Index: Web3RfcTransformer.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation/Web3RfcTransformer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Web3RfcTransformer.java 5 Sep 2003 07:40:20 -0000 1.7
+++ Web3RfcTransformer.java 6 Feb 2004 22:54:05 -0000 1.8
@@ -51,34 +51,31 @@
package org.apache.cocoon.transformation;
-import com.sap.mw.jco.IFunctionTemplate;
-import com.sap.mw.jco.JCO;
-
-import org.apache.cocoon.components.web3.Web3Client;
-import org.apache.cocoon.components.web3.Web3DataSource;
-import org.apache.cocoon.components.web3.Web3Streamer;
-import org.apache.cocoon.components.web3.Web3;
-
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
-import org.apache.cocoon.environment.SourceResolver;
-
-import org.apache.avalon.framework.component.Composable;
+import org.apache.avalon.excalibur.pool.Poolable;
+import org.apache.avalon.excalibur.pool.Recyclable;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.component.ComponentManager;
-import org.apache.avalon.framework.component.ComponentSelector;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.excalibur.pool.Poolable;
-import org.apache.avalon.excalibur.pool.Recyclable;
-
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.components.web3.Web3;
+import org.apache.cocoon.components.web3.Web3Client;
+import org.apache.cocoon.components.web3.Web3DataSource;
+import org.apache.cocoon.components.web3.Web3Streamer;
+import org.apache.cocoon.environment.SourceResolver;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
+import com.sap.mw.jco.IFunctionTemplate;
+import com.sap.mw.jco.JCO;
+
/**
* TBD
*
@@ -87,10 +84,10 @@
* @version CVS $Id$
*/
public class Web3RfcTransformer extends AbstractTransformer
-implements Composable, Disposable, Configurable, Poolable, Recyclable {
+implements Serviceable, Disposable, Configurable, Poolable, Recyclable {
- /** The component manager instance */
- protected ComponentManager manager = null;
+ /** The service manager instance */
+ protected ServiceManager manager = null;
protected Web3DataSource web3source = null;
protected Web3Client connection = null;
@@ -125,8 +122,7 @@
}
}
- public void compose(ComponentManager manager) {
-
+ public void service(ServiceManager manager) {
this.manager = manager;
initTags();
}
@@ -191,9 +187,9 @@
if ( Web3.URI.equals( uri ) && !this.error ) {
switch ( Integer.parseInt( (String) this.tags.get( loc ))) {
case INCLUDE_ELEM:
- ComponentSelector r3sc = null;
+ ServiceSelector r3sc = null;
try {
- r3sc = (ComponentSelector)
+ r3sc = (ServiceSelector)
this.manager.lookup ( Web3DataSource.ROLE + "Selector");
this.web3source = (Web3DataSource) r3sc.select( this.backend );
this.connection = this.web3source.getWeb3Client();
@@ -301,11 +297,11 @@
switch ( Integer.parseInt( (String) this.tags.get( loc ))) {
case INCLUDE_ELEM:
Web3Streamer w3s = null;
- ComponentSelector streamerSelector = null;
+ ServiceSelector streamerSelector = null;
try {
this.connection.execute( this.function );
streamerSelector =
- (ComponentSelector)
+ (ServiceSelector)
this.manager.lookup( Web3Streamer.ROLE + "Selector" );
w3s = (Web3Streamer) streamerSelector.select( this.streamer );
w3s.stream( this.function, super.contentHandler );