donaldp 2002/11/06 21:18:32
Modified: container/src/java/org/apache/excalibur/container/classloader
ComponentClassLoader.java
DirectoryChangeListener.java
DirectoryClassManager.java JarEntries.java
JarScanner.java
container/src/java/org/apache/excalibur/container/legacy
ComponentManager2ServiceManager.java
ComponentProxyGenerator.java
ComponentSelector2ServiceSelector.java
LegacyComponentManager.java
LegacyComponentSelector.java
container/src/java/org/apache/excalibur/container/lifecycle
AbstractAccessor.java AbstractCreator.java
Accessor.java Creator.java
container/src/java/org/apache/excalibur/container/lookup
AbstractServiceManager.java
Log:
Optimize imports
Revision Changes Path
1.9 +23 -24
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/ComponentClassLoader.java
Index: ComponentClassLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/ComponentClassLoader.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ComponentClassLoader.java 23 Oct 2002 16:33:50 -0000 1.8
+++ ComponentClassLoader.java 7 Nov 2002 05:18:31 -0000 1.9
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,17 +49,16 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.classloader;
-import java.util.Set;
-
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
+import java.util.Set;
/**
* A ClassLoader that lists all the entries of a particular type. Using
@@ -103,9 +102,9 @@
super( classPath, parent, urlHandlerFactory );
m_entries = new JarEntries();
- for ( int i = 0; i < classPath.length; i++ )
+ for( int i = 0; i < classPath.length; i++ )
{
- m_entries.merge( JarScanner.scan( classPath[i] ) );
+ m_entries.merge( JarScanner.scan( classPath[ i ] ) );
}
}
@@ -136,7 +135,7 @@
public String[] getBlockEntries()
{
Set blocks = m_entries.getBlockEntries();
- return (String[]) blocks.toArray( new String[ blocks.size() ] );
+ return (String[])blocks.toArray( new String[ blocks.size() ] );
}
/**
@@ -146,7 +145,7 @@
public String[] getTypeEntries()
{
Set types = m_entries.getTypeEntries();
- return (String[]) types.toArray( new String[ types.size() ] );
+ return (String[])types.toArray( new String[ types.size() ] );
}
/**
@@ -155,6 +154,6 @@
public String[] getServiceEntries()
{
Set services = m_entries.getServiceEntries();
- return (String[]) services.toArray( new String[ services.size() ] );
+ return (String[])services.toArray( new String[ services.size() ] );
}
}
1.4 +17 -17
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/DirectoryChangeListener.java
Index: DirectoryChangeListener.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/DirectoryChangeListener.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DirectoryChangeListener.java 23 Oct 2002 16:33:50 -0000 1.3
+++ DirectoryChangeListener.java 7 Nov 2002 05:18:31 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.classloader;
1.4 +45 -47
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/DirectoryClassManager.java
Index: DirectoryClassManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/DirectoryClassManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DirectoryClassManager.java 23 Oct 2002 16:33:50 -0000 1.3
+++ DirectoryClassManager.java 7 Nov 2002 05:18:31 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,18 +49,16 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.classloader;
-import java.net.URL;
-
-import java.io.InputStream;
-import java.io.IOException;
import java.io.File;
-
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -80,10 +78,10 @@
{
private final static long RECHECK_PERIOD = 60 * 1000; // One minute
private final ClassLoader m_parentClassLoader;
- private final Map m_classLoaders;
- private final Map m_modifiedMap;
- private final Timer m_timer;
- private final File m_rootDir;
+ private final Map m_classLoaders;
+ private final Map m_modifiedMap;
+ private final Timer m_timer;
+ private final File m_rootDir;
private DirectoryChangeListener m_listener = null;
@@ -102,7 +100,7 @@
public DirectoryClassManager( File rootDir, ClassLoader parent )
throws IOException
{
- if ( rootDir.isFile() )
+ if( rootDir.isFile() )
{
throw new IOException( "The File object passed in must be a directory"
);
}
@@ -115,16 +113,16 @@
m_modifiedMap = new HashMap( entries.length );
m_classLoaders.put( m_rootDir,
- new ComponentClassLoader( new URL[] { m_rootDir.toURL() },
m_parentClassLoader ) );
+ new ComponentClassLoader( new URL[]{m_rootDir.toURL()},
m_parentClassLoader ) );
m_modifiedMap.put( m_rootDir, new Long( m_rootDir.lastModified() ) );
- for ( int i = 0; i < entries.length; i++ )
+ for( int i = 0; i < entries.length; i++ )
{
- if ( entries[i].isFile() )
+ if( entries[ i ].isFile() )
{
- m_classLoaders.put( entries[i],
- new ComponentClassLoader( new URL[] { entries[i].toURL() },
m_parentClassLoader ) );
- m_modifiedMap.put( entries[i], new Long( entries[i].lastModified()
) );
+ m_classLoaders.put( entries[ i ],
+ new ComponentClassLoader( new URL[]{entries[ i
].toURL()}, m_parentClassLoader ) );
+ m_modifiedMap.put( entries[ i ], new Long( entries[ i
].lastModified() ) );
}
}
@@ -143,21 +141,21 @@
Iterator it = m_classLoaders.values().iterator();
Class klass = null;
- while ( it.hasNext() && klass == null)
+ while( it.hasNext() && klass == null )
{
- ClassLoader loader = (ClassLoader) it.next();
+ ClassLoader loader = (ClassLoader)it.next();
try
{
klass = loader.loadClass( className );
}
- catch ( Exception e )
+ catch( Exception e )
{
// ignore
}
}
- if ( null == klass )
+ if( null == klass )
{
throw new ClassNotFoundException( className );
}
@@ -170,15 +168,15 @@
Iterator it = m_classLoaders.values().iterator();
URL resource = null;
- while ( it.hasNext() && resource == null)
+ while( it.hasNext() && resource == null )
{
- ClassLoader loader = (ClassLoader) it.next();
+ ClassLoader loader = (ClassLoader)it.next();
try
{
resource = loader.getResource( path );
}
- catch ( Exception e )
+ catch( Exception e )
{
// ignore
}
@@ -206,29 +204,29 @@
{
Iterator it = m_modifiedMap.keySet().iterator();
- while ( it.hasNext() )
+ while( it.hasNext() )
{
- File curFile = (File) it.next();
+ File curFile = (File)it.next();
long lastModified = curFile.lastModified();
- if ( lastModified > ( (Long) m_modifiedMap.get( curFile )
).longValue() )
+ if( lastModified > ( (Long)m_modifiedMap.get( curFile )
).longValue() )
{
- ComponentClassLoader loader = (ComponentClassLoader)
m_classLoaders.get( curFile );
+ ComponentClassLoader loader =
(ComponentClassLoader)m_classLoaders.get( curFile );
JarEntries oldEntries = loader.getEntries();
- loader = new ComponentClassLoader( new URL[] {
curFile.toURL() }, m_parentClassLoader );
+ loader = new ComponentClassLoader( new
URL[]{curFile.toURL()}, m_parentClassLoader );
m_classLoaders.put( curFile, loader );
JarEntries newEntries = loader.getEntries();
- if ( null != m_listener )
+ if( null != m_listener )
{
m_listener.directoryChanged( curFile, oldEntries,
newEntries );
}
}
}
}
- catch ( Exception e )
+ catch( Exception e )
{
// ignore for now
}
1.4 +17 -17
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/JarEntries.java
Index: JarEntries.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/JarEntries.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JarEntries.java 23 Oct 2002 16:33:50 -0000 1.3
+++ JarEntries.java 7 Nov 2002 05:18:31 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.classloader;
1.6 +43 -48
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/JarScanner.java
Index: JarScanner.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/classloader/JarScanner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JarScanner.java 23 Oct 2002 16:33:50 -0000 1.5
+++ JarScanner.java 7 Nov 2002 05:18:31 -0000 1.6
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,26 +49,20 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.classloader;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-
import java.io.File;
import java.io.IOException;
-
import java.net.JarURLConnection;
import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLStreamHandlerFactory;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.jar.Attributes;
/**
* The JarScanner will scan any URL pointing to a jar, and check for any Avalon
@@ -87,7 +81,8 @@
private static JarEntries m_systemJarEntries = null;
private JarScanner()
- {}
+ {
+ }
/**
* The logic to look through the manifest entries in the JAR url passed
@@ -105,9 +100,9 @@
final Map manifest = jar.getManifest().getEntries();
final Iterator it = manifest.keySet().iterator();
- while ( it.hasNext() )
+ while( it.hasNext() )
{
- final String entry = (String) it.next();
+ final String entry = (String)it.next();
final Attributes attributes = (Attributes)manifest.get( entry );
final Iterator attrIt = attributes.keySet().iterator();
@@ -115,20 +110,20 @@
{
final String attrName = attrIt.next().toString();
- if ( attrName.equals( BLOCK ) &&
+ if( attrName.equals( BLOCK ) &&
attributes.getValue( attrName ).equals( "true" ) )
{
entries.addBlockEntry( cleanName( entry ) );
}
- else if ( attrName.equals( AVALON ) )
+ else if( attrName.equals( AVALON ) )
{
final String attrVal = attributes.getValue( attrName );
- if ( attrVal.equals( TYPE ) )
+ if( attrVal.equals( TYPE ) )
{
entries.addTypeEntry( cleanName( entry ) );
}
- else if ( attrVal.equals( SERVICE ) )
+ else if( attrVal.equals( SERVICE ) )
{
entries.addServiceEntry( cleanName( entry ) );
}
@@ -140,7 +135,7 @@
}
}
}
- catch ( IOException ioe )
+ catch( IOException ioe )
{
// TODO: Handle error condition
}
@@ -154,7 +149,7 @@
*/
public static JarEntries getSystemJarEntries()
{
- if ( m_systemJarEntries == null )
+ if( m_systemJarEntries == null )
{
m_systemJarEntries = loadSystemJarEntries();
}
@@ -169,10 +164,10 @@
private static JarEntries loadSystemJarEntries()
{
JarEntries entries = new JarEntries();
- String pathSeparator = System.getProperty("path.separator");
+ String pathSeparator = System.getProperty( "path.separator" );
- StringTokenizer classPath = new StringTokenizer(
System.getProperty("java.class.path"),
- pathSeparator, false);
+ StringTokenizer classPath = new StringTokenizer( System.getProperty(
"java.class.path" ),
+ pathSeparator, false );
while( classPath.hasMoreTokens() )
{
@@ -182,14 +177,14 @@
{
entries.merge( scan( new URL( path ) ) );
}
- catch ( Exception e )
+ catch( Exception e )
{
// skip and move on
}
}
- classPath = new StringTokenizer( System.getProperty("java.ext.dirs"),
- pathSeparator, false);
+ classPath = new StringTokenizer( System.getProperty( "java.ext.dirs" ),
+ pathSeparator, false );
while( classPath.hasMoreTokens() )
{
@@ -209,19 +204,19 @@
{
JarEntries entries = new JarEntries();
- if ( path.isDirectory() )
+ if( path.isDirectory() )
{
File[] pathEntries = path.listFiles();
- for ( int i = 0; i < pathEntries.length; i++ )
+ for( int i = 0; i < pathEntries.length; i++ )
{
- if ( pathEntries[i].isFile() )
+ if( pathEntries[ i ].isFile() )
{
try
{
- entries.merge( scan( pathEntries[i].toURL() ) );
+ entries.merge( scan( pathEntries[ i ].toURL() ) );
}
- catch ( Exception e )
+ catch( Exception e )
{
// ignore and move on to the next entry
}
@@ -233,7 +228,7 @@
{
entries.merge( scan( path.toURL() ) );
}
- catch ( Exception e )
+ catch( Exception e )
{
// ignore and move on
}
1.4 +22 -22
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentManager2ServiceManager.java
Index: ComponentManager2ServiceManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentManager2ServiceManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ComponentManager2ServiceManager.java 23 Oct 2002 16:33:51 -0000 1.3
+++ ComponentManager2ServiceManager.java 7 Nov 2002 05:18:31 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.legacy;
@@ -91,16 +91,16 @@
{
temp = m_manager.lookup( role );
- if ( temp instanceof ComponentSelector )
+ if( temp instanceof ComponentSelector )
{
temp = new ComponentSelector2ServiceSelector( role,
- (ComponentSelector) temp );
+
(ComponentSelector)temp );
}
}
catch( ComponentException ce )
{
throw new ServiceException( role,
- "Could not return a reference to the Component", ce );
+ "Could not return a reference to the
Component", ce );
}
return temp;
@@ -113,6 +113,6 @@
public void release( Object component )
{
- m_manager.release((Component) component);
+ m_manager.release( (Component)component );
}
}
1.5 +28 -28
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentProxyGenerator.java
Index: ComponentProxyGenerator.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentProxyGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ComponentProxyGenerator.java 23 Oct 2002 16:33:51 -0000 1.4
+++ ComponentProxyGenerator.java 7 Nov 2002 05:18:31 -0000 1.5
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,16 +49,16 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.legacy;
-import org.apache.avalon.framework.component.Component;
+import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.lang.reflect.InvocationHandler;
+import org.apache.avalon.framework.component.Component;
/**
* Create a Component proxy. Requires JDK 1.3+
@@ -86,10 +86,10 @@
public ComponentProxyGenerator( final ClassLoader parentClassLoader )
{
m_classLoader = ( null == parentClassLoader ) ?
- ( ( null == Thread.currentThread().getContextClassLoader() ) ?
- getClass().getClassLoader()
- : Thread.currentThread().getContextClassLoader() )
- : parentClassLoader;
+ ( ( null == Thread.currentThread().getContextClassLoader() ) ?
+ getClass().getClassLoader()
+ : Thread.currentThread().getContextClassLoader() )
+ : parentClassLoader;
}
/**
@@ -100,9 +100,9 @@
{
Class serviceInterface = m_classLoader.loadClass( role );
- return (Component) Proxy.newProxyInstance( m_classLoader,
- new Class[] { Component.class, serviceInterface },
- new ComponentInvocationHandler(service) );
+ return (Component)Proxy.newProxyInstance( m_classLoader,
+ new Class[]{Component.class,
serviceInterface},
+ new ComponentInvocationHandler(
service ) );
}
/**
@@ -117,8 +117,8 @@
m_delagate = proxy;
}
- public Object invoke(Object proxy, Method meth, Object[] args)
- throws Throwable
+ public Object invoke( Object proxy, Method meth, Object[] args )
+ throws Throwable
{
return meth.invoke( m_delagate, args );
}
1.4 +21 -21
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentSelector2ServiceSelector.java
Index: ComponentSelector2ServiceSelector.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/ComponentSelector2ServiceSelector.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ComponentSelector2ServiceSelector.java 23 Oct 2002 16:33:51 -0000 1.3
+++ ComponentSelector2ServiceSelector.java 7 Nov 2002 05:18:31 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.legacy;
@@ -72,7 +72,7 @@
public class ComponentSelector2ServiceSelector implements ServiceSelector
{
private final ComponentSelector m_selector;
- private final String m_role;
+ private final String m_role;
/**
* This constructor is a constructor for a ComponentServiceManager
@@ -95,7 +95,7 @@
catch( ComponentException ce )
{
throw new ServiceException( m_role + hint,
- "Could not return a reference to the Component", ce );
+ "Could not return a reference to the
Component", ce );
}
return temp;
@@ -108,6 +108,6 @@
public void release( Object component )
{
- m_selector.release((Component) component);
+ m_selector.release( (Component)component );
}
}
1.9 +38 -35
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/LegacyComponentManager.java
Index: LegacyComponentManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/LegacyComponentManager.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- LegacyComponentManager.java 23 Oct 2002 16:33:51 -0000 1.8
+++ LegacyComponentManager.java 7 Nov 2002 05:18:31 -0000 1.9
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,15 +49,18 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.legacy;
-import org.apache.avalon.framework.component.*;
-import org.apache.avalon.framework.service.*;
import java.util.HashMap;
+import org.apache.avalon.framework.component.Component;
+import org.apache.avalon.framework.component.ComponentException;
+import org.apache.avalon.framework.component.ComponentManager;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
/**
* The <code>LegacyComponentManager</code> is a convenient wrapper to any
@@ -90,15 +93,15 @@
public final class LegacyComponentManager implements ComponentManager
{
private final ComponentProxyGenerator m_proxyGen;
- private final ServiceManager m_manager;
- private final HashMap m_map;
+ private final ServiceManager m_manager;
+ private final HashMap m_map;
/**
* Initialize the LegacyComponentManager with the ServiceManager
* being wrapped. We will automatically create a new
* ComponentProxyGenerator with the default constructor.
*/
- public LegacyComponentManager(final ServiceManager manager)
+ public LegacyComponentManager( final ServiceManager manager )
{
this( new ComponentProxyGenerator(), manager );
}
@@ -108,14 +111,14 @@
* being wrapped and the specified ComponentProxyGenerator.
*/
public LegacyComponentManager( final ComponentProxyGenerator generator,
- final ServiceManager manager )
+ final ServiceManager manager )
{
- if ( null == generator )
+ if( null == generator )
{
throw new NullPointerException( "generator" );
}
- if ( null == manager )
+ if( null == manager )
{
throw new NullPointerException( "manager" );
}
@@ -143,14 +146,14 @@
Object service = null;
String interfaceName = role;
- if ( interfaceName.endsWith("Selector") )
+ if( interfaceName.endsWith( "Selector" ) )
{
interfaceName = interfaceName.substring( 0, interfaceName.length() -
- "Selector".length() );
+ "Selector".length() );
}
- int index = interfaceName.indexOf("/");
- if ( index > 0 )
+ int index = interfaceName.indexOf( "/" );
+ if( index > 0 )
{
interfaceName = interfaceName.substring( 0, index );
}
@@ -159,30 +162,30 @@
{
service = m_manager.lookup( role );
- if ( service instanceof ServiceSelector )
+ if( service instanceof ServiceSelector )
{
component =
new LegacyComponentSelector( interfaceName, m_proxyGen,
(ServiceSelector)service );
}
- else if ( service instanceof Component )
+ else if( service instanceof Component )
{
- component = (Component) service;
+ component = (Component)service;
}
else
{
component = m_proxyGen.getProxy( interfaceName, service );
}
}
- catch (ComponentException ce)
+ catch( ComponentException ce )
{
throw ce;
}
- catch (Exception e)
+ catch( Exception e )
{
throw new ComponentException( role, e );
}
- synchronized ( m_map )
+ synchronized( m_map )
{
m_map.put( component, service );
}
1.5 +30 -29
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/LegacyComponentSelector.java
Index: LegacyComponentSelector.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/legacy/LegacyComponentSelector.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- LegacyComponentSelector.java 23 Oct 2002 16:33:51 -0000 1.4
+++ LegacyComponentSelector.java 7 Nov 2002 05:18:31 -0000 1.5
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,16 +49,17 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.legacy;
-import org.apache.avalon.framework.component.*;
-import org.apache.avalon.framework.service.*;
import java.util.HashMap;
-
+import org.apache.avalon.framework.component.Component;
+import org.apache.avalon.framework.component.ComponentException;
+import org.apache.avalon.framework.component.ComponentSelector;
+import org.apache.avalon.framework.service.ServiceSelector;
/**
* The <code>LegacyComponentSelector</code> is a convenient wrapper to any
@@ -70,10 +71,10 @@
*/
public final class LegacyComponentSelector implements ComponentSelector
{
- private final String m_role;
+ private final String m_role;
private final ComponentProxyGenerator m_proxyGen;
- private final ServiceSelector m_selector;
- private final HashMap m_map;
+ private final ServiceSelector m_selector;
+ private final HashMap m_map;
/**
* Initialize the LegacyComponentSelector with the ServiceSelector
@@ -93,17 +94,17 @@
final ComponentProxyGenerator generator,
final ServiceSelector selector )
{
- if ( null == role )
+ if( null == role )
{
throw new NullPointerException( "role" );
}
- if ( null == generator )
+ if( null == generator )
{
throw new NullPointerException( "generator" );
}
- if ( null == selector )
+ if( null == selector )
{
throw new NullPointerException( "manager" );
}
@@ -136,16 +137,16 @@
service = m_selector.select( hint );
component = m_proxyGen.getProxy( m_role, service );
}
- catch (ComponentException ce)
+ catch( ComponentException ce )
{
throw ce;
}
- catch (Exception e)
+ catch( Exception e )
{
throw new ComponentException( m_role + ":" + hint.toString(), e );
}
- synchronized ( m_map )
+ synchronized( m_map )
{
m_map.put( component, service );
}
1.5 +21 -21
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/AbstractAccessor.java
Index: AbstractAccessor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/AbstractAccessor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractAccessor.java 23 Oct 2002 16:33:51 -0000 1.4
+++ AbstractAccessor.java 7 Nov 2002 05:18:32 -0000 1.5
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.lifecycle;
@@ -88,8 +88,8 @@
if( getLogger().isDebugEnabled() )
{
getLogger().debug(
- "accessing " + object.getClass().getName()
- + "#" + System.identityHashCode( object ));
+ "accessing " + object.getClass().getName()
+ + "#" + System.identityHashCode( object ) );
}
}
@@ -110,8 +110,8 @@
if( getLogger().isDebugEnabled() )
{
getLogger().debug(
- "releasing " + object.getClass().getName()
- + "#" + System.identityHashCode( object ));
+ "releasing " + object.getClass().getName()
+ + "#" + System.identityHashCode( object ) );
}
}
}
1.5 +21 -21
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/AbstractCreator.java
Index: AbstractCreator.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/AbstractCreator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AbstractCreator.java 23 Oct 2002 16:33:51 -0000 1.4
+++ AbstractCreator.java 7 Nov 2002 05:18:32 -0000 1.5
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,9 +49,9 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.lifecycle;
@@ -88,8 +88,8 @@
if( getLogger().isDebugEnabled() )
{
getLogger().debug(
- "creating " + object.getClass().getName()
- + "#" + System.identityHashCode( object ));
+ "creating " + object.getClass().getName()
+ + "#" + System.identityHashCode( object ) );
}
}
@@ -110,8 +110,8 @@
if( getLogger().isDebugEnabled() )
{
getLogger().debug(
- "destroying " + object.getClass().getName()
- + "#" + System.identityHashCode( object ));
+ "destroying " + object.getClass().getName()
+ + "#" + System.identityHashCode( object ) );
}
}
}
1.4 +22 -22
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/Accessor.java
Index: Accessor.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/Accessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Accessor.java 23 Oct 2002 16:33:51 -0000 1.3
+++ Accessor.java 7 Nov 2002 05:18:32 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,17 +49,17 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.lifecycle;
import org.apache.avalon.framework.context.Context;
/**
- * The <code>Accessor</code> interface describes the access and release
- * stages that occur between a service or component manager and a container
- * during service deployment. Lifecycle extensions supporting access
+ * The <code>Accessor</code> interface describes the access and release
+ * stages that occur between a service or component manager and a container
+ * during service deployment. Lifecycle extensions supporting access
* and release stages must implement this interface.
*
* @author <a href="mailto:mcconnell@;apache.org">Stephen McConnell</a>
@@ -87,5 +87,5 @@
* implementation
*/
void release( Object object, Context context );
-
+
}
1.4 +21 -21
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/Creator.java
Index: Creator.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lifecycle/Creator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Creator.java 23 Oct 2002 16:33:51 -0000 1.3
+++ Creator.java 7 Nov 2002 05:18:32 -0000 1.4
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,16 +49,16 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.lifecycle;
import org.apache.avalon.framework.context.Context;
/**
- * The <code>Creator</code> interface describes the create and destroy
- * stages that occur between a component and a container
+ * The <code>Creator</code> interface describes the create and destroy
+ * stages that occur between a component and a container
* during service management. Lifecycle extensions supporting create
* and destroy stages must implement this interface.
*
@@ -87,5 +87,5 @@
* implementation
*/
void destroy( Object object, Context context );
-
+
}
1.6 +32 -30
jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lookup/AbstractServiceManager.java
Index: AbstractServiceManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/container/src/java/org/apache/excalibur/container/lookup/AbstractServiceManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AbstractServiceManager.java 23 Oct 2002 16:33:51 -0000 1.5
+++ AbstractServiceManager.java 7 Nov 2002 05:18:32 -0000 1.6
@@ -1,14 +1,14 @@
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
@@ -20,13 +20,13 @@
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software
- * itself, if and wherever such third-party acknowledgments
+ * Alternately, this acknowledgment may appear in the software
+ * itself, if and wherever such third-party acknowledgments
* normally appear.
*
- * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
+ * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
* must not be used to endorse or promote products derived from this
- * software without prior written permission. For written
+ * software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
@@ -49,17 +49,17 @@
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
+ * information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
- */
+ */
package org.apache.excalibur.container.lookup;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
/**
* Abstract implementation of a <code>ServiceManager</code>. This will
@@ -71,7 +71,7 @@
public abstract class AbstractServiceManager implements ServiceManager
{
private final ServiceManager m_parent;
- private final Context m_context;
+ private final Context m_context;
public AbstractServiceManager()
{
@@ -89,14 +89,14 @@
Context checkContext = initContext;
- if ( null == checkContext )
+ if( null == checkContext )
{
// If there is a public context for services use it.
try
{
checkContext = new InitialContext();
}
- catch ( NamingException ne )
+ catch( NamingException ne )
{
checkContext = null;
}
@@ -106,7 +106,9 @@
}
protected abstract boolean serviceExists( String role );
+
protected abstract Object obtainService( String role ) throws ServiceException;
+
public abstract void release( Object service );
/**
@@ -118,12 +120,12 @@
{
boolean exists = serviceExists( role );
- if ( ! exists && null != m_parent )
+ if( !exists && null != m_parent )
{
exists = m_parent.hasService( role );
}
- if ( ! exists && null != m_context )
+ if( !exists && null != m_context )
{
exists = ( null != obtainServiceFromJNDI( role ) );
}
@@ -141,17 +143,17 @@
{
Object service = obtainService( role );
- if ( null == service && null != m_parent )
+ if( null == service && null != m_parent )
{
service = obtainServiceFromParent( role );
}
- if ( null == service && null != m_context )
+ if( null == service && null != m_context )
{
service = obtainServiceFromJNDI( role );
}
- if ( null == service )
+ if( null == service )
{
throw new ServiceException( role, "Service does not exist." );
}
@@ -167,13 +169,13 @@
{
Object service = null;
- if ( m_parent.hasService( role ) )
+ if( m_parent.hasService( role ) )
{
try
{
service = m_parent.lookup( role );
}
- catch ( ServiceException se )
+ catch( ServiceException se )
{
// ignore, it is already null
}
@@ -196,7 +198,7 @@
{
service = m_context.lookup( role );
}
- catch ( NamingException se )
+ catch( NamingException se )
{
// ignore, it is already null
}
--
To unsubscribe, e-mail: <mailto:avalon-cvs-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@;jakarta.apache.org>