Package edu.isi.pegasus.common.util
Class FactoryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- edu.isi.pegasus.common.util.FactoryException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CleanupFactoryException
,ClustererFactoryException
,CodeGeneratorFactoryException
,CondorStyleFactoryException
,CredentialHandlerFactoryException
,DAXParserFactoryException
,GridStartFactoryException
,JobAggregatorFactoryException
,LogFormatterFactoryException
,LogManagerFactoryException
,OutputMapperFactoryException
,PartitionerFactoryException
,PDAXCallbackFactoryException
,PPSFactoryException
,ReplicaSelectorFactoryException
,SiteCatalogXMLParserFactoryException
,SiteFactoryException
,SiteFactoryException
,SiteSelectorFactoryException
,SLSFactoryException
,TransferImplementationFactoryException
,TransferRefinerFactoryException
,TransformationFactoryException
,WorkFactoryException
,XMLProducerFactoryException
public class FactoryException extends java.lang.RuntimeException
The base exception class to notify of errors, while instantiating classes via any of the factories. Each factory, should throw an exception that is a subclass of this class.- Author:
- Karan Vahi, Jens-S. Vöckler, Gaurang Mehta
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_NAME
The default classname that is associated with the exception.protected java.lang.String
mClassname
The name of the class that was trying to be instantiated when this error occured, or some other signifier like module name.
-
Constructor Summary
Constructors Constructor Description FactoryException(java.lang.String msg)
Constructs aFactoryException
with no detail message.FactoryException(java.lang.String msg, java.lang.String classname)
Constructs aFactoryException
with the specified detailed message.FactoryException(java.lang.String msg, java.lang.String classname, java.lang.Throwable cause)
Constructs aFactoryException
with the specified detailed message and a cause.FactoryException(java.lang.String msg, java.lang.Throwable cause)
Constructs aFactoryException
with the specified detailed message and a cause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convertException()
Converts most of the common instantiation exceptions from the class loader into an error message.java.lang.String
convertException(int index)
Converts most of the common instantiation exceptions from the class loader into an error message.static java.lang.String
convertException(java.lang.String classname, java.lang.Throwable e, int index)
Converts most of the common instantiation exceptions from the class loader into an error message.java.lang.String
getClassname()
Returns the name of the class that was trying to be loaded when this error occured, or some other signifier like a module name.
-
-
-
Field Detail
-
DEFAULT_NAME
public static final java.lang.String DEFAULT_NAME
The default classname that is associated with the exception.- See Also:
- Constant Field Values
-
mClassname
protected java.lang.String mClassname
The name of the class that was trying to be instantiated when this error occured, or some other signifier like module name.
-
-
Constructor Detail
-
FactoryException
public FactoryException(java.lang.String msg)
Constructs aFactoryException
with no detail message. The associated classname is set to value specified byDEFAULT_NAME
.- Parameters:
msg
- the detailed message.- See Also:
DEFAULT_NAME
-
FactoryException
public FactoryException(java.lang.String msg, java.lang.String classname)
Constructs aFactoryException
with the specified detailed message.- Parameters:
msg
- is the detailed message.classname
- the name of class that was trying to be instantiated or some other signifier like module name.
-
FactoryException
public FactoryException(java.lang.String msg, java.lang.Throwable cause)
Constructs aFactoryException
with the specified detailed message and a cause. The associated classname is set to value specified byDEFAULT_NAME
.- Parameters:
msg
- is the detailed message that is to be logged.cause
- is the cause (which is saved for later retrieval by theThrowable.getCause()
method). Anull
value is permitted, and indicates that the cause is nonexistent or unknown.- See Also:
DEFAULT_NAME
-
FactoryException
public FactoryException(java.lang.String msg, java.lang.String classname, java.lang.Throwable cause)
Constructs aFactoryException
with the specified detailed message and a cause.- Parameters:
msg
- is the detailed message that is to be logged.classname
- the name of class that was trying to be instantiated.cause
- is the cause (which is saved for later retrieval by theThrowable.getCause()
method). Anull
value is permitted, and indicates that the cause is nonexistent or unknown.
-
-
Method Detail
-
convertException
public java.lang.String convertException()
Converts most of the common instantiation exceptions from the class loader into an error message. Use for getting sensible error messages, of the causes that are associated with a FactoryException. The index in the messages starts from 0.- Returns:
- the error message
-
convertException
public java.lang.String convertException(int index)
Converts most of the common instantiation exceptions from the class loader into an error message. Use for getting sensible error messages, of the causes that are associated with a FactoryException. The index in the messages starts from 0.- Parameters:
index
- the index to start from.- Returns:
- the error message.
-
convertException
public static java.lang.String convertException(java.lang.String classname, java.lang.Throwable e, int index)
Converts most of the common instantiation exceptions from the class loader into an error message. Use for getting sensible error messages, of the causes that are associated with a FactoryException.- Parameters:
classname
- the class that was trying to be loaded or some other signifier.e
- the FactoryException that is thrown.index
- the index to start from.- Returns:
- the error message.
-
getClassname
public java.lang.String getClassname()
Returns the name of the class that was trying to be loaded when this error occured, or some other signifier like a module name.- Returns:
- the name of the class.
-
-