You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2010/08/23 20:08:42 UTC
svn commit: r988237 [11/24] - in /incubator/lcf/trunk:
modules/connectors/activedirectory/connector/org/apache/acf/authorities/authorities/activedirectory/
modules/connectors/documentum/connector/org/apache/acf/crawler/authorities/DCTM/
modules/connect...
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorFactory.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorFactory.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorFactory.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorFactory.java Mon Aug 23 18:08:32 2010
@@ -19,7 +19,7 @@
package org.apache.acf.agents.interfaces;
import org.apache.acf.core.interfaces.*;
-import org.apache.acf.agents.system.LCF;
+import org.apache.acf.agents.system.ACF;
import java.util.*;
import java.io.*;
@@ -45,7 +45,7 @@ public class OutputConnectorFactory
*@param className is the class name.
*/
public static void install(IThreadContext threadContext, String className)
- throws LCFException
+ throws ACFException
{
IOutputConnector connector = getConnectorNoCheck(className);
connector.install(threadContext);
@@ -55,7 +55,7 @@ public class OutputConnectorFactory
*@param className is the class name.
*/
public static void deinstall(IThreadContext threadContext, String className)
- throws LCFException
+ throws ACFException
{
IOutputConnector connector = getConnectorNoCheck(className);
connector.deinstall(threadContext);
@@ -66,7 +66,7 @@ public class OutputConnectorFactory
*@return the list of activities.
*/
public static String[] getActivitiesList(IThreadContext threadContext, String className)
- throws LCFException
+ throws ACFException
{
IOutputConnector connector = getConnector(threadContext, className);
if (connector == null)
@@ -79,7 +79,7 @@ public class OutputConnectorFactory
/** Output the configuration header section.
*/
public static void outputConfigurationHeader(IThreadContext threadContext, String className, IHTTPOutput out, ConfigParams parameters, ArrayList tabsArray)
- throws LCFException, IOException
+ throws ACFException, IOException
{
IOutputConnector connector = getConnector(threadContext, className);
if (connector == null)
@@ -90,7 +90,7 @@ public class OutputConnectorFactory
/** Output the configuration body section.
*/
public static void outputConfigurationBody(IThreadContext threadContext, String className, IHTTPOutput out, ConfigParams parameters, String tabName)
- throws LCFException, IOException
+ throws ACFException, IOException
{
IOutputConnector connector = getConnector(threadContext, className);
if (connector == null)
@@ -101,7 +101,7 @@ public class OutputConnectorFactory
/** Process configuration post data for a connector.
*/
public static String processConfigurationPost(IThreadContext threadContext, String className, IPostParameters variableContext, ConfigParams configParams)
- throws LCFException
+ throws ACFException
{
IOutputConnector connector = getConnector(threadContext, className);
if (connector == null)
@@ -112,7 +112,7 @@ public class OutputConnectorFactory
/** View connector configuration.
*/
public static void viewConfiguration(IThreadContext threadContext, String className, IHTTPOutput out, ConfigParams configParams)
- throws LCFException, IOException
+ throws ACFException, IOException
{
IOutputConnector connector = getConnector(threadContext, className);
// We want to be able to view connections even if they have unregistered connectors.
@@ -126,18 +126,18 @@ public class OutputConnectorFactory
*@return the instance.
*/
public static IOutputConnector getConnectorNoCheck(String className)
- throws LCFException
+ throws ACFException
{
try
{
- Class theClass = LCF.findClass(className);
+ Class theClass = ACF.findClass(className);
Class[] argumentClasses = new Class[0];
// Look for a constructor
Constructor c = theClass.getConstructor(argumentClasses);
Object[] arguments = new Object[0];
Object o = c.newInstance(arguments);
if (!(o instanceof IOutputConnector))
- throw new LCFException("Class '"+className+"' does not implement IOutputConnector.");
+ throw new ACFException("Class '"+className+"' does not implement IOutputConnector.");
return (IOutputConnector)o;
}
catch (InvocationTargetException e)
@@ -146,41 +146,41 @@ public class OutputConnectorFactory
if (z instanceof Error)
throw (Error)z;
else
- throw (LCFException)z;
+ throw (ACFException)z;
}
catch (ClassNotFoundException e)
{
- throw new LCFException("No output connector class '"+className+"' was found.",
+ throw new ACFException("No output connector class '"+className+"' was found.",
e);
}
catch (NoSuchMethodException e)
{
- throw new LCFException("No appropriate constructor for IOutputConnector implementation '"+
+ throw new ACFException("No appropriate constructor for IOutputConnector implementation '"+
className+"'. Need xxx(ConfigParams).",
e);
}
catch (SecurityException e)
{
- throw new LCFException("Protected constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Protected constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalAccessException e)
{
- throw new LCFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalArgumentException e)
{
- throw new LCFException("Shouldn't happen!!!",e);
+ throw new ACFException("Shouldn't happen!!!",e);
}
catch (InstantiationException e)
{
- throw new LCFException("InstantiationException for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("InstantiationException for IOutputConnector implementation '"+className+"'",
e);
}
catch (ExceptionInInitializerError e)
{
- throw new LCFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
e);
}
@@ -191,7 +191,7 @@ public class OutputConnectorFactory
*@return the instance.
*/
protected static IOutputConnector getConnector(IThreadContext threadContext, String className)
- throws LCFException
+ throws ACFException
{
IOutputConnectorManager connMgr = OutputConnectorManagerFactory.make(threadContext);
if (connMgr.isInstalled(className) == false)
@@ -199,14 +199,14 @@ public class OutputConnectorFactory
try
{
- Class theClass = LCF.findClass(className);
+ Class theClass = ACF.findClass(className);
Class[] argumentClasses = new Class[0];
// Look for a constructor
Constructor c = theClass.getConstructor(argumentClasses);
Object[] arguments = new Object[0];
Object o = c.newInstance(arguments);
if (!(o instanceof IOutputConnector))
- throw new LCFException("Class '"+className+"' does not implement IOutputConnector.");
+ throw new ACFException("Class '"+className+"' does not implement IOutputConnector.");
return (IOutputConnector)o;
}
catch (InvocationTargetException e)
@@ -215,7 +215,7 @@ public class OutputConnectorFactory
if (z instanceof Error)
throw (Error)z;
else
- throw (LCFException)z;
+ throw (ACFException)z;
}
catch (ClassNotFoundException e)
{
@@ -224,37 +224,37 @@ public class OutputConnectorFactory
if (connMgr.isInstalled(className) == false)
return null;
- throw new LCFException("No output connector class '"+className+"' was found.",
+ throw new ACFException("No output connector class '"+className+"' was found.",
e);
}
catch (NoSuchMethodException e)
{
- throw new LCFException("No appropriate constructor for IOutputConnector implementation '"+
+ throw new ACFException("No appropriate constructor for IOutputConnector implementation '"+
className+"'. Need xxx(ConfigParams).",
e);
}
catch (SecurityException e)
{
- throw new LCFException("Protected constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Protected constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalAccessException e)
{
- throw new LCFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalArgumentException e)
{
- throw new LCFException("Shouldn't happen!!!",e);
+ throw new ACFException("Shouldn't happen!!!",e);
}
catch (InstantiationException e)
{
- throw new LCFException("InstantiationException for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("InstantiationException for IOutputConnector implementation '"+className+"'",
e);
}
catch (ExceptionInInitializerError e)
{
- throw new LCFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
e);
}
@@ -265,7 +265,7 @@ public class OutputConnectorFactory
*/
public static IOutputConnector[] grabMultiple(IThreadContext threadContext,
String[] orderingKeys, String[] classNames, ConfigParams[] configInfos, int[] maxPoolSizes)
- throws LCFException
+ throws ACFException
{
IOutputConnector[] rval = new IOutputConnector[classNames.length];
HashMap orderMap = new HashMap();
@@ -273,7 +273,7 @@ public class OutputConnectorFactory
while (i < orderingKeys.length)
{
if (orderMap.get(orderingKeys[i]) != null)
- throw new LCFException("Found duplicate order key");
+ throw new ACFException("Found duplicate order key");
orderMap.put(orderingKeys[i],new Integer(i));
i++;
}
@@ -302,13 +302,13 @@ public class OutputConnectorFactory
{
release(rval[index]);
}
- catch (LCFException e2)
+ catch (ACFException e2)
{
}
}
- if (e instanceof LCFException)
+ if (e instanceof ACFException)
{
- throw (LCFException)e;
+ throw (ACFException)e;
}
throw (Error)e;
}
@@ -326,7 +326,7 @@ public class OutputConnectorFactory
*/
public static IOutputConnector grab(IThreadContext threadContext,
String className, ConfigParams configInfo, int maxPoolSize)
- throws LCFException
+ throws ACFException
{
// We want to get handles off the pool and use them. But the
// handles we fetch have to have the right config information.
@@ -356,10 +356,10 @@ public class OutputConnectorFactory
/** Release multiple output connectors.
*/
public static void releaseMultiple(IOutputConnector[] connectors)
- throws LCFException
+ throws ACFException
{
int i = 0;
- LCFException currentException = null;
+ ACFException currentException = null;
while (i < connectors.length)
{
IOutputConnector c = connectors[i++];
@@ -367,7 +367,7 @@ public class OutputConnectorFactory
{
release(c);
}
- catch (LCFException e)
+ catch (ACFException e)
{
if (currentException == null)
currentException = e;
@@ -381,7 +381,7 @@ public class OutputConnectorFactory
*@param connector is the connector to release.
*/
public static void release(IOutputConnector connector)
- throws LCFException
+ throws ACFException
{
// If the connector is null, skip the release, because we never really got the connector in the first place.
if (connector == null)
@@ -408,7 +408,7 @@ public class OutputConnectorFactory
* This method polls all inactive handles.
*/
public static void pollAllConnectors(IThreadContext threadContext)
- throws LCFException
+ throws ACFException
{
// System.out.println("Pool stats:");
@@ -433,7 +433,7 @@ public class OutputConnectorFactory
*@param threadContext is the local thread context.
*/
public static void closeAllConnectors(IThreadContext threadContext)
- throws LCFException
+ throws ACFException
{
// Go through the whole pool and clean it out
synchronized (poolHash)
@@ -525,7 +525,7 @@ public class OutputConnectorFactory
*@return the connector, or null if no connector could be connected.
*/
public synchronized IOutputConnector getConnector(IThreadContext threadContext)
- throws LCFException
+ throws ACFException
{
while (numFree == 0)
{
@@ -535,7 +535,7 @@ public class OutputConnectorFactory
}
catch (InterruptedException e)
{
- throw new LCFException("Interrupted: "+e.getMessage(),e,LCFException.INTERRUPTED);
+ throw new ACFException("Interrupted: "+e.getMessage(),e,ACFException.INTERRUPTED);
}
}
@@ -551,14 +551,14 @@ public class OutputConnectorFactory
try
{
- Class theClass = LCF.findClass(className);
+ Class theClass = ACF.findClass(className);
Class[] argumentClasses = new Class[0];
// Look for a constructor
Constructor c = theClass.getConstructor(argumentClasses);
Object[] arguments = new Object[0];
Object o = c.newInstance(arguments);
if (!(o instanceof IOutputConnector))
- throw new LCFException("Class '"+className+"' does not implement IOutputConnector.");
+ throw new ACFException("Class '"+className+"' does not implement IOutputConnector.");
rc = (IOutputConnector)o;
rc.connect(configParams);
}
@@ -568,7 +568,7 @@ public class OutputConnectorFactory
if (z instanceof Error)
throw (Error)z;
else
- throw (LCFException)z;
+ throw (ACFException)z;
}
catch (ClassNotFoundException e)
{
@@ -578,37 +578,37 @@ public class OutputConnectorFactory
if (connMgr.isInstalled(className) == false)
return null;
- throw new LCFException("No output connector class '"+className+"' was found.",
+ throw new ACFException("No output connector class '"+className+"' was found.",
e);
}
catch (NoSuchMethodException e)
{
- throw new LCFException("No appropriate constructor for IOutputConnector implementation '"+
+ throw new ACFException("No appropriate constructor for IOutputConnector implementation '"+
className+"'. Need xxx(ConfigParams).",
e);
}
catch (SecurityException e)
{
- throw new LCFException("Protected constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Protected constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalAccessException e)
{
- throw new LCFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("Unavailable constructor for IOutputConnector implementation '"+className+"'",
e);
}
catch (IllegalArgumentException e)
{
- throw new LCFException("Shouldn't happen!!!",e);
+ throw new ACFException("Shouldn't happen!!!",e);
}
catch (InstantiationException e)
{
- throw new LCFException("InstantiationException for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("InstantiationException for IOutputConnector implementation '"+className+"'",
e);
}
catch (ExceptionInInitializerError e)
{
- throw new LCFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
+ throw new ACFException("ExceptionInInitializerError for IOutputConnector implementation '"+className+"'",
e);
}
}
@@ -625,7 +625,7 @@ public class OutputConnectorFactory
*@param connector is the connector.
*/
public synchronized void releaseConnector(IOutputConnector connector)
- throws LCFException
+ throws ACFException
{
if (connector == null)
return;
@@ -641,7 +641,7 @@ public class OutputConnectorFactory
/** Notify all free connectors.
*/
public synchronized void pollAll(IThreadContext threadContext)
- throws LCFException
+ throws ACFException
{
int i = 0;
while (i < stack.size())
@@ -657,7 +657,7 @@ public class OutputConnectorFactory
/** Release all free connectors.
*/
public synchronized void releaseAll(IThreadContext threadContext)
- throws LCFException
+ throws ACFException
{
while (stack.size() > 0)
{
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorManagerFactory.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorManagerFactory.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorManagerFactory.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputConnectorManagerFactory.java Mon Aug 23 18:08:32 2010
@@ -38,16 +38,16 @@ public class OutputConnectorManagerFacto
*@return the output connector manager handle.
*/
public static IOutputConnectorManager make(IThreadContext tc)
- throws LCFException
+ throws ACFException
{
Object o = tc.get(connMgr);
if (o == null || !(o instanceof IOutputConnectorManager))
{
IDBInterface database = DBInterfaceFactory.make(tc,
- LCF.getMasterDatabaseName(),
- LCF.getMasterDatabaseUsername(),
- LCF.getMasterDatabasePassword());
+ ACF.getMasterDatabaseName(),
+ ACF.getMasterDatabaseUsername(),
+ ACF.getMasterDatabasePassword());
o = new org.apache.acf.agents.outputconnmgr.OutputConnectorManager(tc,database);
tc.save(connMgr,o);
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputSpecification.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputSpecification.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputSpecification.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/OutputSpecification.java Mon Aug 23 18:08:32 2010
@@ -38,7 +38,7 @@ public class OutputSpecification extends
*@param xml is the input XML.
*/
public OutputSpecification(String xml)
- throws LCFException
+ throws ACFException
{
super(xml);
}
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/RepositoryDocument.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/RepositoryDocument.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/RepositoryDocument.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/interfaces/RepositoryDocument.java Mon Aug 23 18:08:32 2010
@@ -171,7 +171,7 @@ public class RepositoryDocument
* to remove the entry from the document.
*/
public void addField(String fieldName, Reader[] fieldData)
- throws LCFException
+ throws ACFException
{
if (fieldData == null)
fields.remove(fieldName);
@@ -184,7 +184,7 @@ public class RepositoryDocument
*@param fieldData is the single-valued data (as a Reader). Null means "no value".
*/
public void addField(String fieldName, Reader fieldData)
- throws LCFException
+ throws ACFException
{
fields.put(fieldName,new Reader[]{fieldData});
}
@@ -195,7 +195,7 @@ public class RepositoryDocument
* to remove the entry from the document.
*/
public void addField(String fieldName, String[] fieldData)
- throws LCFException
+ throws ACFException
{
if (fieldData == null)
fields.remove(fieldName);
@@ -208,7 +208,7 @@ public class RepositoryDocument
*@param fieldData is the single-valued data (as a String). Null means "no value".
*/
public void addField(String fieldName, String fieldData)
- throws LCFException
+ throws ACFException
{
fields.put(fieldName,new String[]{fieldData});
}
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/output/BaseOutputConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/output/BaseOutputConnector.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/output/BaseOutputConnector.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/output/BaseOutputConnector.java Mon Aug 23 18:08:32 2010
@@ -63,10 +63,10 @@ public abstract class BaseOutputConnecto
*@param input is the request object.
*/
public void executeCommand(Configuration output, String command, Configuration input)
- throws LCFException
+ throws ACFException
{
// The base connector treats all requests as invalid commands, and throws an exception accordingly.
- throw new LCFException("Unrecognized output connector command '"+command+"'");
+ throw new ACFException("Unrecognized output connector command '"+command+"'");
}
/** Detect if a mime type is indexable or not. This method is used by participating repository connectors to pre-filter the number of
@@ -75,7 +75,7 @@ public abstract class BaseOutputConnecto
*@return true if the mime type is indexable by this connector.
*/
public boolean checkMimeTypeIndexable(String mimeType)
- throws LCFException, ServiceInterruption
+ throws ACFException, ServiceInterruption
{
return true;
}
@@ -87,7 +87,7 @@ public abstract class BaseOutputConnecto
*@return true if the file is indexable.
*/
public boolean checkDocumentIndexable(File localFile)
- throws LCFException, ServiceInterruption
+ throws ACFException, ServiceInterruption
{
return true;
}
@@ -109,7 +109,7 @@ public abstract class BaseOutputConnecto
*@param tabsArray is an array of tab names. Add to this array any tab names that are specific to the connector.
*/
public void outputSpecificationHeader(IHTTPOutput out, OutputSpecification os, ArrayList tabsArray)
- throws LCFException, IOException
+ throws ACFException, IOException
{
}
@@ -122,7 +122,7 @@ public abstract class BaseOutputConnecto
*@param tabName is the current tab name.
*/
public void outputSpecificationBody(IHTTPOutput out, OutputSpecification os, String tabName)
- throws LCFException, IOException
+ throws ACFException, IOException
{
}
@@ -135,7 +135,7 @@ public abstract class BaseOutputConnecto
*@return null if all is well, or a string error message if there is an error that should prevent saving of the job (and cause a redirection to an error page).
*/
public String processSpecificationPost(IPostParameters variableContext, OutputSpecification os)
- throws LCFException
+ throws ACFException
{
return null;
}
@@ -147,7 +147,7 @@ public abstract class BaseOutputConnecto
*@param os is the current output specification for this job.
*/
public void viewSpecification(IHTTPOutput out, OutputSpecification os)
- throws LCFException, IOException
+ throws ACFException, IOException
{
}
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnection/OutputConnectionManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnection/OutputConnectionManager.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnection/OutputConnectionManager.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnection/OutputConnectionManager.java Mon Aug 23 18:08:32 2010
@@ -22,7 +22,7 @@ import java.util.*;
import org.apache.acf.core.interfaces.*;
import org.apache.acf.agents.interfaces.*;
import org.apache.acf.agents.interfaces.CacheKeyFactory;
-import org.apache.acf.agents.system.LCF;
+import org.apache.acf.agents.system.ACF;
/** This class is the manager of the outputconnection description. Inside, a database table is managed,
@@ -53,7 +53,7 @@ public class OutputConnectionManager ext
*@param threadContext is the thread context.
*/
public OutputConnectionManager(IThreadContext threadContext, IDBInterface database)
- throws LCFException
+ throws ACFException
{
super(database,"outputconnections");
@@ -64,7 +64,7 @@ public class OutputConnectionManager ext
/** Install the manager.
*/
public void install()
- throws LCFException
+ throws ACFException
{
// Always have an outer loop, in case retries required
while (true)
@@ -95,51 +95,51 @@ public class OutputConnectionManager ext
/** Uninstall the manager.
*/
public void deinstall()
- throws LCFException
+ throws ACFException
{
performDrop(null);
}
/** Export configuration */
public void exportConfiguration(java.io.OutputStream os)
- throws java.io.IOException, LCFException
+ throws java.io.IOException, ACFException
{
// Write a version indicator
- LCF.writeDword(os,1);
+ ACF.writeDword(os,1);
// Get the authority list
IOutputConnection[] list = getAllConnections();
// Write the number of authorities
- LCF.writeDword(os,list.length);
+ ACF.writeDword(os,list.length);
// Loop through the list and write the individual repository connection info
int i = 0;
while (i < list.length)
{
IOutputConnection conn = list[i++];
- LCF.writeString(os,conn.getName());
- LCF.writeString(os,conn.getDescription());
- LCF.writeString(os,conn.getClassName());
- LCF.writeString(os,conn.getConfigParams().toXML());
- LCF.writeDword(os,conn.getMaxConnections());
+ ACF.writeString(os,conn.getName());
+ ACF.writeString(os,conn.getDescription());
+ ACF.writeString(os,conn.getClassName());
+ ACF.writeString(os,conn.getConfigParams().toXML());
+ ACF.writeDword(os,conn.getMaxConnections());
}
}
/** Import configuration */
public void importConfiguration(java.io.InputStream is)
- throws java.io.IOException, LCFException
+ throws java.io.IOException, ACFException
{
- int version = LCF.readDword(is);
+ int version = ACF.readDword(is);
if (version != 1)
throw new java.io.IOException("Unknown repository connection configuration version: "+Integer.toString(version));
- int count = LCF.readDword(is);
+ int count = ACF.readDword(is);
int i = 0;
while (i < count)
{
IOutputConnection conn = create();
- conn.setName(LCF.readString(is));
- conn.setDescription(LCF.readString(is));
- conn.setClassName(LCF.readString(is));
- conn.getConfigParams().fromXML(LCF.readString(is));
- conn.setMaxConnections(LCF.readDword(is));
+ conn.setName(ACF.readString(is));
+ conn.setDescription(ACF.readString(is));
+ conn.setClassName(ACF.readString(is));
+ conn.getConfigParams().fromXML(ACF.readString(is));
+ conn.setMaxConnections(ACF.readDword(is));
// Attempt to save this connection
save(conn);
i++;
@@ -150,7 +150,7 @@ public class OutputConnectionManager ext
*@return an array of connection objects.
*/
public IOutputConnection[] getAllConnections()
- throws LCFException
+ throws ACFException
{
beginTransaction();
try
@@ -171,7 +171,7 @@ public class OutputConnectionManager ext
}
return loadMultiple(names);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -192,7 +192,7 @@ public class OutputConnectionManager ext
*@return the loaded connection object, or null if not found.
*/
public IOutputConnection load(String name)
- throws LCFException
+ throws ACFException
{
return loadMultiple(new String[]{name})[0];
}
@@ -202,7 +202,7 @@ public class OutputConnectionManager ext
*@return the loaded connection objects.
*/
public IOutputConnection[] loadMultiple(String[] names)
- throws LCFException
+ throws ACFException
{
// Build description objects
OutputConnectionDescription[] objectDescriptions = new OutputConnectionDescription[names.length];
@@ -225,7 +225,7 @@ public class OutputConnectionManager ext
*@return the new object.
*/
public IOutputConnection create()
- throws LCFException
+ throws ACFException
{
OutputConnection rval = new OutputConnection();
return rval;
@@ -235,7 +235,7 @@ public class OutputConnectionManager ext
*@param object is the object to save.
*/
public void save(IOutputConnection object)
- throws LCFException
+ throws ACFException
{
StringSetBuffer ssb = new StringSetBuffer();
ssb.add(getOutputConnectionsKey());
@@ -249,7 +249,7 @@ public class OutputConnectionManager ext
{
performLock();
// Notify of a change to the configuration
- LCF.noteConfigurationChange();
+ ACF.noteConfigurationChange();
// See whether the instance exists
ArrayList params = new ArrayList();
params.add(object.getName());
@@ -289,7 +289,7 @@ public class OutputConnectionManager ext
cacheManager.invalidateKeys(ch);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -315,7 +315,7 @@ public class OutputConnectionManager ext
* name does not exist, no error is returned.
*/
public void delete(String name)
- throws LCFException
+ throws ACFException
{
StringSetBuffer ssb = new StringSetBuffer();
ssb.add(getOutputConnectionsKey());
@@ -329,14 +329,14 @@ public class OutputConnectionManager ext
{
// Check if anything refers to this connection name
if (AgentManagerFactory.isOutputConnectionInUse(threadContext,name))
- throw new LCFException("Can't delete output connection '"+name+"': existing entities refer to it");
- LCF.noteConfigurationChange();
+ throw new ACFException("Can't delete output connection '"+name+"': existing entities refer to it");
+ ACF.noteConfigurationChange();
ArrayList params = new ArrayList();
params.add(name);
performDelete("WHERE "+nameField+"=?",params,null);
cacheManager.invalidateKeys(ch);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -363,7 +363,7 @@ public class OutputConnectionManager ext
*@return the repository connections that use that connector.
*/
public String[] findConnectionsForConnector(String className)
- throws LCFException
+ throws ACFException
{
StringSetBuffer ssb = new StringSetBuffer();
ssb.add(getOutputConnectionsKey());
@@ -389,7 +389,7 @@ public class OutputConnectionManager ext
*@return true if the underlying connector is registered.
*/
public boolean checkConnectorExists(String name)
- throws LCFException
+ throws ACFException
{
beginTransaction();
try
@@ -402,13 +402,13 @@ public class OutputConnectionManager ext
IResultSet set = performQuery("SELECT "+classNameField+" FROM "+getTableName()+" WHERE "+nameField+"=?",params,
localCacheKeys,null);
if (set.getRowCount() == 0)
- throw new LCFException("No such connection: '"+name+"'");
+ throw new ACFException("No such connection: '"+name+"'");
IResultRow row = set.getRow(0);
String className = (String)row.getValue(classNameField);
IOutputConnectorManager cm = OutputConnectorManagerFactory.make(threadContext);
return cm.isInstalled(className);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -460,7 +460,7 @@ public class OutputConnectionManager ext
*@return the corresponding output connection objects.
*/
protected OutputConnection[] getOutputConnectionsMultiple(String[] connectionNames)
- throws LCFException
+ throws ACFException
{
OutputConnection[] rval = new OutputConnection[connectionNames.length];
HashMap returnIndex = new HashMap();
@@ -504,7 +504,7 @@ public class OutputConnectionManager ext
signalRollback();
throw e;
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -522,7 +522,7 @@ public class OutputConnectionManager ext
*@param params is the set of parameters.
*/
protected void getOutputConnectionsChunk(OutputConnection[] rval, Map returnIndex, String idList, ArrayList params)
- throws LCFException
+ throws ACFException
{
IResultSet set;
set = performQuery("SELECT * FROM "+getTableName()+" WHERE "+
@@ -644,7 +644,7 @@ public class OutputConnectionManager ext
* @return the newly created objects to cache, or null, if any object cannot be created.
* The order of the returned objects must correspond to the order of the object descriptinos.
*/
- public Object[] create(ICacheDescription[] objectDescriptions) throws LCFException
+ public Object[] create(ICacheDescription[] objectDescriptions) throws ACFException
{
// Turn the object descriptions into the parameters for the ToolInstance requests
String[] connectionNames = new String[objectDescriptions.length];
@@ -667,7 +667,7 @@ public class OutputConnectionManager ext
* @param objectDescription is the unique identifier of the object.
* @param cachedObject is the cached object.
*/
- public void exists(ICacheDescription objectDescription, Object cachedObject) throws LCFException
+ public void exists(ICacheDescription objectDescription, Object cachedObject) throws ACFException
{
// Cast what came in as what it really is
OutputConnectionDescription objectDesc = (OutputConnectionDescription)objectDescription;
@@ -685,7 +685,7 @@ public class OutputConnectionManager ext
/** Perform the desired operation. This method is called after either createGetObject()
* or exists() is called for every requested object.
*/
- public void execute() throws LCFException
+ public void execute() throws ACFException
{
// Does nothing; we only want to fetch objects in this cacher.
}
Modified: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnmgr/OutputConnectorManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnmgr/OutputConnectorManager.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnmgr/OutputConnectorManager.java (original)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/outputconnmgr/OutputConnectorManager.java Mon Aug 23 18:08:32 2010
@@ -41,7 +41,7 @@ public class OutputConnectorManager exte
*@param database is the database handle.
*/
public OutputConnectorManager(IThreadContext threadContext, IDBInterface database)
- throws LCFException
+ throws ACFException
{
super(database,"outputconnectors");
this.threadContext = threadContext;
@@ -51,7 +51,7 @@ public class OutputConnectorManager exte
/** Install or upgrade.
*/
public void install()
- throws LCFException
+ throws ACFException
{
// Always have an outer loop, in case upgrade needs it.
while (true)
@@ -100,7 +100,7 @@ public class OutputConnectorManager exte
/** Uninstall. This also unregisters all connectors.
*/
public void deinstall()
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
@@ -119,7 +119,7 @@ public class OutputConnectorManager exte
}
performDrop(invKeys);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -141,7 +141,7 @@ public class OutputConnectorManager exte
*@param className is the class name.
*/
public void registerConnector(String description, String className)
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
beginTransaction();
@@ -168,7 +168,7 @@ public class OutputConnectorManager exte
// Either way, we must do the install/upgrade itself.
OutputConnectorFactory.install(threadContext,className);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -189,7 +189,7 @@ public class OutputConnectorManager exte
*@param className is the class name of the connector to unregister.
*/
public void unregisterConnector(String className)
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
beginTransaction();
@@ -200,7 +200,7 @@ public class OutputConnectorManager exte
removeConnector(className);
}
- catch (LCFException e)
+ catch (ACFException e)
{
signalRollback();
throw e;
@@ -222,7 +222,7 @@ public class OutputConnectorManager exte
*@param className is the connector class to remove.
*/
public void removeConnector(String className)
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
ArrayList list = new ArrayList();
@@ -235,7 +235,7 @@ public class OutputConnectorManager exte
* These will be ordered by description.
*/
public IResultSet getConnectors()
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
@@ -248,7 +248,7 @@ public class OutputConnectorManager exte
*@return the description, or null if the class is not registered.
*/
public String getDescription(String className)
- throws LCFException
+ throws ACFException
{
StringSet invKeys = new StringSet(getCacheKey());
@@ -267,7 +267,7 @@ public class OutputConnectorManager exte
*@return true if installed, false otherwise.
*/
public boolean isInstalled(String className)
- throws LCFException
+ throws ACFException
{
// Use the global table key; that's good enough because we don't expect stuff to change out from under very often.
StringSet invKeys = new StringSet(getCacheKey());
Added: incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/system/ACF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/system/ACF.java?rev=988237&view=auto
==============================================================================
--- incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/system/ACF.java (added)
+++ incubator/lcf/trunk/modules/framework/agents/org/apache/acf/agents/system/ACF.java Mon Aug 23 18:08:32 2010
@@ -0,0 +1,255 @@
+/* $Id: ACF.java 965362 2010-07-19 06:15:50Z kwright $ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.acf.agents.system;
+
+import org.apache.acf.core.interfaces.*;
+import org.apache.acf.agents.interfaces.*;
+import java.io.*;
+import java.util.*;
+
+public class ACF extends org.apache.acf.core.system.ACF
+{
+ public static final String _rcsid = "@(#)$Id: ACF.java 965362 2010-07-19 06:15:50Z kwright $";
+
+ // Agents initialized flag
+ protected static boolean agentsInitialized = false;
+
+ /** This is the place we keep track of the agents we've started. */
+ protected static HashMap runningHash = new HashMap();
+ /** This flag prevents startAgents() from starting anything once stopAgents() has been called. */
+ protected static boolean stopAgentsRun = false;
+
+ /** Initialize environment.
+ */
+ public static void initializeEnvironment()
+ throws ACFException
+ {
+ synchronized (initializeFlagLock)
+ {
+ if (agentsInitialized)
+ return;
+
+ // Do core initialization
+ org.apache.acf.core.system.ACF.initializeEnvironment();
+
+ // Create the shutdown hook for agents. All activity will be keyed off of runningHash, so it is safe to do this under all conditions.
+ org.apache.acf.core.system.ACF.addShutdownHook(new AgentsShutdownHook());
+
+ // Initialize the local loggers
+ Logging.initializeLoggers();
+ Logging.setLogLevels();
+ agentsInitialized = true;
+ }
+ }
+
+
+ /** Install the agent tables. This is also responsible for upgrading the existing
+ * tables!!!
+ *@param threadcontext is the thread context.
+ */
+ public static void installTables(IThreadContext threadcontext)
+ throws ACFException
+ {
+ IAgentManager mgr = AgentManagerFactory.make(threadcontext);
+ IIncrementalIngester igstmgr = IncrementalIngesterFactory.make(threadcontext);
+ IOutputConnectorManager outputConnMgr = OutputConnectorManagerFactory.make(threadcontext);
+ IOutputConnectionManager outputConnectionManager = OutputConnectionManagerFactory.make(threadcontext);
+ mgr.install();
+ outputConnMgr.install();
+ outputConnectionManager.install();
+ igstmgr.install();
+ }
+
+ /** Uninstall all the crawler system tables.
+ *@param threadcontext is the thread context.
+ */
+ public static void deinstallTables(IThreadContext threadcontext)
+ throws ACFException
+ {
+ IAgentManager mgr = AgentManagerFactory.make(threadcontext);
+ IIncrementalIngester igstmgr = IncrementalIngesterFactory.make(threadcontext);
+ IOutputConnectorManager outputConnMgr = OutputConnectorManagerFactory.make(threadcontext);
+ IOutputConnectionManager outputConnectionManager = OutputConnectionManagerFactory.make(threadcontext);
+ igstmgr.deinstall();
+ outputConnectionManager.deinstall();
+ outputConnMgr.deinstall();
+ mgr.deinstall();
+ }
+
+ /** Start all not-running agents.
+ *@param threadContext is the thread context.
+ */
+ public static void startAgents(IThreadContext threadContext)
+ throws ACFException
+ {
+ // Get agent manager
+ IAgentManager manager = AgentManagerFactory.make(threadContext);
+ String[] classes = manager.getAllAgents();
+ ACFException problem = null;
+ synchronized (runningHash)
+ {
+ // DO NOT permit this method to do anything if stopAgents() has ever been called for this JVM!
+ // (If it has, it means that the JVM is trying to shut down.)
+ if (stopAgentsRun)
+ return;
+ int i = 0;
+ while (i < classes.length)
+ {
+ String className = classes[i++];
+ if (runningHash.get(className) == null)
+ {
+ // Start this agent
+ IAgent agent = AgentFactory.make(threadContext,className);
+ try
+ {
+ // There is a potential race condition where the agent has been started but hasn't yet appeared in runningHash.
+ // But having runningHash be the synchronizer for this activity will prevent any problems.
+ // There is ANOTHER potential race condition, however, that can occur if the process is shut down just before startAgents() is called.
+ // We avoid that problem by means of a flag, which prevents startAgents() from doing anything once stopAgents() has been called.
+ agent.startAgent();
+ // Successful!
+ runningHash.put(className,agent);
+ }
+ catch (ACFException e)
+ {
+ problem = e;
+ }
+ }
+ }
+ }
+ if (problem != null)
+ throw problem;
+ // Done.
+ }
+
+ /** Stop all started agents.
+ */
+ public static void stopAgents(IThreadContext threadContext)
+ throws ACFException
+ {
+ synchronized (runningHash)
+ {
+ HashMap iterHash = (HashMap)runningHash.clone();
+ Iterator iter = iterHash.keySet().iterator();
+ while (iter.hasNext())
+ {
+ String className = (String)iter.next();
+ IAgent agent = (IAgent)runningHash.get(className);
+ // Stop it
+ agent.stopAgent();
+ runningHash.remove(className);
+ }
+ }
+ // Done.
+ }
+
+ /** Signal output connection needs redoing.
+ * This is called when something external changed on an output connection, and
+ * therefore all associated documents must be reindexed.
+ *@param threadContext is the thread context.
+ *@param connectionName is the connection name.
+ */
+ public static void signalOutputConnectionRedo(IThreadContext threadContext, String connectionName)
+ throws ACFException
+ {
+ // Blow away the incremental ingestion table first
+ IIncrementalIngester ingester = IncrementalIngesterFactory.make(threadContext);
+ ingester.resetOutputConnection(connectionName);
+ // Now, signal to all agents that the output connection configuration has changed. Do this second, so that there cannot be documents
+ // resulting from this signal that find themselves "unchanged".
+ AgentManagerFactory.noteOutputConnectionChange(threadContext,connectionName);
+ }
+
+ /** Agents shutdown hook class */
+ protected static class AgentsShutdownHook implements IShutdownHook
+ {
+
+ public AgentsShutdownHook()
+ {
+ }
+
+ public void doCleanup()
+ throws ACFException
+ {
+ // Shutting down in this way must prevent startup from taking place.
+ synchronized (runningHash)
+ {
+ stopAgentsRun = true;
+ }
+ IThreadContext tc = ThreadContextFactory.make();
+ stopAgents(tc);
+ }
+
+ }
+
+ // Helper methods for API support. These are made public so connectors can use them to implement the executeCommand method.
+
+ // These are the universal node types.
+
+ protected static final String API_ERRORNODE = "error";
+ protected static final String API_SERVICEINTERRUPTIONNODE = "service_interruption";
+
+ /** Find a configuration node given a name */
+ public static ConfigurationNode findConfigurationNode(Configuration input, String argumentName)
+ {
+ // Look for argument among the children
+ int i = 0;
+ while (i < input.getChildCount())
+ {
+ ConfigurationNode cn = input.findChild(i++);
+ if (cn.getType().equals(argumentName))
+ return cn;
+ }
+ return null;
+
+ }
+
+ /** Find a configuration value given a name */
+ public static String getRootArgument(Configuration input, String argumentName)
+ {
+ ConfigurationNode node = findConfigurationNode(input,argumentName);
+ if (node == null)
+ return null;
+ return node.getValue();
+ }
+
+ /** Handle an exception, by converting it to an error node. */
+ public static void createErrorNode(Configuration output, ACFException e)
+ throws ACFException
+ {
+ if (e.getErrorCode() == ACFException.INTERRUPTED)
+ throw e;
+ Logging.api.error(e.getMessage(),e);
+ ConfigurationNode error = new ConfigurationNode(API_ERRORNODE);
+ error.setValue(e.getMessage());
+ output.addChild(output.getChildCount(),error);
+ }
+
+ /** Handle a service interruption, by converting it to a serviceinterruption node. */
+ public static void createServiceInterruptionNode(Configuration output, ServiceInterruption e)
+ {
+ Logging.api.warn(e.getMessage(),e);
+ ConfigurationNode error = new ConfigurationNode(API_SERVICEINTERRUPTIONNODE);
+ error.setValue(e.getMessage());
+ output.addChild(output.getChildCount(),error);
+ }
+
+
+}
+
Modified: incubator/lcf/trunk/modules/framework/api/org/apache/acf/api/APIServlet.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/api/org/apache/acf/api/APIServlet.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/api/org/apache/acf/api/APIServlet.java (original)
+++ incubator/lcf/trunk/modules/framework/api/org/apache/acf/api/APIServlet.java Mon Aug 23 18:08:32 2010
@@ -21,7 +21,7 @@ package org.apache.acf.api;
import org.apache.acf.core.interfaces.*;
import org.apache.acf.agents.interfaces.*;
import org.apache.acf.crawler.interfaces.*;
-import org.apache.acf.crawler.system.LCF;
+import org.apache.acf.crawler.system.ACF;
import org.apache.acf.crawler.system.Logging;
import java.io.*;
@@ -31,7 +31,7 @@ import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
-/** This servlet class provides API services for LCF.
+/** This servlet class provides API services for ACF.
*/
public class APIServlet extends HttpServlet
{
@@ -46,10 +46,10 @@ public class APIServlet extends HttpServ
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
// Nothing more needs to be done at this point.
}
- catch (LCFException e)
+ catch (ACFException e)
{
Logging.misc.error("Error starting API service: "+e.getMessage(),e);
throw new ServletException("Error starting API service: "+e.getMessage(),e);
@@ -64,10 +64,10 @@ public class APIServlet extends HttpServ
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
// Nothing more needs to be done.
}
- catch (LCFException e)
+ catch (ACFException e)
{
Logging.misc.error("Error shutting down API service: "+e.getMessage(),e);
}
@@ -82,7 +82,7 @@ public class APIServlet extends HttpServ
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
// Mint a thread context
IThreadContext tc = ThreadContextFactory.make();
@@ -135,14 +135,14 @@ public class APIServlet extends HttpServ
else
input = null;
- Configuration output = LCF.executeCommand(tc,command,input);
+ Configuration output = ACF.executeCommand(tc,command,input);
// Format the response
try
{
outputText = output.toJSON();
}
- catch (LCFException e)
+ catch (ACFException e)
{
// Log it
Logging.api.error("Error forming JSON response: "+e.getMessage(),e);
@@ -178,7 +178,7 @@ public class APIServlet extends HttpServ
//Logging.authorityService.error("Unsupported encoding: "+e.getMessage(),e);
throw new ServletException("Fatal error occurred: "+e.getMessage(),e);
}
- catch (LCFException e)
+ catch (ACFException e)
{
// We should only see this error if there's an API problem, not if there's an actual problem with the method being called.
response.sendError(response.SC_BAD_REQUEST,e.getMessage());
Modified: incubator/lcf/trunk/modules/framework/authority-service/org/apache/acf/authorityservice/servlet/UserACLServlet.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/authority-service/org/apache/acf/authorityservice/servlet/UserACLServlet.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/authority-service/org/apache/acf/authorityservice/servlet/UserACLServlet.java (original)
+++ incubator/lcf/trunk/modules/framework/authority-service/org/apache/acf/authorityservice/servlet/UserACLServlet.java Mon Aug 23 18:08:32 2010
@@ -20,7 +20,7 @@ package org.apache.acf.authorityservice.
import org.apache.acf.core.interfaces.*;
import org.apache.acf.authorities.interfaces.*;
-import org.apache.acf.authorities.system.LCF;
+import org.apache.acf.authorities.system.ACF;
import org.apache.acf.authorities.system.Logging;
import org.apache.acf.authorities.system.RequestQueue;
import org.apache.acf.authorities.system.AuthRequest;
@@ -63,11 +63,11 @@ public class UserACLServlet extends Http
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
IThreadContext itc = ThreadContextFactory.make();
- LCF.startSystem(itc);
+ ACF.startSystem(itc);
}
- catch (LCFException e)
+ catch (ACFException e)
{
Logging.misc.error("Error starting authority service: "+e.getMessage(),e);
throw new ServletException("Error starting authority service: "+e.getMessage(),e);
@@ -82,11 +82,11 @@ public class UserACLServlet extends Http
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
IThreadContext itc = ThreadContextFactory.make();
- LCF.stopSystem(itc);
+ ACF.stopSystem(itc);
}
- catch (LCFException e)
+ catch (ACFException e)
{
Logging.misc.error("Error shutting down authority service: "+e.getMessage(),e);
}
@@ -101,7 +101,7 @@ public class UserACLServlet extends Http
try
{
// Set up the environment
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
Logging.authorityService.debug("Received request");
@@ -137,11 +137,11 @@ public class UserACLServlet extends Http
Logging.authorityService.debug("Received authority request for user '"+userID+"'");
}
- RequestQueue queue = LCF.getRequestQueue();
+ RequestQueue queue = ACF.getRequestQueue();
if (queue == null)
{
// System wasn't started; return unauthorized
- throw new LCFException("System improperly initialized");
+ throw new ACFException("System improperly initialized");
}
IThreadContext itc = ThreadContextFactory.make();
@@ -195,8 +195,8 @@ public class UserACLServlet extends Http
if (exception != null)
{
// Exceptions are always bad now
- // The LCFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
- if (exception instanceof LCFException)
+ // The ACFException here must disable access to the UI without causing a generic badness thing to happen, so use 403.
+ if (exception instanceof ACFException)
response.sendError(response.SC_FORBIDDEN,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
else
response.sendError(response.SC_INTERNAL_SERVER_ERROR,"From "+ar.getIdentifyingString()+": "+exception.getMessage());
@@ -265,7 +265,7 @@ public class UserACLServlet extends Http
Logging.authorityService.error("Unsupported encoding: "+e.getMessage(),e);
throw new ServletException("Fatal error occurred: "+e.getMessage(),e);
}
- catch (LCFException e)
+ catch (ACFException e)
{
Logging.authorityService.error("User ACL servlet error: "+e.getMessage(),e);
response.sendError(response.SC_INTERNAL_SERVER_ERROR,e.getMessage());
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBCreate.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBCreate.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBCreate.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBCreate.java Mon Aug 23 18:08:32 2010
@@ -19,12 +19,12 @@
package org.apache.acf.core;
import org.apache.acf.core.interfaces.IThreadContext;
-import org.apache.acf.core.interfaces.LCFException;
-import org.apache.acf.core.system.LCF;
+import org.apache.acf.core.interfaces.ACFException;
+import org.apache.acf.core.system.ACF;
import org.apache.acf.core.system.Logging;
/**
- * Create the database using the name as specified through the {@see LCF}. The username and password for the
+ * Create the database using the name as specified through the {@see ACF}. The username and password for the
* configured database need to be specified during construction.
*/
public class DBCreate extends DBInitializationCommand
@@ -46,10 +46,10 @@ public class DBCreate extends DBInitiali
/**
* {@inheritDoc}
*/
- public void doExecute(IThreadContext tc) throws LCFException
+ public void doExecute(IThreadContext tc) throws ACFException
{
- LCF.createSystemDatabase(tc, getUserName(), getPassword());
- Logging.root.info("LCF database created");
+ ACF.createSystemDatabase(tc, getUserName(), getPassword());
+ Logging.root.info("ACF database created");
}
/**
@@ -78,9 +78,9 @@ public class DBCreate extends DBInitiali
try
{
dbCreate.execute();
- System.err.println("LCF database created");
+ System.err.println("ACF database created");
}
- catch (LCFException e)
+ catch (ACFException e)
{
e.printStackTrace();
System.exit(1);
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBDrop.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBDrop.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBDrop.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBDrop.java Mon Aug 23 18:08:32 2010
@@ -19,12 +19,12 @@
package org.apache.acf.core;
import org.apache.acf.core.interfaces.IThreadContext;
-import org.apache.acf.core.interfaces.LCFException;
-import org.apache.acf.core.system.LCF;
+import org.apache.acf.core.interfaces.ACFException;
+import org.apache.acf.core.system.ACF;
import org.apache.acf.core.system.Logging;
/**
- * Drop the database using the name as specified through the {@see LCF}. The username and password for the
+ * Drop the database using the name as specified through the {@see ACF}. The username and password for the
* configured database need to be specified during construction.
*/
public class DBDrop extends DBInitializationCommand
@@ -42,10 +42,10 @@ public class DBDrop extends DBInitializa
super(userName, password);
}
- protected void doExecute(IThreadContext tc) throws LCFException
+ protected void doExecute(IThreadContext tc) throws ACFException
{
- LCF.dropSystemDatabase(tc, getUserName(), getPassword());
- Logging.root.info("LCF database dropped");
+ ACF.dropSystemDatabase(tc, getUserName(), getPassword());
+ Logging.root.info("ACF database dropped");
}
/**
@@ -74,9 +74,9 @@ public class DBDrop extends DBInitializa
try
{
dbDrop.execute();
- System.err.println("LCF database dropped");
+ System.err.println("ACF database dropped");
}
- catch (LCFException e)
+ catch (ACFException e)
{
e.printStackTrace();
System.exit(1);
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBInitializationCommand.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBInitializationCommand.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBInitializationCommand.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/DBInitializationCommand.java Mon Aug 23 18:08:32 2010
@@ -1,9 +1,9 @@
package org.apache.acf.core;
import org.apache.acf.core.interfaces.IThreadContext;
-import org.apache.acf.core.interfaces.LCFException;
+import org.apache.acf.core.interfaces.ACFException;
import org.apache.acf.core.interfaces.ThreadContextFactory;
-import org.apache.acf.core.system.LCF;
+import org.apache.acf.core.system.ACF;
/**
* Parent class for all database initialization related commands. This class provides methods to
@@ -28,14 +28,14 @@ public abstract class DBInitializationCo
this.password = password;
}
- public void execute() throws LCFException
+ public void execute() throws ACFException
{
- LCF.initializeEnvironment();
+ ACF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
doExecute(tc);
}
- protected abstract void doExecute(IThreadContext tc) throws LCFException;
+ protected abstract void doExecute(IThreadContext tc) throws ACFException;
protected String getPassword()
{
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/InitializationCommand.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/InitializationCommand.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/InitializationCommand.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/InitializationCommand.java Mon Aug 23 18:08:32 2010
@@ -1,6 +1,6 @@
package org.apache.acf.core;
-import org.apache.acf.core.interfaces.LCFException;
+import org.apache.acf.core.interfaces.ACFException;
/**
* Interface for commands that initialize state of the connector framework. Among implementations available are:
@@ -15,7 +15,7 @@ public interface InitializationCommand
/**
* Execute the command.
*
- * @throws LCFException Thrown if the execution fails
+ * @throws ACFException Thrown if the execution fails
*/
- void execute() throws LCFException;
+ void execute() throws ACFException;
}
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/LockClean.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/LockClean.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/LockClean.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/LockClean.java Mon Aug 23 18:08:32 2010
@@ -22,7 +22,7 @@ import org.apache.acf.core.interfaces.*;
import org.apache.acf.core.system.*;
/**
- * LCF makes use of a synchronization directory to store data about the current state of the synchronization between
+ * ACF makes use of a synchronization directory to store data about the current state of the synchronization between
* the repository connection and the output connection. This class is used to clear this directory.
*/
public class LockClean implements InitializationCommand
@@ -36,10 +36,10 @@ public class LockClean implements Initia
/**
* {@inheritDoc}
*/
- public void execute() throws LCFException
+ public void execute() throws ACFException
{
- LCF.initializeEnvironment();
- String synchDir = LCF.getProperty(org.apache.acf.core.lockmanager.LockManager.synchDirectoryProperty);
+ ACF.initializeEnvironment();
+ String synchDir = ACF.getProperty(org.apache.acf.core.lockmanager.LockManager.synchDirectoryProperty);
if (synchDir != null)
{
// Recursively clean up the contents of the synch directory. But don't remove the directory itself
@@ -107,7 +107,7 @@ public class LockClean implements Initia
lockClean.execute();
System.err.println("Synchronization storage cleaned up");
}
- catch (LCFException e)
+ catch (ACFException e)
{
e.printStackTrace(System.err);
System.exit(2);
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/Obfuscate.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/Obfuscate.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/Obfuscate.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/Obfuscate.java Mon Aug 23 18:08:32 2010
@@ -42,9 +42,9 @@ public class Obfuscate
String string = args[0];
try
{
- UTF8Stdout.println(LCF.obfuscate(string));
+ UTF8Stdout.println(ACF.obfuscate(string));
}
- catch (LCFException e)
+ catch (ACFException e)
{
e.printStackTrace();
System.exit(1);
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/cachemanager/CacheManager.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/cachemanager/CacheManager.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/cachemanager/CacheManager.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/cachemanager/CacheManager.java Mon Aug 23 18:08:32 2010
@@ -21,7 +21,7 @@ package org.apache.acf.core.cachemanager
import org.apache.acf.core.interfaces.*;
import java.util.*;
import org.apache.acf.core.system.Logging;
-import org.apache.acf.core.system.LCF;
+import org.apache.acf.core.system.ACF;
import java.io.*;
/** This class implements the cache manager interface, and provides generic cache management
@@ -43,7 +43,7 @@ public class CacheManager implements ICa
protected HashMap transactionHash = new HashMap();
public CacheManager(IThreadContext context)
- throws LCFException
+ throws ACFException
{
lockManager = LockManagerFactory.make(context);
}
@@ -76,7 +76,7 @@ public class CacheManager implements ICa
*/
public void findObjectsAndExecute(ICacheDescription[] locateObjectDescriptions, StringSet invalidateKeys,
ICacheExecutor execObject, String transactionID)
- throws LCFException
+ throws ACFException
{
// There is some clever engineering involved here. The lock manager is used to control synchronization
// around usage and invalidation of objects. However, there is ANOTHER lock condition that needs to be
@@ -198,7 +198,7 @@ public class CacheManager implements ICa
*/
public ICacheHandle enterCache(ICacheDescription[] locateObjectDescriptions, StringSet invalidateKeys,
String transactionID)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
{
@@ -283,7 +283,7 @@ public class CacheManager implements ICa
CacheTransactionHandle handle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (handle == null)
{
- LCFException ex = new LCFException("Illegal transaction ID: '"+transactionID+"'",LCFException.GENERAL_ERROR);
+ ACFException ex = new ACFException("Illegal transaction ID: '"+transactionID+"'",ACFException.GENERAL_ERROR);
Logging.cache.error(Thread.currentThread().toString()+": enterCache: "+transactionID+": "+this.toString()+": Transaction hash = "+transactionHash.toString(),ex);
throw ex;
}
@@ -313,7 +313,7 @@ public class CacheManager implements ICa
*@param handle is the cache handle.
*/
public ICacheCreateHandle enterCreateSection(ICacheHandle handle)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -328,8 +328,8 @@ public class CacheManager implements ICa
// stop multiple creation.
ICacheDescription[] locateObjectDescriptions = handle.getObjectDescriptions();
if (locateObjectDescriptions == null)
- throw new LCFException("Can't enter create section without objects to create",
- LCFException.GENERAL_ERROR);
+ throw new ACFException("Can't enter create section without objects to create",
+ ACFException.GENERAL_ERROR);
int i = 0;
ArrayList writeCriticalSectionArray = new ArrayList();
while (i < locateObjectDescriptions.length)
@@ -372,11 +372,11 @@ public class CacheManager implements ICa
*@return the object, or null if not found.
*/
public Object lookupObject(ICacheCreateHandle handle, ICacheDescription objectDescription)
- throws LCFException
+ throws ACFException
{
if (handle == null)
- throw new LCFException("Can't do lookup outside of create section",
- LCFException.GENERAL_ERROR);
+ throw new ACFException("Can't do lookup outside of create section",
+ ACFException.GENERAL_ERROR);
if (Logging.cache.isDebugEnabled())
{
@@ -398,7 +398,7 @@ public class CacheManager implements ICa
CacheTransactionHandle transactionHandle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (transactionHandle == null)
{
- LCFException ex = new LCFException("Illegal transaction id",LCFException.GENERAL_ERROR);
+ ACFException ex = new ACFException("Illegal transaction id",ACFException.GENERAL_ERROR);
Logging.cache.error(Thread.currentThread().toString()+": lookupObject: "+transactionID+": "+this.toString()+": Transaction hash = "+transactionHash.toString(),ex);
throw ex;
}
@@ -467,7 +467,7 @@ public class CacheManager implements ICa
*@return true if expired, false otherwise.
*/
protected boolean hasExpired(String key, long createTime)
- throws LCFException
+ throws ACFException
{
long createdDate = readSharedData(key);
if (Logging.cache.isDebugEnabled())
@@ -509,11 +509,11 @@ public class CacheManager implements ICa
*/
public void saveObject(ICacheCreateHandle handle, ICacheDescription objectDescription,
Object object)
- throws LCFException
+ throws ACFException
{
if (handle == null)
- throw new LCFException("Can't do save outside of create section",
- LCFException.GENERAL_ERROR);
+ throw new ACFException("Can't do save outside of create section",
+ ACFException.GENERAL_ERROR);
if (Logging.cache.isDebugEnabled())
{
@@ -561,7 +561,7 @@ public class CacheManager implements ICa
CacheTransactionHandle transactionHandle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (transactionHandle == null)
{
- LCFException ex = new LCFException("Bad transaction handle",LCFException.GENERAL_ERROR);
+ ACFException ex = new ACFException("Bad transaction handle",ACFException.GENERAL_ERROR);
Logging.cache.error(Thread.currentThread().toString()+": saveObject: "+transactionID+": "+this.toString()+": Transaction hash = "+transactionHash.toString(),ex);
throw ex;
}
@@ -574,7 +574,7 @@ public class CacheManager implements ICa
*@param handle is the handle created by the corresponding enterCreateSection() method.
*/
public void leaveCreateSection(ICacheCreateHandle handle)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -589,7 +589,7 @@ public class CacheManager implements ICa
*@param handle is the cache handle. Does nothing if a null set of keys was passed in.
*/
public void invalidateKeys(ICacheHandle handle)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -610,7 +610,7 @@ public class CacheManager implements ICa
CacheTransactionHandle transactionHandle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (transactionHandle == null)
{
- LCFException ex = new LCFException("Bad transaction ID!",LCFException.GENERAL_ERROR);
+ ACFException ex = new ACFException("Bad transaction ID!",ACFException.GENERAL_ERROR);
Logging.cache.error(Thread.currentThread().toString()+": invalidateKeys: "+transactionID+": "+this.toString()+": Transaction hash = "+transactionHash.toString(),ex);
throw ex;
}
@@ -623,7 +623,7 @@ public class CacheManager implements ICa
*@param keys is the set of keys to invalidate.
*/
protected void performInvalidation(StringSet keys)
- throws LCFException
+ throws ACFException
{
// Finally, perform the invalidation.
@@ -649,7 +649,7 @@ public class CacheManager implements ICa
*@param handle is the handle of the cache we are leaving.
*/
public void leaveCache(ICacheHandle handle)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -668,7 +668,7 @@ public class CacheManager implements ICa
*@param enclosingTransactionID is the id of the transaction that is in effect, or null.
*/
public void startTransaction(String startingTransactionID, String enclosingTransactionID)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -684,8 +684,8 @@ public class CacheManager implements ICa
parent = (CacheTransactionHandle)transactionHash.get(enclosingTransactionID);
if (parent == null)
{
- LCFException ex = new LCFException("Illegal parent transaction ID: "+enclosingTransactionID,
- LCFException.GENERAL_ERROR);
+ ACFException ex = new ACFException("Illegal parent transaction ID: "+enclosingTransactionID,
+ ACFException.GENERAL_ERROR);
Logging.cache.error(Thread.currentThread().toString()+": startTransaction: "+this.toString()+": Transaction hash = "+transactionHash.toString(),ex);
throw ex;
}
@@ -706,7 +706,7 @@ public class CacheManager implements ICa
* held open will be released.
*/
public void commitTransaction(String transactionID)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -716,7 +716,7 @@ public class CacheManager implements ICa
CacheTransactionHandle handle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (handle == null)
- throw new LCFException("Cache manager: commit transaction without start!",LCFException.GENERAL_ERROR);
+ throw new ACFException("Cache manager: commit transaction without start!",ACFException.GENERAL_ERROR);
// First, move all the locally cached entries into the global cache.
// This is safe to do because we know that the transaction belongs to a single thread.
@@ -782,7 +782,7 @@ public class CacheManager implements ICa
* held for the transaction.
*/
public void rollbackTransaction(String transactionID)
- throws LCFException
+ throws ACFException
{
if (Logging.cache.isDebugEnabled())
@@ -792,7 +792,7 @@ public class CacheManager implements ICa
CacheTransactionHandle handle = (CacheTransactionHandle)transactionHash.get(transactionID);
if (handle == null)
- throw new LCFException("Cache manager: rollback transaction without start!",LCFException.GENERAL_ERROR);
+ throw new ACFException("Cache manager: rollback transaction without start!",ACFException.GENERAL_ERROR);
// End all of the locks
// We always end the write locks before the read locks.
@@ -819,7 +819,7 @@ public class CacheManager implements ICa
*@param currentTimestamp is the current time in milliseconds since epoch.
*/
public void expireObjects(long currentTimestamp)
- throws LCFException
+ throws ACFException
{
// This is a local JVM operation; we will not need to do any locks. We just
// need to blow expired objects from the cache.
@@ -834,7 +834,7 @@ public class CacheManager implements ICa
*@return the invalidation time, or 0 if none.
*/
protected long readSharedData(String key)
- throws LCFException
+ throws ACFException
{
// Read cache resource
byte[] cacheResourceData = lockManager.readData("cache-"+key);
@@ -847,7 +847,7 @@ public class CacheManager implements ICa
}
catch (UnsupportedEncodingException e)
{
- throw new LCFException(e.getMessage(),e);
+ throw new ACFException(e.getMessage(),e);
}
}
@@ -856,7 +856,7 @@ public class CacheManager implements ICa
*@param value is the invalidation timestamp.
*/
protected void writeSharedData(String key, long value)
- throws LCFException
+ throws ACFException
{
if (value == 0L)
lockManager.writeData(key,null);
@@ -868,7 +868,7 @@ public class CacheManager implements ICa
}
catch (UnsupportedEncodingException e)
{
- throw new LCFException(e.getMessage(),e);
+ throw new ACFException(e.getMessage(),e);
}
}
}
@@ -1170,7 +1170,7 @@ public class CacheManager implements ICa
*@return the array of write locks we still need to throw.
*/
public StringSet getRemainingWriteLocks(StringSet cacheKeys, StringSet keys)
- throws LCFException
+ throws ACFException
{
// If any of these keys are read locks but not yet write locks, we throw an exception!
// (There is currently no ability to promote a read lock to a write lock.)
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/Base64.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/Base64.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/Base64.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/Base64.java Mon Aug 23 18:08:32 2010
@@ -79,7 +79,7 @@ public class Base64
*@return false if end-of-stream encountered, true otherwise
*/
public boolean decodeNextWord(Reader inputBuffer, OutputStream outputBuffer)
- throws LCFException
+ throws ACFException
{
try
{
@@ -91,7 +91,7 @@ public class Base64
if (character == -1)
{
if (bufferIndex != 0)
- throw new LCFException("Unexpected end of base64 input");
+ throw new ACFException("Unexpected end of base64 input");
return false;
}
char ch = (char)character;
@@ -99,7 +99,7 @@ public class Base64
characterBuffer[bufferIndex++] = ch;
// else
- // throw new LCFException("Illegal Base64 character: '"+ch+"'");
+ // throw new ACFException("Illegal Base64 character: '"+ch+"'");
}
// We have the data; do the conversion.
@@ -132,7 +132,7 @@ public class Base64
}
catch (IOException e)
{
- throw new LCFException("IO error converting from base 64",e);
+ throw new ACFException("IO error converting from base 64",e);
}
}
@@ -141,7 +141,7 @@ public class Base64
*@param outputBuffer is the binary output stream.
*/
public void decodeStream(Reader inputBuffer, OutputStream outputBuffer)
- throws LCFException
+ throws ACFException
{
// Just loop until done.
// It may be efficient to replace this with a "bulk" method, but probably not much.
@@ -155,7 +155,7 @@ public class Base64
*@return a corresponding byte array.
*/
public byte[] decodeString(String inputString)
- throws LCFException
+ throws ACFException
{
try
{
@@ -184,7 +184,7 @@ public class Base64
}
catch (IOException e)
{
- throw new LCFException("Error streaming through base64 decoder",e);
+ throw new ACFException("Error streaming through base64 decoder",e);
}
}
@@ -194,7 +194,7 @@ public class Base64
*@return false if end-of-stream encountered, true otherwise.
*/
public boolean encodeNextWord(InputStream inputStream, Writer outputWriter)
- throws LCFException
+ throws ACFException
{
try
{
@@ -206,7 +206,7 @@ public class Base64
switch (actualLength)
{
case 0:
- throw new LCFException("Read 0 bytes!");
+ throw new ACFException("Read 0 bytes!");
case 1:
i = byteBuffer[0]&0xff;
outputWriter.write(base64CharacterArray[i>>2]);
@@ -240,7 +240,7 @@ public class Base64
}
catch (IOException e)
{
- throw new LCFException("IO error encoding in base64",e);
+ throw new ACFException("IO error encoding in base64",e);
}
}
@@ -249,7 +249,7 @@ public class Base64
*@param outputWriter is the output writer.
*/
public void encodeStream(InputStream inputStream, Writer outputWriter)
- throws LCFException
+ throws ACFException
{
while (encodeNextWord(inputStream,outputWriter))
{
@@ -261,7 +261,7 @@ public class Base64
*@return the encoded string.
*/
public String encodeByteArray(byte[] inputByteArray)
- throws LCFException
+ throws ACFException
{
try
{
@@ -287,7 +287,7 @@ public class Base64
}
catch (IOException e)
{
- throw new LCFException("Error streaming through base64 encoder",e);
+ throw new ACFException("Error streaming through base64 encoder",e);
}
}
Modified: incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/XMLDoc.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/XMLDoc.java?rev=988237&r1=988236&r2=988237&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/XMLDoc.java (original)
+++ incubator/lcf/trunk/modules/framework/core/org/apache/acf/core/common/XMLDoc.java Mon Aug 23 18:08:32 2010
@@ -27,7 +27,7 @@ import javax.xml.parsers.*;
import org.xml.sax.*;
import org.w3c.dom.*;
-import org.apache.acf.core.interfaces.LCFException;
+import org.apache.acf.core.interfaces.ACFException;
public class XMLDoc
{
@@ -228,7 +228,7 @@ public class XMLDoc
* @return xml raw text
*/
public String getXML()
- throws LCFException
+ throws ACFException
{
try
{
@@ -236,7 +236,7 @@ public class XMLDoc
}
catch (UnsupportedEncodingException e)
{
- throw new LCFException(e.getMessage(),e);
+ throw new ACFException(e.getMessage(),e);
}
}
@@ -244,7 +244,7 @@ public class XMLDoc
* @return xml in byte array
*/
public byte[] toByteArray()
- throws LCFException
+ throws ACFException
{
ByteArrayOutputStream os = new ByteArrayOutputStream(_blocksiz);
dumpOutput(os);
@@ -255,7 +255,7 @@ public class XMLDoc
/** Creates the empty doc
*/
public XMLDoc()
- throws LCFException
+ throws ACFException
{
try
{
@@ -266,7 +266,7 @@ public class XMLDoc
}
catch (Exception e)
{
- throw new LCFException("Error setting up parser: "+e.getMessage(),e);
+ throw new ACFException("Error setting up parser: "+e.getMessage(),e);
}
}
@@ -275,7 +275,7 @@ public class XMLDoc
* @param data xml to parse
*/
public XMLDoc(String data)
- throws LCFException
+ throws ACFException
{
try
{
@@ -284,7 +284,7 @@ public class XMLDoc
}
catch (UnsupportedEncodingException e)
{
- throw new LCFException(e.getMessage(),e);
+ throw new ACFException(e.getMessage(),e);
}
}
@@ -293,7 +293,7 @@ public class XMLDoc
* @param data xml to parse
*/
public XMLDoc(StringBuffer data)
- throws LCFException
+ throws ACFException
{
try
{
@@ -303,7 +303,7 @@ public class XMLDoc
}
catch (UnsupportedEncodingException e)
{
- throw new LCFException(e.getMessage(),e);
+ throw new ACFException(e.getMessage(),e);
}
}
@@ -312,7 +312,7 @@ public class XMLDoc
* @param is InputStream of xml to parse
*/
public XMLDoc(InputStream is)
- throws LCFException
+ throws ACFException
{
_doc = init(is);
}
@@ -320,7 +320,7 @@ public class XMLDoc
/** Construct a document from all the children of an existing element object from another document.
*/
public XMLDoc(XMLDoc oldDoc, Object parent)
- throws LCFException
+ throws ACFException
{
try
{
@@ -346,12 +346,12 @@ public class XMLDoc
}
catch (Exception e)
{
- throw new LCFException("Error setting up parser: "+e.getMessage(),e);
+ throw new ACFException("Error setting up parser: "+e.getMessage(),e);
}
}
private Document init(InputStream is)
- throws LCFException
+ throws ACFException
{
Document doc = null;
try {
@@ -366,7 +366,7 @@ public class XMLDoc
}
catch (Exception e)
{
- throw new LCFException("XML parsing error: "+e.getMessage(),e);
+ throw new ACFException("XML parsing error: "+e.getMessage(),e);
}
return doc;
@@ -686,7 +686,7 @@ public class XMLDoc
// Transform the output for serialization
private void dumpOutput(OutputStream os)
- throws LCFException
+ throws ACFException
{
try
{
@@ -699,7 +699,7 @@ public class XMLDoc
}
catch (Exception e)
{
- throw new LCFException("Error dumping output: "+e.getMessage(),e);
+ throw new ACFException("Error dumping output: "+e.getMessage(),e);
}
}